/* Карточки товаров (/shop, «Похожие товары», «Популярные товары») и кнопки на странице товара.
   Дополняет media/css/app.min.css (собран из media-src/css/_products.scss в 2020 г., сборщика на сервере нет). 2026-09-24 */

/* Картинка — отдельный блок справа, вписывается целиком и не наезжает на текст */
.products-list__item { overflow: hidden; }
.products-list__item.has-img { background-image: none !important; }
.products-list__item-img {
  position: absolute;
  top: 15px; right: 15px; bottom: 15px;
  width: 105px;
  max-width: none !important;
  background: no-repeat center / contain;
}

/* Текст — левая колонка, название не длиннее 4 строк */
.products-list__item.has-img > .products-list__item-title,
.products-list__item.has-img > .products-list__item__footer { max-width: 125px; }
.products-list__item-title {
  font-size: 14px;
  line-height: 19px;
  display: -webkit-box !important;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 4;
  line-clamp: 4;
  overflow: hidden;
  overflow-wrap: anywhere;
  max-height: 76px;
}
.products-list__item__footer { width: auto !important; right: 0; }
.products-list__item-price { white-space: nowrap; }

/* Страница товара: «Купить товар» и «Смотреть в магазине» в один ряд, при нехватке места — переносятся ровно */
.product__info-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.product__info-actions .btn { margin: 0 !important; }

