/* public_html/assets/css/components.css */

/* ---------- Glowing background orbs ---------- */
.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(50px);
  pointer-events: none;
  z-index: 0;
}
.orb--one {
  width: 420px; height: 420px;
  background: var(--bg-orb-1);
  top: -120px; right: -80px;
}
.orb--two {
  width: 320px; height: 320px;
  background: var(--bg-orb-2);
  bottom: -100px; left: -60px;
}

/* ---------- Glass card base ---------- */
.glass-card {
  position: relative;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-card);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  box-shadow: var(--shadow-card);
  box-shadow: var(--shadow-card), inset 0 1px 0 var(--card-highlight);
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 13px 26px;
  border-radius: var(--radius-btn);
  font-weight: 600;
  font-size: 0.95rem;
  border: 1px solid transparent;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}
.btn:active { transform: translateY(1px); }

.btn--primary {
  background: linear-gradient(135deg, var(--accent-light), var(--accent-deep));
  color: #0B1410;
  box-shadow: var(--shadow-glow-accent);
}
.btn--primary:hover { box-shadow: 0 10px 26px color-mix(in srgb, var(--accent) 35%, transparent); }

.btn--ghost {
  background: transparent;
  border-color: var(--card-border);
  color: var(--text);
}
.btn--ghost:hover { border-color: var(--accent); }

/* ---------- Badge pills ---------- */
.badge {
  display: inline-block;
  padding: 5px 14px;
  border-radius: var(--radius-pill);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}
.badge--bestseller {
  background: linear-gradient(135deg, var(--accent-light), var(--accent));
  color: #0B1410;
  box-shadow: 0 4px 12px color-mix(in srgb, var(--accent) 30%, transparent);
}
.badge--new {
  background: var(--card-bg);
  border: 1px solid var(--accent);
  color: var(--accent-deep);
}
[data-theme~="dark"] .badge--new { color: var(--accent-light); }

/* ---------- Announcement bar (coupon/shipping line, above the header) ---------- */
.announcement-bar {
  position: sticky;
  top: 0;
  z-index: 51; /* above .site-header so it always stays the topmost element */
  height: var(--announcement-height);
  display: flex;
  align-items: center;
  justify-content: center;
  background: #0B1410;
  color: var(--accent-light);
  text-align: center;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  padding: 0 16px;
  overflow: hidden;
}
.announcement-bar strong { color: var(--accent); }
.announcement-bar__track {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: nowrap;
}
.announcement-bar__line { white-space: nowrap; }

@media (max-width: 560px) {
  /* Two clean lines instead of one truncated/horizontally-scrolling line —
     the sep dot only makes sense inline, so it's hidden once stacked.
     --announcement-height's mobile value is defined once, in variables.css,
     and read here and by .site-header's sticky offset. */
  .announcement-bar { padding: 6px 16px; font-size: 0.72rem; }
  .announcement-bar__track { flex-direction: column; gap: 2px; }
  .announcement-bar__sep { display: none; }
}

/* ---------- Tagline banner: now JUST the category nav (All Categories
   dropdown + curated pill strip). The tagline text itself lives in the
   header row now — see .site-header__tagline below.
   NOTE: deliberately no `overflow: hidden` on this wrapper — the desktop
   dropdown panel below needs to visually extend past this bar's own
   height, and clipping it here would cut the dropdown off. ---------- */
.tagline-banner {
  padding: 8px 20px;
  background: color-mix(in srgb, var(--accent) 6%, transparent);
  border-top: 1px solid var(--card-border);
}

.category-nav {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
}

.category-nav__all-wrap {
  position: relative;
  flex: 0 0 auto;
}

.category-nav__all {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 16px;
  border-radius: var(--radius-pill);
  border: none;
  background: linear-gradient(135deg, var(--accent-light), var(--accent-deep));
  color: #0B1410;
  font-weight: 700;
  font-size: 0.8rem;
  white-space: nowrap;
  box-shadow: var(--shadow-glow-accent);
  transition: box-shadow 0.15s ease;
}
.category-nav__all:hover { box-shadow: 0 10px 26px color-mix(in srgb, var(--accent) 35%, transparent); }
.category-nav__all-caret {
  font-size: 0.65rem;
  transition: transform 0.15s ease;
}
.category-nav__all[aria-expanded="true"] .category-nav__all-caret { transform: rotate(180deg); }

