/* =========================================================
   VEIWED GRID (News + Recommended) — clean version
   цель: горизонтальная лента + карточки, фото сверху, текст снизу
   ========================================================= */

/* 0) Safety */
.veiwed-grid,
.veiwed-grid * {
  box-sizing: border-box;
}

/* 1) Ribbon container (scroll) */
.veiwed-grid {
  width: 100%;
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  gap: 16px;

  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;

  scroll-snap-type: x mandatory;
  padding-bottom: 6px; /* чтобы тень не резалась */

  /* ширина карточки по брейкпоинтам */
  --cardw: calc((100% - 16px * 4) / 5);
}

/* hide scrollbar (optional) */
.veiwed-grid::-webkit-scrollbar { height: 0; }

@media (max-width: 1200px) {
  .veiwed-grid { --cardw: calc((100% - 16px * 3) / 4); }
}
@media (max-width: 992px) {
  .veiwed-grid { --cardw: calc((100% - 16px * 2) / 3); }
}
@media (max-width: 600px) {
  .veiwed-grid { --cardw: 89vw; } /* ~2.1 карточки */
}

/* 2) Item width override (ломаем col-*-12 только внутри ленты) */
.veiwed-grid > .product-layout_carusel,
.veiwed-grid > .product-layout {
  flex: 0 0 var(--cardw) !important;
  width: var(--cardw) !important;
  max-width: var(--cardw) !important;
  float: none !important;

  scroll-snap-align: start;
}

/* 3) Card look */
.veiwed-grid .product-thumb {
  display: flex !important;
  flex-direction: column !important;
  width: 100%;
  height: 100%;

  border-radius: 0;
  background: transparent;
  box-shadow: none;
  overflow: visible;
}

/* 4) KEY FIX: внутри veiwed-grid делаем “фото сверху, текст снизу”
      (у тебя это собирается через .item_best_caption / .box_veiwed) */
.veiwed-grid .item_best_caption,
.veiwed-grid .box_veiwed {
  display: flex !important;
  flex-direction: column !important;
  align-items: stretch !important;
}

/* 5) Image top (full width) */
.veiwed-grid .product-thumb .image,
.veiwed-grid .box_veiwed .image {
  width: 100% !important;
  max-width: 100% !important;
  float: none !important;
  margin: 0 !important;
  overflow: hidden;
}

.veiwed-grid .product-thumb .image img,
.veiwed-grid .box_veiwed .image img {
  width: 100% !important;
  height: auto !important;
  display: block !important;

  /* квадрат как на примере */
  aspect-ratio: 1 / 1;
  object-fit: cover;
}

/* 6) Text block under image */
.veiwed-grid .product-thumb .caption,
.veiwed-grid .box_veiwed .box_flex,
.veiwed-grid .box_veiwed .box_flex.flex_r {
  width: 100% !important;
  float: none !important;
  display: block !important;

  padding: 12px 14px 14px;
}

/* title */
.veiwed-grid .product-thumb .caption a,
.veiwed-grid .product-thumb .caption h4,
.veiwed-grid .box_veiwed .product-name,
.veiwed-grid .box_veiwed .product-name a {
  display: block;
  text-decoration: none;
  font-weight: 700;
  line-height: 1.15;
  word-break: break-word; /* перенос длинных */
}

/* 7) Recommended extras (price + cart) — если есть */
.veiwed-grid .price { margin-top: 6px; }

.veiwed-grid .button-group,
.veiwed-grid .cart,
.veiwed-grid .btn-cart {
  margin-top: auto;
}


/* === ALL veiwed-grid: clean cards like news === */
.veiwed-grid .product-thumb {
  padding: 0 !important;
}
.veiwed-grid .box_veiwed .box_flex,
.veiwed-grid .box_veiwed .box_flex.flex_r {
  padding: 8px 0 0 0 !important;
  background: transparent !important;
}
.veiwed-grid .gtile-i-wrap,
.veiwed-grid .item_best,
.veiwed-grid .item_best.caption,
.veiwed-grid .box_veiwed {
  background: transparent !important;
}
.veiwed-grid .box_veiwed .image {
  border-radius: 0 !important;
}
.veiwed-grid .box_veiwed .image img {
  border-radius: 0 !important;
}

/* === Mobile: all cards 2 per screen === */
@media (max-width: 600px) {
  .veiwed-grid { --cardw: 45vw; }
}


/* VK 2026-07-22 hide Be PVM */
.price-tax { display: none !important; }

/* VK 2026-07-22 v9 hide Be PVM (all) */
.price-tax, .taxpd, ul.taxpd, ul.list-unstyled.taxpd { display: none !important; visibility: hidden !important; height: 0 !important; }
