/* plati.dev — товарная страница v4 (/goods/<slug>/, /goods/p<id>/): надстройка над стеком Orvexa.
   Палитра и компоненты — из шаблона (var(--…)); здесь только раскладка карточки товара. */

/* хлебные крошки */
.plati-crumbs { display: flex; gap: 8px; align-items: center; font-size: 12.5px; color: var(--muted); margin-bottom: 10px; }
.plati-crumbs a { color: var(--muted); text-decoration: none; }
.plati-crumbs a:hover { color: var(--primary-text); }
.plati-crumbs b { color: var(--text); font-weight: 700; }

/* галерея и заголовок товара */
.plati-gallery { border-radius: 16px; overflow: hidden; border: 1px solid var(--line); background: var(--surface, transparent); }
.plati-gallery img { width: 100%; height: 100%; object-fit: cover; display: block; }
.plati-itemhead-copy h1 { font-size: 24px; line-height: 1.25; margin: 2px 0 8px; }
.plati-itemhead-copy > p { color: var(--muted); font-size: 13.5px; line-height: 1.55; }
.plati-goods-head { display: flex; gap: 20px; align-items: flex-start; flex-wrap: wrap; }
.plati-goods-head .p2-head-copy { flex: 1 1 340px; min-width: 0; }

/* чипы вариантов под шапкой (plati.market: Select a purchase option) */
.plati-optrow { margin-top: 14px; padding-top: 12px; border-top: 1px dashed var(--line); }
.plati-optchips { display: flex; flex-wrap: wrap; gap: 8px; }
.plati-optchip {
  display: inline-flex; flex-direction: column; align-items: flex-start; gap: 1px;
  padding: 8px 14px; border: 1px solid var(--line); border-radius: 12px;
  background: transparent; cursor: pointer; text-align: left; font: inherit; color: var(--text);
  transition: border-color .15s ease, background .15s ease;
}
.plati-optchip b { font-size: 14px; font-weight: 750; }
.plati-optchip small { font-size: 12px; color: var(--primary-text); font-weight: 700; }
.plati-optchip:hover { border-color: color-mix(in srgb, var(--primary-text) 45%, var(--line)); }
.plati-optchip.is-selected { border-color: var(--primary-text); background: color-mix(in srgb, var(--primary-text) 8%, transparent); }

/* сетка: слева табы, справа sticky-панель покупки */
.plati-goods-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; align-items: start; }
@media (min-width: 1024px) {
  .plati-goods-grid { grid-template-columns: minmax(0, 1fr) 400px; }
  .plati-goods-side { position: sticky; top: 92px; }
}
.plati-goods-main .p2-panel + .p2-panel { margin-top: 18px; }
.plati-goods-side .p2-panel + .p2-panel { margin-top: 18px; }

/* табы (plati.market: Description | Reviews) */
.plati-tabbar { display: flex; gap: 6px; border-bottom: 1px solid var(--line); margin-bottom: 16px; }
.plati-tab {
  appearance: none; border: 0; background: transparent; cursor: pointer; font: inherit;
  padding: 10px 14px; font-size: 14px; font-weight: 700; color: var(--muted);
  border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.plati-tab:hover { color: var(--text); }
.plati-tab.is-active { color: var(--primary-text); border-bottom-color: var(--primary-text); }
.plati-tabpane { display: none; }
.plati-tabpane.is-active { display: block; }

/* описание и отзывы: компактный вид с раскрытием, без перестройки текста товара */
.plati-goods-lower { display: flex; flex-direction: column; gap: 18px; margin-top: 18px; }
.plati-description-text { color: var(--text); font-size: 14px; line-height: 1.65; }
.plati-description-text p { margin: 0 0 8px; white-space: pre-wrap; }
.plati-description-text p.plati-description-spacer { height: 12px; margin: 0; }
.plati-description-text p:last-child { margin-bottom: 0; }
.plati-description-text.is-collapsed { max-height: 190px; overflow: hidden; position: relative; }
.plati-description-text.is-collapsed::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 58px;
  background: linear-gradient(to bottom, transparent, var(--surface-solid, var(--bg)) 88%);
  pointer-events: none;
}
.plati-expand-btn {
  appearance: none; border: 0; background: transparent; padding: 10px 0 0;
  color: var(--primary-text); font: inherit; font-size: 13px; font-weight: 750; cursor: pointer;
}
.plati-expand-btn:hover { text-decoration: underline; }
.plati-empty-text, .plati-review-note { color: var(--muted); font-size: 13.5px; line-height: 1.55; }
.plati-review-list { display: flex; flex-direction: column; }
.plati-reviews-more-btn {
  appearance: none; align-self: flex-start; margin-top: 14px; padding: 8px 14px;
  border: 1px solid var(--line); border-radius: 8px; background: transparent;
  color: var(--primary-text); font: inherit; font-size: 13px; font-weight: 750; cursor: pointer;
}
.plati-reviews-more-btn:hover { border-color: var(--primary-text); background: color-mix(in srgb, var(--primary-text) 8%, transparent); }
.plati-review-item[hidden] { display: none; }

