/* ===== Reset & base ===== */
* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-body);
  line-height: 1.55;
  transition: background 0.2s ease, color 0.2s ease;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, h4 { font-family: var(--font-heading); line-height: 1.2; }
.container { max-width: 1180px; margin: 0 auto; padding: 0 20px; }
button { font-family: inherit; cursor: pointer; }

/* ===== Top notice bar ===== */
.notice-bar {
  background: var(--color-primary-dark);
  color: #fff;
  text-align: center;
  font-size: 0.85rem;
  padding: 8px 12px;
  letter-spacing: 0.3px;
}

/* ===== Header ===== */
.site-header {
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  position: sticky;
  top: 0;
  z-index: 50;
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  gap: 20px;
}
.logo {
  font-family: var(--font-heading);
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--color-primary);
  white-space: nowrap;
}
.logo span { color: var(--color-accent); }
.main-nav { display: flex; gap: 24px; flex-wrap: wrap; }
.main-nav a {
  font-weight: 500;
  font-size: 0.95rem;
  color: var(--color-text);
  padding: 6px 2px;
  border-bottom: 2px solid transparent;
}
.main-nav a:hover, .main-nav a.active {
  color: var(--color-primary);
  border-bottom-color: var(--color-accent);
}
.header-actions { display: flex; align-items: center; gap: 16px; }
.cart-link {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  color: var(--color-primary);
  border: 1px solid var(--color-border);
  padding: 8px 14px;
  border-radius: 999px;
}
.cart-count {
  background: var(--color-primary);
  color: #fff;
  font-size: 0.7rem;
  min-width: 18px;
  height: 18px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
}
.nav-toggle { display: none; background: none; border: none; font-size: 1.5rem; }

/* ===== Buttons ===== */
.btn {
  display: inline-block;
  padding: 12px 26px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.95rem;
  border: 2px solid transparent;
  transition: transform 0.15s ease, background 0.15s ease;
}
.btn-primary { background: var(--color-primary); color: #fff; }
.btn-primary:hover { background: var(--color-primary-dark); }
.btn-outline { border-color: var(--color-primary); color: var(--color-primary); background: transparent; }
.btn-outline:hover { background: var(--color-primary); color: #fff; }
.btn-block { display: block; width: 100%; text-align: center; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ===== Hero ===== */
.hero {
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
  color: #fff;
  padding: 64px 20px;
}
.hero-inner {
  max-width: 1180px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 40px;
  align-items: center;
}
.hero h1 { font-size: 2.6rem; margin-bottom: 16px; }
.hero p { font-size: 1.05rem; opacity: 0.92; margin-bottom: 26px; max-width: 46ch; }
.hero-badge {
  display: inline-block;
  background: var(--color-accent);
  color: #2b1810;
  font-weight: 700;
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 0.85rem;
  margin-bottom: 18px;
}
.hero-img { border-radius: 14px; overflow: hidden; box-shadow: 0 20px 50px rgba(0,0,0,0.25); }

/* ===== Section heading ===== */
.section { padding: 56px 20px; }
.section-head { display: flex; justify-content: space-between; align-items: flex-end; margin-bottom: 28px; gap: 16px; flex-wrap: wrap; }
.section-head h2 { font-size: 1.8rem; color: var(--color-text); }
.section-head p { color: var(--color-text-muted); margin-top: 6px; }

/* ===== Category tiles ===== */
.category-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 18px; }
.category-tile {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 12px;
  overflow: hidden;
  text-align: center;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.category-tile:hover { transform: translateY(-4px); box-shadow: 0 12px 28px rgba(0,0,0,0.08); }
.category-tile img { aspect-ratio: 1/1; object-fit: cover; }
.category-tile span { display: block; padding: 12px; font-weight: 600; }

/* ===== Product grid & card ===== */
.product-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 22px; }
.product-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 14px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.product-card:hover { transform: translateY(-4px); box-shadow: 0 14px 32px rgba(0,0,0,0.09); }
.product-media { position: relative; aspect-ratio: 3/4; overflow: hidden; }
.product-media img { width: 100%; height: 100%; object-fit: cover; }
.product-discount-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  background: var(--color-badge);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: 6px;
}
.product-body { padding: 14px 16px 18px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.product-category { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.5px; color: var(--color-text-muted); }
.product-title { font-size: 1.02rem; font-weight: 600; }
.product-title a:hover { color: var(--color-primary); }
.price-row { display: flex; align-items: baseline; gap: 8px; margin-top: 4px; }
.price-now { font-size: 1.15rem; font-weight: 700; color: var(--color-primary); }
.price-mrp { text-decoration: line-through; color: var(--color-text-muted); font-size: 0.9rem; }
.add-to-cart-btn { margin-top: 10px; }

/* ===== Ad slots ===== */
.ad-slot-wrap { margin: 34px 0; text-align: center; }
.ad-label {
  font-size: 0.68rem;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--color-text-muted);
  margin-bottom: 6px;
}
.ad-slot {
  background: var(--color-surface);
  border: 1px dashed var(--color-border);
  border-radius: 8px;
  min-height: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-muted);
  font-size: 0.8rem;
  overflow: hidden;
}
.ad-slot--banner { min-height: 90px; max-width: 970px; margin: 0 auto; }
.ad-slot--infeed { min-height: 250px; grid-column: 1 / -1; }
.ad-slot--sidebar { min-height: 600px; }
.product-grid .ad-slot-wrap { grid-column: 1 / -1; margin: 6px 0; }
.ad-slot-wrap--top { margin: 10px auto 0; padding: 0 20px; }

