:root {
  --blue: #0b5ed7;
  --blue-dark: #0a3d91;
  --blue-light: #e8f1ff;
  --ink: #12233d;
  --muted: #5b6b82;
  --line: #d9e3f2;
  --bg: #ffffff;
  --ok: #1a8f4c;
  --warn: #c77700;
  --bad: #c62828;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.5;
}
a { color: inherit; text-decoration: none; }
.container { max-width: 1160px; margin: 0 auto; padding: 0 20px; }

/* header */
.topbar { background: var(--blue-dark); color: #dbe8ff; font-size: 13px; }
.topbar .container { display: flex; justify-content: space-between; padding-top: 6px; padding-bottom: 6px; gap: 12px; flex-wrap: wrap; }
header.site { background: #fff; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 10; }
header.site .container { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.logo { font-size: 24px; font-weight: 800; color: var(--blue); letter-spacing: -.5px; }
.logo span { color: var(--ink); }
nav a { margin-left: 24px; font-weight: 600; color: var(--muted); }
nav a:hover, nav a.active { color: var(--blue); }

/* hero */
.hero { background: linear-gradient(135deg, var(--blue) 0%, var(--blue-dark) 100%); color: #fff; }
.hero .container { padding-top: 72px; padding-bottom: 72px; display: grid; grid-template-columns: 1.2fr 1fr; gap: 40px; align-items: center; }
.hero h1 { font-size: 44px; line-height: 1.15; margin: 0 0 16px; }
.hero p { font-size: 18px; color: #d5e4ff; margin: 0 0 28px; max-width: 520px; }
.btn { display: inline-block; padding: 12px 26px; border-radius: 8px; font-weight: 700; border: 2px solid transparent; cursor: pointer; font-size: 16px; }
.btn-white { background: #fff; color: var(--blue); }
.btn-white:hover { background: var(--blue-light); }
.btn-blue { background: var(--blue); color: #fff; }
.btn-blue:hover { background: var(--blue-dark); }
.hero-card { background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.25); border-radius: 16px; padding: 28px; }
.eyebrow { display: block; font-size: 14px; letter-spacing: .08em; margin-bottom: 16px; }
.hero-card h2 { font-size: 24px; margin-bottom: 16px; }
.hero-card p { font-size: 16px; margin-bottom: 22px; }
.hero-phone { display: block; width: fit-content; font-size: clamp(20px, 3vw, 28px); font-weight: 700; }
.hero-phone:hover { text-decoration: underline; }
.hero-hours { display: block; margin-top: 8px; color: #d5e4ff; font-size: 14px; }

/* sections */
section { padding: 56px 0; }
h2 { font-size: 30px; margin: 0 0 24px; }
.grid-cats { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 16px; }
.cat { background: var(--blue-light); border-radius: 12px; padding: 22px 16px; font-weight: 700; color: var(--blue-dark); text-align: center; transition: transform .15s, box-shadow .15s; }
.cat:hover { transform: translateY(-3px); box-shadow: 0 8px 20px rgba(11,94,215,.18); }
.cat small { display: block; font-weight: 500; color: var(--muted); margin-top: 4px; }
.features { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 20px; }
.feature { border: 1px solid var(--line); border-radius: 12px; padding: 22px; }
.feature h3 { color: var(--blue-dark); margin: 0 0 10px; font-size: 18px; }
.feature p { margin: 0; color: var(--muted); }
.section-compact { padding-top: 0; }
.how-to { background: #f5f8fc; }
.purchase-steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 32px; list-style: none; margin: 0; padding: 0; counter-reset: steps; }
.purchase-steps li { counter-increment: steps; }
.purchase-steps li::before { content: "0" counter(steps); color: var(--blue); font-size: 28px; font-weight: 800; }
.purchase-steps h3 { margin: 12px 0 8px; font-size: 20px; }
.purchase-steps p { color: var(--muted); margin: 0; }
.purchase-steps a { color: var(--blue); white-space: nowrap; }

/* catalog */
.page-head { background: var(--blue-light); padding: 32px 0; }
.page-head h1 { margin: 0 0 4px; font-size: 32px; }
.page-head p { margin: 0; color: var(--muted); }
.toolbar { display: flex; gap: 12px; flex-wrap: wrap; margin: 24px 0 8px; align-items: center; }
.toolbar input[type=search], .toolbar select { padding: 11px 14px; border: 1px solid var(--line); border-radius: 8px; font-size: 15px; background: #fff; color: var(--ink); }
.toolbar input[type=search] { flex: 1; min-width: 220px; }
.toolbar label { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 14px; }
.toolbar input:focus, .toolbar select:focus { outline: 2px solid var(--blue); border-color: transparent; }
.live { font-size: 13px; color: var(--muted); margin-bottom: 16px; display: flex; align-items: center; gap: 8px; }
.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--ok); animation: pulse 2s infinite; }
.dot.off { background: var(--bad); animation: none; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(26,143,76,.5); } 70% { box-shadow: 0 0 0 8px rgba(26,143,76,0); } 100% { box-shadow: 0 0 0 0 rgba(26,143,76,0); } }
.products { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 18px; padding-bottom: 56px; }
.card { border: 1px solid var(--line); border-radius: 12px; padding: 16px; display: flex; flex-direction: column; background: #fff; transition: box-shadow .15s; }
.card:hover { box-shadow: 0 8px 24px rgba(18,35,61,.1); }
.thumb { height: 120px; border-radius: 8px; background: linear-gradient(135deg, var(--blue-light), #fff); display: grid; place-items: center; font-size: 40px; color: var(--blue); margin-bottom: 12px; overflow: hidden; }
.thumb img { max-width: 100%; max-height: 100%; object-fit: contain; mix-blend-mode: multiply; }
.thumb { height: 190px; }
.product-open { display: flex; flex-direction: column; flex: 1; width: 100%; padding: 0; border: 0; background: transparent; text-align: left; color: inherit; font: inherit; cursor: pointer; }
.product-open .thumb { width: 100%; }
.photo-empty { font-size: 14px; color: var(--muted); }
.product-open:focus-visible, .btn:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; }
.pagination { display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 12px; padding-bottom: 30px; }
.page-controls, .page-numbers { display: flex; justify-content: center; align-items: center; gap: 10px; flex-wrap: wrap; }
.pagination .btn { padding: 7px 16px; font-size: 14px; }
.pagination .page-number { min-width: 38px; padding: 7px 10px; background: var(--blue-light); color: var(--blue-dark); }
.pagination .page-number:disabled { background: var(--blue); color: #fff; cursor: default; }
header.site nav .cart-link { position: relative; display: inline-flex; align-items: center; justify-content: center; vertical-align: middle; width: 46px; height: 46px; padding: 8px; margin-left: 24px; border: 0; border-radius: 10px; background: transparent; color: var(--blue); cursor: pointer; text-decoration: none; }
header.site nav .cart-link:hover { background: var(--blue-light); }
.cart-link:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; }
.cart-link img { display: block; }
.cart-count { position: absolute; top: -2px; right: -6px; min-width: 21px; padding: 2px 5px; border: 2px solid #fff; border-radius: 20px; font: 700 11px/15px "Segoe UI", sans-serif; text-align: center; color: #fff; background: var(--blue); }
.cart-count[hidden] { display: none; }
#list { scroll-margin-top: 110px; }
#notice { color: var(--blue-dark); }
#notice:empty { display: none; }
nav a.btn-blue { color: #fff; }
dialog { width: min(640px, calc(100% - 24px)); max-height: 88vh; overflow: auto; border: 0; border-radius: 16px; padding: 24px; color: var(--ink); box-shadow: 0 20px 80px #0005; }
dialog::backdrop { background: #07132599; backdrop-filter: blur(5px); }
.dialog-head { display: flex; align-items: start; justify-content: space-between; gap: 12px; }
.dialog-head h2 { font-size: 22px; overflow-wrap: anywhere; }
.product-photo { height: min(400px, 45vh); display: grid; place-items: center; background: #f6f8fb; border-radius: 10px; }
.product-photo img { width: 100%; height: 100%; min-height: 0; object-fit: contain; }
.cart-row { border-bottom: 1px solid var(--line); padding: 12px 0; }
.quantity { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.home-search { display: flex; gap: 8px; margin-top: 20px; }
.home-search input { min-width: 0; flex: 1; padding: 12px; border: 1px solid var(--line); border-radius: 8px; font: inherit; }
@media (max-width: 600px) { header.site .container { height: auto; min-height: 64px; flex-wrap: wrap; padding-top: 10px; padding-bottom: 10px; gap: 8px; } nav { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; } nav a { margin-left: 0; } header.site nav .cart-link { margin-left: 0; } .toolbar > input, .toolbar > select { width: 100%; } .pagination { gap: 8px; } dialog { padding: 16px; } }
.card .sku { font-size: 12px; color: var(--muted); }
.card h3 { font-size: 16px; margin: 4px 0 4px; flex: 1; }
.card .car { font-size: 13px; color: var(--muted); margin-bottom: 10px; min-height: 20px; }
.price { font-size: 24px; font-weight: 800; color: var(--blue-dark); }
.stock { font-size: 13px; font-weight: 600; margin: 4px 0 12px; }
.stock.ok { color: var(--ok); } .stock.low { color: var(--warn); } .stock.none { color: var(--bad); }
.card .btn { width: 100%; text-align: center; padding: 10px; }
.btn[disabled] { background: #c9d4e6; cursor: not-allowed; }
.flash { animation: flash 1.2s; }
@keyframes flash { from { background: #fff6c8; } to { background: transparent; } }
.empty { grid-column: 1 / -1; text-align: center; color: var(--muted); padding: 40px 0; }

/* contacts + footer */
.contacts { background: var(--blue-light); }
.contacts { scroll-margin-top: 90px; }
.contact-layout { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.3fr); gap: 40px; align-items: start; }
.contact-details h3 { margin: 0 0 12px; font-size: 22px; }
.contact-details address { font-style: normal; }
.contact-details dl { margin: 24px 0; }
.contact-details dt { color: var(--muted); font-size: 13px; margin-top: 18px; }
.contact-details dd { margin: 4px 0 0; overflow-wrap: anywhere; }
.contact-details dd a { color: var(--blue-dark); font-weight: 600; }
.contact-details dd a:hover, .map-link:hover { text-decoration: underline; }
.map-link { display: inline-block; color: var(--blue-dark); margin: 14px 0 0 16px; }
.store-map { background: #fff; border-radius: 14px; overflow: hidden; border: 1px solid var(--line); }
.store-map iframe { display: block; border: 0; width: 100%; height: 350px; }
.store-map p { margin: 0; padding: 12px 16px; color: var(--muted); font-size: 13px; }
footer { background: var(--blue-dark); color: #b9cdee; padding: 24px 0; font-size: 14px; }

@media (max-width: 800px) {
  .hero .container { grid-template-columns: 1fr; padding-top: 44px; padding-bottom: 44px; }
  .hero h1 { font-size: 32px; }
  nav a { margin-left: 14px; }
  .purchase-steps, .contact-layout { grid-template-columns: 1fr; }
  .contact-layout { gap: 24px; }
}