.plati-tabpane .p2-panel + .p2-panel { margin-top: 18px; }

/* список в секциях описания */
.plati-list { list-style: none; padding: 0; margin: 8px 0 0; }
.plati-list li { position: relative; padding-left: 16px; }
.plati-list li::before { content: "·"; position: absolute; left: 2px; color: var(--primary-text); font-weight: 800; }

/* панель покупки */
.plati-buy-label { margin: 2px 0 8px; font-size: 11.5px; font-weight: 750; color: var(--muted); text-transform: uppercase; letter-spacing: .07em; }
.plati-variants { display: flex; flex-direction: column; gap: 8px; }
.plati-variant {
  display: flex; align-items: center; gap: 10px; padding: 11px 13px; cursor: pointer;
  border: 1px solid var(--line); border-radius: 12px; background: transparent;
  transition: border-color .15s ease, background .15s ease;
}
.plati-variant:hover { border-color: color-mix(in srgb, var(--primary-text) 45%, var(--line)); }
.plati-variant.is-selected { border-color: var(--primary-text); background: color-mix(in srgb, var(--primary-text) 8%, transparent); }
.plati-variant input { position: absolute; opacity: 0; pointer-events: none; }
.plati-variant-name { font-weight: 750; font-size: 14px; color: var(--text); }
.plati-variant-price { margin-left: auto; font-weight: 800; font-size: 15px; color: var(--primary-text); }
.plati-delta { font-size: 11.5px; color: var(--muted); border: 1px solid var(--line); border-radius: 999px; padding: 2px 8px; }

.plati-buy-price { display: flex; align-items: baseline; justify-content: space-between; margin: 14px 2px 10px; }
.plati-buy-price small { color: var(--muted); font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; }
.plati-buy-price b { font-size: 26px; font-weight: 800; color: var(--primary-text); }

.plati-buy-btn { width: 100%; justify-content: center; font-size: 15px; padding: 12px 18px; }
.plati-buy-note { margin-top: 10px; color: var(--muted); font-size: 12px; line-height: 1.55; }

/* прямая ссылка на оплату */
.plati-direct {
  width: 100%; margin-top: 8px; padding: 8px 10px; font-size: 11.5px; font-family: ui-monospace, monospace;
  color: var(--text); background: var(--surface, transparent); border: 1px solid var(--line); border-radius: 8px;
}

/* карточка продавца (рейтинг из API отзывов Digiseller) */
.plati-seller-row { display: flex; gap: 12px; align-items: center; }
.plati-seller-avatar {
  display: flex; align-items: center; justify-content: center; width: 44px; height: 44px;
  border-radius: 12px; font-weight: 800; font-size: 18px; color: var(--primary-text);
  background: color-mix(in srgb, var(--primary-text) 12%, transparent); border: 1px solid var(--line);
}
.plati-seller-meta { color: var(--muted); font-size: 12.5px; margin-top: 2px; }

