:root {
  --ink: #12263F; --bg: #F7FAFB; --card: #FFFFFF; --muted: #5B6B7D; --line: #E1EAEE;
  --accent: #A31511; --accent-ink: #FFFFFF; --gold: #C99A2E; --green: #2F7D4F; --err: #B42318;
  --shadow: 0 1px 2px rgba(18,38,63,.06), 0 6px 18px rgba(18,38,63,.07);
  --head: 'Space Grotesk', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --body: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root { --ink: #E8EEF4; --bg: #0F1720; --card: #17212C; --muted: #9AA9B8; --line: #26323F; --accent: #E0483F;
    --shadow: none; color-scheme: dark; }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.55 var(--body); }
h1, h2, h3 { font-family: var(--head); line-height: 1.2; margin: 0 0 .5em; }
h1 { font-size: clamp(1.5rem, 4vw, 2.1rem); } h2 { font-size: 1.3rem; } h3 { font-size: 1rem; }
a { color: inherit; }
img { max-width: 100%; display: block; }
.wrap { max-width: 1180px; margin: 0 auto; padding: 0 16px; }
.page { padding-top: 22px; padding-bottom: 48px; min-height: 60vh; outline: none; }
.loading { text-align: center; margin-top: 40vh; color: var(--muted); }
.muted { color: var(--muted); } .small { font-size: .85rem; } .err { color: var(--err); } .ok { color: var(--green); }
.row-between { display: flex; justify-content: space-between; align-items: end; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
section { margin: 28px 0; }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; padding: 10px 20px;
  border-radius: 999px; border: 1px solid transparent; font: 600 .95rem var(--body); text-decoration: none; cursor: pointer; }