/* Closed by default — category-nav.js sets `display: grid` (desktop) or
   `display: block` (mobile) only once the button is actually clicked.
   Without this, the dropdown renders open on first paint/refresh, before
   any JS has run.
   Background is a SOLID page color, not the translucent glass-card look —
   backdrop-filter isn't rendering reliably in testing, so a translucent
   background here just lets whatever's underneath (breadcrumbs, filter
   panel, page text) show straight through it. Solid avoids that
   regardless of backdrop-filter support. */
.category-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  min-width: 240px;
  max-height: 60vh;
  overflow-y: auto;
  padding: 10px;
  grid-template-columns: repeat(2, 1fr);
  gap: 4px;
  z-index: 60;
  background: var(--bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
}

/* Only shown in the mobile slide-in panel (see media query below) —
   gives it the same "title + close" header the Filters drawer has. */
.category-dropdown__head {
  display: none;
  align-items: center;
  justify-content: space-between;
  padding: 4px 4px 14px;
  margin-bottom: 10px;
  border-bottom: 1px solid var(--card-border);
}
.category-dropdown__head h3 { margin: 0; font-size: 1.05rem; }
.category-dropdown__close {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid var(--card-border);
  background: transparent;
  color: var(--text-muted);
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
}
.category-dropdown__close:hover { border-color: var(--accent); color: var(--accent); }

.category-dropdown__item {
  display: block; /* these are <a> tags — without this they wrap as inline
                      text instead of stacking one per line in the mobile
                      drawer's plain block layout (desktop's grid layout
                      auto-blockifies them, so this only shows up on mobile) */
  padding: 8px 10px;
  border-radius: 10px;
  font-size: 0.85rem;
  color: var(--text);
  white-space: nowrap;
}
/* Was hardcoded emerald rgba — now derives from the live theme's accent,
   same bug class as .tile__icon-badge and the tagline-pulse keyframes below. */
.category-dropdown__item:hover { background: color-mix(in srgb, var(--accent) 10%, transparent); color: var(--accent-deep); }
[data-theme~="dark"] .category-dropdown__item:hover { color: var(--accent-light); }

.category-nav__group {
  flex: 1 1 0;
  display: flex;
  gap: 10px;
  overflow-x: auto;
  scrollbar-width: none; /* Firefox */
  white-space: nowrap;
}
.category-nav__group::-webkit-scrollbar { display: none; } /* Chrome/Safari */

.category-pill {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  padding: 5px 14px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--card-border);
  background: var(--card-bg);
  color: var(--text-muted);
  font-size: 0.76rem;
  font-weight: 600;
  transition: color 0.15s ease, border-color 0.15s ease;
}
.category-pill:hover { color: var(--accent); border-color: var(--accent); }

@media (max-width: 880px) {
  /* Not enough room to show the full strip — collapse into one swipeable
     row instead: All Categories, then every pill, in order, no wrapping. */
  .category-nav {
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
  }
  .category-nav::-webkit-scrollbar { display: none; }

  .category-nav__group {
    flex: 0 0 auto;
    overflow: visible; /* the parent .category-nav handles scrolling now */
  }

  /* The dropdown becomes a full-height slide-in panel, same off-canvas
     pattern as .listing__filters. */
  .category-dropdown {
    position: fixed;
    inset: 0 0 0 auto;
    top: 0;
    left: auto;
    width: min(300px, 85vw);
    height: 100vh;
    max-height: none;
    grid-template-columns: 1fr;
    padding: 20px 18px;
    border-radius: 0;
    z-index: 100;
    transform: translateX(100%);
    transition: transform 0.25s ease;
  }
  .category-dropdown.is-open {
    transform: translateX(0);
  }

  .category-dropdown__head { display: flex; }
  .category-dropdown__item {
    padding: 12px 10px;
    font-size: 0.95rem;
  }
}

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: var(--announcement-height); /* sticks directly below the announcement bar above it */
  z-index: 50;
  background: var(--header-bg);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--card-border);
}
.site-header__inner {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 14px 24px;
}
.site-header__logo {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.3rem;
  color: var(--text);
  flex-shrink: 0;
}
.site-header__logo span { color: var(--accent); }

.site-header__search {
  flex: 1;
  max-width: 480px;
}
.site-header__search input {
  width: 100%;
  padding: 10px 16px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--card-border);
  background: var(--card-bg);
  color: var(--text);
  font-family: var(--font-body);
}
.site-header__search input::placeholder { color: var(--text-muted); }

/* Sits between the search box and the theme toggle — flex:1 lets it soak
   up whatever room search doesn't use (search stops growing at its
   480px max-width), and text-align:center keeps it centered in that gap
   rather than jammed against either side. */