/* отзывы */
.plati-review-sum { display: flex; align-items: baseline; gap: 8px; color: var(--muted); font-size: 13.5px; }
.plati-review-sum b { font-size: 20px; color: var(--text); }
.plati-review-star { color: #d99a00; }
.plati-review-cap { margin: 16px 0 2px; font-size: 11.5px; font-weight: 750; color: var(--muted); text-transform: uppercase; letter-spacing: .07em; }
.plati-review { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; margin-top: 10px; }
.plati-review header { display: flex; align-items: center; gap: 8px; min-width: 0; }
.plati-review header b { font-size: 13px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.plati-review header time { margin-left: auto; color: var(--muted); font-size: 11.5px; white-space: nowrap; }
.plati-review-mark { flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center; width: 20px; height: 20px; border-radius: 50%; font-size: 12px; font-weight: 800; }
.plati-review-mark.ok { color: var(--mint-text); background: color-mix(in srgb, var(--mint) 15%, transparent); }
.plati-review-mark.bad { color: var(--danger-text); background: color-mix(in srgb, var(--danger) 15%, transparent); }
.plati-review p { margin: 8px 0 0; color: var(--text); font-size: 13.5px; line-height: 1.55; }
.plati-review-reply { color: var(--muted) !important; font-size: 12.5px !important; border-top: 1px dashed var(--line); padding-top: 8px; }

/* каталог-главная */
.plati-cat-title { font-size: 18px; font-weight: 800; margin: 0 0 12px; }
.plati-catalog { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.plati-card {
  position: relative; display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 16px; overflow: hidden;
  text-decoration: none; background: color-mix(in srgb, var(--surface-solid, transparent) 92%, transparent);
  transition: border-color .15s ease, transform .15s ease;
}
.plati-card:hover { border-color: color-mix(in srgb, var(--primary-text) 55%, var(--line)); transform: translateY(-2px); }
.plati-card-link { display: flex; flex-direction: column; flex: 1 1 auto; text-decoration: none; }
.plati-card-img { display: block; aspect-ratio: 11 / 7; overflow: hidden; background: var(--surface, transparent); }
.plati-card-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.plati-card-body { display: flex; flex-direction: column; gap: 6px; padding: 12px 14px 8px; }
.plati-card-body b { color: var(--text); font-size: 14px; line-height: 1.35; font-weight: 750; }
.plati-card-meta { color: var(--muted); font-size: 12px; }
.plati-card-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 14px 14px; margin-top: auto; }
.plati-card-price { color: var(--primary-text); font-weight: 800; font-size: 16px; }
.plati-card-buy { padding: 7px 16px !important; font-size: 13px !important; white-space: nowrap; }

/* hero-преимущества (этап 6.3) */
.plati-benefits { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.plati-benefit {
  display: inline-flex; align-items: center; gap: 7px; padding: 6px 12px;
  border: 1px solid var(--line); border-radius: 999px;
  color: var(--muted); font-size: 12px; font-weight: 700; white-space: nowrap;
}
.plati-benefit svg { width: 14px; height: 14px; color: var(--primary-text); }

/* тулбар каталога: фильтр + сортировка (этап 6.3) */
.plati-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; margin: 0 0 18px; }
.plati-filter { display: flex; gap: 6px; flex-wrap: wrap; }
.plati-chip {
  border: 1px solid var(--line); border-radius: 999px; padding: 6px 14px;
  background: transparent; color: var(--muted); font-size: 12.5px; font-weight: 700; cursor: pointer;
}
.plati-chip:hover { color: var(--text); }
.plati-chip.is-active {
  color: var(--primary-text); border-color: color-mix(in srgb, var(--primary-text) 55%, var(--line));
  background: color-mix(in srgb, var(--primary-text) 12%, transparent);
}
.plati-sort { display: inline-flex; align-items: center; gap: 8px; margin-left: auto; color: var(--muted); font-size: 12.5px; font-weight: 700; }
.plati-sort select {
  border: 1px solid var(--line); border-radius: 9px; padding: 6px 10px;
  background: color-mix(in srgb, var(--surface-solid, transparent) 70%, transparent);
  color: var(--text); font-size: 12.5px; font-weight: 650; outline: none;
}

/* статистика (этап 6.3) — только честные суммы по своим товарам из Digiseller API */
.plati-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
@media (max-width: 640px) { .plati-stats { grid-template-columns: 1fr; } }
.plati-stat {
  border: 1px solid var(--line); border-radius: 14px; padding: 16px 18px;
  display: flex; flex-direction: column; gap: 3px;
}
.plati-stat b { color: var(--text); font-size: 24px; font-weight: 800; letter-spacing: -.02em; }
.plati-stat span { color: var(--muted); font-size: 12.5px; }

/* отзывы на главной (этап 6.3) */
.plati-reviews-home { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }
.plati-reviews-home .plati-review { margin-top: 0; }
.plati-review-product {
  flex: 0 0 auto; max-width: 45%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  color: var(--muted); font-size: 11px; font-weight: 700; border: 1px dashed var(--line);
  border-radius: 6px; padding: 2px 6px;
}

/* избранное на карточках (этап 6.5) */
.plati-fav { position: absolute; top: 10px; right: 10px; z-index: 5; width: 34px; height: 34px; border-radius: 10px;
  border: 1px solid var(--line); background: color-mix(in srgb, var(--surface-solid, transparent) 88%, transparent);
  color: var(--muted); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.plati-fav svg { width: 16px; height: 16px; }
.plati-fav:hover { color: var(--text); border-color: color-mix(in srgb, var(--primary-text) 45%, var(--line)); }
.plati-fav.is-liked { color: #e76f61; border-color: color-mix(in srgb, #e76f61 45%, var(--line)); }
.plati-fav.is-liked svg { fill: #e76f61; }

/* Товар: галерея | информация и описание | покупка. Отзывы — под первыми двумя колонками. */
.plati-product-grid {
  display: grid; gap: 24px; align-items: start; max-width: 1392px; margin-inline: auto;
  grid-template-columns: minmax(0, 1fr);
  grid-template-areas: "gallery" "info" "buy" "description" "reviews";
}
.plati-product-grid > * { min-width: 0; }
.plati-product-grid > .plati-gallery { grid-area: gallery; width: min(200px, 100%); height: auto; aspect-ratio: 1; }
.plati-product-grid > .plati-gallery img { width: 100%; height: 100%; }
.plati-product-grid > .plati-itemhead-copy { grid-area: info; overflow-wrap: anywhere; }
.plati-product-grid .plati-crumbs { flex-wrap: wrap; }
.plati-product-grid .plati-optchip { max-width: 100%; min-width: 0; }
.plati-product-grid > .plati-buycol { grid-area: buy; }
.plati-product-grid > .plati-description { grid-area: description; overflow-wrap: anywhere; }
.plati-product-grid > .plati-reviews-section { grid-area: reviews; overflow-wrap: anywhere; }
@media (min-width: 1024px) {
  .plati-product-grid {
    grid-template-columns: 200px minmax(0, 1fr) clamp(300px, 25vw, 400px);
    grid-template-areas: "gallery info buy" "gallery description buy" "reviews reviews buy";
  }
  .plati-product-grid > .plati-description { padding: 0; border: 0; background: none; box-shadow: none; }
  /* Тема задаёт боковой padding панелей через !important. */
  #app-main .plati-product-grid > .plati-description > :is(.p2-panel-head, .p2-panel-body) { padding-inline: 0 !important; }
}

.plati-buycol { display: flex; flex-direction: column; justify-content: center;
  border: 1px solid var(--line); border-radius: 14px; padding: 16px;
  background: color-mix(in srgb, var(--surface-solid, var(--bg)) 55%, transparent); }
.plati-buycol form { display: flex; flex-direction: column; gap: 10px; }
.plati-vhidden { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.plati-price-big { font-size: 27px; font-weight: 800; color: var(--text); letter-spacing: -0.5px; white-space: nowrap; }
/* зелёная «Купить» как у ggsel: плоский травяной зелёный, белый текст, БЕЗ свечения */
.plati-btn-buy { width: 100%; height: 48px; padding: 0 22px; border-radius: 8px; font-size: 15px; font-weight: 800;
  background: #3dc455 !important; color: #ffffff !important; border: none; box-shadow: none; }
.plati-btn-buy:hover { background: #35b24b !important; }
.plati-btn-buy:active { background: #30a545 !important; }
.plati-btn-buy svg { width: 17px; height: 17px; }
.plati-buy-note { margin: 0; font-size: 12px; }
.plati-sellerline { display: flex; align-items: center; gap: 9px; flex-wrap: wrap;
  color: var(--muted); font-size: 12px; }
.plati-sellerline .plati-seller-avatar { width: 26px; height: 26px; font-size: 12px; border-radius: 8px; }
.plati-sellerline-meta b { color: var(--text); font-size: 12.5px; }
.plati-chat-mini { height: 30px; padding: 0 12px; font-size: 12px; border-radius: 8px; }
.plati-chat-mini svg { width: 13px; height: 13px; }
.plati-direct-details { margin: 0; }
.plati-direct-details summary { font-size: 12px; color: var(--muted); }
.plati-optchips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.plati-payrow { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; margin-top: 12px; }
.plati-pay { display: inline-flex; align-items: center; }
.plati-pay svg { display: block; height: 20px; width: auto; }
