/* ============================================================
   FAVAFINDS — Style Sheet
   Palette: Soft Ivory + Deep Forest Green + Champagne Gold
   Fonts: Cabinet Grotesk (display) + Satoshi (body)
============================================================ */

/* ---- Design Tokens ---- */
:root,
[data-theme='light'] {
  /* Surfaces */
  --color-bg: #FAF7F0;           /* Soft Ivory */
  --color-surface: #FFFFFF;      /* Clean White — cards */
  --color-surface-2: #F3F0E8;    /* Slightly deeper ivory */
  --color-surface-offset: #EAE6DC;
  --color-border: #D8D2C7;       /* Soft Taupe Gray */
  --color-divider: #E2DDD4;      /* Soft Taupe Gray lighter */

  /* Text */
  --color-text: #1F3D35;         /* Deep Forest Green — headings */
  --color-text-body: #2F3430;    /* Warm Charcoal — body text */
  --color-text-muted: #6B7A6A;   /* Muted sage */
  --color-text-faint: #A8B0A6;
  --color-text-inverse: #FAF7F0;

  /* Primary — Deep Forest Green */
  --color-primary: #1F3D35;
  --color-primary-hover: #162c27;
  --color-primary-active: #0e1e19;
  --color-primary-highlight: #E4EDE8;

  /* Accent — Champagne Gold */
  --color-accent: #C8A96A;
  --color-accent-hover: #b3944f;
  --color-accent-highlight: #FBF5E8;

  /* Sage — category labels, icons, hover */
  --color-sage: #7A8B78;
  --color-sage-hover: #637062;
  --color-sage-highlight: #EDF0EC;

  /* Success */
  --color-success: #1F3D35;
  --color-success-bg: #E4EDE8;

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(26, 24, 20, 0.07);
  --shadow-md: 0 4px 16px rgba(26, 24, 20, 0.09);
  --shadow-lg: 0 12px 36px rgba(26, 24, 20, 0.12);
  --shadow-hover: 0 8px 28px rgba(26, 24, 20, 0.14);

  /* Radius */
  --radius-sm: 0.375rem;
  --radius-md: 0.625rem;
  --radius-lg: 1rem;
  --radius-xl: 1.5rem;
  --radius-full: 9999px;

  /* Spacing */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-20: 5rem;
  --space-24: 6rem;

  /* Type scale */
  --text-xs: clamp(0.75rem, 0.7rem + 0.25vw, 0.875rem);
  --text-sm: clamp(0.875rem, 0.8rem + 0.35vw, 1rem);
  --text-base: clamp(1rem, 0.95rem + 0.25vw, 1.125rem);
  --text-lg: clamp(1.125rem, 1rem + 0.75vw, 1.5rem);
  --text-xl: clamp(1.5rem, 1.2rem + 1.25vw, 2.25rem);
  --text-2xl: clamp(2rem, 1.2rem + 2.5vw, 3.5rem);

  /* Fonts */
  --font-display: 'Cabinet Grotesk', 'Helvetica Neue', sans-serif;
  --font-body: 'Satoshi', 'Inter', sans-serif;

  /* Transitions */
  --transition: 180ms cubic-bezier(0.16, 1, 0.3, 1);

  /* Layout */
  --content-default: 1160px;
  --header-height: 64px;
}

/* Dark Mode */
[data-theme='dark'] {
  --color-bg: #141a17;
  --color-surface: #1a221e;
  --color-surface-2: #1f2a25;
  --color-surface-offset: #253029;
  --color-border: #2e3d36;
  --color-divider: #263229;
  --color-text: #EDE8DF;
  --color-text-body: #CFC9BE;
  --color-text-muted: #8a9e90;
  --color-text-faint: #4a5e52;
  --color-text-inverse: #141a17;
  --color-primary: #9fc9b0;
  --color-primary-hover: #7db598;
  --color-primary-active: #5da07f;
  --color-primary-highlight: #1f3028;
  --color-accent: #D4B87A;
  --color-accent-hover: #bfa05f;
  --color-accent-highlight: #2a2010;
  --color-sage: #8FAD8C;
  --color-sage-hover: #749072;
  --color-sage-highlight: #1e2b1e;
  --color-success: #9fc9b0;
  --color-success-bg: #1a2e22;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.25);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.35);
  --shadow-lg: 0 12px 36px rgba(0,0,0,0.45);
  --shadow-hover: 0 8px 28px rgba(0,0,0,0.5);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --color-bg: #111210;
    --color-surface: #181714;
    --color-surface-2: #1e1d1a;
    --color-surface-offset: #252320;
    --color-border: #2e2c29;
    --color-divider: #242220;
    --color-text: #e8e6e1;
    --color-text-muted: #7a7874;
    --color-text-faint: #4a4845;
    --color-text-inverse: #111210;
    --color-primary: #6b9fe4;
    --color-primary-hover: #4d87d8;
    --color-primary-highlight: #1e2a3a;
    --color-accent: #f5a623;
    --color-accent-hover: #e09510;
    --color-accent-highlight: #2a2010;
    --color-success: #66bb6a;
    --color-success-bg: #1a2e1a;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.25);
    --shadow-md: 0 4px 16px rgba(0,0,0,0.35);
    --shadow-lg: 0 12px 36px rgba(0,0,0,0.45);
    --shadow-hover: 0 8px 28px rgba(0,0,0,0.5);
  }
}