/* ===== Mobile anchor ad ===== */
.anchor-ad {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 60;
  background: var(--color-surface);
  border-top: 1px solid var(--color-border);
  box-shadow: 0 -6px 16px rgba(0,0,0,0.1);
  display: none;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
}
.anchor-ad .ad-slot { flex: 1; min-height: 50px; }
.anchor-ad-close {
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: 50%;
  width: 26px; height: 26px;
  flex-shrink: 0;
  font-size: 0.85rem;
  line-height: 1;
  color: var(--color-text-muted);
}
body.has-anchor-ad { padding-bottom: 64px; }
@media (max-width: 640px) {
  .anchor-ad { display: flex; }
}

/* ===== Filters (products page) ===== */
.catalog-layout { display: grid; grid-template-columns: 220px 1fr; gap: 30px; }
.filters { background: var(--color-surface); border: 1px solid var(--color-border); border-radius: 12px; padding: 18px; align-self: start; position: sticky; top: 100px; }
.filters h3 { font-size: 0.95rem; margin-bottom: 12px; }
.filter-group { margin-bottom: 20px; }
.filter-group label { display: flex; align-items: center; gap: 8px; font-size: 0.9rem; margin-bottom: 8px; cursor: pointer; }
.sort-bar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; flex-wrap: wrap; gap: 10px; }
.sort-bar select {
  padding: 8px 12px; border: 1px solid var(--color-border); border-radius: 8px; background: var(--color-surface); color: var(--color-text);
}

