/* ===== Reset / Normalize ===== */
*,
*::before,
*::after { margin: 0; padding: 0; box-sizing: border-box; }

input, button, textarea, select {
  font: inherit; color: inherit; background: none; border: none; outline: none;
}

ul, ol { list-style: none; }

a { text-decoration: none; color: inherit; }

h1, h2, h3, h4, h5, h6 { font-size: inherit; font-weight: inherit; margin: 0; }

body {
  line-height: 1.5;
  font-family: 'Roboto Condensed', sans-serif;
  color: #303030;
  background: #fff;
  -webkit-font-smoothing: antialiased;
}

img { display: block; max-width: 100%; height: auto; }

strong {
    font-weight: 500;
}

:focus { outline: none; }

/* ===== Layout ===== */
.container { max-width: 1160px; margin: 0 auto; } /* не трогаем глобально на брейкпойнтах */

.product-page {
  display: flex;
  gap: 40px;
  align-items: flex-start;
  justify-content: space-between;
}

.product-left { max-width: 784px; flex: 1; }

.product-right-wrapper { width: 320px; flex-shrink: 0; }
.product-right { position: relative; width: 100%; }
.product-right-inner { border: 1px solid #ddd; padding: 20px; font-size: 16px; background: #fff; }

/* ===== Breadcrumbs / Title ===== */
.breadcrumbs {
  font-size: 14px; color: #777; margin-bottom: 16px; margin-top: 20px;
}
.breadcrumbs a { color: #777; }
.breadcrumbs a:hover { color: #C2181F; }
.breadcrumbs span { color: #303030; }

.product-title { font-size: 32px; font-weight: 400; margin-bottom: 24px; }

/* ===== Gallery / Specs ===== */
.product-gallery-block { display: flex; gap: 40px; margin-bottom: 40px; }

.product-thumbs-wrapper { display: flex; flex-direction: column; align-items: center; position: relative; }

.product-thumbs {
  display: flex; flex-direction: column; gap: 12px;
  max-height: 360px; overflow-y: auto; scrollbar-width: none;
}
.product-thumbs::-webkit-scrollbar { display: none; }

.product-thumbs img {
  width: 60px; height: 60px; object-fit: contain; border: 1px solid #ddd; cursor: pointer; transition: border .2s;
}
.product-thumbs img.active { border: 2px solid #C2181F; }

.thumbs-scroll-down { background: none; border: none; color: #999; font-size: 18px; margin-top: 8px; cursor: pointer; }
.thumbs-scroll-down svg { pointer-events: none; display: block; }

.product-main-image img { width: 320px; height: auto; object-fit: contain; }

.product-specs { margin-left: auto; flex: 1; max-width: 280px; }
.specs-title { font-size: 20px; font-weight: 500; margin-bottom: 16px; }
.spec-row {
  display: flex; justify-content: space-between;
  padding: 8px 0; border-bottom: 1px solid #eee; font-size: 14px; color: #333;
}

/* ===== Description / Features ===== */
.product-section { margin-top: 40px; }
.product-section h2 { font-size: 20px; font-weight: 500; margin-bottom: 16px; }
.product-section p { font-size: 16px; line-height: 1.5; }

.features-list {
  padding: 0; display: flex; flex-direction: column; gap: 2px;
}
.features-list li { border-bottom: 1px solid #eee; padding-bottom: 8px; }

/* ===== Right panel ===== */
.rating { color: #C2181F; font-size: 18px; }
.sku { font-size: 14px; color: #666; margin: 8px 0; }
.price { font-size: 24px; font-weight: bold; margin-bottom: 8px; }
.stock { color: green; font-size: 14px; margin-bottom: 16px; }

.add-to-cart {
  width: 100%; background: #C2181F; color: #fff; padding: 12px; cursor: pointer; font-size: 16px; margin-bottom: 12px;
}
.add-to-cart:hover { opacity: .85; }

.quick-order {
  width: 100%; background: #fff; border: 1px solid #C2181F; color: #C2181F; padding: 12px; font-size: 16px; cursor: pointer;
}
.quick-order:hover { opacity: .85; }

.delivery-note { font-size: 13px; color: #666; margin-top: 12px; }

.sidebar-links { margin-top: 24px; padding: 20px; border: 1px solid #ddd; background: #fff; }
.sidebar-links a { display: block; margin-top: 8px; color: #000; font-size: 14px; }
.sidebar-brand img { max-width: 80px; margin-bottom: 12px; }

/* ===== Reviews ===== */
.product-reviews { max-width: 1160px; margin: 60px auto 40px; padding: 0; }
.reviews-title { font-size: 24px; font-weight: 500; margin-bottom: 24px; }
.reviews-list { display: flex; flex-direction: column; gap: 24px; }
.review-item { border: 1px solid #eee; padding: 20px; font-size: 16px; line-height: 1.5; background: #fff; }
.review-rating { color: #C2181F; font-size: 20px; margin-bottom: 8px; }
.review-author { font-weight: 500; margin-bottom: 12px; }
.review-pros, .review-cons, .review-comment { margin-bottom: 8px; }

.reviews-filters {
  display: flex; align-items: center; justify-content: flex-start; flex-wrap: wrap; gap: 40px; margin-bottom: 32px;
}
.reviews-filters .sort span, .reviews-filters .filter span { font-weight: 500; margin-right: 8px; }
.reviews-filters a { color: #666; margin-right: 12px; }
.reviews-filters a.active { color: #C2181F; }

.reviews-more { margin-top: 32px; }
.reviews-more a {
  color: #8A8A8A; font-size: 16px; display: inline-flex; align-items: center; gap: 8px;
}
.reviews-more a:hover { text-decoration: underline; }
.arrow-icon { display: inline-block; }

/* ===== Sticky summary (как было) ===== */
.sticky-summary {
  position: fixed; top: 0; left: 0; right: 0; z-index: 1000; background: #fff;
  border-bottom: 1px solid #eee; padding: 8px 16px; display: flex; align-items: center; justify-content: space-between;
  transform: translateY(-100%); transition: transform .3s ease;
}
.sticky-summary.visible { transform: translateY(0); }
.sticky-summary-left { display: flex; align-items: center; gap: 12px; flex: 1; }
.sticky-summary-left img { width: 48px; height: 48px; object-fit: contain; }
.sticky-summary-info { display: flex; flex-direction: column; font-size: 14px; }
.sticky-summary-title { font-weight: 500; margin-bottom: 4px; }
.sticky-summary-price { font-weight: bold; }
.sticky-summary-rating { color: #C2181F; font-size: 16px; margin-right: 16px; }
.sticky-summary-stock { color: green; font-size: 14px; margin-right: 16px; }
.sticky-summary-cart {
  background: #C2181F; color: #fff; border: none; padding: 10px 16px; border-radius: 4px; font-size: 14px; margin-left: 16px; cursor: pointer;
}
.sticky-summary-icons i { font-size: 18px; color: #999; margin-left: 12px; cursor: pointer; }


@media (max-width: 1279px) {
    .container {
        max-width: 944px;
    }

      .product-left { max-width: 568px; }

  .product-gallery-block { display: flex; flex-wrap: wrap; width: 100%; }
  .product-thumbs-wrapper { order: 0; }
  .product-main-image { order: 1; margin-right: auto; }
  .product-specs { order: 2; width: 568px; flex-basis: 100%; margin-top: 20px; margin-left: 0; }
  .spec-row { width: 568px; }
}

/* ====== 1168px ====== */
@media (max-width: 1168px) {
  /* Не трогаем .container глобально, чтобы не ломать хедер/футер
     Если нужно сжать только карточку, оберни её в .product-card-container и правь его тут */


}

/* ====== 1023px — единый MOBILE/TABLET layout через GRID ====== */
@media (max-width: 911px) {
  .container { max-width: 94%;}
  /* Переходим на Grid, чтобы вставить правый блок между галереей и описанием */
  .product-page { display: grid; grid-template-columns: 1fr; gap: 20px; }

  /* «Разворачиваем» .product-left: его дети станут grid-элементами */
  .product-left { display: contents; }

  /* Порядок элементов */
  .product-gallery-block { grid-row: 1; }             /* Галерея + спецификации */
  .product-right-wrapper { grid-row: 2; width: 100%; flex-shrink: 0; } /* Правый блок сразу после галереи */
  .product-left .product-section:nth-of-type(1) { grid-row: 3; } /* Описание */
  .product-left .product-section:nth-of-type(2) { grid-row: 4; } /* Основные характеристики */

  /* Размеры внутри */
  .product-main-image { text-align: center; }
  .product-main-image img { max-width: 320px; width: 100%; height: auto; margin: 0 auto; }

  .product-specs { max-width: 100%; margin: 12px 0 0; }

  /* Панель справа на всю ширину и приятные размеры */
  .product-right-inner { padding: 16px; font-size: 16px; }
  .product-right-wrapper .price { font-size: 20px; margin-bottom: 12px; }
  .product-right-wrapper .add-to-cart,
  .product-right-wrapper .quick-order { font-size: 14px; padding: 10px; width: 100%; }
}

/* ====== 767px — только типографика/отступы (без смены раскладки!) ====== */
@media (max-width: 767px) {
  .product-title { font-size: 20px; margin-bottom: 16px; }
  .delivery-note { font-size: 12px; }
  .reviews-title { font-size: 18px; }
  .review-item { font-size: 14px; padding: 16px; }
}

/* ====== 414px — мелкая полировка при необходимости ====== */
@media (max-width: 414px) {
  .sticky-summary { padding: 6px 8px; }
  .sticky-summary-left img { width: 32px; height: 32px; }
  .sticky-summary-info { font-size: 12px; }
  .sticky-summary-title { font-size: 12px; margin-bottom: 2px; }
  .sticky-summary-price { font-size: 13px; }
  .sticky-summary-rating, .sticky-summary-stock { display: none; }
  .sticky-summary-cart { font-size: 14px; padding: 10px 6px; margin: 0; }
  .sticky-summary-icons i { font-size: 16px; margin-right: 12px; }
}

@media (max-width: 1023px) {
  .spec-row { width: 100%; }
  .product-specs { max-width: 100%; width: 100%; }
  .product-gallery-block { gap: 20px; } /* чуть меньше gap, чтобы точно не вылазило */
  .container {max-width: 94%;}
}

/* Гарантируем, что правый столбец на узких экранах тянется на всю ширину (переигрываем правила 900/840) */
@media (max-width: 900px) {
  .product-right-wrapper { width: 100%; }
}
@media (max-width: 840px) {
  .product-right-wrapper { width: 100%; }
}

/* На очень узких — ограничим главную картинку, чтобы не «давила» */
@media (max-width: 767px) {
  .product-main-image { text-align: center; }
  .product-main-image img {
    max-width: 320px;
    width: 100%;
    height: auto;
    margin: 0 auto;
  }
}

/* На случай длинных артикулов/хлебных крошек (чтобы строка не «проталкивала» макет) */
.breadcrumbs, .sku {
  overflow-wrap: anywhere;
  word-break: break-word;
}

/* ===== Lightbox (fullscreen gallery) ===== */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.9);
  z-index: 2000;
  display: none;
}

.lightbox.open { display: block; }

.lightbox-inner {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
}

.lightbox-close {
  position: absolute;
  top: 10px;
  right: 14px;
  font-size: 32px;
  line-height: 1;
  color: #fff;
  background: none;
  border: none;
  cursor: pointer;
  z-index: 2100;
}

.lightbox-swiper {
  width: 100%;
  height: 100%;
}

.lightbox-swiper .swiper-slide {
  display: grid;
  place-items: center;
}

.lightbox-swiper .swiper-slide img {
  max-width: 100%;
  max-height: 85vh;
  width: auto;
  height: auto;
  object-fit: contain;
}

.lightbox-prev,
.lightbox-next {
  color: #fff;
}

.lightbox-pagination .swiper-pagination-bullet {
  background: #fff;
  opacity: .4;
}

.lightbox-pagination .swiper-pagination-bullet-active {
  opacity: 1;
}

.product-main-image img { cursor: zoom-in; }


/* фирменный красный */
.lightbox {
  --swiper-navigation-color: #C2181F;
  --swiper-pagination-color: #C2181F;
}

/* если где-то переигрывается, можно продублировать */
.lightbox-prev, .lightbox-next { color: #C2181F; }

.lightbox-swiper {
  width: 100%;
  height: 100%;
}
.lightbox-swiper .swiper-wrapper { height: 100%; }
.lightbox-swiper .swiper-slide {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: zoom-out; /* подсказка, что клик закроет */
}

.lightbox-swiper .swiper-slide img {
  max-width: 100%;
  max-height: 85vh;
  width: auto;
  height: auto;
  object-fit: contain;
  cursor: default; /* чтобы на самой картинке курсор оставался обычным */
}

/* Красные стрелки/буллеты — оставить */
.lightbox {
  --swiper-navigation-color: #C2181F;
  --swiper-pagination-color: #C2181F;
}
.lightbox-prev, .lightbox-next { color: #C2181F; }


/* ≤399px: превью в одну горизонтальную ленту, большая картинка ниже */
@media (max-width: 425px) {

  /* Чуть компактнее основная картинка, чтобы смотрелось аккуратнее */
  .product-main-image img {
    max-width: 240px;   /* было 320px — на ультраузких лучше 280 */
    width: 100%;
    height: auto;
    margin: 0 auto;
  }

    .product-gallery-block {
    align-items: center; /* выравниваем основное фото по вертикали */
  }
}


/* ===== Rich text (описание из БД) ===== */
.product-section {
  color: #303030;
}

/* Заголовки (h3) внутри описания */
.product-section h3 {
  font-size: 20px;
  line-height: 1.3;
  font-weight: 500;
  margin: 28px 0 12px;
  position: relative;
  scroll-margin-top: 80px; /* чтоб не прилипало под липкий header при якорях */
}

/* Акцентная черта под h3 (не кричащая) */
/* .product-section h3::after {
  content: "";
  display: block;
  width: 56px;
  height: 2px;
  background: #C2181F;
  margin-top: 8px;
  border-radius: 2px;
} */

/* Параграфы */
.product-section p {
  font-size: 16px;
  line-height: 1.7;
  margin: 0 0 14px;
  color: #303030;
}

/* Списки под h3 (и вообще в описании) */
.product-section ul {
  margin: 8px 0 18px 0;
  padding-left: 0;           /* убираем дефолтный отступ */
}

.product-section li {
  position: relative;
  padding-left: 28px;        /* место под кастомный маркер */
  margin: 8px 0;
  line-height: 1.6;
}

/* Кастомный маркер списка: мягкая «пилюля» в фирменном цвете */
.product-section li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.8em;                /* вертикальное выравнивание точки с текстом */
  width: 8px;
  height: 8px;
  background: #C2181F;
  border-radius: 999px;
  transform: translateY(-50%);
  box-shadow: 0 0 0 3px rgba(194, 24, 31, 0.12); /* мягкое свечение */
}

/* Вложенные списки: чуть меньше маркер и отступ */
.product-section li ul {
  margin-top: 6px;
  margin-bottom: 6px;
}
.product-section li ul > li {
  padding-left: 24px;
}
.product-section li ul > li::before {
  width: 6px;
  height: 6px;
  box-shadow: 0 0 0 2px rgba(194, 24, 31, 0.10);
}

/* Последний параграф/список без лишнего отступа снизу */
.product-section > *:last-child {
  margin-bottom: 0 !important;
}

/* Ссылки в описании */
.product-section a {
  color: #C2181F;
  text-decoration: none;
  border-bottom: 1px solid rgba(194, 24, 31, 0.3);
}
.product-section a:hover {
  border-bottom-color: rgba(194, 24, 31, 0.6);
}

/* Таблицы (если вдруг залетят) — компактно и аккуратно */
.product-section table {
  width: 100%;
  border-collapse: collapse;
  margin: 16px 0;
  font-size: 15px;
}
.product-section th,
.product-section td {
  padding: 10px 12px;
  border-bottom: 1px solid #eee;
  text-align: left;
}
.product-section th {
  font-weight: 600;
  background: #fafafa;
}

/* Мелкая адаптация под узкие экраны */
@media (max-width: 767px) {
  .product-section h3 { font-size: 18px; margin: 24px 0 10px; }
  .product-section p  { font-size: 15px; line-height: 1.7; }
  .product-section li { margin: 6px 0; padding-left: 24px; }
  .product-section li::before { width: 7px; height: 7px; box-shadow: 0 0 0 2.5px rgba(194,24,31,.12); }
}

.lightbox:not(.open) { display: none !important; }

/* Общий вид списка */
.features-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 0;
  margin: 0;
}

/* Одна строка характеристики */
.feature-row {
  display: flex;
  align-items: baseline;      /* выравнивание по базовой линии — смотрится аккуратнее */
  gap: 10px;
  padding: 0px 0;
  border-bottom: 1px solid #eee;
}

/* Имя — слева */
.feature-name {
  color: #303030;
  min-width: 0;               /* чтобы работали обрезки/переносы при длинных именах */
}

/* «Дорожка» между именем и значением */
.feature-dots {
  flex: 1 1 auto;
  border-bottom: 0px dotted #E3E3E3;
  margin: 0 6px;
  transform: translateY(-2px); /* чуть поднимаем, чтобы линия была на уровне текста */
}

/* Значение — справа */
.feature-value {
  color: #000;
  text-align: right;
  white-space: nowrap;        /* не переносим значение — обычно это короче и аккуратнее */
}

/* Узкие экраны: если значения бывают длинными — разрешим переносы */
@media (max-width: 480px) {
  .feature-value {
    white-space: normal;
    word-break: break-word;
    text-align: right;
  }
}

b {
  font-weight: 500;
}

/* Цена — общий блок */
.price-wrap { margin: 8px 0 12px; }
.price-row { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }

/* Текущая цена */
.price-current {
  font-size: 28px;
  font-weight: 500;
  line-height: 1.1;
  color: #000;
}

/* Старая цена (если есть акция) */
.price-old {
  font-size: 16px;
  color: #8A8A8A;
  text-decoration: line-through;
}

/* У вас была .price — можно больше не использовать,
   либо оставить для обратной совместимости, но без жирности: */
.price { font-size: 24px; font-weight: 500; margin-bottom: 8px; }

/* В липком суммари делаем компактнее */
.sticky-summary .price-current { font-size: 16px; font-weight: 500; }
.sticky-summary .price-old { font-size: 13px; }

/* ожидание */
.add-to-cart.btn-cart--pending,
.sticky-summary-cart.btn-cart--pending {
  opacity: .7;
  pointer-events: none;
}

/* ошибка */
.add-to-cart.btn-cart--error,
.sticky-summary-cart.btn-cart--error {
  background: #B00020 !important;
  border-color: #B00020 !important;
  color: #fff !important;
}

/* В корзине — зелёная */
.add-to-cart.btn-cart--added,
.add-to-cart[aria-pressed="true"],
.sticky-summary-cart.btn-cart--added,
.sticky-summary-cart[aria-pressed="true"] {
  background: #3A7A63 !important;
  border-color: #3A7A63 !important;
  color: #fff !important;
}


.sticky-fav-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border: 1px solid #e6e6e6; border-radius: 8px;
  background: #fff; color: #8A8A8A; cursor: pointer;
}
.sticky-fav-btn:hover { background: #f7f7f7; }
.sticky-fav-btn[aria-pressed="true"] { color: #C2181F; border-color: #f0c7cb; background: #fff5f6; }