/* ---- Reset ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-height) + var(--space-4));
}
body {
  min-height: 100dvh;
  font-family: var(--font-body);
  font-size: var(--text-base);
  color: var(--color-text-body);
  background: var(--color-bg);
  line-height: 1.6;
}
img, svg { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
button { cursor: pointer; background: none; border: none; font: inherit; color: inherit; }
ul { list-style: none; }
a, button, [role='button'] {
  transition: color var(--transition), background var(--transition),
    box-shadow var(--transition), border-color var(--transition), transform var(--transition);
}
:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* ---- Utility ---- */
.container {
  width: 100%;
  max-width: var(--content-default);
  margin-inline: auto;
  padding-inline: clamp(var(--space-4), 4vw, var(--space-10));
}
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0;
  margin: -1px; overflow: hidden; clip: rect(0,0,0,0);
  white-space: nowrap; border-width: 0;
}

/* ============================================================
   HEADER
============================================================ */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-height);
  background: color-mix(in oklab, var(--color-bg) 92%, transparent);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--color-divider);
  transition: box-shadow var(--transition);
}
.header.scrolled { box-shadow: var(--shadow-md); }

.header-inner {
  display: flex;
  align-items: center;
  gap: var(--space-6);
  height: 100%;
  max-width: var(--content-default);
  margin-inline: auto;
  padding-inline: clamp(var(--space-4), 4vw, var(--space-10));
}

/* Logo */
.logo {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-shrink: 0;
}
.logo-text {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 800;
  color: var(--color-text);
  letter-spacing: -0.02em;
}

/* Nav */
.nav {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  margin-left: var(--space-4);
}
.nav-link {
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--color-text-muted);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-md);
}
.nav-link:hover { color: var(--color-text); background: var(--color-surface-2); }
.nav-link.active-page { color: var(--color-text); font-weight: 700; }

/* Right controls */
.header-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.theme-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  color: var(--color-text-muted);
}
.theme-toggle:hover { background: var(--color-surface-2); color: var(--color-text); }

.mobile-menu-btn {
  display: none;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  color: var(--color-text-muted);
}
.mobile-menu-btn:hover { background: var(--color-surface-2); }

/* Mobile nav */
.mobile-nav {
  display: none;
  flex-direction: column;
  background: var(--color-surface);
  border-top: 1px solid var(--color-divider);
  padding: var(--space-3) var(--space-4);
  gap: var(--space-1);
}
.mobile-nav.open { display: flex; }
.mobile-nav-link {
  font-size: var(--text-base);
  font-weight: 500;
  color: var(--color-text-muted);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-md);
}
.mobile-nav-link:hover { background: var(--color-surface-2); color: var(--color-text); }

@media (max-width: 768px) {
  .nav { display: none; }
  .mobile-menu-btn { display: flex; }
  .header { height: auto; min-height: var(--header-height); }
  .header-inner { height: var(--header-height); }
}

/* ============================================================
   HERO
============================================================ */
.hero {
  background: linear-gradient(135deg, #1F3D35 0%, #0e2420 100%);
  padding-block: clamp(var(--space-16), 10vw, var(--space-24));
  position: relative;
  overflow: hidden;
}

/* Decorative circles */
.hero::before {
  content: '';
  position: absolute;
  top: -80px; right: -80px;
  width: 400px; height: 400px;
  border-radius: 50%;
  background: rgba(255,255,255,0.04);
  pointer-events: none;
}
.hero::after {
  content: '';
  position: absolute;
  bottom: -100px; left: 20%;
  width: 300px; height: 300px;
  border-radius: 50%;
  background: rgba(200, 169, 106, 0.12);
  pointer-events: none;
}

.hero-inner {
  max-width: var(--content-default);
  margin-inline: auto;
  padding-inline: clamp(var(--space-4), 4vw, var(--space-10));
  text-align: center;
  position: relative;
  z-index: 1;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  background: var(--color-accent);
  color: #1F3D35;
  font-size: var(--text-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-full);
  margin-bottom: var(--space-5);
}
.hero-badge::before {
  content: '';
  width: 6px; height: 6px;
  background: #fff;
  border-radius: 50%;
  animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.7); }
}

