/* Магазин: каталог, картки товарів, швидкий перегляд, сторінка товару.
   Працює поверх styles.css і використовує ті самі токени. */

/* ---------- Банер каталогу ---------- */
.cat-hero { position: relative; isolation: isolate; overflow: hidden; background: var(--ink); color: var(--on-dark); min-height: clamp(340px, 46vh, 460px); display: flex; align-items: flex-end; padding: 56px 0 44px; }
.cat-hero-bg { position: absolute; inset: 0; z-index: -2; }
.cat-hero-bg img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transform: scale(1.08); transition: opacity 1s var(--ease), transform 7s var(--ease); }
.cat-hero-bg img.on { opacity: 1; transform: scale(1); }
.cat-hero::before { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(90deg, rgb(10 9 7 / .9) 0%, rgb(10 9 7 / .62) 48%, rgb(10 9 7 / .25) 100%), linear-gradient(0deg, rgb(10 9 7 / .7), transparent 55%); }
.cat-hero .crumbs { color: var(--on-dark-2); margin-bottom: 22px; }
.cat-hero .crumbs a:hover { color: #fff; }
.cat-hero h1 { font-size: clamp(42px, 6.4vw, 88px); line-height: 1; letter-spacing: -.01em; max-width: 14ch; }
.cat-hero h1 em { font-style: italic; color: var(--accent); }
.cat-hero-lead { margin-top: 18px; max-width: 54ch; font-size: clamp(16px, 1.4vw, 19px); color: rgb(243 239 230 / .78); }
.cat-hero-stats { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 28px; }
.cat-hero-stats span { display: inline-flex; align-items: center; gap: 8px; padding: 9px 16px; border: 1px solid rgb(255 255 255 / .18); border-radius: var(--pill); background: rgb(255 255 255 / .06); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); font-size: 14px; color: rgb(243 239 230 / .9); }
.cat-hero-stats b { color: #fff; font-weight: 700; }
.cat-hero-stats i { color: var(--accent); font-size: 17px; }
.cat-hero h1, .cat-hero-lead { transition: opacity .45s var(--ease), transform .6s var(--ease); }
.cat-hero.swap h1, .cat-hero.swap .cat-hero-lead { opacity: 0; transform: translateY(14px); }

/* ---------- Стрічка категорій ---------- */
.cat-rail { position: sticky; top: var(--nav-h); z-index: 40; background: rgb(247 244 238 / .9); backdrop-filter: saturate(160%) blur(16px); -webkit-backdrop-filter: saturate(160%) blur(16px); border-bottom: 1px solid var(--line); }
.cat-rail-row { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; padding: 10px 0; }
.cat-rail-row::-webkit-scrollbar { display: none; }
.rcat { position: relative; flex: none; display: flex; align-items: center; gap: 10px; padding: 8px 16px 8px 8px; border: 0; border-radius: var(--pill); background: transparent; color: var(--text-2); font-size: 14px; font-weight: 600; white-space: nowrap; transition: background .25s, color .25s; }
.rcat i { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--mist); color: var(--accent-press); font-size: 18px; transition: background .3s, color .3s, transform .4s var(--ease); }
.rcat small { font-weight: 500; color: var(--text-3); }
.rcat:hover { background: var(--mist); color: var(--text); }
.rcat:hover i { transform: rotate(-8deg) scale(1.06); }
.rcat[aria-pressed="true"] { background: var(--ink); color: #fff; }
.rcat[aria-pressed="true"] i { background: var(--accent); color: var(--ink); }
.rcat[aria-pressed="true"] small { color: rgb(255 255 255 / .6); }

/* ---------- Сітка магазину ---------- */
.shop { display: grid; grid-template-columns: 270px 1fr; gap: 44px; padding: 40px 0 110px; align-items: start; }
.shop-side { position: sticky; top: calc(var(--nav-h) + 76px); max-height: calc(100dvh - var(--nav-h) - 96px); overflow: auto; scrollbar-width: thin; display: grid; gap: 26px; padding-right: 6px; }
.side-head { display: none; }
.side-scrim { display: none; }
.shop > .shop-side, .shop > .shop-main { min-width: 0; }
.side-block h3 { font-family: var(--font); font-size: 12px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: var(--text-3); margin-bottom: 12px; }
.side-search { position: relative; }
.side-search input { width: 100%; height: 48px; border: 1px solid var(--line); border-radius: var(--pill); background: #fff; padding: 0 16px 0 44px; font: inherit; font-size: 15px; color: var(--text); transition: border-color .2s, box-shadow .2s; }
.side-search input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.side-search i { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); color: var(--text-3); font-size: 18px; }
.brand-find { width: 100%; height: 38px; border: 0; border-bottom: 1px solid var(--line); background: transparent; font: inherit; font-size: 14px; margin-bottom: 8px; color: var(--text); }
.brand-find:focus { outline: none; border-color: var(--accent); }
.brand-list { display: grid; gap: 2px; max-height: 330px; overflow: auto; scrollbar-width: thin; }
.bcheck { display: flex; align-items: center; gap: 10px; padding: 7px 8px; border-radius: 8px; cursor: pointer; font-size: 14px; color: var(--text-2); transition: background .2s, color .2s; }
.bcheck:hover { background: var(--mist); color: var(--text); }
.bcheck input { appearance: none; width: 18px; height: 18px; border: 1.5px solid var(--line); border-radius: 5px; background: #fff; display: grid; place-items: center; flex: none; transition: background .2s, border-color .2s; }
.bcheck input:checked { background: var(--ink); border-color: var(--ink); }
.bcheck input:checked::after { content: ""; width: 9px; height: 5px; border: 2px solid #fff; border-top: 0; border-right: 0; transform: rotate(-45deg) translate(1px, -1px); }
.bcheck small { margin-left: auto; color: var(--text-3); }
.switch { display: flex; align-items: center; justify-content: space-between; gap: 12px; cursor: pointer; font-size: 14px; color: var(--text-2); padding: 4px 8px; }
.switch input { appearance: none; width: 40px; height: 24px; border-radius: 99px; background: var(--line); position: relative; flex: none; transition: background .25s; cursor: pointer; }
.switch input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgb(0 0 0 / .2); transition: transform .3s var(--ease); }
.switch input:checked { background: var(--accent); }
.switch input:checked::after { transform: translateX(16px); }
.side-cta { position: relative; overflow: hidden; border-radius: var(--r-lg); background: var(--ink); color: var(--on-dark); padding: 22px; isolation: isolate; }
.side-cta::before { content: ""; position: absolute; inset: 0; z-index: -1; background: url("../img/store/g2.jpg") center / cover; opacity: .28; }
.side-cta b { display: block; font-family: var(--display); font-weight: 400; font-size: 21px; line-height: 1.2; }
.side-cta p { font-size: 14px; color: var(--on-dark-2); margin: 8px 0 16px; }
.side-cta .btn { min-height: 44px; width: 100%; padding: 0 16px; }

.shop-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-bottom: 26px; }
.shop-count { font-size: 15px; color: var(--text-2); }
.shop-count b { color: var(--text); }
.active-f { display: flex; flex-wrap: wrap; gap: 8px; flex: 1; }
.fchip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 8px 6px 12px; border-radius: var(--pill); background: var(--ink); color: #fff; font-size: 13px; border: 0; }
.fchip i { font-size: 13px; opacity: .7; }
.fchip:hover i { opacity: 1; }
.fclear { background: none; border: 0; color: var(--accent-press); font-size: 13px; font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
.shop-tools { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.shop-tools .select { height: 42px; border-radius: var(--pill); border: 1px solid var(--line); background: #fff; padding: 0 16px; font: inherit; font-size: 14px; color: var(--text); }
.density { display: inline-flex; border: 1px solid var(--line); border-radius: var(--pill); padding: 3px; background: #fff; }
.density button { width: 36px; height: 34px; border: 0; border-radius: var(--pill); background: transparent; color: var(--text-3); font-size: 17px; display: grid; place-items: center; }
.density button[aria-pressed="true"] { background: var(--ink); color: #fff; }
.btn-filter { display: none; align-items: center; gap: 8px; height: 42px; padding: 0 16px; border-radius: var(--pill); border: 1px solid var(--line); background: #fff; font-size: 14px; font-weight: 600; }
.btn-filter span { min-width: 20px; height: 20px; border-radius: 99px; background: var(--accent); color: var(--ink); font-size: 11px; display: grid; place-items: center; }
.btn-filter span:empty { display: none; }

.pgrid { display: grid; grid-template-columns: repeat(var(--cols, 3), minmax(0, 1fr)); gap: 34px 22px; }
.shop-more { display: flex; flex-direction: column; align-items: center; gap: 14px; margin-top: 54px; }
.shop-progress { width: 220px; height: 2px; background: var(--line); border-radius: 2px; overflow: hidden; }
.shop-progress i { display: block; height: 100%; background: var(--accent); transition: width .5s var(--ease); }
.shop-more small { color: var(--text-3); font-size: 13px; }

@media (max-width: 1100px) { .pgrid { --cols: 3 !important; } .density { display: none; } }
@media (max-width: 1000px) {
  .shop { grid-template-columns: 1fr; padding-top: 24px; }
  .btn-filter { display: inline-flex; }
  .shop-side { position: fixed; top: 0; bottom: 0; left: 0; z-index: 90; width: min(360px, 88vw); max-height: none; background: var(--paper); padding: 20px; transform: translateX(-104%); transition: transform .45s var(--ease); box-shadow: 30px 0 60px rgb(0 0 0 / .2); }
  body.side-open .shop-side { transform: none; }
  .side-scrim { display: block; position: fixed; inset: 0; z-index: 89; background: rgb(10 9 7 / .5); opacity: 0; visibility: hidden; transition: opacity .35s, visibility .35s; }
  body.side-open .side-scrim { opacity: 1; visibility: visible; }
  .side-head { display: flex; align-items: center; justify-content: space-between; font-family: var(--display); font-size: 26px; }
}
@media (max-width: 760px) { .pgrid { --cols: 2 !important; gap: 24px 12px; } .shop-tools { margin-left: 0; width: 100%; } .shop-tools .select { flex: 1; } }

/* ---------- Картка товару ---------- */
.pcard { position: relative; display: flex; flex-direction: column; min-width: 0; }
@media (prefers-reduced-motion: no-preference) { .pgrid .pcard { animation: pcard-in .8s var(--ease) both; animation-delay: calc(var(--i, 0) * 45ms); } }
@keyframes pcard-in { from { opacity: 0; transform: translateY(26px); } }
.pcard-media { position: relative; aspect-ratio: 1; border-radius: var(--r-lg); background: #fff; overflow: hidden; box-shadow: 0 0 0 1px rgb(23 20 15 / .06); transition: box-shadow .5s var(--ease), transform .5s var(--ease); }
.pcard-media > a { position: absolute; inset: 0; display: block; }
.pcard-media img { width: 100%; height: 100%; object-fit: contain; transition: transform 1.1s var(--ease); }
.pcard-media .ph-media { border-radius: 0; }
.pcard:hover .pcard-media { box-shadow: 0 0 0 1px rgb(176 141 79 / .35), 0 26px 50px -18px rgb(23 20 15 / .28); transform: translateY(-4px); }
.pcard:hover .pcard-media img { transform: scale(1.07); }
.pcard-badge { position: absolute; top: 12px; left: 12px; padding: 5px 10px; border-radius: var(--pill); background: var(--ink); color: var(--accent); font-size: 10.5px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; pointer-events: none; }
.pcard-qv { position: absolute; left: 12px; right: 12px; bottom: 12px; height: 44px; border: 0; border-radius: var(--pill); background: rgb(18 16 12 / .82); color: #fff; backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); font-size: 13px; font-weight: 600; display: flex; align-items: center; justify-content: center; gap: 8px; opacity: 0; transform: translateY(14px); transition: opacity .35s var(--ease), transform .45s var(--ease), background .2s; }
.pcard-qv:hover { background: var(--ink); }
.pcard:hover .pcard-qv, .pcard-qv:focus-visible { opacity: 1; transform: none; }
@media (hover: none) { .pcard-qv { display: none; } }
.pcard-body { display: flex; flex-direction: column; flex: 1; padding: 16px 2px 0; }
.pcard-brand { font-size: 11px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: var(--accent-press); }
.pcard-title { font-family: var(--font); font-weight: 600; font-size: 15.5px; line-height: 1.38; letter-spacing: 0; margin-top: 6px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.pcard-title a { background: linear-gradient(currentColor, currentColor) 0 100% / 0 1px no-repeat; transition: background-size .5s var(--ease); }
.pcard:hover .pcard-title a { background-size: 100% 1px; }
.pcard-foot { margin-top: auto; padding-top: 12px; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.pcard-price { font-weight: 700; font-size: 15px; }
.pcard-price.ask { font-weight: 500; color: var(--text-2); font-size: 14px; }
.pcard-add { width: 42px; height: 42px; flex: none; border: 1px solid var(--line); background: #fff; }
.pcard-add:hover { border-color: var(--ink); background: var(--ink); color: #fff; }
.pcard-add.is-added { border-color: var(--accent); }
.rail .pcard { width: 100%; }

/* ---------- Швидкий перегляд ---------- */
.qv { position: fixed; inset: 0; z-index: 85; display: grid; place-items: center; padding: 24px; }
.qv-scrim { position: absolute; inset: 0; background: rgb(10 9 7 / .6); backdrop-filter: blur(6px); animation: fade .3s var(--ease); }
.qv-panel { position: relative; width: min(1040px, 100%); max-height: calc(100dvh - 48px); overflow: auto; display: grid; grid-template-columns: 1.05fr 1fr; background: var(--paper); border-radius: 18px; box-shadow: 0 40px 100px rgb(0 0 0 / .45); animation: qv-in .55s var(--ease); }
@keyframes qv-in { from { opacity: 0; transform: translateY(24px) scale(.97); } }
.qv-x { position: absolute; top: 14px; right: 14px; z-index: 2; background: #fff; }
.qv-panel > * { min-width: 0; }
.qv-media { background: #fff; aspect-ratio: 1; display: grid; place-items: center; width: 100%; overflow: hidden; }
.qv-media img { width: 100%; height: 100%; object-fit: contain; }
.qv-info { padding: 44px 40px 36px; display: flex; flex-direction: column; }
.qv-info h2 { font-size: clamp(26px, 2.6vw, 34px); line-height: 1.15; margin: 10px 0 10px; }
.qv-meta { font-size: 13px; color: var(--text-3); }
.qv-price { font-family: var(--display); font-size: 28px; margin: 22px 0 10px; }
.qv-desc { color: var(--text-2); font-size: 15px; display: -webkit-box; -webkit-line-clamp: 6; -webkit-box-orient: vertical; overflow: hidden; }
.qv-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 26px; }
.qv-actions .btn { flex: 1; min-width: 160px; }
.qv-perks { list-style: none; margin: 26px 0 0; padding: 20px 0 0; border-top: 1px solid var(--line); display: grid; gap: 10px; font-size: 14px; color: var(--text-2); }
.qv-perks i { color: var(--accent-press); font-size: 18px; vertical-align: -3px; margin-right: 8px; }
@media (max-width: 800px) {
  .qv { padding: 0; place-items: end stretch; }
  .qv-panel { grid-template-columns: 1fr; border-radius: 18px 18px 0 0; max-height: 92dvh; animation: sheet-in .5s var(--ease); }
  .qv-media { aspect-ratio: 4 / 3; }
  .qv-info { padding: 24px 22px 28px; }
}
@keyframes sheet-in { from { transform: translateY(100%); } }

/* ---------- Сторінка товару ---------- */
.product-media[data-zoom] { cursor: zoom-in; }
.product-media[data-zoom] img { transition: transform .35s var(--ease); }
.product-media.zooming img { transform: scale(2.1); }
.specs { margin: 0 0 28px; display: grid; grid-template-columns: 1fr 1fr; gap: 0 24px; border-top: 1px solid var(--line); }
.specs div { padding: 14px 0; border-bottom: 1px solid var(--line); }
.specs dt { font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--text-3); }
.specs dd { margin: 4px 0 0; font-weight: 600; font-size: 15px; }
.specs dd a { color: var(--accent-press); }
.acc { border-top: 1px solid var(--line); }
.acc details { border-bottom: 1px solid var(--line); }
.acc summary { list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; padding: 18px 0; font-weight: 700; font-size: 16px; }
.acc summary::-webkit-details-marker { display: none; }
.acc summary i { transition: transform .35s var(--ease); color: var(--accent-press); }
.acc details[open] summary i { transform: rotate(45deg); }
.acc details > div { padding: 0 0 20px; color: var(--text-2); font-size: 15.5px; }
.acc details > div p + p { margin-top: 10px; }
@media (max-width: 600px) { .specs { grid-template-columns: 1fr; } }
