:root {
  --green: #1d3d2a; --green-2: #2c5a40; --gold: #b8975a; --gold-soft: #e9dcc0; --cream: #f8f4ea; --paper: #fffdf8;
  --ink: #1f2a24; --muted: #6b756e; --line: #e2dccb; --red: #b3392f; --amber: #a86a12; --ok: #2e7d4f;
  --radius: 12px; --shadow: 0 1px 2px rgba(29,61,42,.06), 0 6px 20px rgba(29,61,42,.07);
  --serif: "Cormorant Garamond", Georgia, "Times New Roman", serif; --sans: Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--cream); color: var(--ink); font: 15px/1.5 var(--sans); }
h1, h2, h3 { font-variant-numeric: lining-nums; font-family: var(--serif); color: var(--green); margin: 0 0 .4em; line-height: 1.15; letter-spacing: .2px; }
h1 { font-size: 2rem; } h2 { font-size: 1.5rem; } h3 { font-size: 1.15rem; }
a { color: var(--green-2); }
.boot { text-align: center; margin-top: 30vh; color: var(--muted); }
.hidden { display: none !important; }
.muted { color: var(--muted); } .small { font-size: .85rem; } .right { text-align: right; } .nowrap { white-space: nowrap; }
.gold { color: var(--gold); }

/* shell */
.topbar { background: var(--green); color: #fff; position: sticky; top: 0; z-index: 20; border-bottom: 3px solid var(--gold); }
.topbar .inner { max-width: 1100px; margin: 0 auto; padding: 10px 16px; display: flex; align-items: center; gap: 18px; }
.brand { font-family: var(--serif); font-size: 1.7rem; font-weight: 700; color: #fff; text-decoration: none; line-height: 1; }
.brand small { display: block; font: 600 .55rem var(--sans); letter-spacing: .4em; color: var(--gold); margin-top: 3px; }
.nav { display: flex; gap: 4px; flex: 1; flex-wrap: wrap; }
.nav a { color: #e8efe9; text-decoration: none; padding: 7px 12px; border-radius: 8px; font-weight: 500; }
.nav a.active, .nav a:hover { background: rgba(255,255,255,.12); color: #fff; }
.who { font-size: .85rem; color: var(--gold-soft); display: flex; gap: 10px; align-items: center; }
.who button { background: none; border: 1px solid rgba(255,255,255,.3); color: #fff; padding: 5px 10px; border-radius: 8px; cursor: pointer; }
main { max-width: 1100px; margin: 0 auto; padding: 20px 16px 120px; }

/* cards + forms */
.card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); margin-bottom: 16px; }
.card.flat { box-shadow: none; }
.grid { display: grid; gap: 16px; } .cols-2 { grid-template-columns: 1fr 1fr; } .cols-3 { grid-template-columns: repeat(3, 1fr); }
label { display: block; font-weight: 500; font-size: .85rem; margin: 12px 0 4px; }
input, select, textarea { width: 100%; padding: 10px 12px; border: 1px solid #cfc7b2; border-radius: 9px; font: inherit; background: #fff; color: var(--ink); }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--gold); outline-offset: 1px; border-color: var(--gold); }
textarea { min-height: 70px; resize: vertical; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; background: var(--green); color: #fff; border: 0; padding: 11px 18px; border-radius: 10px; font: 600 .95rem var(--sans); cursor: pointer; text-decoration: none; }
.btn:hover { background: var(--green-2); } .btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.gold { background: var(--gold); color: #1d2a21; } .btn.gold:hover { background: #c7a66a; }
.btn.ghost { background: transparent; color: var(--green); border: 1px solid var(--green); } .btn.ghost:hover { background: rgba(29,61,42,.06); }
.btn.danger { background: var(--red); } .btn.small { padding: 6px 11px; font-size: .82rem; border-radius: 8px; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; } .row.between { justify-content: space-between; }
.pill { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: .75rem; font-weight: 600; background: #e8efe9; color: var(--green); }
.pill.warn { background: #fbefd5; color: var(--amber); } .pill.bad { background: #f7dedb; color: var(--red); } .pill.ok { background: #dcefe3; color: var(--ok); } .pill.grey { background: #ece9df; color: var(--muted); }
.banner { background: var(--green); color: #fff; border-radius: var(--radius); padding: 14px 18px; display: flex; gap: 12px; align-items: center; margin-bottom: 16px; border-left: 6px solid var(--gold); }
.banner b { color: var(--gold-soft); } .banner.warn { background: #fbefd5; color: #5c3b06; border-left-color: var(--amber); }
.notice { background: #fbefd5; border: 1px solid #ecd49a; color: #5c3b06; padding: 10px 14px; border-radius: 10px; margin: 10px 0; font-size: .9rem; }
.notice.bad { background: #f7dedb; border-color: #e5b2ac; color: #6d1d16; }

table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); padding: 8px 10px; border-bottom: 2px solid var(--line); }
td { padding: 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tr.click { cursor: pointer; } tr.click:hover td { background: #faf6ea; }
.tablewrap { overflow-x: auto; }

/* shop */
.shop { display: grid; grid-template-columns: 1fr 360px; gap: 20px; align-items: start; }
.cat-title { font: 600 .75rem var(--sans); letter-spacing: .14em; text-transform: uppercase; color: var(--gold); margin: 18px 0 8px; }
.product { display: flex; align-items: center; gap: 14px; padding: 12px 14px; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 8px; }
.product .info { flex: 1; min-width: 0; } .product .name { font-weight: 600; } .product .pack { color: var(--muted); font-size: .82rem; }
.product .price { text-align: right; min-width: 92px; font-weight: 600; } .product .price small { display: block; color: var(--muted); font-weight: 400; }
.stepper { display: inline-flex; align-items: center; border: 1px solid #cfc7b2; border-radius: 10px; overflow: hidden; background: #fff; }
.stepper button { width: 36px; height: 38px; border: 0; background: #f3eee0; font-size: 1.2rem; cursor: pointer; color: var(--green); }
.stepper button:hover { background: var(--gold-soft); }
.stepper input { width: 58px; text-align: center; border: 0; border-radius: 0; padding: 8px 2px; -moz-appearance: textfield; }
.stepper input::-webkit-outer-spin-button, .stepper input::-webkit-inner-spin-button { -webkit-appearance: none; }
.basket { position: sticky; top: 84px; }
.line { display: flex; justify-content: space-between; gap: 10px; padding: 5px 0; } .line.total { border-top: 2px solid var(--green); margin-top: 8px; padding-top: 10px; font-weight: 700; font-size: 1.1rem; color: var(--green); }
.seg { display: grid; grid-template-columns: 1fr 1fr; border: 1px solid var(--green); border-radius: 10px; overflow: hidden; }
.seg button { padding: 10px; border: 0; background: #fff; color: var(--green); font: 600 .9rem var(--sans); cursor: pointer; } .seg button.on { background: var(--green); color: #fff; }
.mobile-bar { display: none; }

/* auth */
.auth { max-width: 520px; margin: 4vh auto; } .auth .hero { text-align: center; margin-bottom: 18px; }
.auth .hero .brand-big { font: 700 3rem var(--serif); color: var(--green); line-height: 1; } .auth .hero .tag { letter-spacing: .45em; font-size: .7rem; color: var(--gold); font-weight: 600; margin-top: 6px; }

/* modal + toast */
.overlay { position: fixed; inset: 0; background: rgba(20,32,25,.55); z-index: 50; display: flex; align-items: flex-start; justify-content: center; overflow-y: auto; padding: 5vh 12px; }
.modal { background: var(--paper); border-radius: 14px; max-width: 560px; width: 100%; padding: 22px; box-shadow: 0 20px 60px rgba(0,0,0,.35); }
#toasts { position: fixed; right: 16px; bottom: 16px; z-index: 60; display: grid; gap: 8px; }
.toast { background: var(--green); color: #fff; padding: 11px 16px; border-radius: 10px; box-shadow: var(--shadow); max-width: 360px; } .toast.bad { background: var(--red); }
.stat { text-align: center; } .stat .n { font: 600 2rem var(--sans); color: var(--green); } .stat .l { font-size: .75rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.kv { display: grid; grid-template-columns: 130px 1fr; gap: 4px 12px; } .kv dt { color: var(--muted); font-size: .85rem; } .kv dd { margin: 0; }
hr { border: 0; border-top: 1px solid var(--line); margin: 14px 0; }

@media (max-width: 860px) {
  .shop { grid-template-columns: 1fr; } .basket { position: static; }
  .cols-2, .cols-3 { grid-template-columns: 1fr; }
  .topbar .inner { flex-wrap: wrap; gap: 8px; } .nav { order: 3; flex-basis: 100%; } .who { margin-left: auto; }
  .product { display: grid; grid-template-columns: 1fr auto; gap: 10px 12px; align-items: start; }
  .product .info { grid-column: 1; } .product .price { grid-column: 2; grid-row: 1; min-width: 0; }
  .product .stepper { grid-column: 1 / -1; display: flex; width: 100%; }
  .stepper button { width: 64px; height: 46px; font-size: 1.4rem; } .stepper input { flex: 1; width: auto; font-size: 1.05rem; }
  .mobile-bar { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 25; background: var(--green); color: #fff; padding: 12px 16px; justify-content: space-between; align-items: center; border-top: 3px solid var(--gold); }
  .mobile-bar .btn { padding: 9px 16px; }
  main { padding-bottom: 130px; }
}
