:root {
  --ink: #20231f;
  --muted: #6b7068;
  --paper: #f7f7f2;
  --surface: #fff;
  --surface-2: #f0f1ea;
  --line: #e1e3da;
  --brand: #176b55;
  --brand-dark: #0e4f3e;
  --brand-soft: #e5f3ed;
  --accent: #f29b38;
  --danger: #b83b3b;
  --success: #28815d;
  --warning: #9a6517;
  --shadow: 0 18px 55px rgba(28, 35, 29, .09);
  --radius: 22px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font: 16px/1.55 Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; }
a { color: inherit; }
img { max-width: 100%; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid rgba(225, 227, 218, .9);
  background: rgba(247, 247, 242, .92);
  backdrop-filter: blur(18px);
}
.nav-shell, .page-shell { width: min(1180px, calc(100% - 32px)); margin-inline: auto; }
.nav-shell { min-height: 74px; display: flex; align-items: center; gap: 24px; }
.brand { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; min-width: 0; }
.brand img { width: 52px; height: 52px; object-fit: contain; border-radius: 12px; background: #fff; }
.brand-mark { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 13px; background: var(--brand); color: #fff; font-weight: 850; }
.brand-copy { min-width: 0; }
.brand-copy strong { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand-copy span { display: block; color: var(--muted); font-size: 12px; }
.main-nav { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.nav-link { text-decoration: none; padding: 10px 12px; border-radius: 12px; color: #424740; font-weight: 650; }
.nav-link:hover { background: var(--surface-2); }
.nav-order { background: var(--brand); color: #fff; }
.nav-order:hover { background: var(--brand-dark); }
.account-form { display: inline; }
.link-button { border: 0; background: none; cursor: pointer; }

.cart-pill {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  text-decoration: none;
}
.cart-pill span { position: absolute; top: -6px; right: -6px; min-width: 21px; height: 21px; padding: 0 5px; display: grid; place-items: center; border-radius: 99px; background: var(--accent); color: #21180d; font-size: 11px; font-weight: 850; }
.cart-pill svg { width: 21px; }

.page-shell { padding-block: 34px 72px; min-height: calc(100vh - 150px); }
.site-footer { border-top: 1px solid var(--line); padding: 28px 0; color: var(--muted); font-size: 13px; }
.footer-inner { display: flex; justify-content: space-between; gap: 24px; }

.flash { position: fixed; right: 22px; top: 92px; z-index: 90; width: min(430px, calc(100% - 44px)); padding: 15px 18px; border-radius: 16px; color: #fff; box-shadow: var(--shadow); animation: slide-in .25s ease-out; }
.flash-success { background: var(--success); }
.flash-error { background: var(--danger); }
.flash-info { background: #326b8a; }
@keyframes slide-in { from { transform: translateY(-8px); opacity: 0; } }

.hero { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(300px, .75fr); gap: 28px; align-items: stretch; }
.hero-main { min-height: 430px; display: flex; flex-direction: column; justify-content: center; padding: clamp(32px, 6vw, 76px); color: #fff; border-radius: 32px; background: linear-gradient(135deg, #0e4f3e, #1d8065); box-shadow: var(--shadow); overflow: hidden; position: relative; }
.hero-main::after { content: ""; position: absolute; width: 300px; height: 300px; border-radius: 50%; right: -90px; top: -90px; background: rgba(255,255,255,.08); box-shadow: -100px 270px 0 rgba(255,255,255,.045); }
.eyebrow { margin: 0 0 12px; color: inherit; opacity: .76; font-size: 13px; font-weight: 800; letter-spacing: .11em; text-transform: uppercase; }
h1, h2, h3, h4, p { margin-top: 0; }
h1 { font-size: clamp(38px, 6vw, 70px); line-height: 1.02; letter-spacing: -.045em; margin-bottom: 20px; }
h2 { font-size: clamp(27px, 4vw, 42px); line-height: 1.08; letter-spacing: -.03em; }
h3 { line-height: 1.2; }
.lead { font-size: clamp(17px, 2vw, 21px); max-width: 620px; opacity: .88; }
.hero-actions, .button-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.hero-side { display: grid; gap: 18px; }

.btn { min-height: 48px; padding: 12px 20px; border: 0; border-radius: 14px; display: inline-flex; align-items: center; justify-content: center; gap: 9px; background: var(--brand); color: #fff; text-decoration: none; font-weight: 780; cursor: pointer; transition: transform .15s, background .15s, box-shadow .15s; }
.btn:hover { transform: translateY(-1px); background: var(--brand-dark); box-shadow: 0 8px 25px rgba(14,79,62,.18); }
.btn-light { background: #fff; color: var(--brand-dark); }
.btn-light:hover { background: #f5fbf8; }
.btn-secondary { background: var(--surface-2); color: var(--ink); }
.btn-secondary:hover { background: #e4e6dc; box-shadow: none; }
.btn-danger { background: #fae9e9; color: var(--danger); }
.btn-small { min-height: 38px; padding: 8px 13px; border-radius: 11px; font-size: 13px; }
.btn-block { width: 100%; }
.btn[disabled], .btn.disabled { opacity: .45; cursor: not-allowed; pointer-events: none; transform: none; }

.panel, .card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 8px 28px rgba(28,35,29,.04); }
.panel { padding: clamp(22px, 4vw, 38px); }
.card { padding: 22px; }
.card-soft { background: var(--brand-soft); border-color: #cde7db; }
.card-title { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.metric { font-size: 32px; font-weight: 850; letter-spacing: -.04em; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.section-head { display: flex; justify-content: space-between; align-items: end; gap: 20px; margin: 42px 0 20px; }
.section-head h2 { margin-bottom: 0; }

.choice-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.choice-card { position: relative; display: block; }
.choice-card input { position: absolute; opacity: 0; pointer-events: none; }
.choice-content { display: flex; gap: 16px; min-height: 150px; padding: 25px; border: 2px solid var(--line); border-radius: 20px; background: var(--surface); cursor: pointer; transition: .16s; }
.choice-content:hover, .choice-card input:checked + .choice-content { border-color: var(--brand); background: var(--brand-soft); transform: translateY(-2px); }
.choice-icon { flex: 0 0 52px; width: 52px; height: 52px; display: grid; place-items: center; border-radius: 16px; background: var(--brand); color: #fff; font-size: 25px; }
.choice-content h3 { margin: 4px 0 7px; }

.stepper { display: flex; gap: 8px; margin-bottom: 28px; }
.step { height: 5px; flex: 1; border-radius: 99px; background: var(--line); }
.step.done, .step.current { background: var(--brand); }
.step-label { margin-bottom: 8px; color: var(--muted); font-size: 13px; font-weight: 700; }

.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 18px; }
.field { margin-bottom: 18px; }
.field-full { grid-column: 1 / -1; }
.field label { display: block; margin-bottom: 7px; font-size: 13px; color: #484c46; font-weight: 760; }
.input, .select, .textarea { width: 100%; min-height: 50px; padding: 12px 14px; color: var(--ink); border: 1px solid #ced2c8; border-radius: 13px; background: #fff; outline: none; transition: border .15s, box-shadow .15s; }
.textarea { min-height: 100px; resize: vertical; }
.input:focus, .select:focus, .textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 4px rgba(23,107,85,.12); }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; color: var(--muted); }
.check input { margin-top: 4px; }

.catalog-head { display: grid; grid-template-columns: 1fr auto; gap: 20px; align-items: end; margin-bottom: 28px; }
.family-nav { position: sticky; top: 75px; z-index: 20; display: flex; gap: 8px; overflow-x: auto; padding: 10px 0 14px; background: var(--paper); scrollbar-width: none; }
.family-nav a { flex: 0 0 auto; padding: 9px 14px; border: 1px solid var(--line); border-radius: 99px; background: #fff; text-decoration: none; font-size: 13px; font-weight: 700; }
.family-section { scroll-margin-top: 145px; margin: 34px 0 48px; }
.product-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 18px; }
.product-card { overflow: hidden; padding: 0; display: flex; flex-direction: column; }
.product-image { width: 100%; aspect-ratio: 4/3; object-fit: cover; background: var(--surface-2); }
.product-placeholder { aspect-ratio: 4/3; display: grid; place-items: center; background: linear-gradient(135deg, var(--brand-soft), #f4efe2); color: var(--brand); font-size: 42px; font-weight: 900; }
.product-body { padding: 20px; display: flex; flex: 1; flex-direction: column; }
.product-body h3 { margin-bottom: 8px; }
.product-description { color: var(--muted); font-size: 14px; flex: 1; }
.product-bottom { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 16px; }
.price { font-size: 20px; font-weight: 850; }
.add-form { display: flex; gap: 8px; }
.qty { width: 56px; min-height: 40px; text-align: center; border: 1px solid var(--line); border-radius: 11px; }

.cart-layout, .checkout-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 24px; align-items: start; }
.summary-sticky { position: sticky; top: 96px; }
.cart-line { display: grid; grid-template-columns: 72px 1fr auto auto; gap: 16px; align-items: center; padding: 17px 0; border-bottom: 1px solid var(--line); }
.cart-line:last-child { border-bottom: 0; }
.cart-thumb { width: 72px; height: 72px; border-radius: 14px; object-fit: cover; background: var(--surface-2); }
.summary-row { display: flex; justify-content: space-between; gap: 18px; margin: 10px 0; }
.summary-total { padding-top: 15px; margin-top: 15px; border-top: 1px solid var(--line); font-size: 20px; font-weight: 850; }
.minimum { margin: 18px 0; }
.progress { height: 8px; overflow: hidden; border-radius: 99px; background: var(--line); }
.progress span { display: block; height: 100%; background: var(--accent); }
.empty { text-align: center; padding: 64px 24px; }
.empty-icon { font-size: 54px; margin-bottom: 12px; }

.tabs { display: flex; gap: 8px; border-bottom: 1px solid var(--line); margin-bottom: 24px; }
.tab-button { padding: 12px 16px; border: 0; border-bottom: 3px solid transparent; background: transparent; font-weight: 750; cursor: pointer; }
.tab-button.active { border-color: var(--brand); color: var(--brand); }
.tab-panel[hidden] { display: none; }
.auth-shell { max-width: 720px; margin: 20px auto; }

.order-list { display: grid; gap: 13px; }
.order-card { display: grid; grid-template-columns: 1fr auto; gap: 18px; align-items: center; }
.order-products { margin: 7px 0 0; color: var(--muted); font-size: 13px; }
.status { display: inline-flex; align-items: center; gap: 7px; width: max-content; padding: 6px 10px; border-radius: 99px; font-size: 12px; font-weight: 800; }
.status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.status-warning { color: var(--warning); background: #fff3d9; }
.status-info { color: #2d6f93; background: #e5f2f8; }
.status-accent { color: #8a5513; background: #ffecd2; }
.status-success { color: var(--success); background: #e4f4ec; }
.status-danger { color: var(--danger); background: #fae8e8; }
.status-neutral { color: #62665f; background: #eceee8; }

.dashboard-grid { display: grid; grid-template-columns: 1.2fr .8fr; gap: 24px; }
.address-list { display: grid; gap: 10px; }
.address { padding: 14px; border: 1px solid var(--line); border-radius: 14px; }
.detail-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 16px; }
.detail { padding: 16px; border-radius: 15px; background: var(--surface-2); }
.detail span { display: block; color: var(--muted); font-size: 12px; }
.detail strong { display: block; margin-top: 3px; }

.timeline { display: grid; grid-template-columns: repeat(4, 1fr); margin: 34px 0; }
.timeline-step { position: relative; text-align: center; color: var(--muted); font-size: 13px; }
.timeline-step::before { content:""; position:absolute; height:4px; left:-50%; right:50%; top:15px; background:var(--line); z-index:0; }
.timeline-step:first-child::before { display:none; }
.timeline-dot { position:relative; z-index:1; width:34px; height:34px; margin:0 auto 9px; display:grid; place-items:center; border-radius:50%; background:var(--line); color:#fff; font-weight:800; }
.timeline-step.done::before, .timeline-step.done .timeline-dot, .timeline-step.active::before, .timeline-step.active .timeline-dot { background:var(--brand); }
.timeline-step.active { color:var(--ink); font-weight:750; }

.payment-box { max-width: 580px; margin: 70px auto; text-align: center; }
.spinner { width: 44px; height: 44px; margin: 20px auto; border: 4px solid var(--line); border-top-color: var(--brand); border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 900px) {
  .hero, .cart-layout, .checkout-layout, .dashboard-grid { grid-template-columns: 1fr; }
  .hero-main { min-height: 380px; }
  .product-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .summary-sticky { position: static; }
  .nav-link:not(.nav-order), .brand-copy span { display: none; }
}
@media (max-width: 620px) {
  .nav-shell, .page-shell { width: min(100% - 22px, 1180px); }
  .nav-shell { min-height: 66px; gap: 8px; }
  .brand img, .brand-mark { width: 40px; height: 40px; }
  .brand-copy strong { max-width: 110px; font-size: 14px; }
  .nav-order { padding: 9px 11px; min-height: 42px; font-size: 13px; }
  .page-shell { padding-top: 20px; }
  .hero-main { min-height: 350px; padding: 30px 24px; border-radius: 24px; }
  .hero-actions .btn { width: 100%; }
  .choice-grid, .form-grid, .product-grid, .detail-grid { grid-template-columns: 1fr; }
  .choice-content { min-height: 126px; padding: 20px; }
  .panel { padding: 20px; }
  .catalog-head { grid-template-columns: 1fr; }
  .cart-line { grid-template-columns: 58px 1fr auto; }
  .cart-thumb { width: 58px; height: 58px; }
  .cart-line .line-total { grid-column: 2 / -1; }
  .order-card { grid-template-columns: 1fr; }
  .timeline-step span { font-size: 11px; }
  .footer-inner { display: block; }
}
