/* ========================================
   GOOGLE FONTS
   ======================================== */
@import url('https://fonts.googleapis.com/css2?family=Fraunces:ital,wght@0,300;0,400;0,600;0,700;1,400&family=Work+Sans:wght@300;400;500;600;700&display=swap');

/* ========================================
   CSS VARIABLES — NEW COLOR PALETTE
   ======================================== */
:root {
  /* Primary Colors */
  --color-terracotta: #C0603D;
  --color-terracotta-hover: #A34E30;
  --color-terracotta-light: #F0DACE;

  /* Backgrounds */
  --color-bg: #FBF3EA;
  --color-surface: #FFFFFF;
  --color-surface-alt: #F7EEE2;

  /* Text Colors */
  --color-text: #2E2A26;
  --color-text-muted: #6B6560;

  /* Borders */
  --color-border: #E4D9C9;

  /* Accents */
  --color-success: #2ecc71;
  --color-sale: #e74c3c;

  /* Typography */
  --font-heading: 'Fraunces', serif;
  --font-body: 'Work Sans', sans-serif;

  /* Spacing */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 40px;
  --space-xxl: 64px;

  /* Shadows */
  --shadow-sm: 0 2px 8px rgba(46, 42, 38, 0.06);
  --shadow-md: 0 4px 20px rgba(46, 42, 38, 0.10);
  --shadow-lg: 0 8px 40px rgba(46, 42, 38, 0.14);
  --shadow-xl: 0 16px 60px rgba(46, 42, 38, 0.18);

  /* Border Radius */
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-full: 9999px;

  /* Transitions */
  --transition-fast: 0.15s ease;
  --transition-medium: 0.3s ease;
  --transition-slow: 0.5s ease;
  --transition-bounce: 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ========================================
   RESET & BASE
   ======================================== */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  color: var(--color-text);
  background: var(--color-bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img {
  max-width: 100%;
  display: block;
}

a {
  text-decoration: none;
  color: inherit;
}

ul {
  list-style: none;
}

/* ========================================
   CONTAINER
   ======================================== */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--space-md);
}

/* ========================================
   TYPOGRAPHY
   ======================================== */
h1, h2, h3, h4, h5 {
  font-family: var(--font-heading);
  font-weight: 700;
  line-height: 1.2;
  color: var(--color-text);
}

h1 {
  font-size: 2.2rem;
}
h2 {
  font-size: 1.8rem;
}
h3 {
  font-size: 1.3rem;
}
h4 {
  font-size: 1.1rem;
}

p {
  color: var(--color-text-muted);
  max-width: 60ch;
}

/* Eyebrow — no emojis */
.eyebrow {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--color-terracotta);
  background: var(--color-terracotta-light);
  padding: 4px 14px;
  border-radius: var(--radius-full);
  margin-bottom: 8px;
}

.section-title {
  font-size: 1.8rem;
  margin-bottom: 6px;
}

.section-subtitle {
  color: var(--color-text-muted);
  font-size: 0.95rem;
  margin-bottom: var(--space-lg);
}

/* ========================================
   BUTTONS — Terracotta palette
   ======================================== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 28px;
  border-radius: var(--radius-full);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.9rem;
  border: none;
  cursor: pointer;
  transition: all var(--transition-medium);
  text-decoration: none;
}

.btn-primary {
  background: var(--color-terracotta);
  color: #fff;
  box-shadow: 0 4px 16px rgba(192, 96, 61, 0.30);
}
.btn-primary:hover {
  background: var(--color-terracotta-hover);
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(192, 96, 61, 0.40);
}

.btn-secondary {
  background: var(--color-text);
  color: #fff;
}
.btn-secondary:hover {
  background: #1a1614;
  transform: translateY(-2px);
}

.btn-outline {
  background: transparent;
  color: var(--color-text);
  border: 2px solid var(--color-border);
}
.btn-outline:hover {
  background: var(--color-text);
  color: #fff;
  border-color: var(--color-text);
}

.btn-sm {
  padding: 8px 18px;
  font-size: 0.75rem;
}

/* ========================================
   HEADER
   ======================================== */
.site-header {
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--color-border);
  position: sticky;
  top: 0;
  z-index: 1000;
  padding: 12px 0;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
}

.logo {
  font-family: var(--font-heading);
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--color-text);
  flex-shrink: 0;
}
.logo span {
  color: var(--color-terracotta);
}

