:root {
  --bg: #fbfbf9;
  --surface: #ffffff;
  --text: #23272a;
  --muted: #6b716d;
  --primary: #4b6350;
  --primary-hover: #3d5342;
  --primary-fg: #f7f9f6;
  --accent: #e7ede6;
  --border: #e5e7e2;
  --border-strong: #d4d8d0;
  --radius: 10px;
  --radius-sm: 7px;
  --shadow: 0 1px 2px rgba(20, 30, 22, 0.04), 0 8px 24px rgba(20, 30, 22, 0.06);
  --container: 1120px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html.bg-page { background: var(--bg); }

body {
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }

.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding-left: 1.25rem;
  padding-right: 1.25rem;
}

.mono { font-family: ui-monospace, "SF Mono", Menlo, monospace; }
.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--primary);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  height: 46px;
  padding: 0 1.5rem;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
  white-space: nowrap;
}
.btn-primary { background: var(--primary); color: var(--primary-fg); }
.btn-primary:hover { background: var(--primary-hover); }
.btn-outline { background: transparent; color: var(--text); border-color: var(--border-strong); }
.btn-outline:hover { border-color: var(--text); }
.btn-block { width: 100%; }
.btn:disabled { opacity: 0.6; cursor: not-allowed; }

.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 38px; height: 38px; border-radius: 50%;
  background: transparent; border: none; color: var(--text); cursor: pointer;
}
.icon-btn:hover { background: var(--accent); }

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 40;
  background: rgba(251, 251, 249, 0.85);
  backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid var(--border);
}
.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  height: 68px; gap: 1.5rem;
}
.brand { display: inline-flex; align-items: center; gap: 0.6rem; }
.brand-mark {
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; border-radius: 7px;
  background: var(--primary); color: var(--primary-fg);
  font-weight: 700; font-size: 1rem;
}
.brand-name { font-size: 1.15rem; font-weight: 700; letter-spacing: -0.01em; }
.main-nav { display: none; gap: 1.75rem; margin-left: auto; }
.main-nav a { font-size: 0.9rem; color: var(--muted); font-weight: 500; }
.main-nav a:hover { color: var(--text); }

.basket-btn {
  display: inline-flex; align-items: center; gap: 0.5rem;
  height: 40px; padding: 0 0.95rem;
  border: 1px solid var(--border-strong); border-radius: 999px;
  background: var(--surface); color: var(--text);
  font-size: 0.85rem; font-weight: 600; cursor: pointer;
}
.basket-btn:hover { border-color: var(--text); }
.basket-count {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px;
  background: var(--primary); color: var(--primary-fg);
  font-size: 0.72rem; font-weight: 700;
}

/* Hero */
.hero { padding: 3.5rem 0 2.5rem; }
.hero-grid { display: grid; grid-template-columns: 1fr; gap: 2.5rem; align-items: center; }
.hero-copy h1 {
  font-size: clamp(2rem, 5vw, 3.1rem); line-height: 1.08;
  letter-spacing: -0.02em; margin: 0.9rem 0 1.1rem; font-weight: 700;
}
.lede { font-size: 1.05rem; color: var(--muted); max-width: 34ch; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 0.8rem; margin-top: 1.75rem; }
.hero-media img {
  width: 100%; border-radius: var(--radius); box-shadow: var(--shadow);
  aspect-ratio: 4 / 3; object-fit: cover;
}

/* Values */
.values {
  display: grid; grid-template-columns: 1fr; gap: 1.5rem;
  padding: 2rem 1.25rem 1rem;
  border-top: 1px solid var(--border);
  margin-top: 1.5rem;
}
.value h3 { font-size: 1rem; margin-bottom: 0.35rem; }
.value p { color: var(--muted); font-size: 0.92rem; }

/* Catalog */
.category { padding: 3rem 0 1rem; }
.category-head { max-width: 46ch; margin-bottom: 1.75rem; }
.category-head h2 { font-size: 1.7rem; letter-spacing: -0.01em; margin-bottom: 0.4rem; }
.category-head p { color: var(--muted); }
.product-grid {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.25rem;
}

