/* =======================================================================
   СТРАНИЦА ТОВАРА
   ======================================================================= */

.woocommerce div.product {
    padding-top: 32px;
    margin-bottom: 60px;
}

.x-page--product {
    /* padding: 0 0 60px; */
}

.x-sp__grid {
    display: grid;
    grid-template-columns: 1fr 520px;
    gap: 48px;
    align-items: start;
}

.x-sp__left,
.x-sp__right {
    min-width: 0;
    position: relative;
}

.x-sp__left {
    position: sticky;
    top: 80px; /* отступ от верха окна */
    align-self: flex-start; /* при использовании гридов важно */
    z-index: 2; /* чтобы не перекрывалось другими элементами */
}

@media (max-width: 1024px) {
    .x-sp__left {
        position: relative;
    }
}

/* =======================================================================
   БЕЙДЖИ (Скидка / Новинка / Хит)
   ======================================================================= */

.x-sp__badges {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 8px;
    margin: 0 0 12px;
}

.x-badge {
    font-size: 12px;
    font-weight: 800;
    padding: 4px 8px;
    border-radius: 0 0 6px 6px;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.x-badge--sale {
    background: #fa4d62;
    color: #fff;
}

.x-badge--new {
    background: #90a2b1;
    color: #fff;
}

.x-badge--hit {
    background: #22c55e;
    color: #fff;
}

/* =======================================================================
   ТЕКСТОВЫЕ ЭЛЕМЕНТЫ (Заголовок / Разделитель / Подзаголовки секций)
   ======================================================================= */

.x-sp__title {
    font-size: 30px;
    line-height: 1.05;
    font-weight: 900;
    margin: 0 0 18px;
}

.x-sp__divider {
    height: 1px;
    background: #eef2f7;
    margin: 18px 0;
}

.x-sp__h {
    font-size: 18px;
    font-weight: 600;
    margin: 18px 0 10px;
}

/* =======================================================================
   ГАЛЕРЕЯ ТОВАРА (Слайдер + Стрелки + Превью)
   ======================================================================= */

.x-pg {
    width: 100%;
}

.x-pg__viewport {
    position: relative;
    overflow: hidden;
    border-radius: 18px;
    background: #fff;
}

.x-pg__track {
    display: flex;
    will-change: transform;
    transform: translate3d(0, 0, 0);
    transition: transform 420ms cubic-bezier(0.22, 0.9, 0.25, 1);
}

.x-pg__slide {
    min-width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.x-pg__img {
    width: 100%;
    height: auto;
    max-height: 520px;
    object-fit: contain;
    display: block;
}

.x-pg__slide--video .video-wrapper {
    width: 100%;
    height: 100%;
}
.x-pg__video {
    width: 100%;
    height: 100%;
    object-fit: contain; /* или cover, по вашему дизайну */
    background: #000;
}

.x-pg__nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 54px;
    height: 54px;
    border-radius: 999px;
    border: 0;
    background: rgba(0, 0, 0, 0.18);
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    line-height: 1;
    user-select: none;
}

.x-pg__nav--prev {
    left: 18px;
}

.x-pg__nav--next {
    right: 18px;
}

.x-pg__thumbs-wrap {
    display: flex;
    justify-content: center;
}

.x-pg__thumbs {
    margin-top: 14px;
    display: flex;
    gap: 4px;
    align-items: center;
    overflow: auto;
    max-width: 100%;
}

.x-pg__thumb {
    width: 48px;
    height: 48px;
    border-radius: 4px;
    border: 2px solid transparent;
    background: #fff;
    padding: 0;
    cursor: pointer;
    flex: 0 0 auto;
}

.x-pg__thumb.is-active {
    border-color: #90a2b1;
}

.x-pg__thumbimg {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.x-pg__thumb--video .x-pg__thumb-video-icon svg {
    width: 100%;
    height: 100%;
    display: block;
}
.x-pg__thumb--video {
    background: #e8ecf4;
}

.x-pg__thumb-video-preview {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
    border-radius: 6px;
    background: #111;
}

.x-pg__thumb-video-preview video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    pointer-events: none; /* клики идут на кнопку-thumb, не на видео */
}

.x-pg__thumb-play-icon {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.x-pg__thumb-play-icon svg {
    width: 28px;
    height: 28px;
    filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.4));
}

