:root {
  /* Afriviv brand palette: red, black, gold */
  --ink: #140505;
  --ink-soft: #6b5350;
  --cream: #fdf9f7;
  --cream-alt: #f6ebe9;
  --line: #ecdcd9;
  --accent: #b3121f;
  --accent-dark: #7d0c16;
  --accent-soft: #f5d9dc;
  --gold: #c9a227;
  --gold-soft: #f2e6bd;
  --radius: 14px;
  --shadow: 0 20px 50px -25px rgba(20, 5, 5, 0.35);
  --font-display: "Fraunces", Georgia, serif;
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
[hidden] { display: none !important; }

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--cream);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.container {
  width: 100%;
  max-width: 1140px;
  margin: 0 auto;
  padding: 0 24px;
}

a { color: inherit; }

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.15;
  margin: 0 0 16px;
}

p { margin: 0 0 16px; color: var(--ink-soft); }

.eyebrow {
  font-size: 13px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 600;
  margin: 0 0 12px;
}

.section-title { font-size: clamp(28px, 3.4vw, 40px); color: var(--ink); }
.center { text-align: center; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 15px;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-dark); transform: translateY(-1px); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }
.btn-lg { padding: 14px 28px; font-size: 16px; }

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(253, 249, 247, 0.9);
  backdrop-filter: blur(8px);
  border-top: 3px solid var(--gold);
  border-bottom: 1px solid var(--line);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 72px; }
.logo {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  color: var(--ink);
}
.logo-img { height: 44px; width: auto; display: block; }
.nav { display: flex; gap: 32px; }
.nav a { text-decoration: none; color: var(--ink-soft); font-size: 15px; font-weight: 500; }
.nav a:hover { color: var(--accent); }
.header-actions { display: flex; align-items: center; gap: 16px; }
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 36px;
  height: 36px;
  background: none;
  border: none;
  cursor: pointer;
}
.nav-toggle span { display: block; height: 2px; background: var(--ink); border-radius: 2px; }

.icon {
  width: 22px;
  height: 22px;
  display: block;
}

.cart-toggle {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  color: var(--ink);
  cursor: pointer;
  padding: 6px;
}
.cart-toggle:hover { color: var(--accent); }
.cart-count {
  position: absolute;
  top: -2px;
  right: -2px;
  background: var(--accent);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  min-width: 18px;
  height: 18px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
}

/* Hero */
.hero { position: relative; padding: 96px 0; overflow: hidden; }
.hero-inner { max-width: 680px; position: relative; z-index: 1; }
.hero h1 { font-size: clamp(34px, 5vw, 54px); letter-spacing: -0.01em; }
.lede { font-size: 18px; max-width: 52ch; }
.hero-actions { display: flex; gap: 16px; flex-wrap: wrap; margin: 28px 0 0; }

.hero-banners { position: absolute; inset: 0; z-index: 0; }
.hero-banners img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 1.2s ease;
}
.hero-banners img.active { opacity: 1; }
.hero--has-banner .hero-banners::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(20, 5, 5, 0.8) 0%, rgba(20, 5, 5, 0.45) 55%, rgba(20, 5, 5, 0.2) 100%);
}
.hero--has-banner .eyebrow { color: var(--gold-soft); }
.hero--has-banner h1,
.hero--has-banner .lede { color: #fff; }

/* Categories */
.categories { padding: 96px 0; background: var(--cream-alt); }
.category-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
  margin-top: 48px;
}
.category-card {
  position: relative;
  aspect-ratio: 3 / 4;
  border-radius: var(--radius);
  overflow: hidden;
  border: none;
  padding: 0;
  cursor: pointer;
  background: #fff;
  box-shadow: var(--shadow);
}
.category-card img { width: 100%; height: 100%; object-fit: cover; display: block; }
.category-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(20, 5, 5, 0) 40%, rgba(20, 5, 5, 0.75) 100%);
}
.category-card-name {
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 14px;
  z-index: 1;
  color: #fff;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 18px;
  text-align: left;
}

