/* ============================================================================
 * product.css — страница товара
 * Layout по preview.html: hero на полную ширину серым фоном,
 * белые ценовые карточки с активной синей обводкой, 6-табовая навигация.
 * ========================================================================= */

/* Контент страницы товара отступает от краёв на slider-padding (как на
   главной), контейнер 1280px (как и везде). Внутренние шрифты крупнее
   средних — чтобы не выглядело "мелковато". */
.page-product .container {
    max-width: var(--container-fluid-max);
    margin-inline: auto;
    padding-inline: var(--side-pad-fluid);
}
@media (max-width: 980px) {
    .page-product .container {
        padding-left: var(--slider-padding-mobile, 15px);
        padding-right: var(--slider-padding-mobile, 15px);
    }
}

.product-page {
    margin: 0 auto 56px;
}
/* Вложенный .container (benefits/business внутри main.container) НЕ должен
   получать ещё один slider-padding — иначе контент сдвигается на 200px
   и упирается в левую часть, оставляя огромный пустой правый край. */
.page-product .container .container {
    padding-left: 0;
    padding-right: 0;
}

/* ---------------------- hero на полную ширину ---------------------- */
.p-hero-section {
    background: linear-gradient(180deg, #e6ecf1 0%, #e8edf2 100%);
    margin: 8px 0 0;
    padding: 24px 0 32px;
}
.p-hero {
    display: grid;
    grid-template-columns: 52% 48%;
    gap: 32px;
    align-items: stretch;
}
.p-hero > .p-info { align-self: start; }

/* ---------------------- галерея фото ---------------------- */
.p-gallery {
    position: relative;
    min-height: 380px;
    display: flex;
    flex-direction: column;
    align-self: stretch;
}
.p-gallery__viewport {
    position: relative;
    flex: 1;
    min-height: 320px;
    overflow: hidden;
    background: #fff;
    /* Тёмная кромка с заметным скруглением углов; прижата прямо к
       картинке (padding у .p-gallery__slide убран ниже). */
    border: 2px solid #2c2c2c;
    border-radius: 18px;
    touch-action: pan-y;
}
.p-gallery__slide {
    position: absolute;
    inset: 0;
    opacity: 0;
    transition: opacity .25s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    /* padding убран — картинка прижата к кромке без прослойки */
    padding: 0;
    box-sizing: border-box;
}
.p-gallery__slide img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    filter: drop-shadow(0 16px 18px rgba(0,0,0,.08));
}
.p-gallery__slide.is-active { opacity: 1; }

.p-gallery__arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    color: #9e9e9e;
    cursor: pointer;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: color .15s ease;
}
.p-gallery__arrow:hover { color: #2c2c2c; }
.p-gallery__arrow--prev { left: 4px; }
.p-gallery__arrow--next { right: 4px; }

.p-gallery__dots {
    display: flex;
    justify-content: center;
    gap: 8px;
    padding-top: 12px;
}
.p-gallery__dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #d6d8db;
    border: none;
    cursor: pointer;
    padding: 0;
    transition: background .15s ease;
}
.p-gallery__dot:hover { background: #a8acaf; }
.p-gallery__dot.is-active { background: #2c2c2c; }

/* ---------------------- информация (правая колонка) ---------------------- */
.p-info {
    padding: 20px 8px 0 22px;
}
.p-info__title {
    font-family: var(--font-head);
    font-size: var(--fs-h1);
    font-weight: 700;
    margin: 0 0 16px;
    line-height: 1.1;
    color: #2e2e2e;
}
/* SKU/артикул не показываем покупателю — оставляем в DOM на случай нужды
   (микроразметка, аналитика). Если потребуется снова — убрать display:none. */
.p-info__sku { display: none; }
/* «В наличии» скрыт от покупателей — оставлено в DOM для будущего
   статуса pre-order / out-of-stock, который может потребоваться вернуть. */
.p-info__status { display: none; }

/* ---------------------- 3 ценовых блока ---------------------- */
.p-pricecards {
    display: flex;
    gap: 10px;
    margin: 4px 0 14px;
    align-items: stretch;
}
.p-pricecard {
    flex: 1;
    background: #fff;
    border-radius: 10px;
    padding: 10px 12px 11px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 6px;
    text-align: left;
    box-shadow: 0 0 0 1px rgba(0,0,0,.06);
}
/* min-height = 2 строки текста при line-height 1.3 → лейбл всегда занимает
   2 строки, цены у соседних карточек строго на одном уровне. */
.p-pricecard__label {
    font-size: 11px;
    color: #555;
    line-height: 1.3;
    min-height: 2.6em;
    display: block;
}
.p-pricecard__value {
    font-family: var(--font-head);
    font-size: 20px;
    font-weight: 700;
    color: #2e2e2e;
}

/* ---------------------- radio комплектации ---------------------- */
.p-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 8px 0 0;
}
.p-options__label {
    font-size: 14px;
    color: #2e2e2e;
    margin: 0 0 6px;
    font-weight: 600;
}
.p-option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0;
    cursor: pointer;
    background: transparent;
    font-size: 14px;
    color: #333;
}
.p-option input { position: absolute; opacity: 0; pointer-events: none; }
.p-option__radio {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 1px solid #bcbcbc;
    background: #fff;
    flex-shrink: 0;
    position: relative;
}
.p-option__radio::after {
    content: '';
    position: absolute;
    inset: 3px;
    border-radius: 50%;
    background: #7a7a7a;
    opacity: 0;
    transition: opacity .15s ease;
}
.p-option input:checked + .p-option__radio::after { opacity: 1; }
.p-option__thumb {
    width: 28px;
    height: 24px;
    object-fit: contain;
    flex-shrink: 0;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 2px;
    box-sizing: border-box;
}
.p-option__thumb-placeholder {
    width: 28px;
    height: 24px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #7b7b7b;
    font-size: 14px;
    flex-shrink: 0;
}
.p-option__name {
    color: #444;
    line-height: 1.3;
}