/* Обёртка видео — центрирует плеер на весь экран */
.x-lightbox__video-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

/* Сам плеер — максимальный размер с сохранением пропорций */
.x-lightbox__video {
    max-width: 100%;
    max-height: 85vh;
    width: auto;
    height: auto;
    border-radius: 8px;
    background: #000;
    outline: none;
}

/* =======================================================================
   ЦЕНА (текущая/старая) + СКРЫТИЕ screen-reader текста
   ======================================================================= */

div.product .x-sp__price .price {
    margin: 24px 0;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    font-weight: 600;
    font-size: 22px !important;
    color: #000 !important;
}

/* текущая цена */
div.product .x-sp__price .price ins {
    order: 1;
    text-decoration: none;
    font-size: 16px;
    font-weight: 600;
    color: #000;
}

div.x-sp__right .x-sp__price .price ins .amount {
    font-size: 22px !important;
    font-weight: 600 !important;
}

/* старая цена */
.x-sp__price .price del {
    order: 2;
    font-size: 14px;
    font-weight: 100;
    color: #9aa4b2;
    text-decoration: line-through;
    opacity: 1;
}

/* цвета для внутренних amount */
.x-sp__price .price ins .amount,
.x-sp__price .price ins .woocommerce-Price-amount {
    color: #000 !important;
    font-weight: 500;
}

.x-sp__price .price del .amount,
.x-sp__price .price del .woocommerce-Price-amount {
    color: #9aa4b2 !important;
    font-weight: 100;
}

.x-sp__price .price .screen-reader-text {
    display: none;
}

/* =======================================================================
   ПЛАШКА СКИДКИ (розовая, с “хвостиком”) — ТОЛЬКО В ОДНОМ ВАРИАНТЕ
   ВАЖНО: убраны дубликаты “auto pill” через ins[data-x-discount]
   ======================================================================= */

.x-sp__price .price del[data-x-discount] {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 10px; /* отделяем плашку от зачеркнутой цены */
}

/* хвостик */
.x-sp__price .price del[data-x-discount]::before {
    content: "";
    width: 10px;
    height: 10px;
    background: #fa4d62;
    border-radius: 3px;
    transform: rotate(45deg);
    margin-left: 6px; /* отступ от цены */
}

/* сама плашка */
.x-sp__price .price del[data-x-discount]::after {
    content: attr(data-x-discount);
    display: inline-flex;
    align-items: center;
    height: 22px;
    padding: 0 10px;
    background: #fa4d62;
    color: #fff;
    font-size: 12px;
    font-weight: 800;
    line-height: 1;
    border-radius: 999px;
    white-space: nowrap;
}

/* =======================================================================
   НАЛИЧИЕ (как на макете)
   ======================================================================= */

.x-sp__stock {
    margin: 0 0 18px;
    padding: 24px 0;
    border-top: 1px solid #eef2f7;
    border-bottom: 1px solid #eef2f7;
}

/* контейнер: слева плашка, справа текст */
#x-stock-display {
    display: flex;
    align-items: center;
    gap: 18px;
    min-width: 0;
}

/* плашка статуса */
#x-stock-display .stock {
    margin: 0;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    border-radius: 6px;
    font-weight: 600;
    font-size: 12px;
    line-height: 1;
    white-space: nowrap;
}

/* IN STOCK */
#x-stock-display .stock.in-stock {
    background: rgba(34, 197, 94, 0.08);
    color: #01ba04;
}

/* OUT OF STOCK (серый как на макете) */
#x-stock-display .stock.out-of-stock {
    background: rgba(148, 163, 184, 0.12);
    color: #90a2b1;
}

/* текст справа (если Woo его вернёт в availability_html) */
#x-stock-display > :not(.stock) {
    color: #6b7280;
    font-weight: 600;
    font-size: 12px;
    line-height: 1.2;
    min-width: 0;
}

.product-info-text {
    margin-top: 16px;
    margin-bottom: 24px;
    color: #4b5563;
    font-size: 14px;
    line-height: 1.5;
}

.product-info-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 6px;
}

/* =======================================================================
   Кнопка "Уведомить о поступлении" (твоя .x-notify-btn)
   ======================================================================= */