/* Product card */
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column;
  transition: box-shadow 0.18s ease, transform 0.18s ease;
}
.card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.card-media { background: #f2f3ef; aspect-ratio: 1 / 1; overflow: hidden; }
.card-media img { width: 100%; height: 100%; object-fit: cover; }
.card-body { padding: 1rem 1.1rem 1.2rem; display: flex; flex-direction: column; gap: 0.5rem; flex: 1; }
.card-name { font-size: 1rem; font-weight: 600; }
.card-blurb { font-size: 0.86rem; color: var(--muted); flex: 1; }
.card-foot { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; margin-top: 0.35rem; }
.card-price { font-weight: 700; font-size: 1.05rem; }
.add-btn {
  height: 40px; padding: 0 1rem; border-radius: var(--radius-sm);
  background: var(--primary); color: var(--primary-fg); border: none;
  font-weight: 600; font-size: 0.8rem; letter-spacing: 0.04em;
  text-transform: uppercase; cursor: pointer;
}
.add-btn:hover { background: var(--primary-hover); }

/* About */
.about { border-top: 1px solid var(--border); margin-top: 2.5rem; padding: 3.5rem 0; }
.about-grid { display: grid; grid-template-columns: 1fr; gap: 1.5rem; }
.about-grid h2 { font-size: 1.9rem; letter-spacing: -0.01em; margin-top: 0.6rem; }
.about-body { display: flex; flex-direction: column; gap: 1rem; color: var(--muted); }

/* Footer */
.site-footer { background: var(--surface); border-top: 1px solid var(--border); margin-top: 3rem; padding-top: 3rem; }
.footer-grid { display: grid; grid-template-columns: 1fr; gap: 2rem; padding-bottom: 2.5rem; }
.footer-brand p { color: var(--muted); font-size: 0.9rem; margin-top: 0.75rem; max-width: 30ch; }
.footer-col h4 { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.14em; color: var(--muted); margin-bottom: 0.85rem; }
.footer-col a, .footer-col p { display: block; color: var(--text); font-size: 0.9rem; margin-bottom: 0.5rem; }
.footer-col a:hover { color: var(--primary); }
.footer-legal { border-top: 1px solid var(--border); padding-top: 1.5rem; padding-bottom: 2rem; }
.footer-legal p { color: var(--muted); font-size: 0.82rem; }

/* Drawer */
.drawer-overlay, .modal-overlay { position: fixed; inset: 0; background: rgba(25, 30, 26, 0.4); z-index: 50; }
.cart-drawer {
  position: fixed; top: 0; right: 0; z-index: 60;
  width: min(420px, 92vw); height: 100%;
  background: var(--surface); border-left: 1px solid var(--border);
  display: flex; flex-direction: column;
  transform: translateX(100%); transition: transform 0.25s ease;
}
.cart-drawer.open { transform: translateX(0); }
.cart-head { display: flex; align-items: center; justify-content: space-between; padding: 1.25rem; border-bottom: 1px solid var(--border); }
.cart-head h2 { font-size: 1.1rem; }
.cart-body { flex: 1; overflow-y: auto; padding: 1rem 1.25rem; }
.cart-empty { color: var(--muted); text-align: center; padding: 3rem 1rem; font-size: 0.95rem; }
.cart-line { display: flex; gap: 0.9rem; padding: 0.9rem 0; border-bottom: 1px solid var(--border); }
.cart-line img { width: 68px; height: 68px; border-radius: var(--radius-sm); object-fit: cover; background: #f2f3ef; }
.cart-line-info { flex: 1; min-width: 0; }
.cart-line-name { font-size: 0.9rem; font-weight: 600; }
.cart-line-price { color: var(--muted); font-size: 0.85rem; margin-top: 0.15rem; }
.qty { display: inline-flex; align-items: center; border: 1px solid var(--border-strong); border-radius: 999px; margin-top: 0.5rem; }
.qty button { width: 28px; height: 28px; border: none; background: transparent; cursor: pointer; font-size: 1rem; color: var(--text); }
.qty button:hover { color: var(--primary); }
.qty span { min-width: 26px; text-align: center; font-size: 0.85rem; font-weight: 600; }
.line-remove { background: none; border: none; color: var(--muted); font-size: 0.78rem; cursor: pointer; text-decoration: underline; align-self: flex-start; }
.line-remove:hover { color: var(--text); }
.cart-foot { border-top: 1px solid var(--border); padding: 1.25rem; }
.cart-subtotal { display: flex; justify-content: space-between; font-weight: 700; font-size: 1.05rem; }
.cart-note { color: var(--muted); font-size: 0.8rem; margin: 0.4rem 0 1rem; }

/* Checkout */
.checkout-view { min-height: 60vh; }
.checkout-top { border-bottom: 1px solid var(--border); background: var(--surface); }
.checkout-top .container { display: flex; align-items: center; gap: 0.6rem; height: 64px; }
.checkout-top .brand-name { font-size: 1.1rem; }
.checkout-grid { display: grid; grid-template-columns: 1fr; gap: 0; max-width: 1000px; margin: 0 auto; }
.checkout-main { padding: 2rem 1.25rem; }
.checkout-side { background: var(--accent); padding: 2rem 1.25rem; border-top: 1px solid var(--border); }
.breadcrumbs { display: flex; flex-wrap: wrap; gap: 0.4rem; font-size: 0.8rem; color: var(--muted); margin-bottom: 1.5rem; }
.breadcrumbs .active { color: var(--text); font-weight: 600; }
.checkout-block { margin-bottom: 2rem; }
.checkout-block h2 { font-size: 1.1rem; margin-bottom: 0.9rem; }
.checkout-block .row-between { display: flex; align-items: baseline; justify-content: space-between; }
.field { margin-bottom: 0.85rem; }
.field label { display: block; font-size: 0.8rem; color: var(--muted); margin-bottom: 0.35rem; }
.field input, .field select {
  width: 100%; height: 46px; padding: 0 0.85rem;
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  font-size: 0.95rem; font-family: inherit; background: var(--surface); color: var(--text);
}
.field input:focus, .field select:focus { outline: 2px solid var(--primary); outline-offset: -1px; border-color: var(--primary); }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0.85rem; }
.discount-row { display: flex; gap: 0.6rem; }
.discount-row input { flex: 1; }
.summary-line { display: flex; gap: 1rem; align-items: center; padding: 0.6rem 0; }
.summary-thumb { position: relative; width: 60px; height: 60px; flex-shrink: 0; }
.summary-thumb img { width: 100%; height: 100%; border-radius: var(--radius-sm); object-fit: cover; border: 1px solid var(--border); background: #f2f3ef; }
.summary-badge { position: absolute; top: -8px; right: -8px; width: 22px; height: 22px; border-radius: 999px; background: var(--muted); color: #fff; font-size: 0.72rem; display: flex; align-items: center; justify-content: center; font-weight: 700; }
.summary-name { flex: 1; font-size: 0.9rem; }
.summary-name small { display: block; color: var(--muted); }
.summary-price { font-size: 0.9rem; font-weight: 600; }
.summary-totals { border-top: 1px solid var(--border-strong); margin-top: 1rem; padding-top: 1rem; }
.summary-totals .line { display: flex; justify-content: space-between; font-size: 0.9rem; margin-bottom: 0.5rem; color: var(--muted); }
.summary-totals .grand { display: flex; justify-content: space-between; font-size: 1.25rem; font-weight: 700; color: var(--text); margin-top: 0.75rem; }
.summary-totals .grand small { font-size: 0.75rem; color: var(--muted); font-weight: 500; }
.pay-note { font-size: 0.8rem; color: var(--muted); margin-top: 0.75rem; text-align: center; }
.block-sub { font-size: 0.8rem; color: var(--muted); margin: -0.5rem 0 0.9rem; }
.card-panel { border: 1px solid var(--border-strong); border-radius: var(--radius-sm); padding: 0.9rem; background: var(--surface); }
.card-panel .field:last-child { margin-bottom: 0; }

/* Modal */
.modal-overlay { display: flex; align-items: center; justify-content: center; padding: 1.25rem; z-index: 70; }
.modal {
  background: var(--surface); border-radius: var(--radius); max-width: 420px; width: 100%;
  padding: 2.25rem 1.75rem; text-align: center; box-shadow: var(--shadow);
}
.modal-check {
  width: 56px; height: 56px; border-radius: 50%; margin: 0 auto 1.1rem;
  display: flex; align-items: center; justify-content: center;
  background: var(--accent); color: var(--primary);
}
.modal h2 { font-size: 1.3rem; letter-spacing: -0.01em; margin-bottom: 0.75rem; }
.modal p { color: var(--muted); font-size: 0.95rem; margin-bottom: 1.5rem; }

/* Toast */
.toast {
  position: fixed; left: 50%; bottom: 1.5rem; transform: translateX(-50%) translateY(1rem);
  background: var(--text); color: #fff; padding: 0.7rem 1.1rem; border-radius: 999px;
  font-size: 0.88rem; z-index: 80; opacity: 0; transition: opacity 0.2s ease, transform 0.2s ease;
  pointer-events: none;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* Legal pages */
.legal { max-width: 760px; margin: 0 auto; padding: 3.5rem 1.25rem 4rem; }
.legal h1 { font-size: 2.1rem; letter-spacing: -0.02em; margin: 0.6rem 0 0.5rem; }
.legal .updated { color: var(--muted); font-size: 0.85rem; }
.legal .intro { color: var(--muted); margin-top: 1.25rem; font-size: 1.02rem; }
.legal section { margin-top: 2.25rem; }
.legal section h2 { font-size: 1.15rem; margin-bottom: 0.6rem; }
.legal section p { color: #4a4f4b; margin-bottom: 0.75rem; font-size: 0.95rem; }
.legal .contact-box { margin-top: 2.5rem; border: 1px solid var(--border); background: var(--accent); border-radius: var(--radius); padding: 1.4rem; font-size: 0.9rem; color: var(--muted); }
.legal .contact-box p:first-child { color: var(--text); font-weight: 600; margin-bottom: 0.5rem; }

[hidden] { display: none !important; }

/* Responsive */
@media (min-width: 640px) {
  .product-grid { grid-template-columns: repeat(3, 1fr); }
  .values { grid-template-columns: repeat(3, 1fr); }
  .field-row { grid-template-columns: 1fr 1fr; }
}
@media (min-width: 900px) {
  .main-nav { display: flex; }
  .hero-grid { grid-template-columns: 1.05fr 1fr; }
  .about-grid { grid-template-columns: 1fr 1.3fr; gap: 3rem; }
  .footer-grid { grid-template-columns: 1.4fr 1fr 1fr 1.2fr; }
  .checkout-grid { grid-template-columns: 1.15fr 0.85fr; }
  .checkout-main { padding: 2.5rem 2.5rem 3rem; }
  .checkout-side { border-top: none; border-left: 1px solid var(--border); min-height: calc(100vh - 64px); }
}
