/* ------------------------------------------------------------------
   Карточка товара: лента фото, просмотр на весь экран, «один экземпляр»,
   раскрывающиеся блоки, закреплённая панель на телефоне.
   Подключается только на карточке (@push('styles')).
   ------------------------------------------------------------------ */

/* ---------- лента фото ---------- */
.pg { --g: clamp(1rem, 3vw, 2rem); min-width: 0; }
.pg-track {
  position: relative; display: flex;
  overflow-x: auto; overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory; scrollbar-width: none;
}
.pg-track::-webkit-scrollbar { display: none; }
.pg-track:focus-visible { outline: 2px solid var(--taupe); outline-offset: 2px; }
.pg-slide { flex: 0 0 100%; margin: 0; scroll-snap-align: start; scroll-snap-stop: always; }
.pg-open { display: block; position: relative; aspect-ratio: 1 / 1; background: var(--mat); cursor: zoom-in; overflow: hidden; }
.pg-open img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; transition: transform .5s cubic-bezier(.2,.7,.2,1); }
@media (hover: hover) { .pg-open:hover img { transform: scale(1.02); } }
.pg-empty { cursor: default; }
.pg-slide figcaption {
  display: flex; justify-content: space-between; gap: 1rem;
  padding-top: 10px; font-size: 14px; color: var(--taupe-deep);
}
.pg-num { font-variant-numeric: tabular-nums; }