/* Корзина: наличие в магазине, размеры и цвета (2026-09-24) */
.cart-stock { font-size: 13px; line-height: 18px; margin-top: 8px; }
.cart-stock.cs-ok { color: #1e9e6a; }
.cart-stock.cs-oos { color: #d64545; font-weight: 700; }
.cart-stock.cs-unknown { color: #8a98a3; }
.cart-stock.cs-checking { color: #8a98a3; }
.cart-stock.cs-checking:before {
  content: ''; display: inline-block; width: 10px; height: 10px; margin-right: 6px; vertical-align: -1px;
  border: 2px solid #b9c6cf; border-top-color: #2fb489; border-radius: 50%; animation: cartSpin .8s linear infinite;
}
@keyframes cartSpin { to { transform: rotate(360deg); } }
.cart-price-changed { font-size: 13px; line-height: 18px; color: #c77700; margin-top: 4px; }
.cart-options { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.cart-opt { font-size: 13px; padding: 5px 8px; border: 1px solid #cfdbe2; border-radius: 6px; background: #fff; max-width: 220px; }
.cart-opt_error { border-color: #d64545; box-shadow: 0 0 0 2px rgba(214, 69, 69, .15); }
.cart__item_oos .cart__item-product__title { opacity: .55; }
.btn-waiting { opacity: .6; cursor: progress; }

/* Список магазинов /shop (2026-09-24): логотип — своя колонка справа, текст не наезжает; описание до 5 строк */
@media (min-width: 769px) {
  .b-shop-list__item { display: flex; align-items: stretch; gap: 30px; }
  .b-shop-list__item-info { flex: 1 1 auto; min-width: 0; max-width: none; padding-right: 0; }
  .b-shop-list__item-logo {
    position: relative; flex: 0 0 220px; width: 220px; height: auto; min-height: 110px;
    background-size: contain; background-origin: content-box; padding: 10px 20px 10px 32px; box-sizing: border-box;
  }
}
.b-shop-list__item-info__lead {
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 5; line-clamp: 5; overflow: hidden;
}
.b-shop-list__item-info__buttons { display: flex; flex-wrap: wrap; gap: 10px; }
.b-shop-list__item-info__buttons .btn { margin: 0 !important; }
.shop-external-note { font-size: 13px; color: #8a98a3; margin-top: 8px; }
@media (max-width: 768px) {
  .b-shop-list__item { display: flex; flex-direction: column; }
  .b-shop-list__item-logo { order: -1; }
  .b-shop-list__item-info__buttons { justify-content: center; }
}

.cart-opt_text { width: 220px; }

/* справочная цена в рублях (только ru, 2026-09-24) */
.products-list__item-rub { display: block; font-size: 12px; line-height: 16px; color: #8a98a3; margin-top: 2px; }
.product-rub { display: block; font-size: 15px; color: #8a98a3; margin-top: 4px; cursor: help; }
.cart-rub { display: block; font-size: 12px; font-weight: 400; color: #8a98a3; }
.cart-total-rub { margin-left: 6px; font-size: 14px; color: #8a98a3; }
.js-cart-item .cart__item-price { height: auto; min-height: 30px; }
.cart-rub { line-height: 16px; margin-top: 3px; }
.cart-total-rub { line-height: 18px; }

/* комиссия за выкуп в корзине (2026-09-24) */
.cart-fee { margin: 14px 0 0; padding: 12px 16px; border-radius: 8px; background: #f3f8f9; color: #1d4a5c; font-size: 15px; line-height: 22px; }
.cart-fee__total { margin-left: 18px; white-space: nowrap; }
.cart-fee__total b { color: #20b598; font-size: 17px; }
.cart-fee__note { font-size: 13px; color: #8a98a3; margin-top: 4px; }
@media (max-width: 768px) { .cart-fee__total { display: block; margin: 4px 0 0; } }
.cart-fee__note_rub { color: #b07a1c; }

/* Корзина на телефоне (2026-09-24): строка товара — сетка, высота по содержимому
   (раньше блок с фото/названием был absolute и новые блоки наличия/параметров вылезали на соседний товар) */
@media (max-width: 768px) {
  .cart .cart__item.js-cart-item {
    display: grid !important; height: auto !important; min-height: 0 !important;
    grid-template-columns: 96px minmax(0, 1fr) 28px;
    grid-template-areas: "title title x" "photo price price" "photo amount amount" "photo total total" "stock stock stock" "note note note" "opts opts opts";
    column-gap: 14px; row-gap: 6px; padding: 18px 0 !important; align-items: start;
  }
  .cart .js-cart-item .cart__item-product,
  .cart .js-cart-item .cart__item-product > a { display: contents !important; }
  .cart .js-cart-item .cart__item-product__title { grid-area: title; width: auto !important; position: static !important; margin: 0 !important; }
  .cart .js-cart-item .cart__item-product__photo { grid-area: photo; width: 96px !important; height: 96px !important; position: static !important; margin: 0 !important; }
  .cart .js-cart-item .cart__item-price { grid-area: price; width: auto !important; position: static !important; }
  .cart .js-cart-item .cart__item-amount { grid-area: amount; width: auto !important; max-width: 220px; position: static !important; }
  .cart .js-cart-item .cart__item-total { grid-area: total; width: auto !important; padding-top: 4px !important; position: static !important; }
  .cart .js-cart-item .cart__item-actions { grid-area: x; position: static !important; justify-self: end; }
  .cart .js-cart-item .js-item-stock { grid-area: stock; width: auto !important; margin-top: 4px; }
  .cart .js-cart-item .js-price-changed { grid-area: note; }
  .cart .js-cart-item .js-item-options { grid-area: opts; width: auto !important; }
  .cart .js-cart-item .cart-opt { max-width: 100%; flex: 1 1 100%; }
  .cart .cart__bottom { height: auto !important; }
}
/* окна (lightbox) на телефоне: подложка имела min-width 1170px, окно 520px уезжало за экран */
@media (max-width: 768px) {
  .lightbox-wrapper { min-width: 0 !important; width: 100% !important; }
  .lightbox-wrapper .lightbox { width: auto !important; left: 16px !important; right: 16px !important; margin-left: 0 !important; max-width: none !important; }
  .lightbox-wrapper .lightbox-buttons { display: flex; flex-direction: column; gap: 10px; }
  .lightbox-wrapper .lightbox-buttons .btn { margin: 0 !important; width: 100%; }
}

/* «+» на карточке товара — сразу в корзину (2026-09-25), как в общем каталоге */
.products-list__item { position: relative; }
.products-list__add { position: absolute; right: 10px; bottom: 10px; z-index: 3; width: 34px; height: 34px; border-radius: 50%;
  background: #e3f6ef; box-shadow: 0 2px 6px rgba(14, 77, 100, .18); cursor: pointer; transition: background .15s, transform .15s; }
.products-list__add::before, .products-list__add::after { content: ''; position: absolute; left: 50%; top: 50%; width: 14px; height: 2px;
  margin: -1px 0 0 -7px; background: #2fb489; border-radius: 1px; }
.products-list__add::after { transform: rotate(90deg); }
.products-list__add:hover { background: #2fb489; transform: scale(1.08); }
.products-list__add:hover::before, .products-list__add:hover::after { background: #fff; }
.products-list__add.busy { opacity: .6; }
.products-list__add.added { background: #2fb489; }
.products-list__add.added::before { width: 7px; margin: 1px 0 0 -6px; background: #fff; transform: rotate(45deg); }   /* галочка */
.products-list__add.added::after  { width: 13px; margin: -1px 0 0 -3px; background: #fff; transform: rotate(-50deg); }

/* Наличие в магазине на карточке товара (2026-09-25) */
.product-stock { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; margin: 10px 0 14px; font-size: 14px; line-height: 1.4; color: #1d4a5c; }
.product-stock__dot { width: 9px; height: 9px; border-radius: 50%; background: #8a98a3; flex: none; }
.product-stock__ago { color: #8a98a3; font-size: 13px; }
.product-stock.is-checking .product-stock__dot { background: #f0b429; animation: productStockPulse 1s ease-in-out infinite; }
.product-stock.is-in_stock .product-stock__dot { background: #2fb489; }
.product-stock.is-in_stock .product-stock__text { color: #1f8a5f; font-weight: 600; }
.product-stock.is-out_of_stock .product-stock__dot { background: #e0493c; }
.product-stock.is-out_of_stock .product-stock__text { color: #c0392b; font-weight: 600; }
@keyframes productStockPulse { 0%, 100% { opacity: 1; } 50% { opacity: .3; } }

/* предварительный расчёт доставки в корзине (2026-09-25) */
.cart-delivery { margin: 10px 0 0; padding: 12px 16px; border-radius: 8px; background: #f7f7f2; color: #1d4a5c; font-size: 15px; line-height: 22px; }
.cart-delivery__head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.cart-delivery__country { height: 30px; padding: 0 6px; border: 1px solid #cfd8dc; border-radius: 6px; background: #fff; font-size: 15px; max-width: 100%; }
.cart-delivery__weight { color: #5b6b75; white-space: nowrap; }
.cart-delivery__list { display: flex; flex-wrap: wrap; gap: 4px 22px; margin-top: 6px; }
.cart-delivery__item { white-space: nowrap; }
.cart-delivery__item u { text-decoration: none; }
.cart-delivery__item b { color: #20b598; font-size: 17px; }
.cart-delivery__item .cart-rub { display: inline; margin: 0; font-style: normal; color: #8a98a3; font-size: 13px; }
.cart-delivery__none { color: #b07a1c; }
.cart-delivery__elec { margin-top: 8px; padding: 8px 12px; border-radius: 6px; background: #fff4e5; border: 1px solid #f5c98b; color: #7a4d0b; font-size: 14px; line-height: 20px; }

/* заголовок товара стал H1 (SEO, 2026-09-26) — вид прежний: без отступов браузера */
h1.product__info-title { margin: 0; }
