/* ============================================
   AIRCHAIR — Button System
   StarButton (primary) + Glass (secondary)
   ============================================ */

/* ============================================
   STAR BUTTON — orbiting light CTA
   Vanilla port of 21st.dev star-button
   Adapted to Airchair green/white/black palette
   ============================================ */

/* --- Animation keyframe --- */
@keyframes star-btn-orbit {
  0%   { offset-distance: 0%; }
  100% { offset-distance: 100%; }
}

/* --- Base (works on both <a> and <button>) --- */
.star-btn {
  /* Reset */
  appearance: none;
  border: none;
  outline: none;
  cursor: pointer;
  text-decoration: none;
  color: inherit;
  background: transparent;

  /* Layout */
  position: relative;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  isolation: isolate;
  overflow: hidden;

  /* Typography */
  font-family: 'Sora', sans-serif;
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;

  /* Sizing */
  height: 2.75rem;
  padding: 0.5rem 1.25rem;
  border-radius: 1.5rem;

  /* Custom properties — defaults for Airchair palette */
  --star-duration: 3;
  --star-light-width: 110px;
  --star-light-color: #a8e6b8;
  --star-bg-color: #0a1f12;
  --star-border-width: 2px;

  transition: transform 0.15s ease, box-shadow 0.2s ease;
}

/* --- Orbiting light element --- */
.star-btn__light {
  position: absolute;
  inset: 0;
  aspect-ratio: 1;
  width: var(--star-light-width);
  background: radial-gradient(ellipse at center, var(--star-light-color), transparent, transparent);
  offset-path: var(--star-path);
  offset-distance: 0%;
  animation: star-btn-orbit calc(var(--star-duration) * 1s) linear infinite;
  pointer-events: none;
}

/* --- SVG star-field background layer --- */
.star-btn__bg {
  position: absolute;
  inset: 0;
  z-index: 4;
  overflow: hidden;
  border-radius: inherit;
  border-width: var(--star-border-width);
  border-style: solid;
  border-color: rgba(255, 255, 255, 0.15);
  pointer-events: none;
}

.star-btn__bg svg {
  display: block;
  width: 100%;
  height: 100%;
}

/* --- Label text with gradient treatment --- */
.star-btn__label {
  position: relative;
  z-index: 10;
  background: linear-gradient(to top, #ffffff, #8fa89a);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  display: inline-block;
}

/* --- Hover --- */
.star-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 24px rgba(74, 158, 98, 0.2);
}

.star-btn:hover .star-btn__label {
  background: linear-gradient(to top, #ffffff, #c8e0d0);
  -webkit-background-clip: text;
  background-clip: text;
}

/* --- Active / pressed --- */
.star-btn:active {
  transform: translateY(0.5px) scale(0.985);
  box-shadow: none;
}

/* --- Focus-visible --- */
.star-btn:focus-visible {
  outline: 2px solid rgba(74, 158, 98, 0.7);
  outline-offset: 3px;
}

/* ============================================
   STAR BUTTON — NAV VARIANT (compact)
   ============================================ */
.star-btn--nav {
  height: 2.375rem;
  padding: 0.375rem 1.1rem;
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  border-radius: 1.25rem;
  --star-light-width: 80px;
  --star-duration: 4;
  --star-light-color: rgba(168, 230, 184, 0.7);
}

/* ============================================
   STAR BUTTON — LARGE VARIANT (hero CTA)
   ============================================ */
.star-btn--lg {
  height: 3.25rem;
  padding: 0.625rem 2.25rem;
  font-size: 0.875rem;
  letter-spacing: 0.1em;
  border-radius: 1.75rem;
  --star-light-width: 130px;
  --star-duration: 2.5;
}

.star-btn--lg:hover {
  box-shadow: 0 6px 32px rgba(74, 158, 98, 0.25);
}

/* ============================================
   SECONDARY GLASS BUTTON (unchanged)
   For "View Product Details", "Return to Story"
   ============================================ */
.btn-glass--secondary {
  /* Reset */
  appearance: none;
  border: none;
  outline: none;
  cursor: pointer;
  text-decoration: none;

  /* Layout */
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  isolation: isolate;

  /* Typography */
  font-family: 'Sora', sans-serif;
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;

  /* Sizing */
  min-height: 3.25rem;
  padding: 0 2rem;
  border-radius: 999px;

  /* Glass surface */
  background:
    linear-gradient(
      165deg,
      rgba(255, 255, 255, 0.08) 0%,
      rgba(255, 255, 255, 0.04) 40%,
      rgba(255, 255, 255, 0.06) 100%
    );
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);

  box-shadow:
    inset 0 1px 0 0 rgba(255, 255, 255, 0.10),
    inset 0 0 0 1px rgba(255, 255, 255, 0.07),
    0 2px 8px rgba(0, 0, 0, 0.15),
    0 6px 24px rgba(0, 0, 0, 0.12);
  color: rgba(244, 248, 245, 0.85);

  transition:
    background 0.25s ease,
    box-shadow 0.25s ease,
    transform 0.15s ease,
    color 0.2s ease;
}

