/**
 * Карточка товара — стили в духе скрина «1920. Карточка товара».
 * Двухколоночный layout: слева фото, справа название, цена, размер/цвет, описание, характеристики.
 * Цвета: кнопка «В корзину» #FDE895, выбранный размер — синяя обводка, шрифт Montserrat.
 */

.product-detail-page {
    font-family: Montserrat, sans-serif;
    background: #fff;
}

/* Внешний .row (element.php) — не трогаем, пусть контент на всю ширину */
.product-detail-page > .row {
    display: flex;
    flex-wrap: wrap;
    margin-left: 0;
    margin-right: 0;
}

/* Сетка только у первой строки карточки: галерея 30%, контент 70% */
.product-detail-page .bx-catalog-element > .row,
.product-detail-page .bx-catalog-element .product-detail-card,
.product-detail-page .product-item-detail > .row {
    display: grid;
    grid-template-columns: 30% 1fr;
    gap: 2rem;
    margin-left: 0;
    margin-right: 0;
    align-items: start;
}

.product-detail-page .bx-catalog-element > .row > [class*="col-"]:first-child,
.product-detail-page .bx-catalog-element .product-detail-gallery,
.product-detail-page .product-item-detail > .row > [class*="col-"]:first-child {
    grid-column: 1;
    min-width: 0;
}

.product-detail-page .bx-catalog-element > .row > [class*="col-"]:last-child,
.product-detail-page .bx-catalog-element .product-detail-info,
.product-detail-page .product-item-detail > .row > [class*="col-"]:last-child {
    grid-column: 2;
    min-width: 0;
}

/* Галерея: миниатюры столбиком слева, главное фото справа */
.product-detail-page .product-detail-gallery__wrap {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    gap: 0.75rem;
}
.product-detail-page .product-detail-gallery__thumbs {
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    gap: 0.5rem;
    order: 0;
}
.product-detail-page .product-detail-gallery__thumb {
    display: block;
    border: 2px solid #b8d4e3;
    border-radius: 4px;
    overflow: hidden;
    width: 56px;
    padding: 0;
    background: none;
    cursor: pointer;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.product-detail-page .product-detail-gallery__thumb:hover {
    border-color: #7BC4C4;
}
.product-detail-page .product-detail-gallery__thumb_active {
    border-color: #7BC4C4;
    box-shadow: 0 0 0 1px #7BC4C4;
}
.product-detail-page .product-detail-gallery__thumb img {
    display: block;
    width: 100%;
    height: auto;
    pointer-events: none;
}
.product-detail-page .product-detail-gallery__main {
    flex: 1;
    min-width: 0;
    border: 1px solid #b8d4e3;
    border-radius: 4px;
    overflow: hidden;
}
.product-detail-page .product-detail-gallery__img {
    display: block;
    width: 100%;
    height: auto;
}
.product-detail-page .product-detail-artnumber {
    font-size: 0.875rem;
    color: #555;
    margin: 0 0 0.5rem 0;
}
.product-detail-page .product-detail-price {
    margin-bottom: 1rem;
}
.product-detail-page .product-detail-price__label {
    display: block;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #333;
    margin-bottom: 0.25rem;
}
.product-detail-page .product-item-detail-price-current {
    font-size: 1.25rem;
    font-weight: 600;
    color: #333;
}
.product-detail-page .product-detail-option,
.product-detail-page .product-detail-prop {
    margin-bottom: 0.75rem;
}
.product-detail-page .product-detail-option__label,
.product-detail-page .product-detail-prop__label {
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.7rem;
    letter-spacing: 0.05em;
    display: block;
    margin-bottom: 0.25rem;
}
.product-detail-page .product-detail-description__title,
.product-detail-page .product-detail-characteristics__title {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #333;
    margin: 1.25rem 0 0.5rem 0;
}
.product-detail-page .product-detail-characteristics__table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}
.product-detail-page .product-detail-characteristics__table td {
    padding: 0.5rem 0;
    border-bottom: 1px solid #eee;
}
.product-detail-page .product-detail-characteristics__table td:last-child {
    text-align: right;
    color: #333;
}