/* ---------------------- кнопка Купить ---------------------- */
.p-cta {
    margin: 22px 0 8px;
}
.p-cta__primary {
    width: 100%;
    height: 48px;
    padding: 0 24px;
    font-size: 16px;
    font-weight: 600;
    letter-spacing: 0.2px;
    background: #3f3d3f;
    color: #fff;
    border-radius: 10px;
    border: none;
    cursor: pointer;
    transition: background .15s ease;
    font-family: inherit;
}
.p-cta__primary:hover { background: #1f1d1f; }

.p-cta-secondary {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin: 10px 0 10px;
}
.p-cta-secondary .btn { padding: 10px 14px; font-size: 13px; }

.p-quote {
    display: block;
    text-align: center;
    padding: 10px;
    color: var(--primary);
    font-weight: 600;
    font-size: 13px;
    margin-top: 8px;
}

.p-delivery-note {
    background: var(--primary-soft);
    border-radius: var(--radius-sm);
    padding: 12px 16px;
    font-size: 13px;
    color: var(--text);
    margin: 14px 0 8px;
}

/* ---------------------- 6 tabs ---------------------- */
.p-tabs {
    margin: 36px 0 0;
    border-bottom: 1px solid #d1d1d1;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    align-items: end;
    height: 56px;
}
.p-tabs__btn {
    height: 100%;
    padding: 0 0 16px;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    color: #333;
    font-family: inherit;
    font-weight: 500;
    font-size: 14px;
    cursor: pointer;
    text-align: center;
    transition: color .15s ease, border-color .15s ease;
}
.p-tabs__btn:hover { color: #000; }
.p-tabs__btn.is-active {
    color: #000;
    font-weight: 700;
    border-bottom-color: #2c2c2c;
}
.p-tab {
    display: none;
    padding: 32px 0 0;
    font-size: 15px;
    line-height: 1.6;
    color: #515151;
}
.p-tab.is-active { display: block; }
.p-tab table {
    width: 100%;
    border-collapse: collapse;
    margin: 12px 0;
}
.p-tab table td, .p-tab table th {
    padding: 8px 12px;
    border-bottom: 1px solid var(--border);
    text-align: left;
    font-size: 14px;
}
.p-tab table th { background: var(--bg-soft); font-weight: 600; }

/* mobile accordion header убран. На мобиле .p-tabs становится
   горизонтально-скроллящейся полоской. */
.p-tab__mhead { display: none; }
.p-tab__body { display: block; }

@media (max-width: 720px) {
    /* Полоска табов: горизонтальный flex с overflow-x:auto, кнопки не
       переносятся; снизу серая тонкая линия — как в эталоне. */
    .p-tabs {
        display: flex;
        gap: 0;
        overflow-x: auto;
        overflow-y: hidden;
        flex-wrap: nowrap;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        margin: 24px calc(-1 * var(--slider-padding-mobile, 15px)) 0;
        padding: 0 var(--slider-padding-mobile, 15px);
        border-bottom: 1px solid rgba(50,50,50,0.3);
        height: auto;
        grid-template-columns: none;
    }
    .p-tabs::-webkit-scrollbar { display: none; }
    .p-tabs__btn {
        flex: 0 0 auto;
        height: auto;
        padding: 14px 14px 14px 0;
        margin-right: 18px;
        font-size: 15px;
        white-space: nowrap;
        border-bottom: 2px solid transparent;
        color: rgba(50,50,50,0.6);
    }
    .p-tabs__btn:last-child { margin-right: 0; }
    .p-tabs__btn.is-active {
        color: rgba(50,50,50,1);
        border-bottom-color: rgba(50,50,50,1);
    }
}

.p-faq__item {
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
}
.p-faq__q {
    font-family: var(--font-head);
    font-weight: 600;
    color: var(--text);
    margin-bottom: 6px;
    cursor: pointer;
}
.p-faq__a { color: var(--text-dim); font-size: 14px; }

/* ---------------------- мобильная адаптация ---------------------- */
@media (max-width: 980px) {
    .p-hero-section { padding: 16px 0 24px; }
    .p-hero { grid-template-columns: 1fr; gap: 16px; }
    .p-info { padding: 8px 0 0; }
    .p-info__title { font-size: 22px; }
    /* Существенно увеличиваем фото на мобиле — было 240×«как влезет»,
       теперь — квадрат во всю ширину контейнера. */
    .p-gallery { min-height: 0; align-self: stretch; }
    .p-gallery__viewport {
        min-height: 0;
        aspect-ratio: 1 / 1;
        width: 100%;
    }
    .p-gallery__slide { padding: 0; }
    .p-pricecards { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; }
    .p-pricecard { padding: 8px 10px; }
    .p-pricecard__value { font-size: 16px; }
    .p-pricecard__label { font-size: 10px; }
    .p-tabs {
        grid-template-columns: repeat(5, 1fr);
        height: auto;
        gap: 0;
    }
    .p-tabs__btn { padding: 12px 4px; font-size: 12px; }
    .p-cta__primary { height: 44px; font-size: 15px; }
}
@media (max-width: 480px) {
    .p-pricecards { grid-template-columns: 1fr; }
    .p-tabs { grid-template-columns: repeat(2, 1fr); }
    .p-info__title { font-size: 20px; }
}
