/* Карточка товара (module: product).
   SW: product.html темы Shop-Script, динамика помечена в разметке комментариями SW */
/* minmax(0, …) и min-width: 0 (задание 18б): иначе ячейка сетки не уже содержимого, и лента из 5+ миниатюр
   растягивала карточку на телефоне до 477-664px (в облаке у флагмана после новых фото 5+ миниатюр) */
.pdp {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  gap: 22px;
  margin-top: 22px;
  align-items: start;
}
.pdp > *,
.specs-sec > * {
  min-width: 0;
}
.pdp .gal .stage {
  position: relative;
  background: var(--card);
  border-radius: 22px;
  overflow: hidden;
  padding: 16px 16px 6px;
}
.pdp .gal .ghost {
  position: absolute;
  left: 50%;
  top: 6%;
  transform: translateX(-50%);
  font: 800 300px/1 "Unbounded";
  letter-spacing: -0.06em;
  color: #eff0ec;
  user-select: none;
  white-space: nowrap;
  pointer-events: none;
}
.pdp .gal .stage > img,
.pdp .gal .stage .hs {
  position: relative;
}
.pdp .gal .stage > img {
  width: 100%;
  height: auto;
  mix-blend-mode: multiply;
}
.pdp .gal .stage .hs-hint {
  position: absolute;
  left: 20px;
  bottom: 14px;
  z-index: 1;
}
.pdp .gal .tag {
  position: absolute;
  left: 18px;
  top: 18px;
  z-index: 1;
  background: var(--ink);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: 999px;
}
.thumbs-row {
  display: flex;
  gap: 10px;
  margin-top: 10px;
  overflow-x: auto;
  scrollbar-width: thin;
}
.thumbs-row a {
  flex: 0 0 110px;
  background: var(--card);
  border-radius: 14px;
  border: 2px solid transparent;
  overflow: hidden;
  cursor: pointer;
  padding: 0;
}
.thumbs-row a.on {
  border-color: var(--red);
}
.thumbs-row img {
  width: 100%;
  height: auto;
  display: block;
  mix-blend-mode: multiply;
}
.buybox {
  background: var(--card);
  border-radius: 22px;
  padding: 30px 30px 26px;
  position: sticky;
  top: 96px;
}
.buybox .kicker {
  font-size: 12px;
}
.buybox h1 {
  font-size: 32px;
  line-height: 1.1;
  font-weight: 700;
  margin: 14px 0 8px;
}
.buybox .sub {
  color: var(--muted);
  font-size: 15px;
}
.buybox .price-row {
  display: flex;
  align-items: baseline;
  gap: 14px;
  margin: 24px 0 4px;
}
.buybox .price {
  font: 700 38px/1 "Unbounded";
  letter-spacing: -0.03em;
}
.buybox .stock {
  color: var(--ok);
  font-weight: 600;
  font-size: 14px;
}
.buybox .note {
  color: var(--muted);
  font-size: 13px;
}
.opt {
  margin-top: 22px;
}
.opt .t {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 9px;
}
.opt .t b {
  color: var(--ink);
}
.opt .row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.opt .o {
  border: 1.5px solid var(--line);
  border-radius: 12px;
  padding: 10px 16px;
  font: 600 15px/1.2 "Onest";
  background: #fff;
  transition: border-color 0.15s;
}
.opt .o small {
  display: block;
  font-weight: 500;
  font-size: 12px;
  color: var(--muted);
}
.opt .o:hover {
  border-color: var(--ink);
}
.opt .o.on {
  border-color: var(--red);
  box-shadow: 0 0 0 1px var(--red) inset;
}
.opt .dot {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 3px solid #fff;
  box-shadow: 0 0 0 1.5px #c9cdc7;
}
.opt .dot.on {
  box-shadow: 0 0 0 2px var(--red);
}
/* задание 20: круг-ссылка цвета, сосед без остатка бледнее, неизвестный цвет нейтральный с подсказкой */
.opt a.dot {
  display: inline-block;
}
.opt .dot.oos {
  opacity: 0.45;
}
.opt .dot.unk,
.card .colors i.unk {
  background: repeating-linear-gradient(45deg, #e3e5e7 0 4px, #cfd3d6 4px 8px);
}
.buybox .actions {
  display: flex;
  gap: 10px;
  margin-top: 26px;
}
.buybox .actions .btn {
  flex: 1;
  height: 58px;
}
.buybox .perks {
  list-style: none;
  margin-top: 22px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  display: grid;
  gap: 10px;
  font-size: 14px;
  color: #4a4f55;
}
.buybox .perks li {
  display: flex;
  gap: 10px;
  align-items: start;
}
.buybox .perks li::before {
  content: "";
  flex: none;
  width: 18px;
  height: 18px;
  margin-top: 1px;
  border-radius: 50%;
  background: #fde7e8 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23e81219' stroke-width='3.5'%3E%3Cpath d='m6 12.5 4 4 8-9'/%3E%3C/svg%3E") center/11px no-repeat;
}
.specs-sec {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  gap: 22px;
}
.specs {
  background: var(--card);
  border-radius: 22px;
  padding: 30px 32px;
}
.specs h2,
.about h2 {
  font: 700 24px/1.2 "Unbounded";
  margin-bottom: 18px;
}
.specs dl {
  display: grid;
  grid-template-columns: 200px minmax(0, 1fr);
}
.specs dt,
.specs dd {
  overflow-wrap: anywhere; /* длинные коды и адреса из 1С без пробелов не раздвигают колонку */
  padding: 13px 0;
  border-bottom: 1px solid #ebede8;
  font-size: 15px;
}
.specs dt {
  color: var(--muted);
}
.specs dd {
  font-weight: 500;
}
.specs dl > :nth-last-child(-n + 2) {
  border-bottom: 0;
}
.about {
  background: var(--graphite);
  color: #fff;
  border-radius: 22px;
  padding: 30px 30px;
}
.about p {
  color: #b4babf;
  font-size: 15px;
  margin-bottom: 14px;
}
.about .btn {
  margin-top: 8px;
}
.ladder {
  display: grid;
  grid-template-columns: repeat(9, 1fr);
  gap: 10px;
}
.ladder a {
  background: var(--card);
  border: 1.5px solid transparent;
  border-radius: 14px;
  padding: 14px 14px 12px;
  transition: border-color 0.15s;
}
.ladder a:hover {
  border-color: var(--ink);
}
.ladder a.on {
  border-color: var(--red);
}
.ladder b {
  font: 700 22px/1 "Unbounded";
}
.ladder b sup {
  font-size: 12px;
  vertical-align: 8px;
}
.ladder span {
  display: block;
  font-size: 13px;
  color: var(--muted);
  margin-top: 8px;
}
@media (max-width: 1100px) {
  .ladder { grid-template-columns: repeat(5, 1fr); }
}
@media (max-width: 760px) {
  .pdp { grid-template-columns: minmax(0, 1fr); gap: 10px; margin-top: 12px; }
  .pdp .gal .stage { border-radius: 18px; padding: 10px 6px 34px; }
  .pdp .gal .ghost { font-size: 150px; top: 16%; }
  .pdp .gal .tag { left: 12px; top: 12px; }
  .pdp .gal .stage .hs-hint { left: 14px; bottom: 10px; font-size: 13px; }
  .thumbs-row { overflow-x: auto; scrollbar-width: none; }
  .thumbs-row a { flex-basis: 84px; }
  .buybox { position: static; padding: 22px 18px; border-radius: 18px; }
  .buybox h1 { font-size: 24px; }
  .buybox .price { font-size: 30px; }
  .buybox .actions { display: none; }
  .specs-sec { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .specs, .about { padding: 22px 18px; border-radius: 18px; }
  .specs dl { grid-template-columns: 120px minmax(0, 1fr); }
  .specs dt, .specs dd { font-size: 14px; }
  .ladder {
    display: flex;
    overflow-x: auto;
    margin: 0 -16px;
    padding: 0 16px 4px;
    scrollbar-width: none;
  }
  .ladder a { flex: 0 0 96px; }
  .mbar .price-m {
    display: block;
    flex: 0 0 auto;
    color: #fff;
    font: 700 19px/1.1 "Unbounded";
    align-self: center;
    white-space: nowrap;
    padding: 0 6px;
  }
  .mbar .price-m small { display: block; font: 500 11px "Onest"; color: #a6acb2; margin-bottom: 3px; }
}
.about { align-self: start; }
