:root {
  --bg: #f3f3f3;
  --ink: #151515;
  --muted: #777;
  --line: #e2e2e2;
  --card: #fff;
  --ph: #f2f2f2;
  --hot: #e0322b;
  --ok: #1f9d55;
  --shadow: 0 10px 28px rgba(0, 0, 0, .08);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
/* страховка: сторінка ніколи не їздить вліво-вправо, навіть якщо щось виявиться ширшим за екран */
html, body { overflow-x: clip; }
img { max-width: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 14px/1.45 Rubik, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}
body.locked { overflow: hidden; }
a { color: inherit; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
.muted { color: var(--muted); }

.container { max-width: 1440px; margin: 0 auto; padding: 0 32px; }

/* ---------- Header */
.site-header { background: #0b0b0b; color: #fff; position: relative; z-index: 30; }
.count { display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: var(--hot); color: #fff; font-size: 11px; font-weight: 500; line-height: 1; }

.topbar-in { display: flex; align-items: center; gap: 24px; min-height: 40px; }
.toplinks { display: flex; align-items: center; gap: 6px 22px; flex-wrap: wrap; font-size: 14px; }
.toplinks a { text-decoration: none; color: #fff; white-space: nowrap; }
.toplinks a:hover { color: #bdbdbd; }
.top-tg { display: grid; place-items: center; }
.top-tg svg { width: 22px; height: 22px; }
.top-wish { margin-left: auto; display: flex; align-items: center; gap: 8px; padding: 6px 0; border: 0; background: none; color: #fff; font-size: 14px; white-space: nowrap; }
.top-wish svg { width: 20px; height: 20px; }
.top-wish[aria-pressed="true"] { color: #ff6b63; }

.header-main { display: flex; align-items: center; gap: 40px; min-height: 104px; }
.logo { font-weight: 600; font-size: 28px; letter-spacing: .08em; text-decoration: none; white-space: nowrap; text-transform: uppercase; }
.phone-box { position: relative; }
.header-phone { display: flex; align-items: center; gap: 10px; padding: 0; border: 0; background: none; color: #fff; font-size: 22px; white-space: nowrap; text-decoration: none; }
.header-phone svg { width: 24px; height: 24px; }
.header-phone.is-tg { padding: 10px 18px; border: 1px solid #3a3a3a; border-radius: 999px; font-size: 16px; }
.header-phone.is-tg svg { color: #2aabee; }
.header-phone.is-tg:hover { border-color: #fff; }
/* сторінок може бути багато: один рядок, решта — прокруткою, край м'яко зникає */
.toplinks { flex: 1; min-width: 0; flex-wrap: nowrap; }
/* Усі посилання видно повністю: якщо не вміщаються в один рядок — переносяться на другий */
.toplinks-pages { display: flex; flex-wrap: wrap; gap: 6px 22px; min-width: 0; padding: 4px 0; }
.toplinks-pages::-webkit-scrollbar { display: none; }
.toplinks-pages.fade-end { -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 48px), transparent); mask-image: linear-gradient(to right, #000 calc(100% - 48px), transparent); }
.top-tg { flex: none; }
.search { flex: 1; max-width: 520px; display: flex; align-items: center; gap: 12px; border-bottom: 1px solid #3a3a3a; transition: border-color .2s; }
.search:focus-within { border-color: #fff; }
.search svg { width: 20px; height: 20px; flex: none; color: #bbb; }
.search input { flex: 1; min-width: 0; background: none; border: 0; outline: 0; color: #fff; padding: 12px 0; font-size: 16px; }
.search input::placeholder { color: #8d8d8d; }
.schedule { margin-left: auto; display: flex; align-items: flex-start; gap: 10px; font-size: 16px; line-height: 1.4; }
.schedule svg { width: 22px; height: 22px; flex: none; margin-top: 1px; }
.schedule b { display: block; font-weight: 500; }
.schedule span { display: block; white-space: pre-line; }
.header-nav { display: flex; justify-content: space-around; align-items: center; height: 60px; border-top: 1px solid #1f1f1f; }
.header-nav a { text-decoration: none; text-transform: uppercase; letter-spacing: .05em; font-size: 17px; color: #d6d6d6; padding: 6px 0; border-bottom: 2px solid transparent; white-space: nowrap; }
.header-nav a:hover, .header-nav a.active { color: #fff; border-color: #fff; }

/* ---------- Page head */
.crumbs { display: flex; gap: 10px; color: var(--muted); font-size: 13px; padding-top: 28px; }
.crumbs a { text-decoration: none; }
.crumbs a:hover { color: var(--ink); }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; flex-wrap: wrap; gap: 12px 24px; margin: 14px 0 24px; }
h1 { margin: 0; font-weight: 400; font-size: 34px; text-transform: uppercase; }
.sync { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 13px; }
.sync .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); flex: none; }
.sync.loading .dot { background: #d29b00; animation: blink 1s infinite; }
.sync.error .dot { background: var(--hot); }
.sync.warn .dot { background: #d29b00; }
.sync.error, .sync.warn { max-width: 640px; }
@keyframes blink { 50% { opacity: .3; } }
.link-btn { background: none; border: 0; padding: 0; text-decoration: underline; text-underline-offset: 3px; color: var(--ink); font-size: 13px; }
.link-btn:disabled { opacity: .35; cursor: default; }

/* ---------- Layout */
.layout { display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: 32px; align-items: start; padding-bottom: 72px; }

/* ---------- Filters */
/* Панель фільтрів на комп'ютері не має власної прокрутки: вона просто йде разом зі сторінкою */
.filters { background: var(--card); padding: 24px; align-self: start; min-width: 0; overflow: visible; }
.filters-head { display: none; }
.fbox + .fbox { border-top: 1px solid var(--line); margin-top: 20px; padding-top: 20px; }
.fbox h3 { margin: 0 0 14px; font-size: 16px; font-weight: 600; }
.size-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.size-opt { position: relative; padding: 10px 0 9px; border: 1px solid #d6d6d6; background: #fff; border-radius: 2px; font-size: 14px; text-align: center; }
.size-opt sup { position: absolute; top: 2px; right: 4px; font-size: 10px; color: var(--muted); }
.size-opt:hover:not(:disabled) { border-color: var(--ink); }
.size-opt[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }
.size-opt[aria-pressed="true"] sup { color: #aaa; }
.size-opt:disabled { opacity: .35; cursor: default; }
.check { display: flex; align-items: center; gap: 12px; padding: 6px 0; cursor: pointer; font-size: 15px; }
.check input { appearance: none; -webkit-appearance: none; flex: none; width: 22px; height: 22px; margin: 0; border: 1px solid #bdbdbd; background: #fff; display: grid; place-items: center; cursor: pointer; }
.check input:checked { background: var(--ink); border-color: var(--ink); }
.check input[type="checkbox"]:checked::after { content: ""; width: 6px; height: 11px; border: solid #fff; border-width: 0 2px 2px 0; transform: translateY(-1px) rotate(45deg); }
.check input[type="radio"] { border-radius: 50%; }
.check input[type="radio"]:checked::after { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #fff; }
.check sup { color: var(--muted); font-size: 11px; margin-left: -6px; }
.check.zero { opacity: .4; }
.filters-foot { display: flex; gap: 8px; margin-top: 24px; }
.filters-foot .btn { flex: 1; }
.filters-foot .filters-apply { display: none; }  /* «Показати» потрібна лише у випадній панелі на телефоні */

/* ---------- Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 12px 20px; border: 1px solid var(--ink); background: var(--ink); color: #fff; font-size: 14px; text-decoration: none; transition: background .15s, color .15s; }
.btn:hover { background: #333; }
.btn-ghost { background: #fff; color: var(--ink); border-color: #d0d0d0; }
.btn-ghost:hover { background: #fff; border-color: var(--ink); }
.btn-sm { padding: 9px 14px; font-size: 13px; }
.icon-btn { width: 40px; height: 40px; border: 0; background: none; font-size: 28px; line-height: 1; display: grid; place-items: center; }

/* ---------- Toolbar */
.toolbar { display: flex; align-items: center; flex-wrap: wrap; gap: 12px 16px; margin-bottom: 16px; }
.filters-toggle { display: none; }
.filters-toggle svg { width: 18px; height: 18px; }
.found { color: var(--muted); }
.sort { margin-left: auto; display: flex; align-items: center; gap: 10px; color: var(--muted); }
.sort select { appearance: none; -webkit-appearance: none; border: 1px solid var(--line); background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%23151515' stroke-width='1.5'/%3E%3C/svg%3E") no-repeat right 12px center; padding: 10px 36px 10px 12px; color: var(--ink); cursor: pointer; }
.quick-sizes { display: none; }
.active-filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.active-filters:empty { display: none; }
.pill { display: inline-flex; align-items: center; gap: 8px; padding: 7px 12px; background: #fff; border: 1px solid var(--line); border-radius: 999px; font-size: 13px; }
.pill span { color: var(--muted); font-size: 16px; line-height: 1; }
.pill:hover { border-color: var(--ink); }
.pill-reset { background: none; border-color: transparent; text-decoration: underline; text-underline-offset: 3px; }

/* ---------- Product grid */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 16px; }
.card { background: var(--card); display: flex; flex-direction: column; transition: box-shadow .2s; }
.card:hover { box-shadow: var(--shadow); }
.card-media-wrap { position: relative; margin: 16px 16px 0; }
.card-media { position: relative; display: block; width: 100%; aspect-ratio: 1; padding: 0; border: 0; background: var(--ph); overflow: hidden; }
.wish-toggle { display: grid; place-items: center; width: 36px; height: 36px; padding: 0; border: 0; border-radius: 50%; background: rgba(255, 255, 255, .92); }
.card-media-wrap .wish-toggle { position: absolute; top: 8px; right: 8px; }
.wish-toggle svg { width: 20px; height: 20px; fill: none; stroke: var(--ink); stroke-width: 1.8; }
.wish-toggle:hover svg { stroke: var(--hot); }
.wish-toggle[aria-pressed="true"] svg { fill: var(--hot); stroke: var(--hot); }
.card-media img, .modal-media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ph { width: 100%; height: 100%; display: grid; place-items: center; align-content: center; gap: 12px; color: #cfcfcf; }
.ph svg { width: 62%; }
.ph span { font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: #a9a9a9; }
.card:hover .ph { color: #c2c2c2; }
.badges { position: absolute; top: 10px; left: 10px; right: 52px; display: flex; flex-wrap: wrap; gap: 4px; pointer-events: none; }
.badge { padding: 4px 8px; background: var(--hot); color: #fff; font-size: 12px; }
.badge-custom { background: var(--ink); }
.badge-tag { background: #5b5b5b; }
.card-body { flex: 1; display: flex; flex-direction: column; gap: 10px; padding: 14px 16px 16px; }
.card-brand { font-size: 12px; color: var(--muted); letter-spacing: .1em; text-transform: uppercase; }
.card-title { margin: -4px 0 0; font-size: 15px; font-weight: 400; line-height: 1.35; }
.card-title a { text-decoration: none; }
.card-title a:hover { text-decoration: underline; text-underline-offset: 3px; }
.chips { display: flex; flex-wrap: wrap; gap: 4px; }
.chip { position: relative; min-width: 40px; padding: 5px 6px; border: 1px solid #dcdcdc; border-radius: 2px; background: #fff; font-size: 13px; text-align: center; }
.chip sup, .m-size sup { font-size: 9px; color: var(--muted); margin-left: 1px; }
.chip:hover { border-color: var(--ink); }
.chip.hit { background: var(--ink); border-color: var(--ink); color: #fff; }
/* Ціна й кнопка в один рядок, а якщо картка вузька (ціна + стара ціна) — кнопка переходить під ціну, нічого не вилазить за картку */
.card-foot { margin-top: auto; padding-top: 4px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 10px; min-width: 0; }
.card-foot .btn { flex: 1 1 110px; }
.card-foot.no-price .btn { flex: 1; }
.price { font-size: 18px; font-weight: 500; white-space: nowrap; max-width: 100%; }
.price.ask { font-size: 13px; font-weight: 400; color: var(--muted); }
.price-old { margin-left: 8px; font-size: 13px; font-weight: 400; color: var(--muted); }
.card { min-width: 0; overflow: hidden; }

.empty { grid-column: 1 / -1; background: #fff; padding: 56px 24px; text-align: center; }
.empty p { margin: 0 0 6px; font-size: 16px; }
.empty .btn { margin-top: 16px; }

.skeleton .card-media { animation: shimmer 1.2s infinite; }
.skeleton i { display: block; height: 12px; background: #eee; animation: shimmer 1.2s infinite; }
.skeleton i.short { width: 50%; }
@keyframes shimmer { 50% { opacity: .5; } }

/* ---------- Modal */
.modal { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 24px; background: rgba(0, 0, 0, .55); }
/* minmax(0, …): колонка не розтягується через багато мініатюр фото чи довге посилання в описі */
.modal-card { position: relative; width: min(940px, 100%); max-height: calc(100vh - 48px); overflow-x: hidden; overflow-y: auto; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); background: #fff; }
.modal-close { position: absolute; top: 6px; right: 6px; z-index: 1; }
.modal-media { min-width: 0; background: var(--ph); display: flex; flex-direction: column; }
.modal-info, .page-body { min-width: 0; }
.m-title, .m-desc, .card-title, .page-text, .review p, .os-name, .done-card p { overflow-wrap: anywhere; }
.m-photo { aspect-ratio: 1; }
.m-thumbs { display: flex; gap: 6px; padding: 8px; overflow-x: auto; overscroll-behavior-x: contain; background: #fff; }
.m-thumb { flex: none; width: 64px; height: 64px; padding: 0; border: 2px solid transparent; background: var(--ph); }
.m-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.m-thumb.on { border-color: var(--ink); }
.m-desc { margin: 0; white-space: pre-line; line-height: 1.55; }
.modal-info { display: flex; flex-direction: column; gap: 14px; padding: 36px 32px 28px; }
.m-title { margin: -6px 0 0; font-size: 24px; font-weight: 400; line-height: 1.25; }
.m-meta { color: var(--muted); font-size: 13px; margin-top: -6px; }
.m-meta:empty { display: none; }
.m-group + .m-group { margin-top: 12px; }
.m-group-label { margin-bottom: 8px; font-size: 13px; color: var(--muted); }
.m-sizes { display: flex; flex-wrap: wrap; gap: 6px; }
.m-size { position: relative; min-width: 54px; padding: 11px 8px; border: 1px solid #d6d6d6; background: #fff; font-size: 15px; }
.m-size:hover { border-color: var(--ink); }
.m-size[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }
.m-note { min-height: 20px; color: var(--muted); font-size: 13px; }
.m-fit { margin: 10px 0; padding: 10px 12px; border-left: 3px solid var(--hot); background: #fff4f2; font-size: 13px; line-height: 1.5; color: #333; }
.m-fit[hidden] { display: none; }
.m-note.warn { color: var(--hot); }
/* «Наявні кольори»: маленькі фото кросівок кожного кольору моделі, поточний обведено */
.m-swatches { margin: 10px 0 4px; min-width: 0; }
.m-swatches[hidden] { display: none; }
.m-swatches-label { margin-bottom: 8px; font-size: 14px; font-weight: 600; }
.m-color-row { display: flex; flex-wrap: wrap; gap: 8px; padding: 2px; }
@media (max-width: 700px) {
  /* на телефоні — один рядок, що гортається пальцем */
  .m-color-row { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 6px; scrollbar-width: none; }
  .m-color-row::-webkit-scrollbar { display: none; }
}
.m-color-wrap { position: relative; }
/* Стрілки «ще є кольори»: з'являються, лише коли ряд не вміщається й його можна гортати */
.m-arrow { position: absolute; top: calc(50% - 3px); z-index: 2; display: grid; place-items: center; width: 28px; height: 28px; padding: 0; border: 0; border-radius: 50%; background: #fff; color: var(--ink); box-shadow: 0 1px 6px rgba(0, 0, 0, .35); cursor: pointer; transform: translateY(-50%); }
.m-arrow[hidden] { display: none; }
.m-arrow svg { width: 16px; height: 16px; }
.m-arrow.prev { left: 2px; }
.m-arrow.next { right: 2px; }
.m-tile { position: relative; flex: none; width: 56px; height: 42px; padding: 0; overflow: hidden; border: 1px solid #dcdcdc; background: #f3f3f3; cursor: pointer; }
.m-tile:hover { border-color: var(--ink); }
.m-tile img { display: block; width: 100%; height: 100%; object-fit: contain; }
.m-tile[aria-current="true"] { border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink); cursor: default; }
.m-tile-fill { display: grid; place-items: center; width: 100%; height: 100%; font-size: 13px; font-weight: 500; color: #555; }
.m-swatch { position: relative; width: 28px; height: 28px; padding: 0; border: 1px solid rgba(0, 0, 0, .25); border-radius: 50%; background: #e9e9e9; font-size: 12px; font-weight: 500; line-height: 1; color: #555; cursor: pointer; }
.m-swatch:hover { border-color: var(--ink); }
.m-swatch[aria-current="true"] { box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--ink); cursor: default; }
.m-actions { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 8px; }
.m-actions:empty { display: none; }
.contact { display: flex; align-items: center; justify-content: center; padding: 13px 12px; background: var(--ink); color: #fff; text-decoration: none; font-weight: 500; }
.contact.tg { background: #229ed9; }
.contact.viber { background: #7360f2; }
.contact.ig { background: linear-gradient(45deg, #f09433, #dc2743 50%, #bc1888); }
.contact.disabled { opacity: .3; pointer-events: none; }
.m-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-right: 34px; }
.m-top .wish-toggle { background: #f3f3f3; }
.m-buy { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 18px; }
.m-buy #mPrice:empty { display: none; }
.m-order { padding: 13px 22px; font-size: 15px; font-weight: 500; }
.m-order-wide { width: 100%; padding: 15px 20px; }
.m-or { margin-bottom: -6px; font-size: 13px; color: var(--muted); }

.drawer-head { display: flex; align-items: center; justify-content: space-between; padding: 10px 8px 10px 20px; border-bottom: 1px solid var(--line); font-size: 18px; font-weight: 500; }

/* ---------- Інформаційні сторінки */
.page-card { width: min(720px, 100%); grid-template-columns: minmax(0, 1fr); }
.page-body { display: flex; flex-direction: column; gap: 16px; padding: 36px 32px 28px; }
.page-body .m-title { margin-right: 32px; }
.page-text { white-space: pre-line; line-height: 1.6; }
.page-text p { margin: 0; }

/* ---------- Відгуки */
.reviews { display: flex; flex-direction: column; gap: 16px; margin-top: 18px; white-space: normal; }
.reviews-summary { display: flex; align-items: center; gap: 10px; font-size: 16px; }
.reviews-summary b { font-size: 20px; font-weight: 500; }
.stars { color: #f5a623; letter-spacing: 1px; white-space: nowrap; }
.stars .off { color: #d6d6d6; }
.reviews-list { display: flex; flex-direction: column; gap: 10px; }
.review { padding: 14px 16px; background: #f6f6f6; }
.review-head { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; margin-bottom: 6px; }
.review-head b { font-weight: 500; }
.review-head .muted { font-size: 13px; }
.review p { margin: 0; white-space: pre-line; }
.review-form { display: flex; flex-direction: column; gap: 12px; padding-top: 16px; border-top: 1px solid var(--line); }
.review-form h3 { margin: 0; font-size: 18px; font-weight: 500; }
.review-form .field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: #555; }
.review-form .field > span { font-weight: 500; }
.review-form input:not([type=radio]), .review-form textarea { width: 100%; padding: 12px; border: 1px solid #cfcfcf; border-radius: 2px; background: #fff; font: inherit; font-size: 16px; color: var(--ink); }
.review-form textarea { resize: vertical; }
.review-form .btn { align-self: flex-start; }
.star-input { display: inline-flex; flex-direction: row-reverse; justify-content: flex-end; gap: 4px; }
.star-input input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.star-input label { font-size: 30px; line-height: 1; color: #d6d6d6; cursor: pointer; }
.star-input input:checked ~ label, .star-input label:hover, .star-input label:hover ~ label { color: #f5a623; }
.star-input input:focus-visible + label { outline: 2px solid var(--ink); outline-offset: 2px; }
.review-thanks { margin: 0; padding: 16px; background: #e3f4ea; color: #1f5f3a; }
.page-contacts { display: flex; flex-direction: column; gap: 6px; white-space: normal; }
.page-contacts a { text-decoration: none; font-size: 16px; }
.page-contacts a:hover { text-decoration: underline; }

.toast { position: fixed; left: 50%; bottom: 24px; z-index: 200; transform: translateX(-50%); max-width: calc(100% - 32px); padding: 12px 18px; background: var(--ink); color: #fff; box-shadow: var(--shadow); }

.scrim { position: fixed; inset: 0; z-index: 40; background: rgba(0, 0, 0, .45); }

/* ---------- Footer */
.site-footer { background: #0b0b0b; color: #fff; padding: 40px 0; }
.footer-inner { display: flex; justify-content: space-between; align-items: flex-start; flex-wrap: wrap; gap: 24px; }
.site-footer .logo { font-size: 22px; }
.site-footer .muted { color: #8d8d8d; margin: 8px 0 0; }
.footer-links { display: grid; grid-template-columns: repeat(2, minmax(0, auto)); gap: 8px 32px; }
.footer-links a { text-decoration: none; color: #ddd; }
.footer-links a:hover { color: #fff; }
.footer-contacts { display: flex; flex-direction: column; gap: 8px; }
.footer-contacts a { text-decoration: none; color: #ddd; }
.footer-contacts a:hover { color: #fff; }
.footer-contacts a.footer-tg { display: inline-flex; align-items: center; align-self: flex-start; gap: 10px; padding: 10px 18px; border: 1px solid #3a3a3a; border-radius: 999px; color: #fff; font-size: 16px; }
.footer-contacts a.footer-tg:hover { border-color: #fff; }
.footer-tg svg { width: 22px; height: 22px; color: #2aabee; }

/* Плаваюча кнопка Telegram: завжди в правому нижньому куті, під вікнами товару й меню, щоб не заважати кнопкам у них */
.tg-float { position: fixed; right: 22px; bottom: 22px; z-index: 35; display: grid; place-items: center; width: 58px; height: 58px; border-radius: 50%; background: #2aabee; color: #fff; text-decoration: none; box-shadow: 0 6px 18px rgba(0, 0, 0, .28); transition: transform .15s ease, box-shadow .15s ease; }
.tg-float svg { width: 30px; height: 30px; margin-right: 2px; }
.tg-float:hover { transform: scale(1.07); box-shadow: 0 8px 22px rgba(0, 0, 0, .34); }
@media (max-width: 700px) {
  .tg-float { right: 14px; bottom: calc(14px + env(safe-area-inset-bottom, 0px)); width: 54px; height: 54px; }
  .site-footer { padding-bottom: 84px; }  /* щоб кнопка не закривала низ підвалу */
}

/* ---------- Responsive */
@media (max-width: 1440px) {
  .toplinks, .toplinks-pages { gap: 6px 14px; font-size: 13px; }
}

@media (max-width: 1300px) {
  .header-main { gap: 28px; }
  .schedule { font-size: 14px; }
}

@media (max-width: 1150px) {
  .header-phone { font-size: 18px; }
  .schedule { display: none; }
  .layout { grid-template-columns: 240px minmax(0, 1fr); gap: 20px; }
  .filters { padding: 20px; }
}

/* Меню-«бургер» (видно лише на телефоні) */
.menu-btn { display: none; place-items: center; width: 40px; height: 40px; margin-left: -8px; padding: 0; border: 0; background: none; color: #fff; flex: none; }
.menu-btn svg { width: 26px; height: 26px; }
.menu-drawer { position: fixed; top: 0; bottom: 0; left: 0; z-index: 60; width: min(340px, 88vw); overflow-y: auto; overscroll-behavior: contain; background: #fff; box-shadow: var(--shadow); }
.menu-drawer .drawer-head { position: sticky; top: 0; z-index: 1; background: #fff; text-transform: uppercase; letter-spacing: .06em; }
.menu-section { display: flex; flex-direction: column; padding: 8px 0; border-bottom: 1px solid var(--line); }
.menu-section:last-child { border-bottom: 0; }
.menu-section > a, .menu-section > button, .menu-contacts .menu-note { display: flex; align-items: center; gap: 8px; min-height: 46px; padding: 0 20px; border: 0; background: none; text-align: left; text-decoration: none; font-size: 16px; color: var(--ink); }
.menu-main > a, .menu-main > button { text-transform: uppercase; letter-spacing: .04em; font-weight: 500; }
.menu-section > .active { background: #f3f3f3; }
.menu-contacts > a { font-weight: 500; }
.menu-contacts > a.tel { font-size: 18px; }
.menu-contacts .menu-note { min-height: 0; padding-top: 6px; padding-bottom: 10px; font-size: 14px; color: var(--muted); }

@media (max-width: 900px) {
  .container { padding: 0 16px; }
  /* верхній рядок переїжджає в меню */
  .topbar { display: none; }
  .menu-btn { display: grid; }
  .header-main { flex-wrap: wrap; gap: 10px 12px; min-height: 0; padding-top: 10px; padding-bottom: 12px; }
  .logo { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; font-size: 20px; }
  .phone-box { margin-left: 0; }
  .header-phone { font-size: 15px; gap: 6px; }
  .header-phone svg { width: 20px; height: 20px; }
  .header-phone.is-tg { padding: 8px 14px; font-size: 14px; }
  .search { order: 3; flex-basis: 100%; max-width: none; margin: 0; }
  .header-nav { justify-content: space-around; gap: 16px; height: 48px; }
  .header-nav a { font-size: 14px; }
  .crumbs { padding-top: 14px; }
  h1 { font-size: 24px; }
  .page-head { margin: 10px 0 14px; }
  .sync { font-size: 12px; }

  /* поля з шрифтом менше 16px iPhone збільшує при натисканні — тому 16px */
  input, select, textarea { font-size: 16px !important; }

  .layout { grid-template-columns: minmax(0, 1fr); }
  .filters { position: fixed; top: 0; bottom: 0; left: 0; z-index: 50; width: min(360px, 88vw); max-height: none; padding: 0 20px 20px; overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain; transform: translateX(-100%); transition: transform .25s ease; }
  .filters.open { transform: none; box-shadow: var(--shadow); }
  .filters-head { display: flex; align-items: center; justify-content: space-between; position: sticky; top: 0; z-index: 1; margin: 0 -20px 16px; padding: 10px 8px 10px 20px; background: #fff; border-bottom: 1px solid var(--line); font-size: 18px; font-weight: 500; }
  .filters-foot { position: sticky; bottom: -20px; margin: 24px -20px -20px; padding: 12px 20px 20px; background: #fff; border-top: 1px solid var(--line); }
  .filters-foot .filters-apply { display: inline-flex; }

  /* «Фільтри» й сортування — дві рівні кнопки в рядок */
  .toolbar { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px; margin-bottom: 10px; }
  .filters-toggle { display: inline-flex; width: 100%; padding: 10px 12px; }
  .sort { display: block; margin: 0; }
  .sort > span { display: none; }
  .sort select { width: 100%; height: 100%; min-height: 44px; }
  .found { grid-column: 1 / -1; order: 3; font-size: 13px; }
  .quick-sizes { display: flex; gap: 6px; overflow-x: auto; margin: 0 -16px 12px; padding: 4px 16px; scrollbar-width: none; }
  .quick-sizes::-webkit-scrollbar { display: none; }
  .quick-sizes .size-opt { flex: none; min-width: 52px; padding: 9px 10px 8px; }

  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .card-media-wrap { margin: 8px 8px 0; }
  .card-media-wrap .wish-toggle { width: 32px; height: 32px; top: 6px; right: 6px; }
  .card-media-wrap .wish-toggle svg { width: 18px; height: 18px; }
  .card-body { padding: 10px 10px 12px; gap: 8px; }
  .card-brand { font-size: 11px; }
  .card-title { font-size: 14px; }
  .chip { min-width: 34px; padding: 5px 4px; font-size: 12px; }
  .card-foot { flex-direction: column; flex-wrap: nowrap; align-items: stretch; }
  .card-foot .btn { flex: none; width: 100%; }
  .card-foot .price { white-space: normal; }  /* ціна й стара ціна на вузькому екрані можуть переноситись, а не вилазити за картку */
  .price { font-size: 16px; }

  .footer-inner { flex-direction: column; gap: 20px; }
}

/* планшет або телефон горизонтально: три товари в ряд */
@media (min-width: 600px) and (max-width: 900px) {
  .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
}

@media (max-width: 520px) {
  .header-phone span { display: none; }
  .header-phone, .header-phone.is-tg { display: grid; place-items: center; width: 40px; height: 40px; padding: 0; border: 0; }
  .header-phone svg { width: 22px; height: 22px; }
  .badges { top: 6px; left: 6px; right: 44px; }
  .badge { padding: 3px 6px; font-size: 10px; white-space: nowrap; }
  .badge-tag { display: none; }
}

@media (max-width: 360px) {
  .container { padding: 0 12px; }
  .header-main { gap: 10px 6px; }
  .logo { font-size: 15px; letter-spacing: .03em; }
  .grid { gap: 6px; }
  .card-media-wrap { margin: 6px 6px 0; }
  .card-body { padding: 8px 8px 10px; }
  .chip { min-width: 30px; font-size: 11px; }
  .quick-sizes { margin: 0 -12px 12px; padding: 4px 12px; }
}

/* Картка товару й сторінки на телефоні — на весь екран, хрестик завжди видно */
@media (max-width: 700px) {
  .modal { padding: 0; place-items: stretch; }
  .modal-card { grid-template-columns: minmax(0, 1fr); align-content: start; width: 100%; height: 100vh; height: 100dvh; max-height: none; overscroll-behavior: contain; }
  .modal-close { position: fixed; top: 10px; right: 10px; z-index: 5; width: 40px; height: 40px; border-radius: 50%; background: rgba(255, 255, 255, .92); box-shadow: 0 2px 10px rgba(0, 0, 0, .15); font-size: 26px; }
  .m-photo { aspect-ratio: 1; }
  .modal-info { padding: 18px 16px 28px; gap: 12px; }
  .m-top { margin-right: 0; }
  .m-title { font-size: 21px; }
  .m-size { min-width: 52px; padding: 12px 8px; }
  .m-actions { grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); }
  .page-body { padding: 20px 16px 28px; }
  .page-body .m-title { margin-right: 44px; }
}

/* Телефон лежить горизонтально (низький екран): картка на весь екран,
   фото зліва стоїть на місці, інформація справа прокручується, хрестик завжди видно */
@media (max-height: 520px) and (min-width: 560px) {
  .modal { padding: 0; place-items: stretch; }
  .modal-card { width: 100%; height: 100vh; height: 100dvh; max-height: none; align-content: start; overscroll-behavior: contain; }
  #modal .modal-card { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .modal-close { position: fixed; top: 8px; right: 8px; z-index: 5; width: 40px; height: 40px; border-radius: 50%; background: rgba(255, 255, 255, .92); box-shadow: 0 2px 10px rgba(0, 0, 0, .15); font-size: 26px; }
  .modal-media { position: sticky; top: 0; align-self: start; height: 100vh; height: 100dvh; }
  .m-photo { flex: 1; min-height: 0; aspect-ratio: auto; }
  .m-photo img { object-fit: contain; }
  .m-thumb { width: 52px; height: 52px; }
  .modal-info { padding: 16px 20px 24px; gap: 12px; }
  .m-top { margin-right: 44px; }
  .m-title { font-size: 20px; }
  .page-body { padding: 18px 20px 24px; }
  .page-body .m-title { margin-right: 44px; }
}

/* ---------- Оформлення замовлення (order.html) */
.order-page .header-main { min-height: 84px; }
.order-page .header-phone { margin-left: auto; text-decoration: none; }
.order-page .logo { flex: none; }
.order-main { padding-bottom: 64px; }
.order-title { margin: 14px 0 24px; }
.order-layout { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 24px; align-items: start; }
.order-summary { order: 2; position: sticky; top: 16px; display: grid; gap: 12px; padding: 16px; background: #fff; }
.order-layout.is-empty { grid-template-columns: minmax(0, 520px); }
.order-layout .order-summary.order-empty { position: static; grid-template-columns: minmax(0, 1fr); padding: 20px; }
.order-empty p { margin: 0; }
.order-empty .btn { justify-self: start; }
/* Підсумок замовлення на комп'ютері стиснуто, щоб фото, розміри й застереження вміщались в один екран ноутбука
   і панель, що «липне» при прокрутці, не обрізалась знизу */
/* Фото лежить абсолютно в рамці з визначеним співвідношенням сторін: так object-fit: contain точно показує його ЦІЛКОМ
   (з height: 100% у рамці без заданої висоти фото вилазило за межі й обрізалось) */
.os-photo { position: relative; aspect-ratio: 4 / 3; display: grid; place-items: center; overflow: hidden; background: var(--ph); }
.os-photo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.order-summary .m-size { min-width: 44px; padding: 9px 6px; font-size: 14px; }
.order-summary .m-sizes { gap: 5px; }
.order-summary .m-fit { margin: 2px 0 0; padding: 8px 10px; font-size: 12.5px; line-height: 1.45; }
/* чим нижчий екран, тим нижче рамка фото (фото в ній усе одно видно цілком) */
@media (min-width: 901px) and (max-height: 760px) {
  .os-photo { aspect-ratio: 3 / 2; }
  .os-name { font-size: 18px; }
}
@media (min-width: 901px) and (max-height: 660px) {
  .os-photo { aspect-ratio: 2 / 1; }
}
.os-photo .ph svg { width: 60%; }
.os-info { display: flex; flex-direction: column; gap: 10px; }
.os-name { font-size: 20px; line-height: 1.3; }
.os-info .m-meta { margin-top: -4px; }
.m-note .warn { color: var(--hot); }
.order-form { order: 1; display: flex; flex-direction: column; gap: 20px; padding: 24px; background: #fff; }
.order-form fieldset { display: flex; flex-direction: column; gap: 14px; margin: 0; padding: 0; border: 0; }
.order-form legend { margin-bottom: 4px; padding: 0; font-size: 18px; font-weight: 500; }
.order-form .field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: #555; }
.order-form .field > span, .order-form .field > label { font-weight: 500; }
.order-form input:not([type=radio]), .order-form select, .order-form textarea { width: 100%; padding: 12px; border: 1px solid #cfcfcf; border-radius: 2px; background: #fff; font-size: 16px; color: var(--ink); }
.order-form input:focus, .order-form select:focus, .order-form textarea:focus { outline: 2px solid var(--ink); outline-offset: -1px; }
.order-form input:disabled { background: #f6f6f6; color: #999; }
.order-form textarea { resize: vertical; }
.o-row2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; }
.o-kinds { display: flex; gap: 8px; }
.o-kind { flex: 1; display: flex; align-items: center; gap: 10px; padding: 12px 14px; border: 1px solid #cfcfcf; cursor: pointer; font-size: 15px; color: var(--ink); }
.o-kind:has(input:checked) { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.o-kind input { width: 18px; height: 18px; margin: 0; accent-color: var(--ink); }
.combo { position: relative; }
.combo-list { position: absolute; top: 100%; left: 0; right: 0; z-index: 20; max-height: 320px; overflow-y: auto; background: #fff; border: 1px solid #cfcfcf; border-top: 0; box-shadow: var(--shadow); }
.combo-list button { display: flex; flex-direction: column; gap: 2px; width: 100%; padding: 11px 12px; border: 0; border-bottom: 1px solid #f0f0f0; background: #fff; text-align: left; font-size: 14px; line-height: 1.35; color: var(--ink); }
.combo-list button:hover, .combo-list button.on { background: #f3f3f3; }
.combo-list b { font-weight: 500; }
.combo-list small { color: var(--muted); font-size: 12px; }
.combo-msg { padding: 10px 12px; color: var(--muted); font-size: 13px; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.o-error { margin: 0; color: var(--hot); font-size: 14px; }
.o-error:empty { display: none; }
.o-submit { padding: 16px; font-size: 16px; font-weight: 500; }
.o-submit:disabled { opacity: .6; cursor: default; }
.o-note { margin: -8px 0 0; font-size: 13px; }
.done-card { display: flex; flex-direction: column; gap: 10px; max-width: 640px; padding: 32px; background: #fff; }
.done-card p { margin: 0; line-height: 1.5; }
.done-num { font-size: 22px; font-weight: 500; }
.done-card .btn { align-self: flex-start; margin-top: 10px; }

@media (max-width: 900px) {
  .order-page .header-main { min-height: 60px; flex-wrap: nowrap; }
  .order-layout { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .order-summary { order: 0; position: static; grid-template-columns: 96px minmax(0, 1fr); gap: 12px; padding: 12px; }
  .os-photo { align-self: start; aspect-ratio: 1; }
  .os-photo img { object-fit: cover; }
  .os-name { font-size: 16px; }
  .os-info { gap: 8px; }
  .order-form { padding: 18px 16px; }
  .done-card { padding: 22px 16px; }
}

@media (max-width: 420px) {
  .o-row2 { grid-template-columns: 1fr; }
  .order-summary { grid-template-columns: 72px minmax(0, 1fr); }
}