.pg-thumbs { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
.pg-thumbs button {
  width: 76px; height: 76px; padding: 0 0 2px; cursor: pointer;
  border: 0; border-bottom: 2px solid transparent; background: var(--mat);
  opacity: .72; transition: opacity .2s ease, border-color .2s ease;
}
.pg-thumbs button:hover, .pg-thumbs button[aria-current="true"] { opacity: 1; }
.pg-thumbs button[aria-current="true"] { border-bottom-color: var(--ink); }
.pg-thumbs img { width: 100%; height: 100%; object-fit: contain; }

.pg-dots { display: none; }
.pg-hint { margin: 10px 0 0; font-size: 13px; color: var(--taupe-deep); }
.pg-hint-touch { display: none; }
@media (hover: none) { .pg-hint-touch { display: inline; } .pg-hint-mouse { display: none; } }

/* Закреплённая галерея не должна быть выше окна (ноутбуки 1366×768). */
@media (min-width: 861px) {
  .pg-open { aspect-ratio: auto; height: min(660px, calc(100dvh - 190px)); min-height: 360px; }
}

/* Телефон: лента на всю ширину, следующий кадр выглядывает — видно, что можно листать. */
@media (max-width: 860px) {
  .pg { margin: 0 calc(-1 * var(--g)); }
  .pg-track { gap: 8px; padding: 0 var(--g); scroll-padding: 0 var(--g); }
  .pg-track::after { content: ""; flex: 0 0 1px; }
  .pg-slide { flex-basis: 86%; }
  .pg-slide:only-child { flex-basis: 100%; }
  .pg-thumbs { display: none; }
  .pg-dots { display: flex; justify-content: center; gap: 8px; margin-top: 12px; }
  .pg-dots span { width: 7px; height: 7px; border-radius: 4px; background: var(--line-strong); transition: width .2s, background .2s; }
  .pg-dots span.is-on { width: 20px; background: var(--ink); }
  .pg-hint { padding: 0 var(--g); text-align: center; }
}

/* ---------- просмотр фото на весь экран ---------- */
html.lb-lock { overflow: hidden; }
.lb {
  width: 100vw; height: 100dvh; max-width: none; max-height: none;
  margin: 0; padding: 0; border: 0; overflow: hidden;
  background: var(--ink); color: var(--paper);
}
.lb::backdrop { background: rgba(28, 32, 33, .9); }
.lb[open] { display: grid; grid-template-rows: minmax(0, 1fr) auto; animation: lb-in .2s ease; }
@keyframes lb-in { from { opacity: 0; } to { opacity: 1; } }
.lb-stage { position: relative; display: grid; place-items: center; overflow: hidden; touch-action: none; cursor: zoom-in; }
.lb.is-zoomed .lb-stage { cursor: grab; }
.lb-img {
  max-width: 100vw; max-height: calc(100dvh - 68px); width: auto; height: auto;
  user-select: none; -webkit-user-drag: none; transform-origin: center; will-change: transform;
}
.lb-bar {
  display: flex; align-items: center; gap: 10px 18px; flex-wrap: wrap; min-height: 68px;
  padding: 10px clamp(1rem, 3vw, 2rem) calc(10px + env(safe-area-inset-bottom));
  border-top: 1px solid rgba(246, 245, 242, .16); font-size: 15px;
}
.lb-count { margin-right: auto; color: rgba(246, 245, 242, .6); font-variant-numeric: tabular-nums; }
.lb button {
  font: inherit; color: inherit; background: transparent; cursor: pointer;
  border: 1px solid rgba(246, 245, 242, .35); border-radius: var(--radius); min-height: 44px; padding: 0 16px;
}
.lb button:hover { border-color: var(--paper); }
.lb-prev, .lb-next {
  position: absolute; top: calc(50% - 34px); transform: translateY(-50%);
  width: 52px; height: 52px; padding: 0 !important; font-size: 22px; background: rgba(28, 32, 33, .55) !important;
}
.lb-prev { left: 16px; } .lb-next { right: 16px; }
.lb.is-zoomed .lb-prev, .lb.is-zoomed .lb-next { display: none; }
@media (max-width: 560px) { .lb-role { flex: 1 1 100%; } .lb-prev, .lb-next { width: 44px; height: 44px; } }

/* ---------- покупка ---------- */
.pd-status:empty { display: none; }
.pd-status { flex: 1 1 100%; margin: 0; font-size: 14px; color: var(--ink); border-left: 2px solid var(--taupe); padding: 2px 0 2px 12px; }
.pd-status.is-error { border-left-color: var(--seal); }
.buybox .actions form { display: flex; }
.buybox .notice.sold { flex: 1 1 100%; }

.pd-unique { margin: 0 0 24px; font-size: 14.5px; }
.pd-unique p { margin: 0 0 14px; max-width: 52ch; }
.pd-unique p b { color: var(--ink); }
.pd-steps { list-style: none; counter-reset: st; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 18px; }
.pd-steps li { counter-increment: st; border-top: 1px solid var(--line-strong); padding-top: 10px; line-height: 1.35; }
.pd-steps li::before { content: counter(st); display: block; font-size: 12px; color: var(--taupe-deep); font-variant-numeric: tabular-nums; margin-bottom: 4px; }
.pd-steps b { display: block; color: var(--ink); font-size: 14px; font-weight: 500; }
.pd-steps span { font-size: 13px; color: var(--body); }
@media (max-width: 420px) {
  .pd-steps { grid-template-columns: 1fr; }
  .pd-steps li { display: flex; gap: 10px; align-items: baseline; padding-bottom: 8px; }
  .pd-steps li::before { margin: 0; }
}

/* ---------- раскрывающиеся блоки ---------- */
.pd-more { border-top: 1px solid var(--line-strong); margin: 8px 0 24px; }
.pd-more details { border-bottom: 1px solid var(--line); }
.pd-more summary {
  list-style: none; cursor: pointer; display: flex; justify-content: space-between; align-items: center;
  min-height: 52px; padding: 12px 0; font-size: 16px; font-weight: 500; color: var(--ink); letter-spacing: var(--ls-s);
}
.pd-more summary::-webkit-details-marker { display: none; }
.pd-more summary::after { content: "+"; font-size: 22px; font-weight: 300; line-height: 1; color: var(--taupe-deep); transition: transform .2s ease; }
.pd-more details[open] summary::after { content: "−"; }
.pd-more details > div { padding: 0 0 18px; font-size: 14.5px; max-width: 60ch; }
.pd-more p { margin: 0 0 .7rem; }
.pd-more b { color: var(--ink); font-weight: 500; }
.pd-more ul { margin: 0 0 .7rem; padding-left: 1.1rem; }
.pd-more li::marker { color: var(--taupe); }
.pd-link { color: var(--ink); border-bottom: 1px solid var(--taupe); }

/* ---------- инструменты вопроса ---------- */
.pd-tools { flex: 1 1 100%; display: flex; flex-wrap: wrap; gap: 4px 22px; }
.pd-tool {
  font: inherit; font-size: 14px; color: var(--ink); background: none; border: 0; padding: 10px 0; cursor: pointer;
  text-underline-offset: 4px;
}
.pd-tool:hover { text-decoration: underline; text-decoration-color: var(--taupe); }

/* ---------- закреплённая панель на телефоне ---------- */
.pd-bar { display: none; }
@media (max-width: 860px) {
  .pd-bar {
    display: flex; align-items: center; gap: 12px;
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 70;
    padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
    background: var(--paper); border-top: 1px solid var(--ink);
    transform: translateY(100%); visibility: hidden;
    transition: transform .2s ease, visibility 0s linear .2s;
  }
  .pd-bar.is-on { transform: none; visibility: visible; transition: transform .2s ease; }
  .pd-bar-info { flex: 1; min-width: 0; line-height: 1.25; }
  .pd-bar-info b { display: block; font-size: 20px; font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; }
  .pd-bar-info span { font-size: 13px; color: var(--taupe-deep); }
  .pd-bar form { display: flex; }
  .pd-bar .btn { min-height: 48px; padding: 0 22px; display: inline-flex; align-items: center; white-space: nowrap; }
}
@media (prefers-reduced-motion: reduce) { .pd-bar { transition: none; } }

/* ---------- крошки на телефоне: чипы, первым — «← Раздел» ---------- */
@media (max-width: 860px) {
  .pd-crumbs { --g: clamp(1rem, 3vw, 2rem); display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; white-space: nowrap;
               margin: 0 calc(-1 * var(--g)); padding: 12px var(--g) 4px; }
  .pd-crumbs::-webkit-scrollbar { display: none; }
  .pd-crumbs span { display: none; }
  .pd-crumbs a { display: inline-flex; align-items: center; min-height: 38px; padding: 0 14px; font-size: 14px;
                 color: var(--ink); border: 1px solid var(--line-strong); border-radius: 999px; }
  .pd-crumbs a.is-up { order: -1; border-color: var(--ink); }
  .pd-crumbs a.is-up::before { content: "←"; margin-right: 6px; color: var(--taupe-deep); }
}

/* ---------- телефон: плотность ---------- */
@media (max-width: 560px) {
  .specs { font-size: 15px; }
  .specs th { width: 38%; }
  .pd-phone { font-size: 1.6rem; }
  .buybox .actions { width: 100%; }
  .buybox .actions > * { flex: 1 1 0; justify-content: center; }
  .buybox .actions form .btn { width: 100%; justify-content: center; }
  .pd-similar .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px 12px; }
  .pd-similar .card .view-toggle, .pd-similar .card .card-similar { display: none; }
  .pd-similar .section-head .more { margin-left: 0; }
}