.x-notify-btn {
    width: 100%;
    height: 44px;
    border-radius: 999px;
    border: 1px solid #cbd5e1;
    background: #fff;
    color: #90a2b1;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
}
.x-notify-btn:hover {
    background: #f6f8fb;
}

@media (max-width: 768px) {
    .x-notify-btn {
        font-size: 0 !important;
    }
    .x-notify-btn::after {
        content: "Уведомить";
        font-size: 12px;
    }
}

/* ===== Variations: buttons like mock ===== */

.x-var__select-hidden {
    display: none !important;
}

.x-var-cards {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 8px;
}

.x-var-cards--top {
    flex-direction: row;
    flex-wrap: wrap;
}

.x-var-card {
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 12px 16px;
    cursor: pointer;
    transition: border-color 0.2s;
}
.x-var-card:hover {
    border-color: #999;
}
.x-var-card.is-active {
    border-color: #000;
}

.x-var-card__save {
    display: inline-block;
    background: #ff4d4d;
    color: #fff;
    font-size: 12px;
    border-radius: 4px;
    padding: 2px 8px;
    margin-bottom: 6px;
}

.x-var-card__body {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.x-var-card__name {
    font-size: 15px;
}

.x-var-card__prices {
    text-align: right;
}
.x-var-card__price {
    font-weight: 600;
    font-size: 16px;
    display: block;
}
.x-var-card__reg {
    font-size: 13px;
    color: #999;
    text-decoration: line-through;
}

.woocommerce div.product form.cart .variations label,
.x-sp__bundle_h,
.x-sp__h {
    font-size: 18px;
    font-weight: 600;
    margin-top: 24px;
    display: block;
}

.x-var-buttons {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    margin-top: 12px;
}

.x-var-btn {
    height: 54px;
    padding: 0 22px;
    border-radius: 8px;
    border: 2px solid #e5e7eb; /* светлая рамка */
    background: #fff;
    color: #6b7280;
    font-size: 14px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    line-height: 1;
    box-shadow: none;
    user-select: none;
    transition:
        border-color 0.15s ease,
        color 0.15s ease;
}

.x-var-btn:hover {
    border-color: #cbd5e1;
    color: #374151;
}

/* активная кнопка */
.x-var-btn.is-active {
    border-color: #111827;
    color: #111827;
}

/* если хочешь сделать неактивные “приглушёнными” */
.x-var-btn.is-disabled {
    opacity: 0.55;
    pointer-events: none;
}

@media (max-width: 560px) {
    .x-var-buttons {
        gap: 12px;
    }
    .x-var-btn {
        min-width: 140px;
        height: 58px;
        font-size: 16px;
    }
}

/* =======================================================================
   СПИСОК КОМПЛЕКТАЦИИ
   ======================================================================= */

.x-sp__bundle-list {
    margin: 12px 0;
}

.x-bundle-list {
    margin: 0;
    padding: 0;
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.x-bundle-list__item {
    font-size: 13px;
}

/* =======================================================================
   КНОПКИ ПОКУПКИ: количество (25%) + В корзину (75%)
   «Покупают вместе» — отдельной строкой сверху на всю ширину
   ======================================================================= */

.woocommerce-variation-add-to-cart {
    width: 100%;
    display: grid;
    grid-template-columns: minmax(0, 25%) minmax(0, 1fr);
    align-items: center;
    column-gap: 16px;
    row-gap: 16px;
}

.woocommerce-variation-add-to-cart > .x-sp__frequently {
    grid-column: 1 / -1;
    width: 100%;
    max-width: 100%;
}

.woocommerce div.product form.cart::before,
.woocommerce div.product form.cart::after,
.woocommerce div.product form.cart .woocommerce-variation-add-to-cart::before,
.woocommerce div.product form.cart .woocommerce-variation-add-to-cart::after {
    content: none !important;
    display: none !important;
}

.woocommerce div.product form.cart {
    margin-top: 24px;
    margin-bottom: 0;
}

/* Количество (левая колонка) */
.woocommerce div.product form.cart .quantity {
    width: 100%;
    max-width: none;
    flex: none;
    height: 54px;
    border-radius: 999px;
    border: 1px solid #e5e7eb;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 8px;
    margin: 0 !important;
}

/* Input qty */
.woocommerce div.product form.cart .quantity .qty {
    width: 64px;
    height: 54px;
    border: 0 !important;
    background: transparent !important;
    text-align: center;
    font-size: 14px;
    font-weight: 600;
    color: #606060;
    font-family:
        Inter,
        ui-sans-serif,
        -apple-system;
}

/* Кнопки +/- если добавлены темой/плагином */
.woocommerce div.product form.cart .quantity button,
.woocommerce div.product form.cart .quantity .minus,
.woocommerce div.product form.cart .quantity .plus,
.woocommerce div.product form.cart .quantity .x-qty-btn {
    height: 44px;
    border: 0;
    background: transparent;
    border-radius: 999px;
    color: #606060;
    font-size: 22px;
    font-weight: 400;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    user-select: none;
}

.woocommerce div.product form.cart .quantity button:hover,
.woocommerce div.product form.cart .quantity .minus:hover,
.woocommerce div.product form.cart .quantity .plus:hover,
.woocommerce div.product form.cart .quantity .x-qty-btn:hover {
    /*background: #F3F4F6;*/
}

/* Убираем нативные стрелки у number */
.woocommerce div.product form.cart .quantity input.qty::-webkit-outer-spin-button,
.woocommerce div.product form.cart .quantity input.qty::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.woocommerce div.product form.cart .quantity input.qty {
    -moz-appearance: textfield;
}

/* Кнопка "В корзину" (правая колонка) */
.woocommerce div.product form.cart .single_add_to_cart_button {
    width: 100%;
    flex: none;
    height: 54px;
    border-radius: 999px;
    border: 0;
    background: #01ba04 !important;
    color: #fff !important;
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
    font-family:
        Inter,
        ui-sans-serif,
        -apple-system;
}

.woocommerce div.product form.cart .single_add_to_cart_button:hover {
    filter: brightness(0.98);
}

/* =======================================================================
   КНОПКИ НИЖЕ (Купить в 1 клик / Кредит / Рассрочка)
   ======================================================================= */

.x-sp__fast {
    margin: 14px 0 0;
}

.x-sp__pay {
    margin: 14px 0 0;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

@media (max-width: 1024px) {
    .x-sp__grid {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    .x-sp__title {
        font-size: 34px;
        line-height: 1.1;
        overflow-wrap: break-word;
        word-break: break-word;
        margin-top: 85px;
    }
}

@media (max-width: 640px) {
    .woocommerce-variation-add-to-cart {
        grid-template-columns: minmax(0, 50%) minmax(0, 1fr);
    }
}

.related.products {
    margin-top: 120px;
}

/* =======================================================================
   КРЕДИТ И РАССРОЧКА
   ======================================================================= */

.x-credit-modal {
    display: none;
}

.x-credit-modal.is-open {
    display: block;
}

.x-credit-modal__backdrop {
    position: fixed;
    inset: 0;
    background: rgba(10, 16, 28, 0.5);
    backdrop-filter: blur(8px);
    z-index: 9998;
}

.x-credit-modal__panel {
    position: fixed;
    left: 50%;
    top: 70px;
    transform: translateX(-50%);
    width: min(560px, calc(100vw - 32px));
    background: #fff;
    border-radius: 22px;
    box-shadow: 0 18px 60px rgba(16, 24, 40, 0.28);
    z-index: 9999;
    padding: 54px 46px;
}

.x-credit-modal__close {
    position: absolute;
    top: -24px;
    right: -24px;
    width: 24px;
    height: 24px;
    border-radius: 12px;
    border: 0;
    background: #fff;
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 14px 34px rgba(16, 24, 40, 0.18);
    z-index: 10000;
}

.x-credit-modal__title {
    text-align: center;
    font-size: 18px;
    font-weight: 700;
    margin: 0 0 24px;
    color: #111827;
}

.x-credit-modal__banks {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.x-credit-bank {
    width: 100%;
    min-height: 52px;
    padding: 0;
    border: 1px solid #a8a8a8;
    border-radius: 999px;
    background: #fff;
    color: #111827;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    text-align: center;
}

/* .x-credit-bank.x-credit-bank--tbank {
    background: #ffdd2d !important;
}
.x-credit-bank.x-credit-bank--tbank:hover {
    background: #fcc521 !important;
} */

/* Контейнер всей кнопки Т‑Банка */
.tinkoff-payment {
    position: relative;
    width: 100%;
    height: 52px; /* высота, как у других кнопок */
    border-radius: 999px;
    overflow: hidden;
    cursor: pointer;
}

/* Невидимая оригинальная кнопка Т‑Банка (растянута на весь контейнер) */
.tinkoff-payment tinkoff-create-button {
    position: absolute;
    inset: 0;
    opacity: 0;
    z-index: 1;
}

/* Видимая обложка с текстом */
.tinkoff-payment__overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 600;
    color: #111827;
    pointer-events: none; /* клики проходят насквозь к реальной кнопке */
    z-index: 2;
}

.tinkoff-payment-button {
    width: 100%;
    min-height: 52px;
    border: 1px solid #a8a8a8;
    border-radius: 999px;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    cursor: pointer;
}

.tinkoff-payment-logo {
    width: 22px;
    height: 22px;
    background: #ffd400;
    border-radius: 6px;
    position: relative;
}

.tinkoff-payment-logo::before {
    content: "T";
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 14px;
    color: #111827;
}

.tinkoff-payment-content {
    font-size: 16px;
    font-weight: 700;
    color: #404040;
}

@media (max-width: 768px) {
    .x-credit-modal__panel {
        top: 20px;
        width: calc(100vw - 20px);
        padding: 28px 18px;
        border-radius: 18px;
    }

    .x-credit-modal__close {
        top: -12px;
        right: -12px;
    }

    .x-credit-modal__title {
        margin-bottom: 30px;
    }
}

/* ===== ЛАЙТБОКС ===== */
.x-lightbox {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 999999;
}

.x-lightbox.is-active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.x-lightbox__overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.9);
}

.x-lightbox__container {
    position: relative;
    z-index: 1;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 80px;
}

.x-lightbox__track-wrapper {
    width: 100%;
    height: 100%;
    overflow: hidden;
    position: relative;
}

.x-lightbox__track {
    display: flex;
    width: 100%;
    height: 100%;
    transition: transform 0.4s ease;
    will-change: transform;
}

.x-lightbox__slide {
    flex: 0 0 100%;
    min-width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px;
}

.x-lightbox__slide img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    user-select: none;
    -webkit-user-drag: none;
}

/* Навигация */
.x-lightbox__nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
    width: 56px;
    height: 56px;
    border: none;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.08);
    color: #333;
    font-size: 32px;
    cursor: pointer;
    transition: all 0.25s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.x-lightbox__nav:hover {
    background: rgba(0, 0, 0, 0.15);
    transform: translateY(-50%) scale(1.05);
}