.search-bar {
  flex: 1;
  max-width: 420px;
  display: none;
  align-items: center;
  background: var(--color-surface-alt);
  border-radius: var(--radius-full);
  padding: 0 16px;
  border: 2px solid transparent;
  transition: all var(--transition-medium);
}
.search-bar:focus-within {
  border-color: var(--color-terracotta);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(192, 96, 61, 0.15);
}
.search-bar input {
  flex: 1;
  border: none;
  background: transparent;
  padding: 10px 0;
  font-size: 0.9rem;
  outline: none;
  font-family: var(--font-body);
}
.search-bar button {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.1rem;
  color: var(--color-text-muted);
  padding: 6px;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.header-actions a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  transition: all var(--transition-fast);
  position: relative;
  color: var(--color-text);
}
.header-actions a:hover {
  background: var(--color-surface-alt);
}

.cart-badge {
  position: absolute;
  top: -2px;
  right: -2px;
  background: var(--color-terracotta);
  color: #fff;
  font-size: 0.6rem;
  font-weight: 700;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hamburger {
  display: flex;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
  width: 40px;
  height: 40px;
  align-items: center;
  justify-content: center;
}
.hamburger span {
  display: block;
  width: 24px;
  height: 2.5px;
  background: var(--color-text);
  border-radius: 2px;
  transition: all var(--transition-medium);
  transform-origin: center;
}
.hamburger.active span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}
.hamburger.active span:nth-child(2) {
  opacity: 0;
}
.hamburger.active span:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
}

/* ========================================
   NAV — desktop menu hidden by default,
   mobile menu hidden by default, JS toggles
   `.open` on the mobile one only.
   ======================================== */
.nav-menu {
  display: none;
}
.nav-menu.open {
  display: flex;
}
.nav-menu a {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-weight: 500;
  transition: all var(--transition-fast);
  color: var(--color-text);
}
.nav-menu a:hover,
.nav-menu a.active {
  background: var(--color-surface-alt);
  color: var(--color-terracotta);
}

/* Mobile-specific nav container (dropdown under header) */
.mobile-nav {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(12px);
  padding: var(--space-md) var(--space-md) var(--space-lg);
  border-bottom: 1px solid var(--color-border);
  flex-direction: column;
  gap: 4px;
}

/* ========================================
   HERO — with Drift Wall overlay
   ======================================== */
.hero {
  padding: var(--space-xl) 0 var(--space-xxl);
  position: relative;
  overflow: hidden;
  min-height: 600px;
  display: flex;
  align-items: center;
}

.hero-content {
  position: relative;
  z-index: 2;
  max-width: 600px;
}

.hero-content h1 {
  font-size: 3rem;
  margin: 12px 0 var(--space-md);
}

.hero-content h1 span {
  color: var(--color-terracotta);
}

.hero-content p {
  font-size: 1.05rem;
  margin-bottom: var(--space-lg);
}

.hero-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
}

/* ========================================
   FOOTER
   ======================================== */
.site-footer {
  background: var(--color-text);
  color: rgba(255, 255, 255, 0.7);
  padding: var(--space-xl) 0 var(--space-md);
  margin-top: var(--space-xxl);
}

.footer-grid {
  display: grid;
  gap: var(--space-xl);
  padding-bottom: var(--space-lg);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  margin-bottom: var(--space-md);
}

.footer-grid h4 {
  font-family: var(--font-body);
  font-weight: 600;
  color: #fff;
  margin-bottom: var(--space-md);
  font-size: 0.95rem;
}

.footer-grid p {
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.9rem;
}

.footer-grid a {
  display: block;
  color: rgba(255, 255, 255, 0.6);
  padding: 4px 0;
  font-size: 0.9rem;
  transition: all var(--transition-fast);
}
.footer-grid a:hover {
  color: #fff;
}

.footer-newsletter {
  display: flex;
  gap: 8px;
  margin-top: var(--space-sm);
}
.footer-newsletter input {
  flex: 1;
  padding: 10px 16px;
  border-radius: var(--radius-full);
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
  font-size: 0.9rem;
  font-family: var(--font-body);
}
.footer-newsletter input::placeholder {
  color: rgba(255, 255, 255, 0.4);
}
.footer-newsletter input:focus {
  outline: none;
  border-color: var(--color-terracotta);
}
.footer-newsletter .btn {
  flex-shrink: 0;
}

.footer-social {
  display: flex;
  gap: var(--space-sm);
}
.footer-social a {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  transition: all var(--transition-fast);
  color: rgba(255, 255, 255, 0.6);
}
.footer-social a:hover {
  background: var(--color-terracotta);
  color: #fff;
  transform: translateY(-3px);
}

.footer-bottom {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.4);
  text-align: center;
}