.site-header__tagline {
  flex: 1 1 0;
  text-align: center;
  color: var(--accent);
  font-weight: 700;
  font-size: 0.85rem;
  letter-spacing: 0.03em;
  white-space: nowrap;
  animation: tagline-pulse 2.4s ease-in-out infinite;
}
/* Was hardcoded emerald rgba in both keyframe blocks below — now derives
   from the live theme's accent/accent-light, so this stops glowing green
   under a custom theme. */
@keyframes tagline-pulse {
  0%, 100% { text-shadow: 0 0 8px color-mix(in srgb, var(--accent) 35%, transparent); }
  50% { text-shadow: 0 0 18px color-mix(in srgb, var(--accent) 75%, transparent); }
}
[data-theme~="dark"] .site-header__tagline {
  animation-name: tagline-pulse-dark;
}
@keyframes tagline-pulse-dark {
  0%, 100% { text-shadow: 0 0 10px color-mix(in srgb, var(--accent-light) 45%, transparent); }
  50% { text-shadow: 0 0 22px color-mix(in srgb, var(--accent-light) 85%, transparent); }
}
@media (prefers-reduced-motion: reduce) {
  .site-header__tagline { animation: none; }
}

.site-header__actions {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-left: auto;
}

/* Theme toggle */
.theme-toggle {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--card-border);
  background: var(--card-bg);
  color: var(--accent); /* icon is always the bright accent color, in both themes */
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.15s ease, color 0.15s ease;
}
.theme-toggle:hover { border-color: var(--accent); color: var(--accent-light); }

/* Only one icon shows at a time, matching the mode you'd switch TO */
.theme-toggle__icon { display: none; }
[data-theme~="light"] .theme-toggle__icon--moon { display: block; }
[data-theme~="dark"] .theme-toggle__icon--sun { display: block; }

/* ---------- Reusable hover glow (green blurred glow behind an element) ---------- */
/* Add class="glow-hover" to any glass-card, button, etc. to get this effect. */
.glow-hover {
  position: relative;
  isolation: isolate;
}
.glow-hover::before {
  content: '';
  position: absolute;
  inset: -12px;
  border-radius: inherit;
  background: var(--accent);
  filter: blur(24px);
  opacity: 0;
  z-index: -1;
  pointer-events: none;
  transition: opacity 0.25s ease;
}
.glow-hover:hover::before { opacity: 0.35; }

/* ---------- Collection tiles ---------- */
/* Fixed column counts (not auto-fill) so the homepage's 10 tiles always
   form complete rows instead of spilling a partial row: 5 columns -> 2
   full rows on desktop, 2 columns -> 5 full rows on mobile. If the number
   of tiles shown here ever changes from 10, re-check these numbers still
   divide evenly. */
.tile-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 16px;
}
.tile {
  padding: 20px 16px;
  text-align: center;
  transition: transform 0.2s ease;
}
.tile:hover { transform: translateY(-4px); }

/* Soft circular badge behind each icon — emoji glyphs render in wildly
   different visual styles depending on the OS/browser, so this gives them
   a consistent, "designed" container regardless of that.
   Was hardcoded emerald rgba in both light/dark rules — now derives from
   the live theme's accent/accent-light (this was the "icons still
   greenish" bug reported after switching themes). */
.tile__icon-badge {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 10px;
}
[data-theme~="dark"] .tile__icon-badge { background: color-mix(in srgb, var(--accent-light) 14%, transparent); }

/* Fixed-size, overflow-hidden wrapper so the icon can slide across without
   spilling outside the badge — see home.js for the slide animation. */
.tile__icon-wrap {
  position: relative;
  width: 28px;
  height: 28px;
  overflow: hidden;
}
.tile__icon {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  text-align: center;
  font-size: 1.5rem;
  line-height: 28px;
  transition: transform 0.4s ease, opacity 0.4s ease;
}
.tile__icon--b {
  transform: translateX(-120%);
  opacity: 0;
}
.tile__label {
  font-size: 0.88rem;
  font-weight: 600;
}

