:root {
  color-scheme: dark;
  --orange: #ff7900;
  --text: #f3f3f3;
  --muted: #bfc0c2;
  --header-height: 86px;
  font-family: Arial, Helvetica, sans-serif;
  color: var(--text);
  background: #151618;
}
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-width: 0; min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; isolation: isolate; }
body::before { content: ''; position: fixed; inset: 0; z-index: -1; background: #151618 url('../img/bg.webp') center / cover no-repeat; pointer-events: none; }
button, a { -webkit-tap-highlight-color: transparent; }
button { font: inherit; color: inherit; cursor: pointer; }
button:focus-visible, a:focus-visible { outline: 2px solid #ffb460; outline-offset: 5px; }
img { display: block; max-width: 100%; height: auto; }
.header { min-height: var(--header-height); display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 24px; padding: 9px clamp(20px, 4vw, 76px); background: rgba(12, 13, 15, .88); border-bottom: 1px solid rgba(255,255,255,.12); }
.brand { width: clamp(115px, 13vw, 166px); justify-self: start; display: block; }
.nav { display: flex; align-items: center; gap: clamp(18px, 3vw, 58px); }
.nav button { background: none; border: 0; padding: 14px 0; font-size: 15px; font-weight: 600; white-space: nowrap; text-transform: uppercase; letter-spacing: .05em; transition: color .2s; }
.nav button:hover, .nav button[aria-current='page'] { color: var(--orange); }
.tools { display: flex; align-items: center; justify-self: end; gap: clamp(14px, 2.3vw, 32px); }
.language { position: relative; }
.lang-toggle, .cart { display: flex; align-items: center; gap: 7px; border: 0; background: none; padding: 9px 3px; font-size: 14px; font-weight: bold; }
.lang-toggle svg { width: 15px; height: 15px; stroke: var(--orange); fill: none; stroke-width: 1.8; }
.lang-list { position: absolute; z-index: 2; top: calc(100% + 8px); right: 0; min-width: 64px; background: #1d1e20; border: 1px solid #515154; box-shadow: 0 6px 20px #0008; }
.lang-list button { display: block; background: none; border: none; width: 100%; padding: 12px; text-align: center; }
.lang-list button:hover { color: var(--orange); background: #303134; }
.cart svg { width: 27px; height: 27px; fill: none; stroke: var(--orange); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.cart-count { min-width: 19px; height: 19px; border: 1px solid #a74e0a; border-radius: 50%; display: grid; place-items: center; font-size: 11px; }
main { flex: 1; display: grid; place-items: center; padding: 26px 24px 38px; }
.hero { display: flex; flex-direction: column; align-items: center; gap: clamp(26px, 5vh, 54px); width: 100%; }
.hero-image { width: min(100%, 1060px, 121vh); filter: drop-shadow(0 12px 18px #0007); }
.hero-actions { display: flex; justify-content: center; align-items: stretch; flex-wrap: wrap; gap: 16px; }
.action { min-width: 232px; min-height: 54px; padding: 14px 24px; font-size: 15px; font-weight: bold; text-transform: uppercase; letter-spacing: .06em; border: 1px solid var(--orange); border-radius: 3px; transition: background .2s, box-shadow .2s, color .2s; }
.primary { background: linear-gradient(180deg, #ff9d26, #f37300); color: #17110b; box-shadow: 0 4px 20px #ff790026; }
.primary:hover { background: #ffad42; box-shadow: 0 0 25px #ff79004d; }
.secondary { background: #17191de6; color: #fff; }
.secondary:hover { background: #3a2517; box-shadow: 0 0 22px #ff790026; }
.panel { width: min(100%, 880px); padding: clamp(24px, 4vw, 48px); background: #151719ed; border: 1px solid #46474a; border-top: 2px solid var(--orange); box-shadow: 0 18px 55px #0006; }
.panel h1 { font-size: clamp(26px, 4vw, 40px); margin: 24px 0 14px; }
.panel p { color: var(--muted); line-height: 1.65; margin-bottom: 0; }
.back { display: inline-flex; align-items: center; gap: 10px; background: none; border: 0; color: var(--orange); padding: 4px 0; }
.back svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.5; }
footer { text-align: center; font-size: 12px; color: var(--muted); padding: 15px 12px 18px; text-shadow: 0 1px 4px #000; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
@media (max-width: 900px) { .header { gap: 16px; padding-inline: 20px; } .nav { gap: 18px; } .nav button { font-size: 13px; letter-spacing: 0; } }
@media (max-width: 767px) {
  body::before { background-image: url('../img/bg_mob.webp'); }
  .header { grid-template-columns: 1fr auto; gap: 4px 12px; padding: 8px 16px 0; }
  .brand { width: 120px; }
  .tools { grid-column: 2; grid-row: 1; }
  .nav { grid-column: 1 / -1; grid-row: 2; justify-content: center; gap: clamp(10px, 5vw, 36px); border-top: 1px solid #ffffff14; }
  .nav button { padding: 13px 0; font-size: 12px; }
  main { padding: 24px 14px 30px; }
  .hero { gap: 32px; }
  .hero-image { width: min(100%, 580px); }
  .hero-actions { width: min(100%, 340px); flex-direction: column; gap: 12px; }
  .action { width: 100%; min-width: 0; min-height: 51px; font-size: 14px; }
}
@media (max-width: 350px) { .nav { gap: 10px; } .nav button { font-size: 11px; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; } }

.contact-links { display: grid; gap: 18px; margin-top: 28px; }
.contact-links a { display: flex; align-items: center; gap: 12px; width: fit-content; max-width: 100%; color: var(--text); text-decoration: none; overflow-wrap: anywhere; }
.contact-links a:hover { color: var(--orange); }
.contact-links svg { width: 22px; height: 22px; flex: 0 0 22px; fill: none; stroke: var(--orange); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.search-form { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; margin-top: 26px; }
.search-form input { min-width: 0; width: 100%; padding: 12px 15px; font: inherit; color: var(--text); background: #111214; border: 1px solid #55565a; border-radius: 3px; }
.search-form input:focus-visible { outline: 2px solid #ffb460; outline-offset: 2px; }
.search-form .action { min-width: 130px; width: auto; }
#search-status { grid-column: 1 / -1; margin-top: 2px; }
@media (max-width: 767px) { .nav { gap: clamp(8px, 2.5vw, 24px); flex-wrap: wrap; } .nav button { font-size: 11px; } }
@media (max-width: 480px) { .search-form { grid-template-columns: 1fr; } .search-form .action { width: 100%; } }

/* The hero already includes the brand; keep the header grid stable. */
body[data-current-page="home"] .header .brand { visibility: hidden; }

/* Catalog, search and cart only — approved home layout remains unchanged. */
body[data-current-page="catalog"] .panel, body[data-current-page="search"] .panel { width: min(100%, 1320px); }
.catalog-categories { display:flex; flex-wrap:wrap; gap:8px; margin:24px 0; }
.category-button { border:1px solid #515256; background:#202124; padding:10px 14px; border-radius:3px; font-size:14px; }
.category-button:hover, .category-button[aria-pressed=true] { border-color:var(--orange); color:var(--orange); }
.product-grid { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:16px; margin-top:20px; }
.product-card { min-width:0; display:flex; flex-direction:column; padding:14px; background:#202225; border:1px solid #424347; border-top:2px solid #b9651a; }
.product-visual { aspect-ratio:1; background:#17181a; display:grid; place-items:center; border-radius:3px; overflow:hidden; }
.product-photo { width:100%; height:100%; object-fit:contain; }
.product-placeholder { display:grid; justify-items:center; gap:16px; padding:14px; text-align:center; color:var(--muted); }
.chip-icon { display:grid; place-items:center; width:80px; height:80px; border:3px double #b6b6b8; box-shadow:0 0 0 6px #37393b,0 0 0 7px #935321; background:linear-gradient(135deg,#33373b,#18191b); color:#ffa64d; font:bold 20px Arial,sans-serif; letter-spacing:2px; }
.product-name { font-size:18px; line-height:1.25; margin:16px 0 12px; }
.product-specs { display:grid; grid-template-columns:minmax(0,1fr) auto; gap:8px; font-size:12px; margin:0 0 14px; }
.product-specs dt { color:var(--muted); } .product-specs dd { margin:0; text-align:right; }
.product-source { font-size:12px; color:#ffae62; margin-top:auto; margin-bottom:14px; overflow-wrap:anywhere; }
.product-bottom { display:grid; gap:10px; } .product-price { font-size:24px; color:#ff9d26; }
.product-add { min-width:0; width:100%; min-height:42px; padding:10px 6px; font-size:12px; letter-spacing:.02em; }
.shop-empty { grid-column:1/-1; }
/* Share the same column tracks across all cart rows. */
#cart-content { display:grid; grid-template-columns:minmax(0,1fr) max-content max-content; column-gap:16px; }
.cart-row { display:grid; grid-column:1/-1; grid-template-columns:subgrid; align-items:center; gap:16px; padding:16px 0; border-bottom:1px solid #444; }
.cart-row > strong:first-child { min-width:0; overflow-wrap:anywhere; }
.cart-controls { display:flex; align-items:center; gap:9px; flex-wrap:wrap; }
.cart-controls > span { min-width:2ch; text-align:center; font-variant-numeric:tabular-nums; }
.cart-subtotal { text-align:right; white-space:nowrap; font-variant-numeric:tabular-nums; }
.quantity-button,.remove-button { border:1px solid #666; padding:5px 10px; background:#222; border-radius:3px; }
.remove-button { color:#ffae62; } .cart-subtotal,.cart-total { color:#ffa64d !important; font-weight:bold; } .cart-total { text-align:right; font-size:22px; }
@media(max-width:1050px){ .product-grid {grid-template-columns:repeat(2,minmax(0,1fr));} }
@media(max-width:480px){ .product-grid {grid-template-columns:minmax(0,1fr);} #cart-content {display:block;} .cart-row {grid-template-columns:1fr;} .product-visual {aspect-ratio: 4/3;} }

.product-note { color:var(--muted); font-size:11px; line-height:1.4; margin:0 0 12px; }
.product-specs dd { overflow-wrap:anywhere; }

/* Cart footer: clear action and total. */
.cart-footer { grid-column:1/-1; display:flex; align-items:center; justify-content:space-between; flex-wrap:wrap; gap:12px; margin-top:24px; }
.cart-footer .cart-total { margin:0 0 0 auto; }
.cart-clear { padding:10px 16px; }
.cart-clear:hover { border-color:var(--orange); background:#3a2517; }
@media(max-width:480px) { .cart-footer { flex-direction:column; align-items:stretch; } .cart-footer .cart-total { margin:0; } }

/* Close uses the existing home navigation, without changing shop state. */
.panel { position:relative; }
.panel > .section-close { position:absolute; top:12px; right:12px; display:grid; place-items:center; width:40px; height:40px; padding:0; border:1px solid #8c4b1b; border-radius:3px; background:#202124; color:var(--orange); font:400 28px/1 Arial,sans-serif; }
.panel > .section-close:hover { background:#3a2517; border-color:var(--orange); }
.panel > .section-close:focus-visible { outline:2px solid var(--orange); outline-offset:3px; }