.btn.primary { background: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { filter: brightness(1.08); }
.btn.ghost { background: transparent; border-color: var(--line); color: var(--ink); }
.btn.light { background: #fff; color: #12263F; }
.btn.wide { width: 100%; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.link { background: none; border: 0; color: var(--muted); text-decoration: underline; cursor: pointer; font: inherit; padding: 4px; }
.icon-btn { background: none; border: 0; font-size: 1.5rem; color: var(--ink); cursor: pointer; padding: 6px; min-width: 44px; min-height: 44px; }

/* header */
.announce { background: var(--ink); color: var(--bg); text-align: center; padding: 6px 16px; font-size: .9rem; }
.top { background: var(--card); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.top-row { display: flex; align-items: center; gap: 14px; min-height: 66px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font: 700 1.15rem var(--head); letter-spacing: .04em; }
.search { flex: 1; max-width: 460px; margin-left: auto; }
.search input { width: 100%; min-height: 42px; border: 1px solid var(--line); border-radius: 999px; padding: 8px 16px; font: inherit; background: var(--bg); color: var(--ink); }
.top-actions { display: flex; align-items: center; gap: 10px; }
.lang { display: flex; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; }
.lang button { background: none; border: 0; padding: 6px 10px; font: 600 .8rem var(--body); color: var(--muted); cursor: pointer; min-height: 36px; }
.lang button[aria-pressed=true] { background: var(--ink); color: var(--bg); }
.cart-link { text-decoration: none; font-weight: 600; white-space: nowrap; min-height: 44px; display: inline-flex; align-items: center; }
.cart-link span:not(:empty) { background: var(--accent); color: #fff; border-radius: 999px; padding: 0 7px; font-size: .8rem; margin-left: 2px; }
.menu-btn { display: none; }
.mainnav { border-top: 1px solid var(--line); }
.nav-row { display: flex; gap: 22px; align-items: center; min-height: 46px; }
.nav-row > a, .dd > summary { text-decoration: none; font-weight: 500; cursor: pointer; list-style: none; }
.dd { position: relative; } .dd > summary::-webkit-details-marker { display: none; } .dd > summary::after { content: ' ▾'; font-size: .8em; }
.dd-menu { position: absolute; top: 34px; left: -12px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow);
  padding: 8px; display: grid; grid-template-columns: repeat(2, minmax(200px, 1fr)); gap: 2px; z-index: 30; }
.dd-menu a { padding: 8px 10px; border-radius: 8px; text-decoration: none; font-size: .92rem; }
.dd-menu a:hover { background: var(--bg); }

/* hero + home */
.hero { border-radius: 20px; padding: clamp(28px, 6vw, 64px); color: #fff; margin-top: 4px;
  background: linear-gradient(120deg, rgba(18,38,63,.92), rgba(163,21,17,.75)), var(--hero, none) center/cover, #12263F; }
.hero h1 { font-size: clamp(1.8rem, 5vw, 3rem); max-width: 16ch; } .hero p { max-width: 50ch; opacity: .92; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.tile { position: relative; border-radius: 14px; overflow: hidden; background: var(--card); box-shadow: var(--shadow); text-decoration: none; aspect-ratio: 1; }
.tile img { width: 100%; height: 100%; object-fit: cover; }
.tile span { position: absolute; inset: auto 0 0 0; padding: 22px 10px 8px; color: #fff; font: 700 .85rem var(--head);
  background: linear-gradient(transparent, rgba(0,0,0,.7)); }
.promo-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.promo { background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 24px; }
.promo.dark { background: #12263F; color: #fff; border-color: #12263F; }

/* product grid */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 16px; }
.card { background: var(--card); border-radius: 14px; overflow: hidden; box-shadow: var(--shadow); text-decoration: none; display: flex; flex-direction: column; }
.card-img { position: relative; aspect-ratio: 1; background: #fff; }
.card-img img { width: 100%; height: 100%; object-fit: contain; }
.card-body { padding: 10px 12px 14px; }
.card-body h3 { font: 500 .95rem var(--body); margin-bottom: 4px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card-body p { margin: 0; }
.badge { position: absolute; top: 10px; left: 10px; border-radius: 999px; padding: 2px 10px; font: 600 .75rem var(--body); }
.badge.out { background: #5B6B7D; color: #fff; } .badge.sale { background: var(--accent); color: #fff; }
.price { font-weight: 600; } .was { color: var(--muted); font-size: .9em; }
.sort select { min-height: 40px; border-radius: 10px; border: 1px solid var(--line); padding: 6px 10px; font: inherit; background: var(--card); color: var(--ink); }

/* product page */
.back { display: inline-block; margin-bottom: 10px; color: var(--muted); text-decoration: none; }
.product { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 32px; align-items: start; }
.gallery > img { width: 100%; aspect-ratio: 1; object-fit: contain; background: #fff; border-radius: 16px; }
.thumbs { display: flex; gap: 8px; margin-top: 8px; overflow-x: auto; }
.thumbs button { border: 1px solid var(--line); border-radius: 10px; padding: 0; background: #fff; cursor: pointer; flex: 0 0 68px; height: 68px; overflow: hidden; }
.thumbs img { width: 100%; height: 100%; object-fit: contain; }
.big { font-size: 1.4rem; }
.opts { border: 0; padding: 0; margin: 14px 0; display: flex; flex-wrap: wrap; gap: 8px; }
.opts legend { font-weight: 600; margin-bottom: 6px; }
.opt input { position: absolute; opacity: 0; }
.opt span { display: inline-block; border: 1px solid var(--line); border-radius: 10px; padding: 8px 14px; cursor: pointer; background: var(--card); min-height: 40px; }
.opt input:checked + span { border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink); font-weight: 600; }
.opt input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.opt.off span { opacity: .45; text-decoration: line-through; cursor: not-allowed; }
.stock { color: var(--accent); font-weight: 600; min-height: 1.4em; margin: 4px 0; }
.qty-row { display: flex; gap: 12px; align-items: end; flex-wrap: wrap; margin: 10px 0; }
.qty-row input { width: 80px; min-height: 44px; border: 1px solid var(--line); border-radius: 10px; padding: 8px; font: inherit; display: block; background: var(--card); color: var(--ink); }
.desc { line-height: 1.7; }

/* cart + checkout */
.cart { display: grid; gap: 10px; }
.cart-line { display: grid; grid-template-columns: 72px minmax(0, 1fr) 80px 100px auto; gap: 12px; align-items: center; background: var(--card);
  border-radius: 12px; padding: 10px; box-shadow: var(--shadow); }
.cart-line img { width: 72px; height: 72px; object-fit: contain; background: #fff; border-radius: 8px; }
.cart-line input { width: 70px; min-height: 40px; border: 1px solid var(--line); border-radius: 8px; padding: 6px; font: inherit; background: var(--card); color: var(--ink); }
.cart-line strong { text-align: right; }
.cart-foot { text-align: right; margin-top: 16px; }
.checkout { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(280px, 1fr); gap: 24px; align-items: start; }
.checkout fieldset { border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; margin: 0 0 14px; background: var(--card); }
.checkout legend { font: 700 1rem var(--head); padding: 0 6px; }
.checkout label { display: block; margin: 8px 0; font-weight: 500; font-size: .92rem; }
.checkout input:not([type=radio]), .checkout select, .checkout textarea { display: block; width: 100%; margin-top: 4px; min-height: 44px; border: 1px solid var(--line);
  border-radius: 10px; padding: 8px 12px; font: inherit; background: var(--bg); color: var(--ink); }
.checkout label.radio { display: flex; gap: 10px; align-items: center; min-height: 40px; cursor: pointer; }
.checkout label.radio input { width: 20px; height: 20px; accent-color: var(--accent); }
.two { display: grid; grid-template-columns: 140px 1fr; gap: 10px; }
.co-side { background: var(--card); border-radius: 14px; padding: 16px; box-shadow: var(--shadow); position: sticky; top: 130px; }
.sum-line { display: flex; justify-content: space-between; gap: 10px; padding: 6px 0; border-bottom: 1px solid var(--line); font-size: .93rem; }
.sum-line.total { font-weight: 700; font-size: 1.1rem; border-bottom: 0; }
.box { background: var(--card); border-radius: 14px; padding: 16px; box-shadow: var(--shadow); margin: 14px 0; }
.box pre { white-space: pre-wrap; font: inherit; background: var(--bg); border-radius: 10px; padding: 12px; }
.banner { background: #FFF6E5; color: #6B4A00; border: 1px solid #F3D9A4; border-radius: 12px; padding: 12px 14px; }
@media (prefers-color-scheme: dark) { .banner { background: #2E2510; color: #F3D9A4; border-color: #5A4A20; } }
.pill { display: inline-block; border-radius: 999px; padding: 2px 12px; font-size: .85rem; font-weight: 600; background: var(--line); }
.pill.completed { background: #DDF2E5; color: #1F5C38; } .pill.unpaid { background: #FFF1C2; color: #6B4A00; } .pill.cancelled { background: #F8DCDC; color: #7A1C1C; }
.plain { list-style: none; padding: 0; } .plain li { padding: 8px 0; border-bottom: 1px solid var(--line); }
.contact p { margin: 14px 0; } .lead { font-size: 1.1rem; max-width: 65ch; }

/* footer */
.foot { background: #12263F; color: #DCE6EF; padding: 32px 0 12px; margin-top: 40px; }
.foot-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 24px; }
.foot h3 { color: #fff; } .foot a { display: block; color: #DCE6EF; text-decoration: none; padding: 3px 0; }
.foot a:hover { text-decoration: underline; } .copy { font-size: .85rem; opacity: .75; margin-top: 18px; }

/* phones */
@media (max-width: 820px) {
  .menu-btn { display: block; }
  .top-row { flex-wrap: wrap; gap: 8px; padding-top: 6px; padding-bottom: 6px; }
  .brand span { display: none; }
  .search { order: 5; flex-basis: 100%; max-width: none; margin: 0; }
  .top-actions { margin-left: auto; }
  .mainnav { display: none; } .mainnav.open { display: block; }
  .nav-row { flex-direction: column; align-items: stretch; gap: 0; padding-bottom: 8px; }
  .nav-row > a, .dd > summary { padding: 12px 0; border-bottom: 1px solid var(--line); }
  .dd-menu { position: static; grid-template-columns: 1fr; box-shadow: none; border: 0; padding: 0 0 0 12px; }
  .product, .checkout, .promo-row, .foot-grid { grid-template-columns: minmax(0, 1fr); }
  .co-side { position: static; }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .cart-line { grid-template-columns: 56px minmax(0, 1fr) 64px; }
  .cart-line img { width: 56px; height: 56px; }
  .cart-line strong, .cart-line .link { grid-column: 2 / -1; text-align: left; }
}