@media (max-width: 720px) {
  .tile-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ---------- Product / carousel cards ---------- */
.carousel {
  display: flex;
  gap: 18px;
  overflow-x: auto;
  padding: 8px 4px 20px;
  scroll-snap-type: x mandatory;
}
.carousel::-webkit-scrollbar { height: 6px; }
.carousel::-webkit-scrollbar-thumb { background: var(--card-border); border-radius: var(--radius-pill); }

.product-card {
  flex: 0 0 220px;
  scroll-snap-align: start;
  padding: 16px;
}
.product-card__image {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--bg-orb-1), var(--bg-orb-2));
  margin-bottom: 12px;
}
.product-card__title {
  font-weight: 600;
  font-size: 0.92rem;
  margin-bottom: 4px;
}
.product-card__rating {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 6px;
}
.product-card__price {
  font-weight: 700;
  font-family: var(--font-heading);
}
.product-card__price small {
  font-weight: 400;
  color: var(--text-muted);
  text-decoration: line-through;
  margin-left: 6px;
}

/* ---------- Reel / video auto-slider (shorts-style) ---------- */
.reel-slider-wrap { position: relative; }

.reel-slider {
  display: flex;
  gap: 18px;
  overflow-x: auto;
  padding: 8px 4px 20px;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
}
.reel-slider::-webkit-scrollbar { height: 6px; }
.reel-slider::-webkit-scrollbar-thumb { background: var(--card-border); border-radius: var(--radius-pill); }

.reel-card {
  position: relative;
  flex: 0 0 220px;
  scroll-snap-align: start;
  padding: 0;
  overflow: hidden;
  display: block;
  color: var(--text);
}
.reel-card__media {
  position: relative;
  aspect-ratio: 9 / 16;
  overflow: hidden;
  background: linear-gradient(135deg, var(--bg-orb-1), var(--bg-orb-2));
}
.reel-card__media video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.reel-card__play {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 46px; height: 46px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.45);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  pointer-events: none; /* the whole card is the link — this is decorative */
  opacity: 0;
  transition: opacity 0.2s ease;
}
.reel-card.is-active .reel-card__play,
.reel-card.is-paused .reel-card__play { opacity: 1; } /* only show the play glyph on the active/paused card, not every card at once */
.reel-card__live-dot {
  position: absolute;
  top: 12px; right: 12px;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: #ff4d4d;
  opacity: 0;
  transition: opacity 0.2s ease;
}
.reel-card.is-active .reel-card__live-dot { opacity: 1; animation: live-pulse 1.4s ease-in-out infinite; }
@keyframes live-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.7); }
}

.reel-card__footer {
  padding: 12px 14px 14px;
}
.reel-card__caption {
  font-size: 0.85rem;
  font-weight: 600;
  margin: 0 0 4px;
}
.reel-card__handle {
  font-size: 0.76rem;
  color: var(--text-muted);
}

/* Prev/next arrows, overlaid on the slider's edges */
.reel-nav {
  position: absolute;
  top: 40%;
  transform: translateY(-50%);
  width: 38px; height: 38px;
  border-radius: 50%;
  border: 1px solid var(--card-border);
  background: var(--card-bg);
  backdrop-filter: blur(10px);
  color: var(--accent);
  font-size: 1.1rem;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
  box-shadow: var(--shadow-card);
  transition: border-color 0.15s ease, color 0.15s ease, transform 0.15s ease;
}
.reel-nav:hover { border-color: var(--accent); color: var(--accent-light); transform: translateY(-50%) scale(1.08); }
.reel-nav--prev { left: -6px; }
.reel-nav--next { right: -6px; }

@media (max-width: 640px) {
  .reel-card { flex-basis: 170px; }
  .reel-nav { display: none; } /* touch devices swipe instead */
}

/* ---------- Trust strip ---------- */
.trust-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
}
.trust-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px 20px;
}
.trust-item__icon { font-size: 1.4rem; }
.trust-item__text { font-size: 0.88rem; color: var(--text-muted); }

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--card-border);
  padding: 48px 0 24px;
  margin-top: 64px;
}
.site-footer__grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 32px;
}
.site-footer__col h4 {
  font-size: 0.85rem;
  margin-bottom: 14px;
}
.site-footer__col a {
  display: block;
  color: var(--text-muted);
  font-size: 0.88rem;
  padding: 4px 0;
}
.site-footer__col a:hover { color: var(--accent); }
.site-footer__bottom {
  margin-top: 32px;
  padding-top: 20px;
  border-top: 1px solid var(--card-border);
  font-size: 0.8rem;
  color: var(--text-muted);
}

@media (max-width: 720px) {
  .site-header__search { display: none; }
  .site-header__tagline { display: none; } /* not enough room once search hides too */
  .site-footer__grid { grid-template-columns: 1fr 1fr; }
}