.hero-title {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: 800;
  color: #fff;
  line-height: 1.1;
  letter-spacing: -0.03em;
  margin-bottom: var(--space-5);
}

.hero-sub {
  font-size: var(--text-base);
  color: rgba(255,255,255,0.75);
  max-width: 52ch;
  margin-inline: auto;
  margin-bottom: var(--space-8);
  line-height: 1.65;
}

.hero-stats {
  display: flex;
  justify-content: center;
  gap: clamp(var(--space-8), 6vw, var(--space-16));
  margin-top: var(--space-12);
  padding-top: var(--space-10);
  border-top: 1px solid rgba(255,255,255,0.12);
  max-width: var(--content-default);
  margin-inline: auto;
  padding-inline: clamp(var(--space-4), 4vw, var(--space-10));
}
.stat { text-align: center; }
.stat-num {
  display: block;
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 800;
  color: var(--color-accent);
  line-height: 1;
  margin-bottom: var(--space-1);
  letter-spacing: -0.01em;
}
.stat-label {
  font-size: var(--text-xs);
  color: rgba(255,255,255,0.6);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 500;
}

/* ============================================================
   BUTTONS
============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 600;
  border-radius: var(--radius-md);
  padding: var(--space-3) var(--space-6);
  cursor: pointer;
  white-space: nowrap;
  text-decoration: none;
  border: 2px solid transparent;
}
.btn-primary {
  background: var(--color-accent);
  color: #fff;
  border-color: var(--color-accent);
}
.btn-primary:hover {
  background: var(--color-accent-hover);
  border-color: var(--color-accent-hover);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}
.btn-deal {
  background: var(--color-primary);
  color: #fff;
  border-color: var(--color-primary);
  width: 100%;
  justify-content: center;
  font-size: var(--text-sm);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-md);
}
.btn-deal:hover {
  background: var(--color-primary-hover);
  border-color: var(--color-primary-hover);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}
.btn-outline {
  background: transparent;
  color: var(--color-primary);
  border-color: var(--color-sage);
  padding: var(--space-3) var(--space-8);
}
.btn-outline:hover {
  background: var(--color-sage-highlight);
  border-color: var(--color-primary);
}

/* ============================================================
   CATEGORIES / FILTER PILLS
============================================================ */
.categories-section {
  padding-block: var(--space-6);
  border-bottom: 1px solid var(--color-divider);
  background: var(--color-surface);
  position: sticky;
  top: var(--header-height);
  z-index: 50;
}
.category-pills {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  padding-bottom: 2px;
}
.category-pills::-webkit-scrollbar { display: none; }

.pill {
  flex-shrink: 0;
  font-size: var(--text-sm);
  font-weight: 600;
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-full);
  border: 1.5px solid var(--color-border);
  background: var(--color-surface);
  color: var(--color-text-muted);
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--transition);
}
.pill:hover {
  border-color: var(--color-sage);
  color: var(--color-sage);
  background: var(--color-sage-highlight);
}
.pill.active {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: #FAF7F0;
}

/* ============================================================
   DEALS SECTION
============================================================ */
.deals-section {
  padding-block: clamp(var(--space-10), 6vw, var(--space-16));
}

.section-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-4);
  margin-bottom: var(--space-8);
  flex-wrap: wrap;
}
.section-title {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--color-text);
}
.deal-count {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  font-weight: 500;
}

/* ---- Products Grid ---- */
.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: var(--space-6);
}

/* ---- Product Card ---- */
.product-card {
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  position: relative;
  transition: box-shadow var(--transition), transform var(--transition), border-color var(--transition);
}
.product-card:hover {
  box-shadow: var(--shadow-hover);
  transform: translateY(-3px);
  border-color: var(--color-primary-highlight);
}
.product-card.featured {
  border-color: var(--color-accent);
  box-shadow: 0 0 0 1px var(--color-accent);
}

