/* Storefront engine: page blocks (home, category, product, search, 404). */

/* ---- hero + category grid ------------------------------------------------ */
.hero { background: var(--surface); border-bottom: 1px solid var(--line); }
.hero__in { display: grid; gap: 12px; padding-block: 28px 32px; }
.hero__title { font-size: clamp(22px, 2.4vw + 14px, 36px); line-height: 1.15; font-weight: 750; max-width: 24ch; letter-spacing: -0.01em; }
.hero__sub { color: var(--muted); max-width: 60ch; }
.search--hero { max-width: 720px; margin-top: 8px; }
.search--hero .search__input, .search--hero .search__btn { height: 52px; font-size: 17px; }
.cgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 8px; margin: 0; padding: 0; list-style: none; }
.cgrid__item { border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg); }
.cgrid__link { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 52px; padding: 10px 14px;
  color: var(--ink); text-decoration: none; font-weight: 650; border-radius: var(--radius); transition: background-color .15s ease; }
.cgrid__link:hover { background: var(--surface); color: var(--ink); }
.cgrid__n { min-width: 32px; padding: 1px 8px; text-align: center; font-size: 14px; color: var(--muted); background: var(--surface); border-radius: 999px; }
.cgrid__sub { display: grid; gap: 4px; margin: 0; padding: 0 14px 12px; list-style: none; font-size: 15px; }

/* ---- category page ------------------------------------------------------ */
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 16px; padding: 0; list-style: none; }
.chip { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 14px; border: 1px solid var(--line);
  border-radius: 999px; color: var(--ink); text-decoration: none; font-weight: 550; transition: background-color .15s ease, border-color .15s ease; }