.category-chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 40px; }
.category-chip {
  padding: 8px 18px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
.category-chip:hover { border-color: var(--accent); }
.category-chip.active { background: var(--accent); border-color: var(--accent); color: #fff; }

/* New Arrivals / Top Sellers */
.new-arrivals { padding: 96px 0; }
.top-sellers { padding: 96px 0; background: var(--cream-alt); }

/* Shop */
.shop { padding: 96px 0; }
.product-status {
  text-align: center;
  color: var(--ink-soft);
  grid-column: 1 / -1;
}
.product-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin-top: 48px;
}
.product-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow);
}
.product-image {
  position: relative;
  aspect-ratio: 4 / 5;
  background: var(--cream-alt);
  overflow: hidden;
}
.product-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 25%;
  transform: scale(1.12);
  display: block;
}
.product-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  background: var(--ink);
  color: var(--gold-soft);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 999px;
}
.product-card.sold-out .product-image img { opacity: 0.5; }
.product-info { padding: 20px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.product-info h3 { font-size: 18px; margin: 0; }
.product-info p { font-size: 14px; margin: 0; }
.size-selector-row { display: flex; flex-direction: column; gap: 8px; }
.size-selector-label-row { display: flex; align-items: center; justify-content: space-between; }
.size-selector-label { font-size: 12px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--ink-soft); }
.size-selector { display: flex; flex-wrap: wrap; gap: 8px; }
.size-guide-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: none;
  border: none;
  padding: 0;
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
  cursor: pointer;
}
.size-guide-link:hover { color: var(--accent-dark); }
.icon-sm { width: 14px; height: 14px; display: block; }
.size-pill {
  min-width: 34px;
  height: 30px;
  padding: 0 8px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.size-pill:hover { border-color: var(--accent); }
.size-pill.selected { border-color: var(--accent); background: var(--accent); color: #fff; }
.size-pill.sold-out {
  position: relative;
  opacity: 0.4;
  text-decoration: line-through;
  cursor: not-allowed;
}
.size-pill.sold-out:hover { border-color: var(--line); }
.size-pill.sold-out:hover::after {
  content: "Sold out";
  position: absolute;
  bottom: 110%;
  left: 50%;
  transform: translateX(-50%);
  background: var(--ink);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: 6px;
  white-space: nowrap;
  z-index: 5;
  pointer-events: none;
}
.product-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: auto; padding-top: 8px; }
.product-price { font-weight: 700; color: var(--accent); font-size: 16px; }
.product-unavailable { font-size: 13px; color: var(--ink-soft); font-style: italic; }
.btn-sm { padding: 8px 16px; font-size: 13px; }

/* About */
.about { padding: 96px 0; }
.about .lede { max-width: 640px; margin: 0 auto; }

/* Contact */
.contact { padding: 90px 0; background: var(--accent-dark); color: #fff; }
.contact-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 32px;
}
.contact .eyebrow { color: var(--gold-soft); }
.contact .section-title { color: #fff; }
.contact .lede { color: #f3d9d9; }
.contact-links { display: flex; gap: 16px; flex-wrap: wrap; }
.contact .btn-ghost { color: #fff; border-color: rgba(255, 255, 255, 0.5); }
.contact .btn-ghost:hover { border-color: var(--gold); color: var(--gold-soft); }

/* Footer */
.site-footer { background: var(--accent-dark); color: #f3d9d9; padding-top: 56px; border-top: 3px solid var(--gold); }
.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 24px;
  padding-bottom: 32px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}
.footer-inner .logo { color: #fff; }
.footer-inner p { color: #f3d9d9; margin: 8px 0 0; }
.footer-nav { display: flex; gap: 24px; flex-wrap: wrap; }
.footer-nav a { text-decoration: none; color: #f3d9d9; font-size: 14px; }
.footer-nav a:hover { color: var(--gold-soft); }
.footer-social { display: flex; gap: 16px; margin-top: 14px; }
.social-link { color: #f3d9d9; }
.social-link:hover { color: var(--gold-soft); }
.social-link .icon { width: 20px; height: 20px; }
.footer-bottom { padding: 20px 0; }
.footer-bottom p { margin: 0; font-size: 13px; color: #e3b3b3; text-align: center; }

/* Cart */
.drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(20, 5, 5, 0.5);
  z-index: 90;
}
.drawer-close {
  background: none;
  border: none;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  color: var(--ink-soft);
  padding: 4px;
}
.cart-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 380px;
  max-width: 100%;
  background: #fff;
  z-index: 91;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow);
}
.cart-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--line);
}
.cart-drawer-header h2 { margin: 0; font-size: 20px; }
.cart-items { flex: 1; overflow-y: auto; padding: 16px 24px; }
.cart-empty { color: var(--ink-soft); text-align: center; margin-top: 40px; }
.cart-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}
.cart-item-img {
  width: 56px;
  height: 56px;
  object-fit: cover;
  border-radius: 8px;
  flex-shrink: 0;
  background: var(--cream-alt);
}
.cart-item-info { flex: 1; min-width: 0; }
.cart-item-name { margin: 0; font-size: 14px; font-weight: 600; }
.cart-item-price { margin: 2px 0 6px; font-size: 13px; color: var(--ink-soft); }
.cart-item-qty { display: flex; align-items: center; gap: 10px; }
.qty-btn {
  width: 24px;
  height: 24px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #fff;
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
}
.cart-item-remove {
  background: none;
  border: none;
  font-size: 18px;
  color: var(--ink-soft);
  cursor: pointer;
  align-self: flex-start;
}
.cart-drawer-footer { padding: 20px 24px; border-top: 1px solid var(--line); }
.cart-total-row {
  display: flex;
  justify-content: space-between;
  font-weight: 700;
  font-size: 17px;
  margin-bottom: 16px;
}
.cart-drawer-footer .btn { width: 100%; }

.checkout-modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 440px;
  max-width: calc(100% - 32px);
  max-height: calc(100vh - 48px);
  overflow-y: auto;
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  z-index: 101;
}
.checkout-form { display: flex; flex-direction: column; gap: 14px; padding: 28px; }
.checkout-form-header { display: flex; align-items: center; justify-content: space-between; }
.checkout-form-header h2 { margin: 0; font-size: 20px; }
.checkout-form label { display: flex; flex-direction: column; gap: 6px; font-size: 14px; font-weight: 600; color: var(--ink); }
.checkout-form input,
.checkout-form textarea {
  font: inherit;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-weight: 400;
}
.checkout-form input:focus,
.checkout-form textarea:focus { outline: none; border-color: var(--accent); }
.checkout-note { font-size: 12px; color: var(--ink-soft); margin: 0; }
.form-error { color: var(--accent); font-size: 14px; margin: 0; min-height: 1em; }

.size-guide-modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 480px;
  max-width: calc(100% - 32px);
  max-height: calc(100vh - 48px);
  overflow-y: auto;
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  z-index: 101;
}
.size-guide-header { display: flex; align-items: center; justify-content: space-between; padding: 24px 28px 0; }
.size-guide-header h2 { margin: 0; font-size: 20px; }
.size-guide-body { padding: 16px 28px 28px; }
.size-guide-note { font-size: 13px; }
.size-guide-table { width: 100%; border-collapse: collapse; }
.size-guide-table th,
.size-guide-table td { text-align: center; padding: 10px 8px; border-bottom: 1px solid var(--line); font-size: 14px; }
.size-guide-table th { background: var(--cream-alt); font-weight: 600; }

@media (max-width: 480px) {
  .cart-drawer { width: 100%; }
}

/* Responsive */
@media (max-width: 900px) {
  .category-grid { grid-template-columns: repeat(2, 1fr); }
  .product-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 720px) {
  .nav {
    position: fixed;
    top: 72px;
    left: 0;
    right: 0;
    background: var(--cream);
    flex-direction: column;
    padding: 20px 24px;
    border-bottom: 1px solid var(--line);
    gap: 18px;
    transform: translateY(-8px);
    opacity: 0;
    pointer-events: none;
    transition: all 0.2s ease;
  }
  .nav.open { transform: translateY(0); opacity: 1; pointer-events: auto; }
  .nav-toggle { display: flex; }
  .header-actions .btn-primary { display: none; }
  .category-grid { grid-template-columns: 1fr; }
  .product-grid { grid-template-columns: 1fr; }
  .footer-inner { flex-direction: column; }
  .contact-inner { flex-direction: column; align-items: flex-start; }
}
