/* LUIDOM, карточка товара: иерархия покупки и рекомендации.
   Главное действие «В корзину» — тёмная кнопка без обводки. Остальное — ink, sand, gold. */

/* --- Главное действие --- */
.product-page .product-cta,
#purchase-dock .product-cta,
#dialog .product-cta {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--cream);
}
.product-page .product-cta:active,
#purchase-dock .product-cta:active,
#dialog .product-cta:active { background: var(--pressed); border-color: var(--pressed); }
.product-page .product-cta:disabled,
#purchase-dock .product-cta:disabled { background: var(--sand); border-color: var(--line); color: var(--text); }
.product-page .product-cta:focus-visible,
#purchase-dock .product-cta:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; }
.product-info .product-cta { min-height: 58px; font-size: 1rem; }
.product-info .product-cta .price { font-size: 1.0625rem; font-weight: 800; }

/* --- Цена, доставка, бейджи, остаток --- */
.product-badges { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; }
.badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 2px 9px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--cream);
  font-size: .6875rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.badge-hit { background: var(--paper); color: var(--ink); border: 1px solid var(--gold); }
.product-info .product-price { margin-block: 2px 0; }
.delivery-line {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  width: 100%;
  padding: 6px 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  font-size: .8125rem;
  line-height: 1.35;
  text-align: left;
}
.delivery-line > svg { flex: 0 0 auto; width: 19px; height: 19px; color: var(--gold); }
.delivery-line > svg:last-child { width: 16px; margin-inline-start: auto; color: var(--text); }
.delivery-line strong { display: block; font-weight: 700; }
.delivery-line small { display: block; color: var(--text); font-size: .8125rem; }
.stock.low { color: var(--ink); }

/* --- Вторичные действия: тише главной кнопки --- */
.buy-alternatives { display: flex; flex-wrap: wrap; gap: 0 16px; margin-top: -4px; }
.buy-alt {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 44px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  font-size: .875rem;
  font-weight: 650;
  text-decoration: underline;
  text-decoration-color: var(--line);
  text-underline-offset: 4px;
}
.buy-alt svg { width: 18px; height: 18px; color: var(--gold); }
.buy-alt:active { color: var(--gold); }

/* --- Плашки доверия: одна строка, подробности по ссылке --- */
.trust-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 2px 0 0; padding: 0; list-style: none; }
.trust-chips a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 34px;
  padding: 4px 11px 4px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink);
  font-size: .75rem;
  font-weight: 650;
  text-decoration: none;
  white-space: nowrap;
}
.trust-chips svg { width: 15px; height: 15px; color: var(--gold); }
.trust-chips a:active { background: var(--sand); }

/* --- «Дополнит покупку»: горизонтальная лента мини-плиток --- */
.rec-strip { margin-top: 6px; min-width: 0; }
.rec-strip h2 { margin: 0 0 6px; font-size: 1rem; line-height: 1.3; }
.mini-track {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 128px;
  gap: 8px;
  margin: 0 calc(-1 * var(--gutter));
  padding: 0 var(--gutter) 4px;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
  scroll-padding-inline: var(--gutter);
  scrollbar-width: none;
  list-style: none;
}
.mini-track::-webkit-scrollbar { display: none; }
.mini-tile {
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--paper);
  scroll-snap-align: start;
}
.mini-tile-link { display: grid; gap: 5px; color: var(--ink); text-decoration: none; }
.mini-tile-photo { display: block; width: 80px; height: 80px; margin-inline: auto; overflow: hidden; border-radius: 8px; }
.mini-tile-photo img { width: 100%; height: 100%; object-fit: contain; }
.mini-tile-title { display: -webkit-box; min-height: 2.7em; overflow: hidden; -webkit-line-clamp: 2; -webkit-box-orient: vertical; font-size: .75rem; line-height: 1.35; }
.mini-tile-foot { display: flex; align-items: center; justify-content: space-between; gap: 4px; margin-top: auto; padding-top: 4px; }
.mini-tile-foot .money { font-size: .8125rem; }
.rec-add {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--paper);
  color: var(--ink);
}
.rec-add svg { width: 16px; height: 16px; }
.rec-add:active { background: var(--sand); }
.rec-add.is-added, .rec-add:disabled { border-color: transparent; background: var(--sand); color: var(--gold); }
.rec-strip .recommendation-confirmation { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; font-size: .8125rem; }
.rec-strip .recommendation-confirmation[hidden] { display: none; }

/* --- Бренд и страна одной строкой над заголовком (видна и на телефоне) --- */
.product-origin { display: flex; flex-wrap: wrap; align-items: center; column-gap: .45em; margin: 0; color: var(--gold); font-size: 11px; font-weight: 700; line-height: 1.45; letter-spacing: .14em; text-transform: uppercase; }
.product-origin a { display: inline-flex; align-items: center; gap: 8px; color: inherit; text-decoration: none; }
.product-origin .brand-logo-box { flex: 0 0 auto; width: auto; min-height: 0; padding: 2px 6px; border-radius: 6px; background: var(--paper); }
.product-origin .brand-logo-box img { width: auto; max-width: 64px; height: 22px; }
.product-origin .brand-initials { width: 24px; height: 24px; border-radius: 6px; font-size: .5625rem; letter-spacing: 0; }
.product-price .stock { margin-inline-start: auto; align-self: center; }