/* Выбор размера */
.product-detail-page .product-detail-size-block {
    margin-bottom: 1rem;
}
.product-detail-page .product-detail-size-block__label {
    display: block;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #333;
    margin-bottom: 0.5rem;
}
.product-detail-page .product-detail-size-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}
.product-detail-page .product-detail-size-btn {
    min-width: 44px;
    padding: 0.45rem 0.75rem;
    font-size: 0.85rem;
    font-family: inherit;
    border: 1px solid #b8d4e3;
    border-radius: 4px;
    background: #fff;
    color: #333;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s, color 0.2s;
}
.product-detail-page .product-detail-size-btn:hover:not(.product-detail-size-btn_disabled) {
    border-color: #7BC4C4;
}
.product-detail-page .product-detail-size-btn_selected {
    background: #7BC4C4;
    border-color: #7BC4C4;
    color: #fff;
}
.product-detail-page .product-detail-size-btn_disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Вложенная строка в правой колонке: опции (цвет, размер) слева ~42%, блок покупки справа ~58% */
.product-detail-page .bx-catalog-element [class*="col-"]:last-child .row,
.product-detail-page .product-item-detail-info-section .row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-left: 0;
    margin-right: 0;
    align-items: start;
}

.product-detail-page .bx-catalog-element [class*="col-"]:last-child .row [class*="col-lg-5"],
.product-detail-page .bx-catalog-element [class*="col-"]:last-child .row [class*="col-"]:first-child {
    grid-column: 1;
    min-width: 0;
}

.product-detail-page .bx-catalog-element [class*="col-"]:last-child .row [class*="col-lg-7"],
.product-detail-page .bx-catalog-element [class*="col-"]:last-child .row [class*="col-"]:last-child {
    grid-column: 2;
    min-width: 0;
}

.product-detail-page .product-item-detail-slider-container,
.product-detail-page [class*="slider"]:first-of-type {
    min-width: 0;
}

@media (max-width: 992px) {
    .product-detail-page .bx-catalog-element > .row,
    .product-detail-page .product-item-detail > .row {
        grid-template-columns: 1fr;
    }
    .product-detail-page .bx-catalog-element > .row > [class*="col-"]:first-child,
    .product-detail-page .bx-catalog-element > .row > [class*="col-"]:last-child,
    .product-detail-page .product-item-detail > .row > [class*="col-"]:first-child,
    .product-detail-page .product-item-detail > .row > [class*="col-"]:last-child {
        grid-column: 1;
    }
    .product-detail-page .bx-catalog-element [class*="col-"]:last-child .row {
        grid-template-columns: 1fr;
    }
    .product-detail-page .bx-catalog-element [class*="col-"]:last-child .row [class*="col-"] {
        grid-column: 1;
    }
}

/* Основное фото и миниатюры — рамка как на скрине (светло-голубая) */
.product-detail-page .product-item-detail-slider-block,
.product-detail-page .product-item-detail-slider-image,
.product-detail-page .product-item-detail-slider-block img,
.product-detail-page .product-item-detail-slider-image img {
    border: 1px solid #b8d4e3;
    border-radius: 4px;
    box-sizing: border-box;
}

.product-detail-page .product-item-detail-slider-controls-image,
.product-detail-page .product-item-detail-slider-controls-block img {
    border: 1px solid #b8d4e3;
    border-radius: 4px;
}

/* ——— Правая колонка: порядок и отступы как на макете ——— */
.product-detail-page .product-item-detail-info-section,
.product-detail-page .bx-catalog-element [class*="col-"]:last-child {
    display: flex;
    flex-direction: column;
    gap: 0;
}

/* Блок с названием — первым */
.product-detail-page .product-item-detail-info-section .product-item-detail-info-container:first-child,
.product-detail-page .product-item-detail-info-section .product-item-detail-info-container:first-of-type,
.product-detail-page .product-item-detail-info-section [class*="info-container"]:first-child {
    order: -2;
}

.product-detail-page .product-item-detail-info-section .product-item-scu-container,
.product-detail-page .product-item-detail-info-section .product-item-detail-info-container:not(:first-child) {
    order: 0;
}

/* 1. Название товара (h1) */
.product-detail-page .product-detail-page__title,
.product-detail-page .product-item-detail-info-section h1,
.product-detail-page .row > [class*="col-"]:last-child h1:first-of-type {
    font-size: 1.35rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    color: #333;
    margin: 0 0 0.5rem 0;
    line-height: 1.3;
}

.product-detail-page .product-item-detail-info-container-title {
    display: block;
    font-size: 1.35rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    color: #333;
    margin: 0 0 0.5rem 0;
}

/* 2. Артикул */
.product-detail-page .product-item-detail-info-container .product-item-detail-artnumber,
.product-detail-page .product-item-detail-info-container [class*="artnumber"] {
    font-size: 0.875rem;
    color: #555;
    margin: 0 0 0.5rem 0;
}

