/* ==========================================================================
   Pilcrow — Страница товара (десктоп). Дизайн по макету Figma.
   Токены: текст #2b2a2b, цена #292d32, скидка #961d1f, контур/заливка #2a2a2a,
   текст-на-тёмном #e1ded7, радиус 8px. Заголовок — Inter Medium, цена/кнопки/
   подписи-акценты — Arial Black.
   ========================================================================== */

/* Десктоп/мобайл переключение блоков (мобайл — отдельная задача) */
.product-mobile { display: none; }
/* высокая специфичность: фикс-бар корзины — только мобайл */
.product-cart-controls.product-cart-controls--mobile { display: none; }

.product-page { padding: 24px 0 40px; background: #fff; }

/* ---- Хлебные крошки ---- */
.product-page .breadcrumbs {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    margin: 0 0 28px;
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    line-height: 1;
    color: rgba(42, 42, 42, .56);
}
.product-page .breadcrumbs a { color: rgba(42, 42, 42, .56); text-decoration: none; }
.product-page .breadcrumbs a:hover { color: #2b2a2b; }
.product-page .breadcrumbs__sep { color: rgba(42, 42, 42, .4); }

/* ====================== Сетка: фото | инфо | сайдбар ====================== */
.product-detail {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr) 320px;
    gap: 44px;
    align-items: start;
}

/* ---------------------------- Галерея ---------------------------- */
.product-gallery { display: flex; gap: 14px; }
.product-gallery__thumbs-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    width: 70px;
    flex: 0 0 70px;
}
.product-gallery__thumbs {
    display: flex;
    flex-direction: column;
    gap: 8px;
    overflow-y: auto;
    max-height: 615px;
    scrollbar-width: none;
}
.product-gallery__thumbs::-webkit-scrollbar { display: none; }
.product-gallery__thumb {
    width: 70px;
    height: 92px;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    border: 1px solid transparent;
    background: #f4f4f4;
    transition: border-color .2s ease;
}
.product-gallery__thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.product-gallery__thumb.active { border-color: #2a2a2a; }
.product-gallery__thumbs-btn {
    width: 32px; height: 32px;
    display: flex; align-items: center; justify-content: center;
    background: none; border: none; cursor: pointer; color: #2b2a2b;
    flex: 0 0 auto;
}
.product-gallery__thumbs-btn:disabled { opacity: .25; cursor: default; }
.product-gallery__main {
    flex: 1;
    aspect-ratio: 466 / 615;
    border-radius: 8px;
    overflow: hidden;
    background: #f4f4f4;
}
.product-gallery__main img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* ---------------------------- Центр: инфо ---------------------------- */
.product-info { min-width: 0; }
/* Бейдж с названием акции над заголовком в макете отсутствует — скрываем */
.product-info__badge { display: none; }
.product-info__title {
    margin: 0 0 16px;
    font-family: 'Inter', sans-serif;
    font-weight: 500;
    font-size: 36px;
    line-height: 1.05;
    text-transform: uppercase;
    color: #2b2a2b;
}

/* Рейтинг / вопросы */
.product-info__meta {
    display: flex;
    align-items: center;
    gap: 22px;
    margin: 0 0 28px;
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    color: #2b2a2b;
}
.product-rating, .product-questions { display: inline-flex; align-items: center; gap: 6px; }
.product-rating__score { font-weight: 700; color: #2b2a2b; }
.product-rating__link, .product-questions__link { color: rgba(42, 42, 42, .56); text-decoration: none; }
.product-rating__link:hover, .product-questions__link:hover { color: #2b2a2b; }

/* Размеры */
.product-sizes { margin: 0 0 28px; }
.product-sizes__head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    margin: 0 0 12px;
}
.product-sizes__label { font-family: 'Inter', sans-serif; font-size: 16px; color: #2b2a2b; }
.product-sizes__chart-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    color: rgba(42, 42, 42, .56);
    text-decoration: none;
    white-space: nowrap;
}
.product-sizes__chart-btn svg { color: rgba(42, 42, 42, .5); }
.product-sizes__chart-btn:hover { color: #2b2a2b; }
.product-sizes__list { display: flex; flex-wrap: wrap; gap: 10px; }
.product-sizes__btn {
    min-width: 64px;
    height: 47px;
    padding: 0 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #2a2a2a;
    border-radius: 8px;
    background: transparent;
    cursor: pointer;
    font-family: 'Inter', sans-serif;
    color: #2b2a2b;
    transition: background .18s ease, color .18s ease, border-color .18s ease;
}
.product-sizes__btn-main { font-size: 16px; line-height: 1; text-transform: uppercase; }
/* рус-размер по макету не показываем (доступен в характеристиках) */
.product-sizes__btn-rus { display: none; }
.product-sizes__btn:hover { border-color: #000; }
.product-sizes__btn.active { background: #2a2a2a; border-color: #2a2a2a; color: #e1ded7; }
.product-sizes__btn.unavailable { opacity: .35; cursor: not-allowed; text-decoration: line-through; }

/* Аккордеоны «О товаре» / «Характеристики» (раскрытие текста) */
.product-about, .product-chars { margin: 0 0 24px; }
.product-about__title, .product-chars__title {
    margin: 0 0 10px;
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    font-size: 16px;
    color: #2b2a2b;
}
.product-about__text {
    font-family: 'Inter', sans-serif;
    font-size: 15px;
    line-height: 1.6;
    color: #2b2a2b;
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.product-about__text.expanded { -webkit-line-clamp: unset; overflow: visible; }
.product-about__more, .product-chars__toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 10px;
    padding: 0;
    background: none;
    border: none;
    cursor: pointer;
    font-family: 'Inter', sans-serif;
    font-size: 15px;
    color: #2b2a2b;
}
.product-about__more svg, .product-chars__toggle svg { width: 16px; height: 16px; transition: transform .2s ease; }
.product-about__more.open svg, .product-chars__toggle.open svg { transform: rotate(180deg); }

/* Характеристики — строки с точечным лидером */
.product-chars__list { display: flex; flex-direction: column; gap: 10px; }
.product-chars__row { display: flex; align-items: baseline; gap: 6px; font-family: 'Inter', sans-serif; font-size: 15px; }
.product-chars__row.hidden { display: none; }
.product-chars__label { color: rgba(42, 42, 42, .56); white-space: nowrap; }
.product-chars__dots { flex: 1; border-bottom: 1px dotted rgba(42, 42, 42, .3); transform: translateY(-4px); }
.product-chars__value { color: #2b2a2b; text-align: right; display: inline-flex; align-items: center; gap: 6px; }
.copy-btn { background: none; border: none; cursor: pointer; color: rgba(42, 42, 42, .5); line-height: 0; }
.copy-btn:hover { color: #2b2a2b; }

/* Фото/видео покупателей */
.product-buyer-media { margin: 8px 0 0; }
.product-buyer-media__title { margin: 0 0 10px; font-family: 'Inter', sans-serif; font-weight: 600; font-size: 16px; color: #2b2a2b; }
.product-buyer-media__list { display: flex; gap: 8px; flex-wrap: wrap; }
.product-buyer-media__item {
    width: 72px; height: 96px; border-radius: 8px; overflow: hidden; cursor: pointer;
    background: #f4f4f4; position: relative;
}
.product-buyer-media__item img { width: 100%; height: 100%; object-fit: cover; display: block; }
.product-buyer-media__more { display: flex; align-items: center; justify-content: center; background: #2a2a2a; color: #e1ded7; font-family: 'Arial Black','Arial',sans-serif; font-size: 16px; }

/* ---------------------------- Сайдбар: цена + покупка ---------------------------- */
.product-sidebar { position: sticky; top: 100px; }
.product-purchase-block { margin: 0 0 20px; }
.product-price__row { display: flex; align-items: baseline; flex-wrap: wrap; gap: 12px; margin: 0 0 14px; }
.product-price__current {
    font-family: 'Arial Black', 'Arial', sans-serif;
    font-weight: 900;
    font-size: 32px;
    line-height: 1;
    color: #292d32;
}
.product-price__old {
    font-family: 'Arial Black', 'Arial', sans-serif;
    font-weight: 900;
    font-size: 20px;
    line-height: 1;
    color: rgba(41, 45, 50, .4);
    text-decoration: line-through;
}
.product-price__discount {
    font-family: 'Arial Black', 'Arial', sans-serif;
    font-weight: 900;
    font-size: 20px;
    line-height: 1;
    color: #961d1f;
}
.product-price__badges { display: flex; flex-direction: column; gap: 6px; margin: 0 0 16px; }

/* Кнопки покупки */
.product-cart-controls { display: flex; flex-direction: column; gap: 10px; }
.product-cart-row { display: flex; flex-direction: column; gap: 10px; }
/* На десктопе по макету — одна основная кнопка «добавить в корзину» */
.product-sidebar .product-buy-now-btn { display: none; }
.product-cart-btn {
    width: 100%;
    height: 56px;
    background: #2a2a2a;
    color: #e1ded7;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-family: 'Arial Black', 'Arial', sans-serif;
    font-weight: 900;
    font-size: 20px;
    text-transform: uppercase;
    transition: opacity .2s ease;
}
.product-cart-btn:hover { opacity: .9; }
.product-cart-btn.unavailable { background: #e4e4e6; color: #9e9e9e; cursor: not-allowed; }

/* В корзине: счётчик количества */
.product-qty-block {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    height: 52px;
    padding: 0 8px;
    border: 1px solid #2a2a2a;
    border-radius: 8px;
}
.product-qty-btn {
    width: 40px; height: 40px;
    display: flex; align-items: center; justify-content: center;
    background: none; border: none; cursor: pointer;
    font-size: 22px; color: #2b2a2b;
}
.product-qty-info { display: flex; flex-direction: column; align-items: center; line-height: 1.1; }
.product-qty-value { font-family: 'Arial Black','Arial',sans-serif; font-size: 18px; color: #2b2a2b; }
.product-qty-label { font-family: 'Inter', sans-serif; font-size: 11px; color: rgba(42, 42, 42, .56); }

/* Аккордеон преимущества/доставка — контурные скруглённые боксы */
.product-accordion { display: flex; flex-direction: column; gap: 10px; }
.product-accordion__item { border: 1px solid #2a2a2a; border-radius: 8px; }
.product-accordion__header {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 18px;
    background: none;
    border: none;
    cursor: pointer;
    font-family: 'Arial Black', 'Arial', sans-serif;
    font-weight: 900;
    font-size: 15px;
    text-transform: uppercase;
    color: #292d32;
}
.product-accordion__arrow { width: 16px; height: 16px; transition: transform .2s ease; color: #2b2a2b; }
.product-accordion__item.open .product-accordion__arrow { transform: rotate(180deg); }
.product-accordion__content { display: none; padding: 0 18px 16px; }
.product-accordion__item.open .product-accordion__content { display: block; }
.product-benefits__item, .delivery-option { display: flex; align-items: flex-start; gap: 10px; margin: 0 0 12px; font-family: 'Inter', sans-serif; font-size: 14px; color: #2b2a2b; }
.benefit-icon, .delivery-icon { flex: 0 0 auto; }
.delivery-city { margin: 0 0 14px; font-family: 'Inter', sans-serif; font-size: 14px; color: rgba(42, 42, 42, .7); }
.delivery-city__btn { background: none; border: none; cursor: pointer; color: #2b2a2b; text-decoration: underline; font: inherit; }
.delivery-date { font-weight: 600; }
.delivery-method { color: #2b2a2b; }
.delivery-note { color: rgba(42, 42, 42, .5); font-size: 13px; }

/* ====================== Отзывы / вопросы ====================== */
.reviews-section { padding: 48px 0 0; }
.reviews-tabs { display: flex; gap: 10px; margin: 0 0 24px; }
.reviews-tab {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 22px;
    border: 1px solid #2a2a2a;
    border-radius: 8px;
    background: transparent;
    cursor: pointer;
    font-family: 'Arial Black', 'Arial', sans-serif;
    font-weight: 900;
    font-size: 16px;
    text-transform: uppercase;
    color: #2b2a2b;
    transition: background .2s ease, color .2s ease;
}
.reviews-tab.active { background: #2a2a2a; color: #e1ded7; }
.reviews-tab__count { font-family: 'Inter', sans-serif; font-size: 13px; opacity: .8; }

.reviews-summary { display: flex; align-items: center; gap: 18px; margin: 0 0 22px; }
.reviews-summary__rating { display: flex; align-items: center; gap: 12px; }
.reviews-summary__score { font-family: 'Arial Black','Arial',sans-serif; font-size: 40px; line-height: 1; color: #2b2a2b; }
.reviews-summary__stars { display: inline-flex; gap: 3px; }
.reviews-summary__stars svg { width: 22px; height: 22px; }
.reviews-summary__badge {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 8px 16px; border-radius: 8px; background: #f4f4f4;
    font-family: 'Inter', sans-serif; font-size: 14px; color: #2b2a2b;
}

.reviews-carousel { position: relative; }
.reviews-list, .questions-list {
    display: flex;
    gap: 16px;
    overflow-x: auto;
    scroll-behavior: smooth;
    scrollbar-width: none;
    padding: 2px;
}
.reviews-list::-webkit-scrollbar, .questions-list::-webkit-scrollbar { display: none; }
.review-card, .question-card {
    flex: 0 0 340px;
    max-width: 340px;
    padding: 20px;
    border: 1px solid #e4e4e6;
    border-radius: 12px;
    cursor: pointer;
    background: #fff;
}
.review-card__header { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin: 0 0 12px; }
.review-card__author { font-family: 'Arial Black','Arial',sans-serif; font-size: 15px; color: #2b2a2b; }
.review-card__date { font-family: 'Inter', sans-serif; font-size: 13px; color: rgba(42, 42, 42, .5); }
.review-card__stars { display: inline-flex; gap: 2px; margin-left: auto; }
.review-card__stars svg { width: 16px; height: 16px; }
.review-card__text { font-family: 'Inter', sans-serif; font-size: 14px; line-height: 1.55; color: #2b2a2b; margin: 0 0 8px; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.review-card__text strong { font-weight: 600; }
.review-card__label { font-family: 'Inter', sans-serif; font-size: 13px; color: rgba(42, 42, 42, .56); margin: 0 0 8px; }
.review-card__tags { display: flex; flex-wrap: wrap; gap: 6px; }
.review-card__tag { padding: 5px 10px; border: 1px solid #e4e4e6; border-radius: 8px; font-family: 'Inter', sans-serif; font-size: 12px; text-transform: uppercase; color: #2b2a2b; }
.review-card__photos img { border-radius: 8px; }
.question-card { cursor: default; }
.question-card__question { font-family: 'Arial Black','Arial',sans-serif; font-size: 15px; color: #2b2a2b; margin: 0 0 12px; }
.question-card__answer { font-family: 'Inter', sans-serif; font-size: 14px; line-height: 1.55; color: #2b2a2b; }
.question-card__answer-label { display: block; font-weight: 600; color: rgba(42, 42, 42, .56); margin: 0 0 4px; }

.carousel-arrow {
    position: absolute; top: 50%; transform: translateY(-50%);
    width: 44px; height: 44px; z-index: 3;
    display: flex; align-items: center; justify-content: center;
    background: #fff; border: 1px solid #e4e4e6; border-radius: 50%;
    cursor: pointer; color: #2b2a2b;
    box-shadow: 0 4px 14px rgba(0,0,0,.08);
}
.carousel-arrow--left { left: -10px; }
.carousel-arrow--right { right: -10px; }
.carousel-arrow svg { width: 18px; height: 18px; }
.reviews-more-btn {
    margin-top: 18px; padding: 12px 28px;
    background: transparent; border: 1px solid #2a2a2a; border-radius: 8px;
    cursor: pointer; font-family: 'Arial Black','Arial',sans-serif; font-size: 15px;
    text-transform: uppercase; color: #2b2a2b;
}
.reviews-more-btn:hover { background: #2a2a2a; color: #e1ded7; }

/* ====================== Секции «смотрите также» / «недавно» ====================== */
.similar-section, .recent-section { padding: 48px 0 0; }
.promo-banners { padding: 40px 0 0; }
.promo-banners__grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.promo-banner { border-radius: 8px; overflow: hidden; aspect-ratio: 1; }
.promo-banner img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* ====================== Попап «Оценка и отзывы» (по макету Figma) ====================== */
.all-reviews-overlay {
    position: fixed; inset: 0;
    background: rgba(0, 0, 0, .5);
    z-index: 10001;
    display: flex; align-items: center; justify-content: center;
    padding: 24px;
}
.all-reviews-popup {
    background: #fff;
    border-radius: 20px;
    width: 100%;
    max-width: 900px;
    max-height: 88vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.all-reviews-popup__header {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 28px 28px 18px;
    flex-shrink: 0;
}
.all-reviews-popup__title {
    font-family: 'Arial Black', 'Arial', sans-serif;
    font-weight: 900;
    font-size: 30px;
    text-transform: uppercase;
    color: #2b2a2b;
    text-align: center;
}
.all-reviews-popup__close {
    position: absolute;
    top: 22px; right: 24px;
    background: none; border: none;
    font-size: 30px; line-height: 1; cursor: pointer; color: #2b2a2b;
}
.all-reviews-popup__close:hover { opacity: .6; }
.all-reviews-popup__body { padding: 8px 28px 28px; overflow-y: auto; }
.all-reviews-popup__item {
    padding: 22px;
    border: 1px solid #e4e4e6;
    border-radius: 14px;
    margin: 0 0 16px;
}
.all-reviews-popup__item:last-child { margin-bottom: 0; }
.all-reviews-popup__item .review-card__header { margin-bottom: 14px; }
/* Аватар-заглушка слева от имени */
.all-reviews-popup__item .review-card__header::before {
    content: "";
    width: 40px; height: 40px;
    border-radius: 50%;
    background: #f0f0f0 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%239e9e9e' stroke-width='1.6'%3E%3Ccircle cx='12' cy='8' r='4'/%3E%3Cpath d='M4 21v-1a6 6 0 0 1 6-6h4a6 6 0 0 1 6 6v1'/%3E%3C/svg%3E") center/24px no-repeat;
    flex: 0 0 40px;
}
.all-reviews-popup__item .review-card__text { -webkit-line-clamp: unset; display: block; }
.all-reviews-popup__item .review-card__photos { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.all-reviews-popup__item .review-card__photos img { width: 96px; height: 120px; object-fit: cover; border-radius: 10px; cursor: pointer; }
/* Блок «Ответ продавца» (если есть) */
.all-reviews-popup__answer {
    margin-top: 14px;
    padding: 14px 16px;
    background: #f6f6f6;
    border-radius: 10px;
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    color: #2b2a2b;
}
.all-reviews-popup__answer-label { font-weight: 600; color: rgba(42, 42, 42, .56); margin-right: 6px; }

/* ====================== Лайтбоксы фото/медиа ====================== */
.photo-lightbox, .review-photo-viewer {
    position: fixed; inset: 0; z-index: 10002;
    display: none; align-items: center; justify-content: center;
    background: rgba(0, 0, 0, .85); padding: 24px;
}
.photo-lightbox.active, .review-photo-viewer.active { display: flex; }
.photo-lightbox img, .review-photo-viewer__img { max-width: 90vw; max-height: 90vh; border-radius: 8px; }
.photo-lightbox__close, .review-photo-viewer__close {
    position: absolute; top: 24px; right: 28px;
    background: none; border: none; color: #fff; font-size: 34px; cursor: pointer; line-height: 0;
}
.media-viewer {
    position: fixed; inset: 0; z-index: 10002;
    align-items: center; justify-content: center;
    background: rgba(0, 0, 0, .85); padding: 24px;
}
.media-viewer__img { max-width: 86vw; max-height: 86vh; border-radius: 8px; }
.media-viewer__close { position: absolute; top: 24px; right: 28px; background: none; border: none; color: #fff; font-size: 34px; cursor: pointer; }
.media-viewer__arrow { position: absolute; top: 50%; transform: translateY(-50%); width: 48px; height: 48px; background: none; border: none; cursor: pointer; }
.media-viewer__arrow--left { left: 16px; }
.media-viewer__arrow--right { right: 16px; }
.media-viewer__arrow svg { width: 32px; height: 32px; }
.media-viewer__counter { position: absolute; bottom: 24px; left: 50%; transform: translateX(-50%); color: #fff; font-family: 'Inter', sans-serif; font-size: 14px; }

/* ====================== Адаптив: прячем десктоп-блок на мобайле ====================== */
@media (max-width: 1100px) {
    .product-detail { grid-template-columns: minmax(0, 1fr) 300px; }
    .product-gallery { grid-column: 1 / -1; }
    .product-sidebar { position: static; }
}
@media (max-width: 768px) {
    .product-page { display: none; }
    .product-mobile { display: block; }
    .product-cart-controls.product-cart-controls--mobile { display: block; }
    .reviews-section .container { padding: 0 12px; }
    .review-card, .question-card { flex-basis: 280px; }
}