.chip:hover { background: var(--surface); border-color: #b7c2c7; color: var(--ink); }
.chip__n { font-size: 13px; color: var(--muted); }
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-bottom: 8px; }
.toolbar__label { font-size: 14px; }
.seg { display: inline-flex; margin: 0; padding: 2px; list-style: none; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.seg__item { display: flex; align-items: center; min-height: 36px; padding: 0 12px; border-radius: 4px; color: var(--ink);
  text-decoration: none; font-size: 14px; font-weight: 550; white-space: nowrap; transition: background-color .15s ease; }
.seg__item:hover { background: #e4e9eb; color: var(--ink); }
.seg__item[aria-current] { background: var(--bg); box-shadow: 0 0 0 1px var(--line); font-weight: 700; }
.pager { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px; margin-top: 24px; }
.pager__list { display: flex; gap: 4px; margin: 0; padding: 0; list-style: none; }
.pager__n, .pager__btn { display: inline-flex; align-items: center; justify-content: center; min-width: 44px; min-height: 44px; padding: 0 12px;
  border: 1px solid var(--line); border-radius: var(--radius); color: var(--ink); text-decoration: none; font-variant-numeric: tabular-nums; }
.pager__n:hover, .pager__btn:hover { background: var(--surface); color: var(--ink); }
.pager__n.is-current { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 700; }
.pager__gap { display: flex; align-items: center; padding: 0 4px; color: var(--muted); }

/* ---- product -------------------------------------------------------------- */
.product { display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; padding-top: 8px; }
.product > *, .product__more > * { min-width: 0; }
@media (min-width: 960px) { .product { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 32px; align-items: start; } }
.product__info { display: grid; gap: 16px; min-width: 0; }
.product__title { font-size: clamp(19px, 1vw + 15px, 24px); line-height: 1.3; font-weight: 650; overflow-wrap: anywhere; }
.product.is-sold .product__title { color: var(--muted); }
.sold-banner { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 10px 12px; background: #fbefed; border: 1px solid #efc9c2; border-radius: var(--radius); }
.product__more { display: grid; grid-template-columns: minmax(0, 1fr); gap: 24px; margin-top: 32px; }
.product__more > .section { margin-top: 0; }
@media (min-width: 960px) { .product__more { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 32px; align-items: start; } .product__more > .req:only-child { grid-column: 2; } }

.pns { display: flex; flex-wrap: wrap; gap: 8px; }
.pn { display: inline-flex; align-items: center; gap: 4px; padding: 4px 4px 4px 12px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); max-width: 100%; }
.pn__num { font: 700 clamp(20px, 1vw + 16px, 24px)/1.3 var(--mono); letter-spacing: .02em; user-select: all; overflow-wrap: anywhere; }
.pn__copy { min-height: 36px; padding: 0 10px; font: 600 13px var(--font); color: var(--accent); background: transparent; border: 1px solid transparent;
  border-radius: 4px; cursor: pointer; transition: background-color .15s ease, color .15s ease; }
.pn__copy:hover { background: var(--bg); border-color: var(--line); }
.pn__copy.is-done { color: var(--ok); }

.buy { display: grid; gap: 12px; padding: 16px; border: 1px solid var(--line); border-radius: var(--radius); }
.buy__price { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 16px; }
.buy__value { font-size: 30px; line-height: 1.1; font-weight: 800; }
.buy__value--ask { font-size: 22px; }
.buy__value--sold { color: var(--muted); text-decoration: line-through; text-decoration-thickness: 2px; }
.buy__sku { font-size: 14px; }
.buy__form-link { justify-self: start; font-weight: 600; font-size: 15px; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 16px; font: inherit; font-weight: 650;
  border: 1px solid var(--line); border-radius: var(--radius); color: var(--ink); background: var(--bg); text-decoration: none; cursor: pointer;
  transition: background-color .15s ease, border-color .15s ease, color .15s ease; }
.btn:hover { background: var(--surface); border-color: #b7c2c7; color: var(--ink); }
.btn:active { transform: translateY(1px); }
.btn--primary { color: #fff; background: var(--accent); border-color: var(--accent); }
.btn--primary:hover { color: #fff; background: var(--accent-hover); border-color: var(--accent-hover); }
.btn--call { flex: 1 1 100%; }
.btn__sub { font-weight: 500; opacity: .9; margin-left: 4px; }
.btn--msg { flex: 1 1 0; min-width: 92px; padding-inline: 8px; gap: 6px; }
.btn--whatsapp .icon { color: #1f8a4c; }
.btn--telegram .icon { color: #2a87c0; }
.btn--max .icon { color: #5b4fd6; }
.facts { display: grid; margin: 0; font-size: 15px; }
.facts__row { display: grid; grid-template-columns: 9em minmax(0, 1fr); gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.facts__row dt { color: var(--muted); }
.facts__row dd { margin: 0; }
.prose { max-width: 70ch; }
.prose p + p { margin-top: 12px; }

/* ---- gallery ----------------------------------------------------------------- */
.gallery__stage { position: relative; }
.gallery__track { position: relative; display: flex; overflow-x: auto; scroll-snap-type: x mandatory; overscroll-behavior-x: contain;
  scrollbar-width: none; background: var(--surface); border-radius: var(--radius); aspect-ratio: 4 / 3; }
.gallery__track::-webkit-scrollbar { display: none; }
.gallery__slide { flex: 0 0 100%; margin: 0; scroll-snap-align: start; scroll-snap-stop: always; }
.gallery__zoom { display: block; width: 100%; height: 100%; cursor: zoom-in; }
.gallery__slide img { width: 100%; height: 100%; object-fit: contain; }
.gallery__nav { position: absolute; top: 50%; translate: 0 -50%; display: grid; place-items: center; width: 44px; height: 44px; padding: 0;
  color: var(--ink); background: rgba(255, 255, 255, .92); border: 1px solid var(--line); border-radius: 999px; cursor: pointer;
  transition: background-color .15s ease, opacity .15s ease; }
.gallery__nav:hover { background: #fff; }
.gallery__nav:disabled { opacity: .35; cursor: default; }
.gallery__nav--prev { left: 8px; }
.gallery__nav--next { right: 8px; }
@media (hover: none) { .gallery__nav { display: none; } }
.gallery__count { position: absolute; right: 8px; bottom: 8px; padding: 2px 8px; font-size: 13px; font-weight: 600; color: #fff; background: rgba(27, 35, 38, .78); border-radius: 4px; }
.gallery__thumbs { display: flex; gap: 8px; margin: 8px 0 0; padding: 0; list-style: none; overflow-x: auto; scrollbar-width: thin; }
.gallery__thumb { display: block; width: 72px; aspect-ratio: 4 / 3; overflow: hidden; border-radius: 4px; border: 2px solid transparent; background: var(--surface); }
.gallery__thumb img { width: 100%; height: 100%; object-fit: cover; }
.gallery__thumb:hover { border-color: #b7c2c7; }
.gallery__thumb.is-active { border-color: var(--focus); }
.gallery--empty { display: grid; place-items: center; aspect-ratio: 4 / 3; padding: 16px; text-align: center;
  background: var(--surface); border: 1px dashed #b7c2c7; border-radius: var(--radius); }
.gallery__ask { display: grid; justify-items: center; gap: 8px; max-width: 34ch; }
.gallery--empty .nophoto { width: 88px; margin-bottom: 4px; fill: var(--bg); }
.gallery__ask-title { font-size: 20px; font-weight: 700; }
.gallery__ask-text { font-size: 15px; color: var(--muted); }

/* photo viewer (lightbox.js): full screen, dark, photo fitted; ink-on-dark controls 3:1+ */
.lbox { width: 100vw; height: 100vh; height: 100dvh; max-width: none; max-height: none; margin: 0; padding: 0; border: 0; color: #fff; background: #0c1012; }
.lbox[open] { display: block; animation: lbox-in .18s ease-out; }
.lbox::backdrop { background: rgba(12, 16, 18, .6); }
.lbox__fig { display: grid; place-items: center; width: 100%; height: 100%; margin: 0; padding: 64px 72px; box-sizing: border-box; }
.lbox__img { width: 100%; height: 100%; object-fit: contain; user-select: none; -webkit-user-drag: none; }
.lbox__btn { position: absolute; display: grid; place-items: center; width: 48px; height: 48px; padding: 0; color: #fff; cursor: pointer;
  background: rgba(255, 255, 255, .12); border: 1px solid rgba(255, 255, 255, .35); border-radius: 50%; transition: background-color .15s ease; }
.lbox__btn:hover { background: rgba(255, 255, 255, .26); }
.lbox__btn:focus-visible { outline: 3px solid #a6dcf2; outline-offset: 2px; }
.lbox__btn .icon { width: 26px; height: 26px; }
.lbox__close { top: 12px; right: 12px; font-size: 32px; line-height: 1; }
.lbox__nav { top: 50%; translate: 0 -50%; }
.lbox__nav--prev { left: 12px; }
.lbox__nav--next { right: 12px; }
.lbox__count { position: absolute; top: 22px; left: 50%; translate: -50% 0; padding: 2px 10px; font-size: 15px; font-weight: 600; background: rgba(0, 0, 0, .45); border-radius: 4px; }
@media (max-width: 719px) {
  .lbox__fig { padding: 64px 8px 84px; }
  .lbox__nav { top: auto; bottom: 16px; translate: none; }
  .lbox__nav--prev { left: calc(50% - 60px); }
  .lbox__nav--next { right: calc(50% - 60px); }
}
html.lbox-open { overflow: hidden; }
@keyframes lbox-in { from { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .lbox[open] { animation: none; } }

/* delivery lines inside the buy box */
.ship { display: grid; gap: 6px; margin: 0; padding: 12px 0 0; list-style: none; border-top: 1px solid var(--line); font-size: 15px; }
.ship__item { display: flex; gap: 8px; align-items: flex-start; }
.ship__item .icon { flex: none; width: 20px; height: 20px; margin-top: 1px; color: var(--accent); }
.product.is-sold .gallery__slide img { filter: grayscale(.6); }

/* ---- forms, notes, empty states -------------------------------------------------- */
.card { padding: 16px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg); }
@media (min-width: 720px) { .card { padding: 20px 24px; } }
.req__lead { margin-bottom: 12px; font-size: 15px; }
.form { display: grid; gap: 12px; }
.form__row { display: grid; gap: 12px; }
@media (min-width: 520px) { .form__row { grid-template-columns: 1fr 1fr; } }
.field { display: grid; gap: 4px; }
.field__label { font-size: 14px; font-weight: 600; }
.req-mark { color: var(--err); }
.field__input { width: 100%; min-height: 48px; padding: 10px 12px; font: inherit; font-size: 16px; color: var(--ink); background: #fff;
  border: 1px solid #b7c2c7; border-radius: var(--radius); transition: border-color .15s ease; }
.field__input:hover { border-color: var(--muted); }
textarea.field__input { resize: vertical; min-height: 88px; }
.field__input.is-invalid { border-color: var(--err); box-shadow: 0 0 0 1px var(--err); }
.check { display: flex; align-items: flex-start; gap: 10px; font-size: 14px; cursor: pointer; }
.check input { width: 20px; height: 20px; margin: 1px 0 0; accent-color: var(--accent); flex: none; }
.check.is-invalid span { color: var(--err); }
.form__submit { justify-self: start; min-width: 200px; }
@media (max-width: 519px) { .form__submit { justify-self: stretch; } }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.note { padding: 10px 12px; border-radius: var(--radius); font-weight: 600; margin-bottom: 12px; }
.note--ok { color: #145c39; background: #e6f4ec; border: 1px solid #a9d8bd; }
.note--err { color: #8a1c12; background: #fdecea; border: 1px solid #f1b8b1; }
.empty { display: grid; gap: 12px; justify-items: start; margin-top: 24px; padding: 24px; border: 1px dashed #b7c2c7; border-radius: var(--radius); max-width: 720px; }
.empty__title { font-size: 18px; font-weight: 700; }
.search--page { max-width: 720px; margin-top: 4px; }
.hint { margin-top: 8px; font-size: 14px; }
.notfound { display: grid; gap: 12px; justify-items: start; padding-block: 40px 8px; max-width: 720px; }
.notfound__code { font: 800 64px/1 var(--mono); color: var(--line); }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition-duration: 0s !important; scroll-behavior: auto !important; } }
