/* ---------- Tokens ---------- */
:root {
  --bg: #fbf6ef;
  --bg-alt: #f2e6d5;
  --surface: #ffffff;
  --text: #382b21;
  --text-muted: #7c6a5b;
  --accent: #c1613a;
  --accent-dark: #9c4c2c;
  --border: #e8d9c6;
  --radius: 14px;
  --shadow: 0 4px 16px rgba(56, 43, 33, 0.08);
  --shadow-lg: 0 12px 32px rgba(56, 43, 33, 0.12);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* ---------- Reset ---------- */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; }
ul { padding-left: 1.2em; }
h1, h2, h3, h4 { line-height: 1.2; margin: 0 0 0.5em; font-weight: 700; }
p { margin: 0 0 1em; }
.container {
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(251, 246, 239, 0.92);
  backdrop-filter: saturate(180%) blur(8px);
  border-bottom: 1px solid var(--border);
}
.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
}
.logo {
  font-size: 1.3rem;
  font-weight: 800;
  text-decoration: none;
  color: var(--text);
  letter-spacing: -0.02em;
}
.logo span { color: var(--accent); }

.nav-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  cursor: pointer;
}
.nav-toggle svg { width: 20px; height: 20px; }

.main-nav {
  position: fixed;
  top: 68px;
  left: 0;
  right: 0;
  height: calc(100vh - 68px);
  z-index: 40;
  background: var(--bg);
  padding: 24px 20px;
  overflow-y: auto;
  transform: translateX(100%);
  transition: transform 0.25s ease;
}
.main-nav.is-open { transform: translateX(0); }
.main-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.main-nav a {
  display: block;
  padding: 14px 12px;
  border-radius: 10px;
  text-decoration: none;
  font-weight: 600;
  font-size: 1.05rem;
}
.main-nav a:hover, .main-nav a.is-active { background: var(--bg-alt); color: var(--accent-dark); }

@media (min-width: 900px) {
  .nav-toggle { display: none; }
  .main-nav {
    position: static;
    inset: auto;
    transform: none;
    background: none;
    padding: 0;
    overflow: visible;
  }
  .main-nav ul { flex-direction: row; gap: 4px; }
  .main-nav a { padding: 8px 14px; font-size: 0.95rem; }
}

/* ---------- Hero ---------- */
.hero {
  background: linear-gradient(160deg, var(--bg-alt) 0%, var(--bg) 65%);
  padding: 48px 0 56px;
  border-bottom: 1px solid var(--border);
}
.hero .container {
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.hero h1 {
  font-size: clamp(1rem, 5.6vw, 2.8rem);
  white-space: nowrap;
}
.hero p {
  font-size: 1.1rem;
  color: var(--text-muted);
  max-width: 42ch;
}
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 24px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.95rem;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.btn:active { transform: scale(0.97); }
.btn-primary { background: var(--accent); color: #fff; box-shadow: var(--shadow); }
.btn-primary:hover { background: var(--accent-dark); }
.btn-secondary { background: var(--surface); color: var(--text); border-color: var(--border); }
.btn-secondary:hover { border-color: var(--accent); color: var(--accent-dark); }
.btn-block { width: 100%; }
.btn[aria-disabled="true"] {
  background: var(--border);
  color: var(--text-muted);
  pointer-events: none;
}

/* ---------- Sections ---------- */
.section { padding: 40px 0; }
.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.section-head h2 { font-size: 1.5rem; }
.section-head a { font-size: 0.9rem; font-weight: 600; color: var(--accent-dark); text-decoration: none; white-space: nowrap; }

/* ---------- Category grid ---------- */
.category-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}
@media (min-width: 640px) { .category-grid { grid-template-columns: repeat(3, 1fr); } }

.category-card {
  position: relative;
  display: block;
  border-radius: var(--radius);
  overflow: hidden;
  aspect-ratio: 4 / 3;
  text-decoration: none;
  color: #fff;
  box-shadow: var(--shadow);
  background: var(--text) center / cover no-repeat;
}
.category-card img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.category-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0) 40%, rgba(30, 20, 12, 0.75) 100%);
}
.category-card .label {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 12px;
  z-index: 1;
}
.category-card .label strong { display: block; font-size: 1.05rem; }
.category-card .label span { font-size: 0.8rem; opacity: 0.85; }

