/*
 * MARKET BOX OFFER V4
 * Центральный товарный лендинг и объединённые смысловые карточки.
 */

/* Центральная товарная колонка на компьютере */
body:has(.offer-v3-page) {
    background:
        radial-gradient(circle at top, #f5f1e9 0, #ded8cf 52%, #d2ccc3 100%);
}

.offer-v3-page {
    width: min(100%, 680px) !important;
    max-width: 680px !important;
    margin: 0 auto !important;
    background:
        linear-gradient(180deg, #fff 0%, #f8f5ef 55%, #f1eadf 100%);
    box-shadow: 0 0 60px rgba(23, 19, 15, .16);
}

/* Верхний бренд Market Box */
.offer-v4-brand {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 13px;
    min-height: 92px;
    padding: 17px 20px 15px;
    text-align: left;
    background:
        linear-gradient(135deg, #17130f 0%, #292019 100%);
    border-bottom: 4px solid #ffcf3f;
}

.offer-v4-brand__mark {
    display: grid;
    place-items: center;
    flex: 0 0 52px;
    width: 52px;
    height: 52px;
    color: #17130f;
    background: #ffcf3f;
    border: 3px solid #fff;
    border-radius: 17px;
    box-shadow: 4px 4px 0 rgba(255, 255, 255, .16);
    font-size: 20px;
    font-weight: 900;
    letter-spacing: -.5px;
}

.offer-v4-brand__text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.offer-v4-brand__text strong {
    color: #fff;
    font-size: 25px;
    line-height: 1;
    letter-spacing: -.5px;
}

.offer-v4-brand__text span {
    color: rgba(255, 255, 255, .68);
    font-size: 12px;
    line-height: 1.25;
}

/* Навигация ограничена шириной лендинга */
.offer-v3-nav {
    width: min(100%, 680px) !important;
    max-width: 680px !important;
    margin-right: auto !important;
    margin-left: auto !important;
}

.offer-v3-nav__inner {
    justify-content: flex-start !important;
    overflow-x: auto !important;
    scrollbar-width: none;
}

.offer-v3-nav__inner::-webkit-scrollbar {
    display: none;
}

/* Главное фото: квадрат без искусственной высоты 620/430 px */
.offer-v3-photo {
    padding: 16px 14px 0 !important;
}

.offer-v3-slider {
    position: relative;
}

.offer-v3-slider__stage {
    min-height: 0 !important;
    aspect-ratio: 1 / 1 !important;
    overflow: hidden !important;
    border-width: 4px !important;
    border-radius: 28px !important;
}

.offer-v3-slide {
    display: grid !important;
    place-items: center !important;
}

.offer-v3-slide__image {
    display: block !important;
    width: 100% !important;
    height: 100% !important;
    min-width: 0 !important;
    min-height: 0 !important;
    max-width: none !important;
    max-height: none !important;
    margin: 0 !important;
    object-fit: contain !important;
    background: #fff !important;
    image-rendering: auto !important;
}

/* Перелистывание находится под фотографией */
.offer-v4-slider-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    min-height: 54px;
    padding: 12px 8px 2px;
}

.offer-v4-slider-controls .offer-v3-slider__arrow {
    position: static !important;
    inset: auto !important;
    display: grid !important;
    place-items: center !important;
    flex: 0 0 38px;
    width: 38px !important;
    height: 38px !important;
    transform: none !important;
    color: #17130f !important;
    background: #fff !important;
    border: 2px solid #17130f !important;
    border-radius: 50% !important;
    box-shadow: 3px 3px 0 #ffcf3f !important;
    font-size: 25px !important;
    line-height: 1 !important;
}

.offer-v4-slider-controls .offer-v3-slider__arrow:hover {
    transform: translate(1px, 1px) !important;
    box-shadow: 2px 2px 0 #ffcf3f !important;
}

.offer-v4-slider-controls .offer-v3-slider__dots {
    display: flex !important;
    align-items: center;
    justify-content: center;
    gap: 7px;
    width: auto !important;
    min-width: 72px;
    margin: 0 !important;
    padding: 0 !important;
}

/* Название, цена, кнопка и преимущества — одна карточка */
.offer-v4-top-card {
    display: flex !important;
    flex-direction: column !important;
    width: auto !important;
    margin: 16px 14px 28px !important;
    padding: 22px 18px !important;
    background: #fff !important;
    border: 3px solid #17130f !important;
    border-radius: 28px !important;
    box-shadow: 8px 8px 0 #ffcf3f !important;
}

.offer-v4-top-card .offer-v3-product-title {
    width: 100% !important;
    max-width: 590px !important;
    margin: 0 auto 20px !important;
    text-align: center !important;
    text-wrap: balance;
    font-size: clamp(27px, 5vw, 38px) !important;
    line-height: 1.08 !important;
}

.offer-v4-top-card .offer-v3-price {
    width: 100% !important;
    margin: 0 0 14px !important;
    border-radius: 20px !important;
    box-shadow: none !important;
}

.offer-v4-top-card .offer-v3-buy-button {
    width: 100% !important;
    margin: 0 0 24px !important;
}

.offer-v4-top-card > h2,
.offer-v4-top-card > h3 {
    margin: 0 0 15px !important;
    text-align: center !important;
    font-size: 25px !important;
}

.offer-v4-top-card .offer-v3-short-specs {
    width: 100% !important;
    margin: 0 !important;
}

/* Фото + следующий смысловой блок — единая карточка */
.offer-v4-content-card {
    width: auto;
    margin: 28px 14px;
    overflow: hidden;
    background: #fff;
    border: 3px solid #17130f;
    border-radius: 28px;
    box-shadow: 8px 8px 0 rgba(255, 207, 63, .95);
}

.offer-v4-content-card > .offer-v3-wide-photo {
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
}

.offer-v4-content-card .offer-v3-wide-photo__image {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    max-height: none !important;
    margin: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    object-fit: contain !important;
}

.offer-v4-content-card > .offer-v3-description,
.offer-v4-content-card > .offer-v3-specs,
.offer-v4-content-card > .offer-v3-benefits,
.offer-v4-content-card > .offer-v3-package,
.offer-v4-content-card > .offer-v3-complectation {
    width: 100% !important;
    margin: 0 !important;
    padding: 25px 20px 27px !important;
    background: #fff !important;
}

/* Заголовки внутри смысловых карточек */
.offer-v4-content-card h2,
.offer-v4-content-card h3 {
    margin-top: 0 !important;
    text-align: center !important;
}

/* Отдельные широкие фото больше не тянутся до 1100 px */
.offer-v3-wide-photo {
    width: 100% !important;
    max-width: 680px !important;
}

.offer-v3-wide-photo__image {
    width: 100% !important;
    max-width: 100% !important;
}

/* Финальная галерея, цена и оформление — одна карточка */
.offer-v4-final-card {
    width: auto !important;
    margin: 32px 14px 110px !important;
    padding: 18px !important;
    background: #fff !important;
    border: 3px solid #17130f !important;
    border-radius: 30px !important;
    box-shadow: 9px 9px 0 #ffcf3f !important;
}

.offer-v4-final-card .offer-v3-bottom-product__grid {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 24px !important;
}

.offer-v4-final-card .offer-v3-bottom-product__gallery {
    position: static !important;
    top: auto !important;
}

.offer-v4-final-card .offer-v3-slider--bottom .offer-v3-slider__stage {
    min-height: 0 !important;
    aspect-ratio: 1 / 1 !important;
    border-radius: 23px !important;
    box-shadow: none !important;
}

.offer-v4-final-card .offer-v3-slider--bottom .offer-v3-slide__image {
    width: 100% !important;
    height: 100% !important;
    min-height: 0 !important;
    max-height: none !important;
}

.offer-v4-final-card .offer-v3-price {
    box-shadow: none !important;
}

/* Липкая панель не перекрывает финальную форму */
.offer-v3-mobile-bar.offer-v4-hide-sticky,
.offer-v3-sticky-buy.offer-v4-hide-sticky,
[data-offer-mobile-bar].offer-v4-hide-sticky,
[data-offer-sticky].offer-v4-hide-sticky {
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
    transform: translateY(130%) !important;
}

/* На телефоне колонка занимает весь экран */
@media (max-width: 700px) {
    body:has(.offer-v3-page) {
        background: #f6f2eb;
    }

    .offer-v3-page {
        width: 100% !important;
        max-width: none !important;
        box-shadow: none !important;
    }

    .offer-v4-brand {
        min-height: 82px;
        padding: 13px 16px 12px;
    }

    .offer-v4-brand__mark {
        flex-basis: 46px;
        width: 46px;
        height: 46px;
        border-radius: 15px;
        font-size: 18px;
    }

    .offer-v4-brand__text strong {
        font-size: 23px;
    }

    .offer-v3-photo {
        padding: 12px 10px 0 !important;
    }

    .offer-v3-slider__stage {
        min-height: 0 !important;
        aspect-ratio: 1 / 1 !important;
        border-radius: 23px !important;
    }

    .offer-v3-slide__image {
        min-height: 0 !important;
    }

    .offer-v4-top-card,
    .offer-v4-content-card,
    .offer-v4-final-card {
        margin-right: 10px !important;
        margin-left: 10px !important;
        border-radius: 23px !important;
        box-shadow: 6px 6px 0 #ffcf3f !important;
    }

    .offer-v4-top-card {
        padding: 19px 14px !important;
    }

    .offer-v4-top-card .offer-v3-product-title {
        font-size: 27px !important;
    }

    .offer-v4-content-card > .offer-v3-description,
    .offer-v4-content-card > .offer-v3-specs,
    .offer-v4-content-card > .offer-v3-benefits,
    .offer-v4-content-card > .offer-v3-package,
    .offer-v4-content-card > .offer-v3-complectation {
        padding: 22px 15px 24px !important;
    }

    .offer-v4-final-card {
        margin-bottom: 110px !important;
        padding: 13px !important;
    }
}

/* OFFER V4 BENEFITS WHOLE BLOCK FIX */

.offer-v4-top-card > .offer-v4-benefits-block {
    width: 100% !important;
    max-width: none !important;
    margin: 0 0 20px !important;
    padding: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    border: 0 !important;
}

.offer-v4-benefits-block > .offer-v3-shell,
.offer-v4-benefits-block .offer-v3-shell {
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
    padding: 0 !important;
}

.offer-v4-benefits-block h2,
.offer-v4-benefits-block h3 {
    margin: 0 0 16px !important;
    text-align: center !important;
    font-size: 25px !important;
    line-height: 1.15 !important;
}

.offer-v4-benefits-block > :last-child {
    margin-bottom: 0 !important;
}

/* OFFER V4 ACTIVE NAV ITEM V1 */

.offer-v3-nav a[data-offer-v3-nav] {
    transition:
        color .18s ease,
        background-color .18s ease,
        border-color .18s ease,
        box-shadow .18s ease,
        transform .18s ease;
}

.offer-v3-nav a[data-offer-v3-nav].is-current {
    color: #17130f !important;
    background: #ffcf3f !important;
    border-color: #17130f !important;
    box-shadow: 3px 3px 0 #17130f !important;
    transform: translateY(-1px);
    font-weight: 800 !important;
}

.offer-v3-nav a[data-offer-v3-nav].is-current:hover {
    color: #17130f !important;
    background: #ffcf3f !important;
}

@media (max-width: 600px) {
    .offer-v3-nav a[data-offer-v3-nav].is-current {
        box-shadow: 2px 2px 0 #17130f !important;
    }
}
