/* ====== Ozon proxy — визуальная реплика ====== */
:root {
  --ozon-blue: #005bff;
  --ozon-blue-hover: #1f6fff;
  --green: #10c44c;
  --green-price: #10c44c;
  --pink: #f91155;
  --text: #070707;
  --text-2: rgba(0, 26, 52, .6);
  --text-3: rgba(0, 26, 52, .4);
  --line: #e6ecf0;
  --bg: #fff;
  --bg-2: #f7f8fa;
  --orange: #f1117e;
  --badge: #ff8c68;
  --badge-orange: #ffa000;
  --radius: 16px;
  --radius-sm: 8px;
  --radius-btn: 12px;
  --maxw: 1290px;
  font-synthesis: none;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
html, body { overflow-x: hidden; }
body {
  margin: 0;
  font-family: "Onest", arial, sans-serif;
  color: var(--text);
  background: var(--bg);
  font-size: 14px;
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
img { display: block; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }

.container { max-width: var(--maxw); margin: 0 auto; padding: 0 16px; }

/* ====== Header ====== */
.header { position: sticky; top: 0; z-index: 50; background: #fff; border-bottom: 1px solid var(--line); }
.header__top { display: flex; align-items: center; gap: 16px; padding: 16px 0; }
.logo { display: flex; flex-direction: column; line-height: 1; flex-shrink: 0; }
.logo__img { height: 24px; width: auto; }
.logo__sub { font-size: 8px; font-weight: 700; color: #f1117e; letter-spacing: .5px; margin-top: 3px; text-transform: uppercase; }

.btn-catalog {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--ozon-blue); color: #fff; font-weight: 400; height: 44px;
  padding: 10px 16px; border-radius: var(--radius-btn); white-space: nowrap; font-size: 14px;
}
.btn-catalog svg { width: 18px; height: 18px; }

.search { flex: 1; display: flex; align-items: stretch; min-width: 0; height: 40px;
  border: 2px solid var(--ozon-blue); border-radius: var(--radius-sm); overflow: hidden; background: #fff; }
.search__scope { display: flex; align-items: center; gap: 6px; padding: 0 12px; color: var(--text); font-weight: 400; border-right: 1px solid var(--line); white-space: nowrap; font-size: 14px; }
.search__input { flex: 1; border: none; outline: none; padding: 0 14px; font-size: 16px; min-width: 0; background: transparent; }
.search__clear { padding: 0 8px; color: var(--text-3); font-size: 20px; }
.search__btn { background: var(--ozon-blue); color: #fff; padding: 0 16px; display: flex; align-items: center; }
.search__btn svg { width: 20px; height: 20px; }

.header__icons { display: flex; align-items: center; gap: 20px; flex-shrink: 0; }
.hicon { position: relative; color: var(--text-2); display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 11px; }
.hicon svg { width: 26px; height: 26px; }
.hicon__badge { position: absolute; top: -6px; right: -8px; background: var(--orange); color: #fff; font-size: 10px; font-weight: 700; border-radius: 10px; min-width: 18px; height: 18px; display: flex; align-items: center; justify-content: center; padding: 0 4px; }
.hicon__badge--pink { background: #f91155; }

.header__nav { display: flex; align-items: center; gap: 22px; padding: 8px 0; font-size: 13px; color: var(--text); overflow-x: auto; }
.header__nav a { white-space: nowrap; display: inline-flex; align-items: center; gap: 5px; }
.header__nav .nav-addr { margin-left: auto; color: var(--ozon-blue); font-weight: 600; }

/* ====== Listing layout ====== */
.page { padding-top: 16px; padding-bottom: 60px; }
.listing { display: grid; grid-template-columns: 250px 1fr; gap: 24px; align-items: start; }

/* filters sidebar */
.filters { font-size: 14px; }
.filters__group { padding: 16px 0; border-bottom: 1px solid var(--line); }
.filters__group:first-child { padding-top: 0; }
.filters__title { font-size: 16px; font-weight: 700; margin: 0 0 12px; }
.filters__brand { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.filters__brand img, .filters__brand .ph { width: 32px; height: 32px; border-radius: 6px; object-fit: cover; background: var(--bg-2); }
.filters__row { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; color: var(--text); cursor: pointer; }
.filters__row input { width: 18px; height: 18px; accent-color: var(--ozon-blue); pointer-events: none; }
.filters__brand { cursor: pointer; }
.filters__val { flex: 1; min-width: 0; }
.filters__count { color: var(--muted, #9aa0a6); font-size: 13px; font-variant-numeric: tabular-nums; }
.filters__brand.is-on .ph { outline: 2px solid var(--ozon-blue); outline-offset: 1px; }
.filters__brand.is-on .filters__val { color: var(--ozon-blue); font-weight: 600; }
.filters__more { color: var(--ozon-blue); font-weight: 500; cursor: pointer; }
.grid__empty { grid-column: 1 / -1; padding: 48px 0; text-align: center; color: var(--muted, #9aa0a6); }

/* мобильные элементы фильтра (на десктопе скрыты) */
.results__bar { display: flex; align-items: center; gap: 12px; }
.filters-fab, .filters-panel__head, .filters-panel__apply, .filters-backdrop { display: none; }

/* product grid */
.results { min-width: 0; }
.result-count { font-size: 14px; color: var(--muted, #9aa0a6); margin-bottom: 12px; }
.grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px 10px; }

.card { background: #fff; border-radius: var(--radius); padding: 0; position: relative; transition: box-shadow .15s; display: flex; flex-direction: column; }
.card:hover { box-shadow: 0 8px 24px rgba(0,26,52,.10); z-index: 2; }
.card__fav { position: absolute; top: 8px; right: 8px; z-index: 4; width: 32px; height: 32px; color: var(--text-2); }
.card__fav svg { width: 26px; height: 26px; }
.card__imgwrap { position: relative; border-radius: 12px; overflow: hidden; aspect-ratio: 3/4; background: #fff; }
.card__img { width: 100%; height: 100%; object-fit: contain; }
/* Галерея ТОВАРА — нативный scroll-snap (работает плавно, НЕ трогаем). */
.gallery__track {
  display: flex; height: 100%; width: 100%;
  overflow-x: auto; overflow-y: hidden;
  scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.gallery__track::-webkit-scrollbar { display: none; }
.gallery__slide {
  flex: 0 0 100%; width: 100%; height: 100%; object-fit: contain;
  scroll-snap-align: center;
}
/* Карточки ВЫДАЧИ — тот же нативный scroll-snap, что и галерея товара (она
   работает идеально). Карточка теперь <div> (не <a>) — ссылка-обёртка на iOS
   конфликтовала с горизонтальным скроллом; навигация по JS-клику. */
.card__track {
  display: flex; height: 100%; width: 100%;
  overflow-x: auto; overflow-y: hidden;
  scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.card__track::-webkit-scrollbar { display: none; }
.card__slide {
  flex: 0 0 100%; width: 100%; height: 100%; object-fit: contain;
  scroll-snap-align: center;
}
.card { cursor: pointer; }
/* зоны-наведения только для мыши; на тач-экранах мешали бы нативному свайпу */
@media (hover: none) { .card__zones { display: none; } }
.card__zones { position: absolute; inset: 0; display: flex; z-index: 2; }
.card__zones span { flex: 1 1 0; }
.card__stock { position: absolute; left: 8px; bottom: 8px; background: var(--badge); color: #fff; font-size: 14px; font-weight: 400; padding: 2px 6px; border-radius: 8px; z-index: 3; pointer-events: none; }
.card__dots { position: absolute; left: 0; right: 0; bottom: 8px; display: flex; gap: 4px; justify-content: center; z-index: 3; pointer-events: none; }
.card__dots i { width: 6px; height: 6px; border-radius: 50%; background: rgba(0,0,0,.18); transition: background .1s; }
.card__dots i.on { width: 16px; border-radius: 3px; background: var(--ozon-blue); }
.card__body { padding: 12px 4px 8px; display: flex; flex-direction: column; flex: 1; }
.card__price { display: flex; align-items: baseline; gap: 6px; }
.card__price b { font-size: 20px; font-weight: 700; line-height: 24px; color: var(--green-price); }
.card__cheaper { display: inline-flex; align-items: center; gap: 4px; color: var(--green); font-size: 12px; font-weight: 600; margin: 4px 0; }
.card__cheaper svg { width: 14px; height: 14px; flex-shrink: 0; }
.card__title { color: var(--text); font-size: 14px; line-height: 18px; font-weight: 400; margin: 6px 0 8px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 36px; }
.card__rating { display: flex; align-items: center; gap: 5px; color: var(--text-2); font-size: 12px; font-weight: 600; margin-bottom: 10px; }
.card__rating b { font-weight: 600; color: var(--text); }
.card__rating .muted { color: var(--text-2); font-weight: 400; }
.card__rating .star { color: var(--badge-orange); }
.card__rating { margin-top: 0; }
.card__buy { width: 100%; min-height: 44px; background: var(--ozon-blue); color: #fff; font-weight: 400; padding: 10px 16px; border-radius: var(--radius-btn); display: flex; align-items: center; justify-content: center; gap: 8px; font-size: 14px; margin-top: auto; }
.card__buy svg { width: 18px; height: 18px; }
.card__buy:hover { background: var(--ozon-blue-hover); }

/* ====== Product page ====== */
.breadcrumbs { display: flex; gap: 8px; color: var(--text-2); font-size: 13px; padding: 12px 0; flex-wrap: wrap; }
.breadcrumbs a:hover { color: var(--ozon-blue); }

.pdp { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 24px; align-items: start; }
.pdp__cols { display: grid; grid-template-columns: minmax(360px, 460px) minmax(0, 1fr); gap: 24px; align-items: start; }
.pdp__head { display: flex; justify-content: space-between; gap: 16px; align-items: center; color: var(--text-2); font-size: 13px; padding-bottom: 8px; flex-wrap: wrap; }
.pdp__head .right { display: flex; gap: 16px; }

.gallery { display: flex; gap: 12px; }
.gallery__thumbs { display: flex; flex-direction: column; gap: 12px; }
.gallery__thumb { width: 48px; height: 64px; border-radius: var(--radius-sm); overflow: hidden; border: 2px solid transparent; background: #fff; flex-shrink: 0; }
.gallery__thumb img { width: 100%; height: 100%; object-fit: contain; }
.gallery__thumb.on { border-color: var(--ozon-blue); }
.gallery__main { flex: 1; border-radius: var(--radius); overflow: hidden; background: #fff; max-width: 400px; aspect-ratio: 3/4; position: relative; cursor: zoom-in; }
.gallery__main img { width: 100%; height: 100%; object-fit: contain; }

.pdp__info { display: flex; flex-direction: column; }
.pdp__title { font-size: 24px; font-weight: 700; margin: 8px 0 12px; line-height: 30px; color: var(--text); overflow-wrap: anywhere; }
.pdp__rating { display: flex; align-items: center; gap: 14px; font-size: 14px; margin-bottom: 16px; }
.pdp__rating .star { color: var(--badge-orange); }
.pdp__rating .q { color: var(--ozon-blue); display: inline-flex; align-items: center; gap: 5px; }

.pdp__layplate { display: flex; align-items: center; gap: 12px; background: var(--bg-2); border-radius: var(--radius); padding: 12px 14px; margin-bottom: 20px; }
.pdp__layplate .ic { width: 36px; height: 36px; border-radius: 8px; background: #ffe14d; display: flex; align-items: center; justify-content: center; font-size: 18px; }
.pdp__layplate small { color: var(--text-2); }

.specs { margin-top: 4px; }
.specs__head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.specs__head h2 { font-size: 20px; font-weight: 700; margin: 0; }
.specs__head a { color: var(--ozon-blue); font-weight: 600; }
.specs__row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 13px 0; align-items: baseline; }
.specs__row .k { color: var(--text-2); position: relative; }
.specs__row .k::after { content: ""; position: absolute; left: 0; right: 8px; bottom: 4px; border-bottom: 1px dotted var(--line); }
.specs__row .k span { background: #fff; padding-right: 6px; position: relative; }
.specs__row .v { color: var(--text); overflow-wrap: anywhere; }

.desc { margin-top: 40px; }
.desc h2 { font-size: 24px; font-weight: 700; line-height: 30px; margin: 0 0 16px; }
.desc__body { font-size: 14px; line-height: 22px; color: var(--text); max-width: 720px; }
.desc__body p { margin: 0 0 12px; }
.desc__body h3 { font-size: 16px; font-weight: 700; line-height: 22px; margin: 20px 0 8px; }
.desc__body ul { margin: 0 0 12px; padding-left: 22px; }
.desc__body li { margin: 3px 0; }
.desc__body b { font-weight: 700; }

/* Лайтбокс (зум фото) */
.lightbox { position: fixed; inset: 0; z-index: 100; background: rgba(255, 255, 255, .97); display: none; }
.lightbox.open { display: flex; }
.lightbox__close { position: absolute; top: 20px; right: 28px; width: 44px; height: 44px; border-radius: 50%; background: var(--bg-2); font-size: 24px; color: var(--text); display: flex; align-items: center; justify-content: center; z-index: 2; }
.lightbox__close:hover { background: #eceef1; }
.lightbox__nav { position: absolute; top: 50%; transform: translateY(-50%); width: 52px; height: 52px; border-radius: 50%; background: var(--bg-2); color: var(--text); font-size: 30px; line-height: 1; display: flex; align-items: center; justify-content: center; z-index: 2; }
.lightbox__nav:hover { background: #eceef1; }
.lightbox__nav--prev { left: 28px; }
.lightbox__nav--next { right: 28px; }
.lightbox__inner { margin: auto; display: flex; gap: 20px; align-items: center; padding: 24px; }
.lightbox__thumbs { display: flex; flex-direction: column; gap: 8px; max-height: 84vh; overflow-y: auto; }
.lightbox__thumb { width: 56px; height: 74px; border-radius: 8px; overflow: hidden; border: 2px solid transparent; background: #fff; flex-shrink: 0; }
.lightbox__thumb.on { border-color: var(--ozon-blue); }
.lightbox__thumb img { width: 100%; height: 100%; object-fit: contain; }
.lightbox__main { background: #fff; border-radius: 16px; overflow: hidden; }
.lightbox__main img { display: block; width: auto; height: auto; max-width: min(72vw, 760px); max-height: 88vh; object-fit: contain; }

/* buy box */
.buybox { position: sticky; top: 90px; display: flex; flex-direction: column; gap: 12px; }
.buybox__card { border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.buybox__price { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.buybox__price .now { background: var(--green-price); color: #fff; font-size: 27px; line-height: 32px; font-weight: 700; padding: 2px 8px; border-radius: 8px; }
.buybox__price .banks { color: var(--text-2); font-size: 13px; }
.buybox__old { color: var(--text-2); font-size: 14px; margin: 8px 0 16px; }
.buybox__later { background: #f1edff; border-radius: 12px; padding: 12px 14px; display: flex; align-items: center; gap: 10px; margin-bottom: 12px; font-size: 13px; }
.buybox__later b { background: #7b61ff; color: #fff; padding: 4px 8px; border-radius: 8px; font-size: 12px; }
.buybox__stars { background: var(--bg-2); border-radius: 12px; padding: 12px 14px; font-size: 13px; margin-bottom: 14px; display: flex; align-items: center; gap: 8px; }
.buybox__actions { display: flex; gap: 8px; }
.btn-cart { flex: 1; background: var(--ozon-blue); color: #fff; font-weight: 600; border-radius: 12px; padding: 12px; text-align: center; line-height: 1.2; }
.btn-cart small { display: block; font-weight: 400; font-size: 12px; opacity: .9; }
.btn-cart:hover { background: var(--ozon-blue-hover); }
.btn-fav-lg { width: 52px; border-radius: 12px; background: #e7f0ff; color: var(--ozon-blue); display: flex; align-items: center; justify-content: center; }
.btn-fav-lg svg { width: 24px; height: 24px; }
.btn-buynow { width: 100%; background: #e7f0ff; color: var(--ozon-blue); font-weight: 600; padding: 13px; border-radius: 12px; text-align: center; }

.delivery__title { font-size: 17px; font-weight: 700; margin-bottom: 12px; }
.delivery__row { display: flex; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.delivery__row:last-child { border-bottom: none; }
.delivery__row .free { margin-left: auto; font-weight: 600; }
.delivery__instock { color: var(--text); } .delivery__instock b { color: var(--pink); }

.shop { display: flex; flex-direction: column; gap: 10px; }
.shop__head { display: flex; align-items: center; justify-content: space-between; }
.shop__head b { font-size: 17px; }
.shop__brand { display: flex; align-items: center; gap: 10px; }
.shop__brand .ava { width: 40px; height: 40px; border-radius: 50%; background: #111; color:#fff; display:flex;align-items:center;justify-content:center; font-size:18px; }
.shop__rate { display: flex; align-items: center; gap: 6px; }
.shop__rate .badge { background: var(--bg-2); border-radius: 10px; padding: 4px 8px; display: flex; align-items: center; gap: 4px; font-weight: 700; }

.section-title { font-size: 24px; font-weight: 700; margin: 40px 0 16px; }

/* ====== Responsive ====== */
/* блок цены уходит вниз раньше, чтобы галерее+инфо хватало ширины (иначе заголовок зажимается) */
@media (max-width: 1120px) {
  .pdp { grid-template-columns: 1fr; }
  .buybox { position: static; max-width: 440px; }
  .gallery__main { max-width: 100%; }
}
@media (max-width: 1024px) {
  .grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 900px) {
  .listing { grid-template-columns: 1fr; }
  /* кнопка открытия фильтра */
  .filters-fab {
    display: inline-flex; align-items: center; gap: 6px;
    border: 1px solid var(--line); border-radius: 20px; padding: 8px 16px;
    font-size: 14px; font-weight: 600; color: var(--text); background: #fff;
  }
  .filters-fab::before { content: "⚙"; font-size: 15px; }
  /* off-canvas панель фильтра */
  .filters-panel {
    position: fixed; top: 0; left: 0; bottom: 0; width: 86%; max-width: 340px;
    z-index: 120; background: #fff; transform: translateX(-100%);
    transition: transform .25s ease; overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 14px 16px 16px; display: flex; flex-direction: column;
  }
  .filters-panel.open { transform: translateX(0); box-shadow: 0 0 40px rgba(0,0,0,.25); }
  .filters-panel__head {
    display: flex; align-items: center; justify-content: space-between;
    font-size: 18px; font-weight: 700; margin-bottom: 4px; padding-bottom: 8px;
    position: sticky; top: 0; background: #fff; z-index: 1;
  }
  .filters-panel__close { font-size: 30px; line-height: 1; width: 40px; height: 40px; color: var(--text-2); }
  .filters { flex: 1; }
  .filters-panel__apply {
    display: block; position: sticky; bottom: 0; margin-top: 12px;
    background: var(--ozon-blue); color: #fff; font-weight: 600;
    border-radius: 12px; padding: 14px; font-size: 15px;
  }
  .filters-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 110; }
  .filters-backdrop.open { display: block; }
  body.filters-locked { overflow: hidden; }
}
@media (max-width: 760px) {
  .pdp__cols { grid-template-columns: 1fr; }
  .buybox { max-width: none; }
}
@media (max-width: 768px) {
  .header__top { gap: 8px; flex-wrap: wrap; }
  .btn-catalog { padding: 10px 12px; font-size: 0; gap: 0; }
  .btn-catalog svg { width: 22px; height: 22px; }
  .search { order: 3; flex-basis: 100%; }
  .search__scope { display: none; }
  .header__icons { gap: 14px; margin-left: auto; }
  .hicon span { display: none; }
  .header__nav { display: none; }
  .grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .card__price b { font-size: 18px; }
  .pdp__title { font-size: 20px; line-height: 26px; }
  .gallery { flex-direction: column-reverse; }
  .gallery__thumbs { flex-direction: row; overflow-x: auto; }
}
@media (max-width: 420px) {
  .container { padding: 0 12px; }
  .card__title { font-size: 13px; }
  .specs__row { grid-template-columns: 1fr; gap: 0; }
  .specs__row .k::after { display: none; }
}