/* 3. Цена */
.product-detail-page .product-item-detail-price-current,
.product-detail-page .product-item-detail-price-block .product-item-detail-price-current {
    font-size: 1.75rem;
    font-weight: 700;
    color: #333;
    margin: 0 0 1rem 0;
}

.product-detail-page .product-item-detail-price-old {
    font-size: 0.95rem;
    color: #999;
    text-decoration: line-through;
}

/* 4. Кнопка «Добавить в корзину» + избранное */
.product-detail-page .product-item-detail-buy-block,
.product-detail-page .product-item-detail-pay-block {
    border: none;
    padding: 0;
    margin: 0 0 1.25rem 0;
    background: transparent;
}

.product-detail-page .product-detail-buy-form {
    display: inline-block;
}

.product-detail-page .btn.product-item-detail-buy-button,
.product-detail-page .product-item-detail-buy-button,
.product-detail-page .btn-primary.product-item-detail-buy-button,
.product-detail-page [data-id="buy_link"] {
    width: 280px;
    height: 60px;
    box-sizing: border-box;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #FDE895 !important;
    color: #000 !important;
    border: 1px solid #e5d67a !important;
    font-weight: 600;
    padding: 0;
    border-radius: 6px;
    font-size: 1rem;
}

.product-detail-page .btn.product-item-detail-buy-button:hover,
.product-detail-page .product-item-detail-buy-button:hover {
    background: #44B5B1 !important;
    color: #fff !important;
    border-color: #44B5B1 !important;
}

/* Кнопка избранного рядом с «В корзину» */
.product-detail-page .product-item-detail-buy-block .btn-link,
.product-detail-page .product-item-detail-pay-block a[href*="wishlist"],
.product-detail-page .product-item-detail-compare-container {
    margin-left: 0.5rem;
    vertical-align: middle;
}

/* 5. РАЗМЕР, ЦВЕТ, МАТЕРИАЛ — заголовки */
.product-detail-page .product-item-scu-container-title,
.product-detail-page .product-item-scu-block-title {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #333;
    margin: 0 0 0.5rem 0;
    display: block;
}

.product-detail-page .product-item-scu-block {
    margin-bottom: 1rem;
}

/* Кнопки размера: светлая обводка, выбранный — бирюзовый фон */
.product-detail-page .product-item-scu-item-text-block,
.product-detail-page .product-item-scu-item-text-container {
    min-width: 44px;
}

.product-detail-page .product-item-scu-item-text-block {
    border: 1px solid #b8d4e3;
    outline: none;
    border-radius: 4px;
    padding: 0.45rem 0.75rem;
    font-size: 0.85rem;
    background: #fff;
}

.product-detail-page .product-item-scu-item-text-container.selected .product-item-scu-item-text-block {
    background: #7BC4C4;
    border-color: #7BC4C4;
    color: #fff;
}

.product-detail-page .product-item-scu-item-text-container.selected .product-item-scu-item-text-block .product-item-scu-item-text {
    color: #fff;
}

/* Цвет: квадратик-свотч + текст */
.product-detail-page .product-item-scu-item-color-block {
    border: 1px solid #b8d4e3;
    border-radius: 4px;
}

.product-detail-page .product-item-scu-item-color-container.selected .product-item-scu-item-color-block {
    border-color: #7BC4C4;
    outline: none;
}

/* 6. ОПИСАНИЕ */
.product-detail-page .product-item-description-container h2,
.product-detail-page .product-item-properties-container h2,
.product-detail-page .product-item-detail-info-section h2,
.product-detail-page [class*="description"] h2,
.product-detail-page [class*="properties"] h2 {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #333;
    margin: 1.25rem 0 0.5rem 0;
}

.product-detail-page .product-item-description-container p,
.product-detail-page .product-item-description-container {
    font-size: 0.9rem;
    line-height: 1.55;
    color: #333;
    margin: 0 0 0.5rem 0;
}

/* 7. ХАРАКТЕРИСТИКИ — ключ слева, значение справа, линии между строками */
.product-detail-page .product-item-properties-container table,
.product-detail-page .product-item-detail-info-section table {
    width: 100%;
    font-size: 0.9rem;
    border-collapse: collapse;
}

.product-detail-page .product-item-properties-container td,
.product-detail-page .product-item-detail-info-section table td {
    padding: 0.5rem 0;
    border-bottom: 1px solid #eee;
}

.product-detail-page .product-item-properties-container td:first-child,
.product-detail-page .product-item-detail-info-section table td:first-child {
    color: #555;
}

.product-detail-page .product-item-properties-container td:last-child,
.product-detail-page .product-item-detail-info-section table td:last-child {
    text-align: right;
    color: #333;
}