/* Card badge */
.card-badge {
  position: absolute;
  top: var(--space-3);
  left: var(--space-3);
  z-index: 2;
  font-size: var(--text-xs);
  font-weight: 700;
  padding: 3px var(--space-2);
  border-radius: var(--radius-sm);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.card-badge.deal {
  background: var(--color-primary);
  color: #FAF7F0;
}
.card-badge.hot {
  background: var(--color-accent);
  color: #1F3D35;
  font-weight: 800;
}
.card-badge.sponsored {
  background: linear-gradient(135deg, #C8A96A, #d4b87a);
  color: #1F3D35;
  box-shadow: 0 1px 6px rgba(200,169,106,0.4);
  letter-spacing: 0.03em;
  font-weight: 800;
}

/* Card image */
.card-img-wrap {
  aspect-ratio: 4 / 3;
  background: var(--color-surface-2);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.card-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: var(--space-4);
  transition: transform 0.3s ease;
}
.product-card:hover .card-img-wrap img { transform: scale(1.04); }

/* Card body */
.card-body {
  padding: var(--space-4) var(--space-5) var(--space-5);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  flex: 1;
}

.card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
}
.card-category {
  font-size: var(--text-xs);
  font-weight: 700;
  color: var(--color-sage);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.card-rating {
  font-size: var(--text-xs);
  color: var(--color-accent);
  font-weight: 500;
}
.rating-count {
  color: var(--color-text-faint);
  font-weight: 400;
}

.card-title {
  font-family: var(--font-display);
  font-size: var(--text-base);
  font-weight: 700;
  color: var(--color-text);
  line-height: 1.3;
  letter-spacing: -0.01em;
  flex: 1;
  /* Clamp to 3 lines */
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-price {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-2);
}
.price-current {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 800;
  color: var(--color-text);
}
.price-was {
  font-size: var(--text-sm);
  color: var(--color-text-faint);
  text-decoration: line-through;
}
.price-save {
  font-size: var(--text-xs);
  font-weight: 700;
  color: var(--color-accent-hover);
  background: var(--color-accent-highlight);
  padding: 2px var(--space-2);
  border-radius: var(--radius-sm);
}

/* ---- Load More ---- */
.load-more-wrap {
  text-align: center;
  margin-top: var(--space-12);
}

/* ============================================================
   AFFILIATE DISCLOSURE
============================================================ */
.disclosure-section {
  background: var(--color-surface-2);
  border-top: 1px solid var(--color-divider);
  padding-block: var(--space-6);
}
.disclosure-text {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  line-height: 1.7;
  max-width: 80ch;
}

/* ============================================================
   FOOTER
============================================================ */
.footer {
  background: #1F3D35;
  color: #FAF7F0;
  padding-top: clamp(var(--space-12), 6vw, var(--space-20));
}
[data-theme='dark'] .footer {
  background: #0e1e19;
}

.footer-inner {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: clamp(var(--space-8), 6vw, var(--space-16));
  padding-bottom: var(--space-12);
}
.footer-brand .logo-text { color: #fff; }
.footer-tagline {
  margin-top: var(--space-3);
  font-size: var(--text-sm);
  color: rgba(255,255,255,0.5);
  max-width: 32ch;
  line-height: 1.6;
}

.footer-links {
  display: flex;
  gap: clamp(var(--space-8), 6vw, var(--space-16));
}
.footer-col {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}
.footer-col-title {
  font-size: var(--text-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(255,255,255,0.4);
  margin-bottom: var(--space-1);
}
.footer-link {
  font-size: var(--text-sm);
  color: rgba(255,255,255,0.6);
}
.footer-link:hover { color: var(--color-accent); }

.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.08);
  padding-block: var(--space-5);
}
.footer-copy {
  font-size: var(--text-xs);
  color: rgba(255,255,255,0.35);
  max-width: none;
}

/* ============================================================
   HIDDEN (filter)
============================================================ */
.product-card.hidden {
  display: none;
}

/* ============================================================
   RESPONSIVE
============================================================ */
@media (max-width: 900px) {
  .footer-inner {
    grid-template-columns: 1fr;
  }
  .footer-links {
    flex-wrap: wrap;
    gap: var(--space-8);
  }
}

@media (max-width: 600px) {
  .hero-stats {
    gap: var(--space-8);
    flex-wrap: wrap;
    justify-content: center;
  }
  .products-grid {
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: var(--space-4);
  }
  .section-header { flex-direction: column; gap: var(--space-2); }
}