.x-lightbox__prev {
    left: 20px;
}

.x-lightbox__next {
    right: 20px;
}

/* Закрытие */
.x-lightbox__close {
    position: absolute;
    top: 24px;
    right: 24px;
    z-index: 10;
    width: 48px;
    height: 48px;
    border: none;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.06);
    color: #333;
    font-size: 28px;
    cursor: pointer;
    transition: all 0.25s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.x-lightbox__close:hover {
    background: rgba(0, 0, 0, 0.12);
    transform: rotate(90deg);
}

/* Счетчик */
.x-lightbox__counter {
    position: absolute;
    bottom: 32px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
    color: #666;
    font-size: 14px;
    font-weight: 500;
    background: rgba(255, 255, 255, 0.9);
    padding: 6px 16px;
    border-radius: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.x-lightbox__current {
    color: #000;
    font-weight: 600;
}

/* Адаптив */
@media (max-width: 768px) {
    .x-lightbox__container {
        padding: 20px 50px;
    }
    .x-lightbox__nav {
        width: 40px;
        height: 40px;
        font-size: 24px;
    }
    .x-lightbox__prev {
        left: 8px;
    }
    .x-lightbox__next {
        right: 8px;
    }
    .x-lightbox__close {
        top: 12px;
        right: 12px;
        width: 40px;
        height: 40px;
        font-size: 22px;
    }
}

@media (max-width: 1024px) {
    .woocommerce div.product {
        padding-top: 0px !important;
        margin-top: -50px;
    }
}