.footer-payment-icons {
  display: flex;
  gap: 10px;
  font-size: 1.4rem;
  color: rgba(255, 255, 255, 0.3);
  flex-wrap: wrap;
  justify-content: center;
}
.footer-payment-icons i:hover {
  color: rgba(255, 255, 255, 0.7);
}

/* ========================================
   DRIFT WALL — Base styles
   ======================================== */
.drift-wall-wrapper {
  position: relative;
  width: 100%;
  overflow: hidden;
}

.drift-wall-container {
  position: relative;
  width: 100%;
  height: 600px;
  overflow: hidden;
  background: var(--color-bg);
}

/* ========================================
   DRIFT WALL — Tile Styles
   ======================================== */
.drift-wall-tile {
  position: absolute;
  border-radius: var(--radius-md);
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  background: var(--color-surface);
  box-shadow: var(--shadow-sm);
  will-change: transform, left, top;
}

.drift-wall-tile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.4s ease;
}

.drift-wall-tile .tile-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 20px 16px 16px;
  background: linear-gradient(to top, rgba(46, 42, 38, 0.8) 0%, transparent 100%);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.drift-wall-tile:hover .tile-overlay {
  opacity: 1;
}

.drift-wall-tile .tile-title {
  color: #fff;
  font-family: var(--font-heading);
  font-size: 0.9rem;
  font-weight: 600;
  margin: 0;
}

.drift-wall-tile:hover {
  transform: scale(1.05) translateY(-4px);
  box-shadow: var(--shadow-lg);
  z-index: 10;
}

.drift-wall-tile:hover img {
  transform: scale(1.08);
}

/* Featured section specific */
#featuredDriftContainer .drift-wall-tile {
  border: 2px solid var(--color-surface);
}

#featuredDriftContainer .drift-wall-tile:hover {
  border-color: var(--color-terracotta);
}

/* Hero Drift Wall - subtle */
#heroDriftContainer .drift-wall-tile {
  opacity: 0.6;
  filter: saturate(0.4);
}

#heroDriftContainer .drift-wall-tile .tile-overlay {
  display: none;
}

/* ========================================
   RESPONSIVE BREAKPOINTS
   ======================================== */

@media (min-width: 640px) {
  h1 { font-size: 2.8rem; }
  h2 { font-size: 2rem; }

  .search-bar { display: flex; }
  .hamburger { display: none; }

  /* FIX: only the desktop nav (.nav-menu that is NOT .mobile-nav)
     gets forced visible at this breakpoint. Previously this rule
     targeted every .nav-menu, which included #mobileNav — forcing
     BOTH navs to render at once above 640px. */
  .nav-menu:not(.mobile-nav) {
    display: flex !important;
    position: static;
    flex-direction: row;
    background: transparent;
    padding: 0;
    border: none;
    gap: 4px;
  }
  .nav-menu:not(.mobile-nav) a { padding: 8px 16px; }

  /* FIX: explicitly force the mobile nav off at desktop widths,
     regardless of its .open state. */
  .mobile-nav,
  .mobile-nav.open {
    display: none !important;
  }

  .hero-content h1 { font-size: 3.2rem; }

  .footer-grid {
    grid-template-columns: 2fr 1fr 1fr 1.5fr;
  }
  .footer-bottom {
    flex-direction: row;
    justify-content: space-between;
    text-align: left;
  }
}

@media (min-width: 1024px) {
  .container { padding: 0 var(--space-xl); }
  h1 { font-size: 3.4rem; }
  .hero-content h1 { font-size: 3.8rem; }
}

@media (max-width: 768px) {
  .hero-content h1 { font-size: 2.2rem; }
  .hero { min-height: 400px; }
  .drift-wall-container { height: 400px; }

  /* FIX: these three grids are set inline in the PHP as two
     columns (e.g. "1fr 1.5fr") with no responsive override.
     On phones this squeezes the form/cover next to the summary
     instead of stacking. Overriding by class beats the inline
     style since !important here outranks a plain inline decl
     only for this property in this stylesheet's cascade —
     inline style has higher specificity than any stylesheet
     selector, so !important is required to win here. */
  .product-grid,
  .cart-grid,
  .checkout-grid {
    grid-template-columns: 1fr !important;
  }

  /* Order summary / cart summary use `position: sticky; top: 100px;`
     inline — on mobile once the grid stacks, sticky can trap the
     summary awkwardly mid-scroll. Drop it to static so it just
     flows after the form/items instead. */
  .cart-summary,
  .order-summary {
    position: static !important;
  }
}

@media (max-width: 480px) {
  .hero-content h1 { font-size: 1.8rem; }
  .hero { min-height: 300px; }
  .drift-wall-container { height: 300px; }
}