/* На карточке внизу — своя панель покупки; общая нижняя панель здесь не нужна. */
@media (max-width: 700px) {
  .tabbar { display: none !important; }
  body { padding-bottom: 0; }
}
body.has-pd-bar { padding-bottom: calc(72px + env(safe-area-inset-bottom)); }
@media (max-width: 700px) { .sf-toast { bottom: calc(84px + env(safe-area-inset-bottom)); } }


/* ================================================================
   «Мягкий модерн» для карточки товара (макет j-soft-modern, экран 2).
   ================================================================ */

.product { gap: clamp(20px, 3vw, 40px); padding-top: 8px; align-items: start; }

/* галерея: миниатюры колонкой слева, крупное фото в скруглённой пастельной «нише» */
.pg { position: relative; }
.pg-open {
  border-radius: 40px;
  background: radial-gradient(120% 100% at 50% 30%, #fff 0%, #E6CBBE 72%);
  isolation: isolate;
}
.pg-open img { mix-blend-mode: multiply; filter: brightness(1.12) contrast(1.05); object-fit: cover; }
.pg-open::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(110% 90% at 50% 42%, transparent 60%, #E6CBBE 100%); opacity: .6;
}
.pg-sticker { top: 22px; left: 22px; width: 72px; height: 72px; font-size: 13px; z-index: 5; }
.pg-sticker b { font-size: 22px; }
.pg-slide figcaption { padding: 12px 6px 0; font-size: 14px; }
.pg-thumbs button {
  width: 82px; height: 92px; padding: 0; border: 0; border-radius: 18px; overflow: hidden;
  background: radial-gradient(120% 100% at 50% 30%, #fff 0%, #E6CBBE 80%);
  opacity: 1; transition: box-shadow .25s, transform .25s var(--ease);
}
.pg-thumbs button img { mix-blend-mode: multiply; object-fit: cover; }
.pg-thumbs button:hover { transform: translateY(-2px); }
.pg-thumbs button[aria-current="true"] { box-shadow: 0 0 0 2px var(--paper), 0 0 0 4px var(--cobalt); }
.pg-hint { padding-left: 6px; }

@media (min-width: 1101px) {
  .pg { display: grid; grid-template-columns: 82px minmax(0, 1fr); column-gap: 16px; align-items: start; }
  .pg-track { grid-column: 2; grid-row: 1; }
  .pg-thumbs { grid-column: 1; grid-row: 1; flex-direction: column; flex-wrap: nowrap; margin: 0; max-height: min(660px, calc(100dvh - 190px)); overflow-y: auto; scrollbar-width: none; }
  .pg-thumbs::-webkit-scrollbar { display: none; }
  .pg-hint { grid-column: 2; }
  .pg-sticker { left: 120px; }
}

/* панель покупки — белая карточка */
.pd-info {
  padding: clamp(24px, 3vw, 40px);
  border-radius: 40px; background: var(--card); box-shadow: var(--shadow-soft);
}
.pd-kicker { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.pd-kicker .pill {
  padding: 7px 13px; border-radius: 999px; background: var(--paper); border: 1px solid var(--line);
  font-size: 13px; color: var(--body); white-space: nowrap;
}
.pd-kicker a.pill:hover { border-color: var(--line-strong); color: var(--ink); }
.pd-kicker .pill-lot { background: transparent; }
.product h1 { font-size: clamp(30px, 3.2vw, 46px); line-height: 1.04; letter-spacing: -0.035em; font-weight: 600; margin: 0 0 12px; }
.product .label-line { font-size: 15.5px; color: var(--body); margin: 0 0 24px; }

.buybox { border: 0; padding: 0; margin: 0 0 22px; display: block; }
.buybox .price { font-size: clamp(34px, 3vw, 44px); font-weight: 700; letter-spacing: -0.04em; margin-bottom: 18px; }
.buybox .price .cur { font-weight: 600; }
.buybox .actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.buybox .actions form, .buybox .actions form .btn, .buybox .actions > .btn { width: 100%; }
.buybox .actions .btn { min-height: 58px; font-size: 16.5px; justify-content: center; }
.buybox .notice.sold { margin: 0 0 16px; padding: 16px 18px; border: 0; border-radius: 20px; background: var(--paper); }
.pd-status { margin-top: 12px; border-left: 0; padding: 12px 16px; border-radius: 16px; background: var(--sage); }
.pd-status.is-error { background: var(--blush); }

.pd-unique { margin: 0 0 26px; }
.pd-single { display: flex; gap: 14px; align-items: center; padding: 18px; border-radius: 22px; background: linear-gradient(135deg, #FDF1EC, #FBE8E1); margin-bottom: 14px; }
.pd-single .dot {
  flex: none; width: 50px; height: 50px; border-radius: 50%; display: grid; place-items: center; text-align: center;
  background: var(--coral); color: #fff; font-weight: 700; font-size: 12px; line-height: 1.05; transform: rotate(-8deg);
}
.pd-single p { margin: 0; font-size: 14.5px; color: var(--body); max-width: none; }
.pd-single p b { display: block; color: var(--ink); font-size: 16px; margin-bottom: 2px; }
.pd-steps { gap: 10px; }
.pd-steps li { border: 0; padding: 14px 14px 12px; border-radius: 18px; background: var(--paper); }
.pd-steps li::before {
  width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center;
  background: var(--ink); color: #fff; font-size: 12px; font-weight: 600; margin-bottom: 8px;
}

.specs { margin: 0 0 24px; }
.specs th, .specs td { padding: 13px 0; border-bottom: 1px solid var(--line); }
.specs tr:last-child th, .specs tr:last-child td { border-bottom: 0; }
.specs th { color: var(--muted); }
.specs td { font-weight: 500; }

.pd-info .prose { padding: 26px 28px; border-radius: 28px; background: linear-gradient(150deg, #F4F0F7, var(--lilac)); margin-bottom: 24px; max-width: none; }
.pd-info .prose p { margin: 0; font-size: 16px; color: var(--body); }

.pd-more { border: 0; display: grid; gap: 10px; margin: 0 0 24px; }
.pd-more details { border: 0; border-radius: 20px; background: var(--paper); padding: 0 20px; }
.pd-more summary { min-height: 58px; font-size: 16px; }
.pd-more summary::after { width: 30px; height: 30px; border-radius: 50%; background: #fff; display: grid; place-items: center; font-size: 18px; }

.pd-ask {
  border: 0; border-radius: 28px; padding: 24px 26px;
  background: linear-gradient(150deg, #EDF2F7, var(--sky)); margin: 0;
}
.pd-phone { font-weight: 600; }
.pd-tools { gap: 6px 10px; }
.pd-tool { padding: 9px 14px; border-radius: 999px; background: rgba(255,255,255,.75); font-size: 13.5px; }
.pd-tool:hover { text-decoration: none; background: #fff; }

/* похожие */
.pd-similar { margin-top: 40px; }
.pd-similar .section-head h2 { font-size: clamp(28px, 3vw, 40px); font-weight: 600; letter-spacing: -0.03em; }
.pd-similar .grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; }

/* крошки — пилюли и на десктопе */
.pd-crumbs { display: flex; flex-wrap: wrap; gap: 8px; padding: 6px 0 18px; }
.pd-crumbs span { display: none; }
.pd-crumbs a { display: inline-flex; align-items: center; min-height: 36px; padding: 0 14px; border-radius: 999px; background: rgba(255,255,255,.75); border: 1px solid var(--line); font-size: 14px; color: var(--body); }
.pd-crumbs a:hover { color: var(--ink); border-color: var(--line-strong); }
.pd-crumbs a.is-up { order: 0; border-color: var(--line-strong); color: var(--ink); }
.pd-crumbs a.is-up::before { content: none; }

/* панель на телефоне — стеклянная пилюля */
@media (max-width: 860px) {
  .pd-info { border-radius: 30px; }
  .pd-bar {
    left: 10px; right: 10px; bottom: 10px; border: 1px solid rgba(255,255,255,.75); border-radius: 26px;
    background: rgba(255,255,255,.8); -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px);
    box-shadow: 0 12px 32px -14px rgba(38,33,30,.35);
    padding: 10px 10px 10px 18px; transform: translateY(140%);
  }
  .pd-bar .btn { min-height: 48px; }
  .pg-open { border-radius: 28px; }
  .pg-sticker { top: 14px; left: calc(clamp(1rem, 3vw, 2rem) + 12px); width: 56px; height: 56px; font-size: 11px; }
  .pg-sticker b { font-size: 17px; }
  .pd-similar .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
}
@media (max-width: 560px) {
  .buybox .actions { grid-template-columns: 1fr; }
  .pd-steps { grid-template-columns: 1fr; }
  .pd-info .prose { padding: 20px; }
}

@media (max-width: 560px) { .specs th { width: 44%; padding-right: 12px; } }