/* Ответы покупателям свёрнуты, как остальные аккордеоны; текст остаётся на странице. */
.product-answers.accordion { margin-top: 0; }
.product-answers .qa:first-of-type { border-top: 0; }

/* --- Ленты рекомендаций под карточкой --- */
.rec-rail { margin-top: clamp(28px, 5vw, 48px); }
.rec-head { display: flex; align-items: end; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.rec-head h2 { margin: 0; font-size: clamp(1.25rem, 4.6vw, 1.75rem); line-height: 1.15; }
.rec-head p { margin: 3px 0 0; color: var(--text); font-size: .8125rem; }
.rec-head .text-link { flex: 0 0 auto; }
.rec-track {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(152px, 44%);
  gap: 10px;
  margin: 0 calc(-1 * var(--gutter));
  padding: 2px var(--gutter) 10px;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
  scroll-padding-inline: var(--gutter);
  scrollbar-width: none;
  list-style: none;
}
.rec-track::-webkit-scrollbar { display: none; }
.rec-track > li { min-width: 0; scroll-snap-align: start; }
.rec-tile {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--paper);
  color: var(--ink);
  text-decoration: none;
}
.rec-tile-image { position: relative; display: block; aspect-ratio: 1; background: var(--paper); }
.rec-tile-image img { width: 100%; height: 100%; object-fit: contain; }
.rec-tile-image .badge { position: absolute; inset: 8px auto auto 8px; }
.rec-tile-copy { display: flex; flex: 1; flex-direction: column; gap: 2px; padding: 9px 11px 12px; border-top: 1px solid var(--line); }
.rec-tile-copy .eyebrow { font-size: 10px; letter-spacing: .12em; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.rec-tile-title { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-size: .8125rem; line-height: 1.35; }
.rec-tile-copy .money { margin-top: auto; padding-top: 4px; font-size: .9375rem; }
.rec-stock { color: var(--gold); font-size: .6875rem; font-weight: 700; }

.bundle {
  display: grid;
  gap: 10px;
  margin-bottom: 12px;
  padding: 12px 14px;
  border-radius: 14px;
  background: var(--sand);
}
.bundle-copy strong { display: block; font-size: .9375rem; line-height: 1.35; }
.bundle-copy small { display: block; margin-top: 2px; color: var(--text); font-size: .75rem; line-height: 1.45; }
.bundle .secondary { min-height: 46px; justify-self: start; }
.bundle .secondary:disabled { border-color: var(--line); color: var(--text); }

/* --- Липкая панель покупки на телефоне --- */
#purchase-dock.product-dock { display: flex; align-items: center; gap: 10px; }
#purchase-dock.product-dock[hidden] { display: none !important; }
.dock-summary { display: grid; flex: 0 0 auto; min-width: 0; line-height: 1.2; }
.dock-summary .money { font-size: 1.0625rem; font-weight: 800; }
.dock-summary small { color: var(--text); font-size: .6875rem; white-space: nowrap; }
#purchase-dock.product-dock > .product-cta { flex: 1 1 auto; width: auto; min-height: 50px; }
.dock-whatsapp {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 50px;
  height: 50px;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--ink);
}
.dock-whatsapp svg { width: 21px; height: 21px; }

@media (hover: hover) {
  .product-page .product-cta:hover:not(:disabled), #purchase-dock .product-cta:hover:not(:disabled) { background: var(--pressed); }
  .rec-tile:hover { border-color: var(--gold); }
  .rec-add:hover:not(:disabled), .buy-alt:hover, .trust-chips a:hover, .mini-tile:hover { text-decoration-color: var(--gold); border-color: var(--gold); }
}

@media (min-width: 560px) {
  .rec-track { grid-auto-columns: minmax(170px, 30%); }
  .bundle { grid-template-columns: minmax(0, 1fr) auto; align-items: center; }
}

@media (min-width: 760px) {
  .mini-track { margin: 0; padding: 0 0 4px; }
  .rec-track {
    grid-auto-flow: row;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin: 0;
    padding: 0;
    overflow: visible;
  }
}

@media (min-width: 1030px) {
  .rec-track { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .rec-track > li:nth-child(n + 7) { display: none; }
}

/* «Недавно смотрели» — до 12 карточек: лента прокручивается и на широком экране. */
@media (min-width: 760px) {
  .rec-track.rec-track-scroll {
    grid-auto-flow: column;
    grid-template-columns: none;
    grid-auto-columns: calc((100% - 30px) / 4);
    padding-bottom: 10px;
    overflow-x: auto;
    scrollbar-width: thin;
  }
}
@media (min-width: 1030px) {
  .rec-track.rec-track-scroll { grid-auto-columns: calc((100% - 50px) / 6); }
  .rec-track.rec-track-scroll > li:nth-child(n + 7) { display: block; }
}

@media (prefers-reduced-motion: reduce) {
  .rec-track { scroll-behavior: auto; }
}

/* Нижняя панель на телефоне: «Перейти в корзину» — в одну строку */
#purchase-dock .product-cta { padding-inline: 14px; white-space: nowrap; font-size: .9375rem; }
