:root {
  --bg: #fdfaf7;
  --bg-alt: #f6ede7;
  --ink: #2c2422;
  --ink-soft: #6b5d58;
  --accent: #b8895f;
  --accent-dark: #8f6640;
  --sale: #c1503f;
  --line: #e7dad2;
  --white: #ffffff;
  --radius: 12px;
  --header-h: 64px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.55;
  font-size: 15px;
  overflow-x: hidden;
}
img, svg { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
.container { max-width: 1240px; margin: 0 auto; padding: 0 20px; }

/* ---- Top utility bar ---- */
.topbar {
  background: var(--ink);
  color: #e9dfd8;
  font-size: 12.5px;
}
.topbar .inner {
  max-width: 1240px; margin: 0 auto; padding: 7px 20px;
  display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap;
}
.topbar a { color: #e9dfd8; }
.topbar .sep { opacity: .5; margin: 0 8px; }

/* ---- Header ---- */
.site-header {
  position: sticky; top: 0; z-index: 60;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}
.site-header .inner {
  max-width: 1240px; margin: 0 auto; padding: 14px 20px;
  display: flex; align-items: center; gap: 24px;
}
.logo {
  font-size: 24px; font-weight: 800; letter-spacing: .5px; flex: none;
  color: var(--ink);
}
.logo span { color: var(--accent); }
.search-form {
  flex: 1; display: flex; max-width: 640px;
  border: 1.5px solid var(--line); border-radius: 30px; overflow: hidden;
  background: var(--white);
}
.search-form input {
  flex: 1; border: none; outline: none; padding: 11px 18px; font-size: 14.5px; font-family: inherit;
  background: transparent;
}
.search-form button {
  border: none; background: var(--accent); color: #fff; padding: 0 22px; font-size: 14px; font-weight: 600;
}
.search-form button:hover { background: var(--accent-dark); }
.header-actions { display: flex; align-items: center; gap: 18px; flex: none; }
.header-icon-btn {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px;
  font-size: 11.5px; color: var(--ink-soft); min-width: 44px;
}
.header-icon-btn .ic { font-size: 20px; }
.cart-badge {
  position: absolute; top: -4px; right: 2px;
  background: var(--sale); color: #fff; border-radius: 50%;
  font-size: 10px; font-weight: 700; min-width: 16px; height: 16px;
  display: flex; align-items: center; justify-content: center; padding: 0 3px;
}

/* ---- Category nav strip ---- */
.catnav {
  background: var(--bg-alt); border-bottom: 1px solid var(--line);
}
.catnav .inner {
  max-width: 1240px; margin: 0 auto; padding: 0 20px;
  display: flex; gap: 4px; overflow-x: auto;
}
.catnav a {
  padding: 12px 16px; font-size: 13.5px; font-weight: 600; color: var(--ink-soft);
  white-space: nowrap; border-bottom: 2px solid transparent;
}
.catnav a:hover, .catnav a.active { color: var(--accent-dark); border-bottom-color: var(--accent); }

/* ---- Breadcrumbs ---- */
.breadcrumbs { font-size: 12.5px; color: var(--ink-soft); margin: 18px 0; }
.breadcrumbs a:hover { color: var(--accent-dark); }
.breadcrumbs .sep { margin: 0 6px; opacity: .6; }

/* ---- Hero ---- */
.hero { padding: 32px 0 40px; }
.hero-banner {
  border-radius: 20px; overflow: hidden; position: relative;
  background: linear-gradient(120deg, #f6ede7, #f0dfd2);
  display: grid; grid-template-columns: 1fr 1fr; align-items: center; min-height: 300px;
}
.hero-banner .text { padding: 40px 48px; }
.hero-banner h1 { font-size: 34px; line-height: 1.2; margin: 0 0 14px; }
.hero-banner p { color: var(--ink-soft); font-size: 15.5px; margin: 0 0 24px; max-width: 42ch; }
.hero-banner .art { height: 100%; }
.hero-banner .art svg { width: 100%; height: 100%; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 12px 26px; border-radius: 28px; font-weight: 700; font-size: 14px;
  border: 1.5px solid transparent; transition: all .15s ease;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-dark); }
.btn-outline { border-color: var(--ink); color: var(--ink); }
.btn-outline:hover { background: var(--ink); color: #fff; }
.btn-sm { padding: 8px 16px; font-size: 13px; }
.btn-block { width: 100%; }

/* ---- Section heads ---- */
.section { padding: 36px 0; }
.section-head {
  display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 20px; gap: 12px;
}
.section-head h2 { font-size: 22px; margin: 0; }
.section-head .more { font-size: 13px; color: var(--accent-dark); font-weight: 600; white-space: nowrap; }

/* ---- Category tiles (home) ---- */
.cat-tiles { display: grid; grid-template-columns: repeat(6, 1fr); gap: 14px; }
.cat-tile {
  border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); background: var(--white);
  text-align: center; transition: transform .15s ease, box-shadow .15s ease;
}
.cat-tile:hover { transform: translateY(-3px); box-shadow: 0 10px 24px rgba(44,36,34,.08); }
.cat-tile .art { aspect-ratio: 4/3; }
.cat-tile .art svg { width: 100%; height: 100%; }
.cat-tile .label { padding: 10px 8px; font-size: 13px; font-weight: 600; }

/* ---- Product grid & card ---- */
.grid-products {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px;
}
.product-card {
  background: var(--white); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; display: flex; flex-direction: column; position: relative;
  transition: box-shadow .15s ease, transform .15s ease;
}
.product-card:hover { box-shadow: 0 12px 28px rgba(44,36,34,.10); transform: translateY(-2px); }
.product-card .art { aspect-ratio: 5/4; position: relative; }
.product-card .art svg { width: 100%; height: 100%; }
.product-card .badge {
  position: absolute; top: 10px; left: 10px; z-index: 2;
  background: var(--accent-dark); color: #fff; font-size: 10.5px; font-weight: 700;
  padding: 4px 9px; border-radius: 20px;
}
.product-card .badge.sale { background: var(--sale); }
.product-card .body { padding: 14px 14px 16px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.product-card .brand { font-size: 11.5px; color: var(--ink-soft); text-transform: uppercase; letter-spacing: .4px; }
.product-card .name { font-size: 14px; font-weight: 600; line-height: 1.3; min-height: 2.6em; }
.product-card .rating { font-size: 12px; color: var(--ink-soft); display: flex; align-items: center; gap: 4px; }
.product-card .rating .stars { color: #d9a03c; }
.product-card .price-row { margin-top: auto; display: flex; align-items: baseline; gap: 8px; padding-top: 6px; }
.product-card .price { font-size: 16.5px; font-weight: 800; color: var(--ink); }
.product-card .old-price { font-size: 12.5px; color: var(--ink-soft); text-decoration: line-through; }
.product-card .add-btn {
  margin-top: 8px; width: 100%; padding: 9px; border-radius: 20px; border: 1.5px solid var(--accent);
  background: transparent; color: var(--accent-dark); font-weight: 700; font-size: 13px;
  transition: all .15s ease;
}
.product-card .add-btn:hover, .product-card .add-btn.in-cart { background: var(--accent); color: #fff; }

/* ---- Promo band ---- */
.promo-band {
  border-radius: 20px; background: linear-gradient(120deg, var(--accent) 0%, var(--accent-dark) 100%);
  color: #fff; padding: 40px 48px; display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap;
}
.promo-band h2 { margin: 0 0 8px; font-size: 24px; }
.promo-band p { margin: 0; opacity: .9; }
.promo-band .btn-primary { background: #fff; color: var(--accent-dark); }
.promo-band .btn-primary:hover { background: #f4e9e0; }

/* ---- Trust row ---- */
.trust-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.trust-item { text-align: center; padding: 18px 12px; }
.trust-item .ic { font-size: 26px; margin-bottom: 8px; }
.trust-item h4 { margin: 0 0 4px; font-size: 14px; }
.trust-item p { margin: 0; font-size: 12.5px; color: var(--ink-soft); }

/* ---- Category page layout ---- */
.category-layout { display: grid; grid-template-columns: 220px 1fr; gap: 28px; align-items: start; }
.filters { border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; background: var(--white); position: sticky; top: 90px; }
.filters h4 { font-size: 13px; margin: 0 0 10px; text-transform: uppercase; letter-spacing: .4px; color: var(--ink-soft); }
.filters .group { margin-bottom: 20px; }
.filters label { display: flex; align-items: center; gap: 8px; font-size: 13.5px; margin-bottom: 8px; cursor: pointer; }
.filters input[type=checkbox] { accent-color: var(--accent); width: 15px; height: 15px; }
.filters .price-range { font-size: 13px; color: var(--ink-soft); }
.category-header { margin-bottom: 22px; }
.category-header h1 { font-size: 26px; margin: 0 0 8px; }
.category-header p { color: var(--ink-soft); margin: 0; max-width: 60ch; }
.category-banner { border-radius: 16px; overflow: hidden; margin-bottom: 22px; max-height: 180px; }
.category-banner svg { width: 100%; display: block; }
.toolbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; font-size: 13.5px; color: var(--ink-soft); }
.toolbar select { border: 1px solid var(--line); border-radius: 8px; padding: 7px 10px; font-family: inherit; }

/* ---- Product detail ---- */
.product-detail { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; align-items: start; }
.pd-gallery .main-art { border: 1px solid var(--line); border-radius: 16px; overflow: hidden; aspect-ratio: 1/1; }
.pd-gallery .main-art svg { width: 100%; height: 100%; }
.pd-info .brand { color: var(--accent-dark); font-weight: 700; font-size: 13px; text-transform: uppercase; letter-spacing: .4px; }
.pd-info h1 { font-size: 26px; margin: 8px 0 10px; line-height: 1.25; }
.pd-info .rating { display: flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--ink-soft); margin-bottom: 16px; }
.pd-info .rating .stars { color: #d9a03c; font-size: 15px; }
.pd-price-row { display: flex; align-items: baseline; gap: 12px; margin-bottom: 18px; }
.pd-price-row .price { font-size: 30px; font-weight: 800; }
.pd-price-row .old-price { font-size: 17px; color: var(--ink-soft); text-decoration: line-through; }
.pd-price-row .save { font-size: 12.5px; color: var(--sale); font-weight: 700; background: #fbe6e2; padding: 3px 9px; border-radius: 12px; }
.pd-meta { display: flex; gap: 22px; font-size: 13px; color: var(--ink-soft); margin-bottom: 22px; flex-wrap: wrap; }
.pd-meta b { color: var(--ink); }
.pd-actions { display: flex; align-items: center; gap: 12px; margin-bottom: 26px; }
.qty-stepper { display: flex; align-items: center; border: 1.5px solid var(--line); border-radius: 24px; overflow: hidden; }
.qty-stepper button { border: none; background: var(--bg-alt); width: 36px; height: 40px; font-size: 16px; }
.qty-stepper .qty-val { width: 36px; text-align: center; font-weight: 700; }
.pd-actions .add-btn { flex: 1; padding: 13px 20px; border-radius: 24px; border: none; background: var(--accent); color: #fff; font-weight: 700; font-size: 14.5px; }
.pd-actions .add-btn:hover { background: var(--accent-dark); }
.pd-actions .add-btn.in-cart { background: #3f8f52; }
.pd-tabs { border-top: 1px solid var(--line); padding-top: 18px; }
.pd-tabs .tab-titles { display: flex; gap: 22px; margin-bottom: 14px; }
.pd-tabs .tab-titles button { background: none; border: none; font-size: 14px; font-weight: 700; color: var(--ink-soft); padding: 6px 0; border-bottom: 2px solid transparent; }
.pd-tabs .tab-titles button.active { color: var(--ink); border-color: var(--accent); }
.pd-tabs .tab-panel { display: none; font-size: 14px; color: var(--ink-soft); line-height: 1.7; }
.pd-tabs .tab-panel.active { display: block; }
.pd-trust { display: flex; gap: 18px; margin-top: 20px; font-size: 12.5px; color: var(--ink-soft); flex-wrap: wrap; }

/* ---- Cart page ---- */
.cart-table { width: 100%; border-collapse: collapse; }
.cart-table th { text-align: left; font-size: 12px; text-transform: uppercase; color: var(--ink-soft); padding: 0 0 10px; border-bottom: 1px solid var(--line); }
.cart-table td { padding: 16px 0; border-bottom: 1px solid var(--line); vertical-align: middle; }
.cart-row .prod { display: flex; align-items: center; gap: 14px; }
.cart-row .prod .art { width: 64px; height: 64px; border-radius: 10px; overflow: hidden; border: 1px solid var(--line); flex: none; }
.cart-row .prod .art svg { width: 100%; height: 100%; }
.cart-row .name { font-size: 13.5px; font-weight: 600; }
.cart-row .brand { font-size: 12px; color: var(--ink-soft); }
.cart-remove { background: none; border: none; color: var(--sale); font-size: 12.5px; font-weight: 600; }
.cart-summary { max-width: 340px; margin-left: auto; border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; background: var(--bg-alt); }
.cart-summary .row { display: flex; justify-content: space-between; font-size: 14px; margin-bottom: 10px; }
.cart-summary .total { font-size: 18px; font-weight: 800; border-top: 1px solid var(--line); padding-top: 12px; margin-top: 4px; }
.cart-empty { text-align: center; padding: 60px 20px; color: var(--ink-soft); }

/* ---- Search ---- */
.search-page input#q { width: 100%; padding: 14px 18px; border: 1.5px solid var(--line); border-radius: 12px; font-size: 15px; margin-bottom: 20px; }
.search-results { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.search-empty { color: var(--ink-soft); padding: 30px 0; }

/* ---- Static content pages ---- */
article.content { max-width: 760px; }
article.content h1 { font-size: 28px; margin-bottom: 10px; }
article.content h2 { font-size: 19px; margin: 28px 0 10px; }
article.content p { margin: 0 0 14px; color: var(--ink-soft); }
article.content ul { padding-left: 20px; color: var(--ink-soft); }
article.content li { margin-bottom: 6px; }

/* ---- Footer ---- */
footer { border-top: 1px solid var(--line); background: var(--bg-alt); margin-top: 40px; padding: 40px 0 24px; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr 1fr; gap: 28px; margin-bottom: 28px; }
.footer-grid h4 { font-size: 13px; margin: 0 0 12px; }
.footer-grid ul { list-style: none; padding: 0; margin: 0; }
.footer-grid li { margin-bottom: 8px; }
.footer-grid a { font-size: 13px; color: var(--ink-soft); }
.footer-grid a:hover { color: var(--accent-dark); }
.footer-bottom { border-top: 1px solid var(--line); padding-top: 18px; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; font-size: 12px; color: var(--ink-soft); }

/* ---- Toast ---- */
#toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(20px);
  background: var(--ink); color: #fff; padding: 12px 22px; border-radius: 30px; font-size: 13.5px;
  opacity: 0; pointer-events: none; transition: all .25s ease; z-index: 100;
}
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---- Responsive ---- */
@media (max-width: 980px) {
  .grid-products { grid-template-columns: repeat(3, 1fr); }
  .cat-tiles { grid-template-columns: repeat(3, 1fr); }
  .category-layout { grid-template-columns: 1fr; }
  .filters { position: static; }
  .product-detail { grid-template-columns: 1fr; }
  .hero-banner { grid-template-columns: 1fr; }
  .hero-banner .art { order: -1; height: 220px; }
  .hero-banner .text { padding: 28px 24px; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 640px) {
  .grid-products, .search-results { grid-template-columns: repeat(2, 1fr); }
  .cat-tiles { grid-template-columns: repeat(2, 1fr); }

  .topbar .inner { display: block; text-align: center; padding: 6px 10px; }
  .topbar .inner > div:last-child { display: none; }
  .topbar .sep { display: none; }
  .topbar { font-size: 10.5px; }

  .site-header .inner { flex-wrap: wrap; padding: 12px 16px; gap: 10px 14px; }
  .logo { font-size: 21px; }
  .header-actions { margin-left: auto; gap: 14px; }
  .search-form { order: 3; flex-basis: 100%; max-width: none; }

  .hero-banner h1 { font-size: 26px; }
  .hero-banner .art { height: 180px; }
  .trust-row { grid-template-columns: repeat(2, 1fr); }
}