/* ---------- Product grid & card ---------- */
.product-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}
@media (min-width: 640px) { .product-grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 980px) { .product-grid { grid-template-columns: repeat(4, 1fr); } }

.product-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  text-decoration: none;
  color: var(--text);
  display: flex;
  flex-direction: column;
  transition: box-shadow 0.15s ease, transform 0.15s ease;
}
.product-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-2px); }
.product-card .thumb {
  position: relative;
  aspect-ratio: 1 / 1;
  background: var(--bg-alt);
}
.product-card .thumb img { width: 100%; height: 100%; object-fit: cover; }
.badge {
  position: absolute;
  top: 10px;
  left: 10px;
  background: var(--accent);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 4px 9px;
  border-radius: 999px;
}
.badge-muted { background: var(--text-muted); }
.product-card .body { padding: 12px 14px 16px; flex: 1; display: flex; flex-direction: column; gap: 4px; }
.product-card .name { font-size: 0.92rem; font-weight: 600; }
.product-card .price { margin-top: auto; font-size: 1.05rem; font-weight: 800; color: var(--accent-dark); }
.product-card .price.is-out { color: var(--text-muted); text-decoration: line-through; font-weight: 700; }

/* ---------- Breadcrumbs ---------- */
.breadcrumbs {
  font-size: 0.85rem;
  color: var(--text-muted);
  padding: 16px 0 0;
}
.breadcrumbs a { text-decoration: none; }
.breadcrumbs a:hover { color: var(--accent-dark); }

/* ---------- Category header ---------- */
.category-header { padding: 24px 0 8px; }
.category-header p { color: var(--text-muted); max-width: 60ch; }

/* ---------- Product detail ---------- */
.product-detail {
  display: grid;
  gap: 28px;
  padding: 24px 0 48px;
}
@media (min-width: 860px) {
  .product-detail { grid-template-columns: 1.1fr 1fr; align-items: start; }
}

.gallery-main {
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-alt);
  aspect-ratio: 1 / 1;
  box-shadow: var(--shadow);
}
.gallery-main img { width: 100%; height: 100%; object-fit: cover; }
.gallery-thumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 10px;
}
.gallery-thumbs button {
  padding: 0;
  border: 2px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  width: 68px;
  height: 68px;
  cursor: pointer;
  background: none;
}
.gallery-thumbs button.is-active { border-color: var(--accent); }
.gallery-thumbs img { width: 100%; height: 100%; object-fit: cover; }

.product-info h1 { font-size: 1.6rem; margin-bottom: 8px; }
.product-info .price-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 12px 0 18px;
}
.product-info .price { font-size: 1.9rem; font-weight: 800; color: var(--accent-dark); }
.product-info .price.is-out { color: var(--text-muted); text-decoration: line-through; }
.stock-note { font-size: 0.9rem; font-weight: 600; }
.stock-note.ok { color: #4c7a3f; }
.stock-note.out { color: var(--accent-dark); }

.spec-table {
  width: 100%;
  border-collapse: collapse;
  margin: 20px 0;
  font-size: 0.92rem;
}
.spec-table tr { border-bottom: 1px solid var(--border); }
.spec-table th, .spec-table td { text-align: left; padding: 9px 6px; }
.spec-table th { color: var(--text-muted); font-weight: 600; width: 45%; }

.description { margin-top: 8px; }
.description :is(p, ul, table) { margin-bottom: 1em; }
.description table { border-collapse: collapse; width: 100%; }
.description td { padding: 6px; vertical-align: top; }
.description img { border-radius: 8px; }

.disclaimer {
  margin-top: 20px;
  padding: 14px 16px;
  background: var(--bg-alt);
  border-radius: 10px;
  font-size: 0.85rem;
  color: var(--text-muted);
}
.disclaimer a { color: var(--accent-dark); font-weight: 600; text-decoration: none; }

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--border);
  background: var(--bg-alt);
  padding: 36px 0;
  margin-top: 32px;
}
.site-footer .container {
  display: flex;
  flex-direction: column;
  gap: 16px;
  font-size: 0.85rem;
  color: var(--text-muted);
}
.site-footer a { color: var(--text-muted); text-decoration: underline; }
.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  list-style: none;
  padding: 0;
  margin: 0;
}
.footer-links a { text-decoration: none; color: var(--text); font-weight: 600; font-size: 0.88rem; }

/* ---------- Empty state ---------- */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}