.btn-glass--secondary::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.06) 0%,
    rgba(255, 255, 255, 0.01) 50%,
    rgba(0, 0, 0, 0.02) 100%
  );
  pointer-events: none;
  z-index: -1;
}

.btn-glass--secondary:hover {
  background:
    linear-gradient(
      165deg,
      rgba(255, 255, 255, 0.12) 0%,
      rgba(255, 255, 255, 0.06) 40%,
      rgba(255, 255, 255, 0.08) 100%
    );
  box-shadow:
    inset 0 1px 0 0 rgba(255, 255, 255, 0.14),
    inset 0 0 0 1px rgba(255, 255, 255, 0.10),
    0 4px 16px rgba(0, 0, 0, 0.20),
    0 8px 32px rgba(0, 0, 0, 0.15);
  color: #f4f8f5;
  transform: translateY(-1px);
}

.btn-glass--secondary:active {
  background:
    linear-gradient(
      165deg,
      rgba(255, 255, 255, 0.06) 0%,
      rgba(255, 255, 255, 0.02) 40%,
      rgba(255, 255, 255, 0.04) 100%
    );
  box-shadow:
    inset 0 1px 0 0 rgba(255, 255, 255, 0.06),
    inset 0 0 0 1px rgba(255, 255, 255, 0.05),
    0 1px 4px rgba(0, 0, 0, 0.12);
  transform: translateY(0.5px) scale(0.985);
}

.btn-glass--secondary:focus-visible {
  outline: 2px solid rgba(74, 158, 98, 0.7);
  outline-offset: 3px;
}

/* ============================================
   BUTTON RESPONSIVE
   ============================================ */
@media (max-width: 480px) {
  .star-btn--lg {
    height: 2.75rem;
    padding: 0.5rem 1.5rem;
    font-size: 0.75rem;
    white-space: normal;
    text-align: center;
  }

  .star-btn--nav {
    height: 2rem;
    padding: 0.25rem 0.9rem;
    font-size: 0.6875rem;
    --star-light-width: 60px;
  }

  .btn-glass--secondary {
    min-height: 2.75rem;
    padding: 0 1.5rem;
    font-size: 0.75rem;
    white-space: normal;
    text-align: center;
  }
}

@media (max-width: 375px) {
  .star-btn--lg {
    height: 2.5rem;
    padding: 0.375rem 1.25rem;
    font-size: 0.6875rem;
  }

  .star-btn--nav {
    height: 1.875rem;
    padding: 0.25rem 0.75rem;
    font-size: 0.625rem;
  }

  .btn-glass--secondary {
    min-height: 2.5rem;
    padding: 0 1.25rem;
    font-size: 0.6875rem;
  }
}