/* ===== Product detail ===== */
.product-detail { display: grid; grid-template-columns: 1fr 1fr; gap: 44px; }
.pd-gallery img { border-radius: 14px; aspect-ratio: 3/4; object-fit: cover; }
.pd-info h1 { font-size: 1.9rem; margin-bottom: 10px; }
.pd-price { display: flex; align-items: baseline; gap: 12px; margin: 14px 0; }
.pd-price .price-now { font-size: 1.7rem; }
.pd-discount-tag { background: var(--color-badge); color: #fff; padding: 4px 10px; border-radius: 6px; font-size: 0.8rem; font-weight: 700; }
.pd-desc { color: var(--color-text-muted); margin: 16px 0; }
.color-swatches { display: flex; gap: 10px; margin: 14px 0; }
.swatch { width: 28px; height: 28px; border-radius: 50%; border: 2px solid var(--color-border); cursor: pointer; }
.swatch.selected { outline: 2px solid var(--color-primary); outline-offset: 2px; }
.qty-selector { display: flex; align-items: center; gap: 12px; margin: 18px 0; }
.qty-selector button { width: 34px; height: 34px; border: 1px solid var(--color-border); background: var(--color-surface); border-radius: 8px; font-size: 1.1rem; }
.pd-actions { display: flex; gap: 12px; margin-top: 10px; }
.pd-meta { margin-top: 22px; font-size: 0.88rem; color: var(--color-text-muted); }
.related-heading { margin: 50px 0 20px; }

/* ===== Cart page ===== */
.cart-table { width: 100%; border-collapse: collapse; }
.cart-table th { text-align: left; font-size: 0.8rem; text-transform: uppercase; color: var(--color-text-muted); padding-bottom: 12px; border-bottom: 1px solid var(--color-border); }
.cart-table td { padding: 16px 8px; border-bottom: 1px solid var(--color-border); vertical-align: middle; }
.cart-item-info { display: flex; gap: 14px; align-items: center; }
.cart-item-info img { width: 68px; height: 90px; object-fit: cover; border-radius: 8px; }
.cart-qty { display: flex; align-items: center; gap: 8px; }
.cart-qty button { width: 28px; height: 28px; border: 1px solid var(--color-border); background: var(--color-surface); border-radius: 6px; }
.remove-link { color: var(--color-danger); font-size: 0.85rem; }
.summary-card { background: var(--color-surface); border: 1px solid var(--color-border); border-radius: 12px; padding: 22px; }
.cart-summary { max-width: 380px; margin-left: auto; margin-top: 26px; }
.summary-row { display: flex; justify-content: space-between; margin-bottom: 10px; font-size: 0.95rem; }
.summary-row.total { font-weight: 700; font-size: 1.1rem; border-top: 1px solid var(--color-border); padding-top: 12px; margin-top: 12px; }
.empty-state { text-align: center; padding: 60px 20px; color: var(--color-text-muted); }

/* ===== Checkout ===== */
.checkout-layout { display: grid; grid-template-columns: 1.2fr 1fr; gap: 40px; align-items: start; }
.checkout-form { background: var(--color-surface); border: 1px solid var(--color-border); border-radius: 12px; padding: 26px; }
.form-row { margin-bottom: 16px; }
.form-row label { display: block; font-size: 0.85rem; font-weight: 600; margin-bottom: 6px; }
.form-row input, .form-row textarea {
  width: 100%; padding: 11px 12px; border: 1px solid var(--color-border); border-radius: 8px;
  background: var(--color-bg); color: var(--color-text); font-family: inherit; font-size: 0.95rem;
}
.form-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.cod-note { background: var(--color-bg); border: 1px dashed var(--color-border); border-radius: 8px; padding: 12px 14px; font-size: 0.88rem; color: var(--color-text-muted); }

/* ===== Footer ===== */
.site-footer { background: var(--color-primary-dark); color: #f4e9dd; margin-top: 60px; }
.footer-inner { max-width: 1180px; margin: 0 auto; padding: 48px 20px 24px; display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 30px; }
.site-footer h4 { margin-bottom: 14px; font-size: 1rem; }
.site-footer p { color: #e0cfba; font-size: 0.9rem; }
.footer-links { list-style: none; }
.footer-links li { margin-bottom: 8px; }
.footer-links a { color: #e0cfba; font-size: 0.9rem; }
.footer-links a:hover { color: #fff; }
.footer-bottom { text-align: center; padding: 18px; border-top: 1px solid rgba(255,255,255,0.12); font-size: 0.8rem; color: #cbb8a2; }

/* ===== Static/legal pages ===== */
.prose { max-width: 780px; margin: 0 auto; }
.prose h1 { margin-bottom: 18px; }
.prose h2 { margin: 28px 0 10px; font-size: 1.3rem; }
.prose p { margin-bottom: 14px; color: var(--color-text-muted); }
.prose ul { margin: 10px 0 14px 20px; color: var(--color-text-muted); }

/* ===== Responsive ===== */
@media (max-width: 900px) {
  .hero-inner { grid-template-columns: 1fr; }
  .hero-img { order: -1; }
  .product-detail, .checkout-layout { grid-template-columns: 1fr; }
  .catalog-layout { grid-template-columns: 1fr; }
  .filters { position: static; }
  .footer-inner { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 640px) {
  .main-nav { display: none; position: absolute; top: 100%; left: 0; right: 0; background: var(--color-surface); flex-direction: column; padding: 16px 20px; border-bottom: 1px solid var(--color-border); gap: 14px; }
  .main-nav.open { display: flex; }
  .nav-toggle { display: block; }
  .hero h1 { font-size: 2rem; }
  .form-grid-2 { grid-template-columns: 1fr; }
  .footer-inner { grid-template-columns: 1fr; }
}
