.product-page {
    padding: 28px 0 80px;
}

/* ================================
   PRODUCT TOP
================================ */

.product-detail__top {
    margin-bottom: 65px;
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(400px, 0.95fr);
    gap: 55px;
}

.product-detail__gallery {
    min-width: 0;
}

.product-detail__info {
    padding-top: 5px;
}


/* ================================
   PRODUCT INFO
================================ */

.product-detail__badges {
    min-height: 28px;
    margin-bottom: 15px;
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
}

.product-badge {
    padding: 6px 10px;
    border-radius: 7px;
    color: #fff;
    font-size: 11px;
    font-weight: 850;
    background: linear-gradient(135deg, #e65846, var(--brand-red));
    box-shadow: 0 3px 10px rgba(111, 29, 136, 0.14);
}

.product-badge--popular {
    color: #3c2a08;
    background: linear-gradient(135deg, #ffe36d, var(--brand-gold));
}

.product-badge--favorite {
    background: linear-gradient(135deg, #7b2a8d, var(--brand-purple));
}

.product-detail__meta {
    margin-bottom: 10px;
    display: flex;
    flex-wrap: wrap;
    gap: 9px 22px;
    color: var(--color-text-soft);
    font-size: 12px;
}

.product-detail__meta strong {
    color: #655d69;
}

.product-detail__title {
    margin: 0;
    color: #242126;
    font-size: clamp(30px, 3.1vw, 45px);
    line-height: 1.09;
    letter-spacing: -1.4px;
}

.product-detail__intro {
    max-width: 650px;
    margin-top: 14px;
    color: var(--color-text-muted);
    font-size: 15px;
    line-height: 1.6;
}


/* ================================
   PRICE / AVAILABILITY
================================ */

.product-detail__prices {
    margin-top: 28px;
    display: flex;
    align-items: flex-end;
    gap: 13px;
}

.product-detail__price {
    color: #242126;
    font-size: 34px;
    line-height: 1;
    font-weight: 900;
}

.product-detail__old-price {
    padding-bottom: 3px;
    color: var(--color-text-soft);
    font-size: 16px;
    text-decoration: line-through;
}

.product-detail__availability {
    margin-top: 13px;
    display: flex;
    align-items: center;
    gap: 7px;
    color: var(--color-success);
    font-size: 13px;
    font-weight: 750;
}

.product-detail__availability span {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--color-success);
}


/* ================================
   QUICK SPECS
================================ */

.product-quick-specs {
    margin-top: 28px;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 9px;
}

.product-quick-spec {
    min-height: 62px;
    padding: 11px 13px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 3px;
    border: 1px solid #eee6dc;
    border-radius: 11px;
    background: linear-gradient(135deg, #fffaf1, #f8f6f2);
}

.product-quick-spec span {
    color: var(--color-text-soft);
    font-size: 11px;
}

.product-quick-spec strong {
    color: #3d3041;
    font-size: 14px;
}


/* ================================
   BUY
================================ */

.product-buy {
    margin-top: 26px;
    display: flex;
    align-items: stretch;
    gap: 10px;
}

.product-count {
    height: 50px;
    display: flex;
    overflow: hidden;
    border: 1px solid var(--color-border);
    border-radius: 10px;
    background: #fff;
}

.product-count:focus-within {
    border-color: var(--brand-purple);
}

.product-count__button {
    width: 40px;
    padding: 0;
    border: 0;
    color: #554c59;
    font-size: 19px;
    background: #fff;
    transition: color var(--transition), background var(--transition);
}

.product-count__button:hover {
    color: var(--brand-purple);
    background: #f7f5f2;
}

.product-count__input {
    width: 45px;
    padding: 0;
    border: 0;
    outline: none;
    text-align: center;
    font-weight: 750;
    appearance: textfield;
}

.product-count__input::-webkit-outer-spin-button,
.product-count__input::-webkit-inner-spin-button {
    margin: 0;
    appearance: none;
}

.product-buy__button {
    flex: 1;
    min-height: 50px;
    padding: 0 25px;
    border: 0;
    border-radius: 10px;
    color: #fff;
    font-weight: 850;
    background: linear-gradient(135deg, var(--brand-orange), #f0a02e);
    box-shadow: 0 8px 20px rgba(238, 132, 44, 0.19);
    transition: filter var(--transition), transform var(--transition);
}

.product-buy__button:hover {
    filter: brightness(0.94);
    transform: translateY(-1px);
}

.product-buy__favorite {
    width: 50px;
    border: 1px solid var(--color-border);
    border-radius: 10px;
    color: #242126;
    font-size: 24px;
    background: #fff;
    transition:
        color var(--transition),
        border-color var(--transition),
        background var(--transition);
}

.product-buy__favorite:hover {
    color: var(--brand-purple);
    border-color: var(--brand-purple);
    background: var(--color-bg-soft);
}


/* ================================
   LOWER SECTIONS
================================ */

.product-detail__sections {
    display: grid;
    gap: 20px;
}

.product-section {
    padding: 30px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    background: #fff;
    box-shadow: 0 8px 28px rgba(76, 31, 89, 0.045);
}

.product-section h2 {
    margin: 0 0 22px;
    color: #242126;
    font-size: 24px;
    letter-spacing: -0.5px;
}

.product-description {
    max-width: 950px;
    color: #5d5362;
    font-size: 15px;
    line-height: 1.75;
}

.product-description > :first-child {
    margin-top: 0;
}

.product-description > :last-child {
    margin-bottom: 0;
}


/* ================================
   SPECIFICATIONS
================================ */

.product-specs {
    width: 100%;
    max-width: 1050px;
}

.product-specs__row {
    min-height: 48px;
    padding: 10px 0;
    display: grid;
    grid-template-columns: minmax(190px, 1fr) minmax(150px, 1fr);
    gap: 30px;
    align-items: center;
    border-bottom: 1px solid var(--color-border);
}

.product-specs__row:first-child {
    border-top: 1px solid var(--color-border);
}

.product-specs__row span {
    color: var(--color-text-muted);
    font-size: 14px;
}

.product-specs__row strong {
    color: #35283a;
    font-size: 14px;
    font-weight: 650;
}


/* ================================
   PRODUCT MEDIA GALLERY
================================ */

.product-gallery {
    position: relative;
}

.product-gallery__stage {
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 0.82;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border: 1px solid var(--color-border);
    border-radius: 22px;
    background: radial-gradient(circle at 50% 38%, #fff 0%, #fcfbf9 57%, #f4f1ed 100%);
    box-shadow: 0 10px 34px rgba(74, 28, 88, 0.06);
}

.product-gallery__stage img,
.product-gallery__stage video,
.product-gallery__stage iframe {
    width: 100%;
    height: 100%;
    display: block;
}

.product-gallery__stage img,
.product-gallery__stage video {
    object-fit: contain;
}

.product-gallery__stage video,
.product-gallery__stage iframe {
    background: #181619;
}

.product-gallery__stage iframe {
    border: 0;
}

.product-gallery__empty {
    color: var(--color-text-soft);
}

.product-gallery__arrow {
    position: absolute;
    top: 40%;
    z-index: 5;
    width: 44px;
    height: 44px;
    padding: 0 0 3px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--color-border);
    border-radius: 50%;
    color: #242126;
    font-size: 30px;
    line-height: 1;
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 5px 18px rgba(37, 32, 29, 0.10);
    transform: translateY(-50%);
    transition:
        color var(--transition),
        border-color var(--transition),
        transform var(--transition);
}

.product-gallery__arrow:hover {
    color: var(--brand-purple);
    border-color: var(--brand-purple);
    transform: translateY(-50%) scale(1.05);
}

.product-gallery__arrow--prev {
    left: 15px;
}

.product-gallery__arrow--next {
    right: 15px;
}

.product-gallery__thumbs {
    margin-top: 12px;
    padding: 2px 2px 7px;
    display: flex;
    gap: 9px;
    overflow-x: auto;
    scrollbar-width: thin;
    scrollbar-color: #cfc6bd transparent;
}

.product-gallery__thumb {
    position: relative;
    width: 82px;
    height: 82px;
    flex: 0 0 82px;
    padding: 4px;
    overflow: hidden;
    border: 2px solid transparent;
    border-radius: 11px;
    background: var(--color-bg-soft);
    transition:
        border-color var(--transition),
        background var(--transition),
        transform var(--transition);
}

.product-gallery__thumb:hover {
    border-color: #d8cfc7;
    transform: translateY(-1px);
}

.product-gallery__thumb.is-active {
    border-color: var(--brand-purple);
    background: #fff;
    box-shadow: 0 4px 13px rgba(238, 132, 44, 0.11);
}

.product-gallery__thumb img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: contain;
    border-radius: 6px;
}

.product-gallery__thumb--video {
    color: #fff;
    background: radial-gradient(circle at 50% 30%, #514c52 0%, #272328 72%);
}

.product-gallery__video-bg {
    position: absolute;
    inset: 0;
    background: #272328;
}

.product-gallery__play {
    position: absolute;
    top: 50%;
    left: 50%;
    z-index: 2;
    width: 34px;
    height: 34px;
    padding-left: 2px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    color: #fff;
    font-size: 15px;
    background: linear-gradient(135deg, #e65846, var(--brand-red));
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.18);
    transform: translate(-50%, -50%);
}

.product-gallery__video-label {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 5px;
    z-index: 2;
    color: rgba(255, 255, 255, 0.82);
    font-size: 10px;
    text-align: center;
}

.product-gallery__counter {
    position: absolute;
    right: 16px;
    bottom: 105px;
    z-index: 5;

    padding: 6px 10px;

    border: 1px solid rgba(0, 0, 0, 0.06);
    border-radius: 8px;

    color: #4e494f;
    font-size: 12px;
    font-weight: 700;

    background: rgba(255, 255, 255, 0.92);

    backdrop-filter: blur(5px);
}

/* ================================
   PRODUCT GALLERY ZOOM
================================ */

.product-gallery__stage {
    user-select: none;
}


/*
 * Картинка должна трансформироваться плавно.
 */

.product-gallery__main-image {
    transform-origin: center center;

    transition: transform 0.12s ease;

    cursor: zoom-in;
}


/*
 * После увеличения изображение можно двигать.
 */

.product-gallery__stage.is-zoomed
.product-gallery__main-image {
    cursor: grab;
}


.product-gallery__stage.is-dragging
.product-gallery__main-image {
    cursor: grabbing;

    transition: none;
}


/* ================================
   ZOOM CONTROLS
================================ */

.product-gallery__zoom {
    position: absolute;

    left: 50%;
    bottom: 105px;

    z-index: 7;

    height: 36px;

    display: flex;
    align-items: center;

    overflow: hidden;

    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 10px;

    background: rgba(255, 255, 255, 0.94);

    box-shadow:
        0 4px 15px
        rgba(35, 31, 28, 0.08);

    backdrop-filter: blur(6px);

    transform: translateX(-50%);
}


.product-gallery__zoom[hidden] {
    display: none;
}


.product-gallery__zoom-button,
.product-gallery__zoom-value {
    height: 100%;

    padding: 0;

    border: 0;

    color: #4d474e;

    background: transparent;
}


.product-gallery__zoom-button {
    width: 36px;

    font-size: 19px;
}


.product-gallery__zoom-value {
    min-width: 56px;

    padding: 0 8px;

    border-left:
        1px solid #ece7e2;

    border-right:
        1px solid #ece7e2;

    font-size: 11px;
    font-weight: 700;
}


.product-gallery__zoom-button:hover,
.product-gallery__zoom-value:hover {
    color: var(--brand-purple);

    background: #f8f5f2;
}

.product-buy__cart-form {
    min-width: 0;

    display: flex;
    flex: 1;
}


.product-buy__cart-form .product-buy__button {
    width: 100%;
}


.product-buy__cart-form .product-count {
    width: 100%;
}


.product-buy__cart-form .product-count[hidden] {
    display: none;
}


.product-count__value {
    min-width: 50px;

    flex: 1;

    display: flex;
    align-items: center;
    justify-content: center;

    font-weight: 800;
}

.product-buy__cart {
    min-width: 0;

    display: flex;
    flex: 1;
}


.product-buy__cart .product-buy__button {
    width: 100%;
}


.product-buy__cart .product-count {
    width: 100%;
}


.product-buy__cart .product-count[hidden] {
    display: none;
}


.product-count__value {
    min-width: 50px;

    flex: 1;

    display: flex;
    align-items: center;
    justify-content: center;

    font-weight: 800;
}

.product-buy__button--disabled {
    cursor: not-allowed;

    color: #918a8f;

    background: #ece9e6;

    box-shadow: none;
}


.product-buy__button--disabled:hover {
    filter: none;

    transform: none;
}


.product-detail__availability--empty {
    color: #b34b42;
}


.product-detail__availability--empty span {
    background: #b34b42;
}

/* ================================
   RESPONSIVE
================================ */

@media (max-width: 1000px) {
    .product-detail__top {
        grid-template-columns: 1fr 1fr;
        gap: 30px;
    }
}

@media (max-width: 760px) {
    .product-detail__top {
        display: block;
    }

    .product-detail__info {
        margin-top: 28px;
    }

    .product-detail__title {
        font-size: 31px;
    }

    .product-detail__price {
        font-size: 30px;
    }

    .product-section {
        padding: 22px 18px;
    }

    .product-gallery__arrow {
        top: 39%;
    }
}

@media (max-width: 520px) {
    .product-quick-specs {
        grid-template-columns: 1fr 1fr;
    }

    .product-buy {
        flex-wrap: wrap;
    }

    .product-buy__button {
        min-width: calc(100% - 60px);
    }

    .product-count {
        width: 100%;
    }

    .product-count__input {
        flex: 1;
    }

    .product-specs__row {
        grid-template-columns: 1fr;
        gap: 3px;
    }

    .product-gallery__thumb {
        width: 68px;
        height: 68px;
        flex-basis: 68px;
    }

    .product-gallery__arrow {
        width: 38px;
        height: 38px;
        font-size: 26px;
    }
    
    .product-gallery__counter {
        right: 12px;
        bottom: 91px;
    }
    
    .product-gallery__zoom {
        bottom: 91px;
    }
}

/* ============================================================
   MOBILE / TABLET RESPONSIVE OVERRIDES
============================================================ */

@media (max-width: 820px) {

    .product-page {
        padding: 20px 0 55px;
    }

    .product-detail__top {
        margin-bottom: 38px;

        display: block;
    }

    .product-detail__info {
        margin-top: 27px;
        padding-top: 0;
    }

    .product-gallery__stage {
        border-radius: 16px;
    }

    .product-gallery__thumbs {
        overflow-x: auto;
        scrollbar-width: none;

        -webkit-overflow-scrolling: touch;
    }

    .product-gallery__thumbs::-webkit-scrollbar {
        display: none;
    }

    .product-detail__title {
        font-size: 32px;
        letter-spacing: -0.8px;
    }

    .product-detail__prices {
        margin-top: 22px;
    }

    .product-detail__price {
        font-size: 30px;
    }

    .product-quick-specs {
        margin-top: 22px;
    }

    .product-buy {
        margin-top: 22px;
    }

    .product-detail__sections {
        gap: 14px;
    }

    .product-section {
        padding: 22px 18px;

        border-radius: 15px;
    }

    .product-section h2 {
        margin-bottom: 17px;

        font-size: 21px;
    }

}

@media (max-width: 560px) {

    .product-page {
        padding-top: 14px;
    }

    .product-detail__top {
        margin-bottom: 28px;
    }

    .product-gallery__stage {
        aspect-ratio: 1 / .9;

        border-radius: 13px;
    }

    .product-gallery__arrow {
        width: 36px;
        height: 36px;

        font-size: 25px;
    }

    .product-gallery__arrow--prev {
        left: 8px;
    }

    .product-gallery__arrow--next {
        right: 8px;
    }

    .product-gallery__thumb {
        width: 64px;
        height: 64px;

        flex: 0 0 64px;
    }

    .product-gallery__zoom,
    .product-gallery__counter {
        bottom: 85px;
    }

    .product-detail__badges {
        min-height: 0;
        margin-bottom: 11px;
    }

    .product-detail__title {
        font-size: 28px;
        line-height: 1.1;
    }

    .product-detail__intro {
        margin-top: 10px;

        font-size: 14px;
    }

    .product-detail__prices {
        margin-top: 18px;
    }

    .product-detail__price {
        font-size: 28px;
    }

    .product-quick-specs {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));

        gap: 7px;
    }

    .product-quick-spec {
        min-height: 58px;
        padding: 9px 10px;
    }

    .product-quick-spec strong {
        font-size: 13px;
    }

    .product-buy {
        display: grid;
        grid-template-columns:
            minmax(0, 1fr)
            auto;

        gap: 8px;
    }

    .product-buy__cart {
        min-width: 0;
    }

    .product-count {
        grid-column: 1 / -1;
        width: 100%;
    }

    .product-buy__button {
        width: 100%;
        min-width: 0;

        padding: 0 16px;
    }

    .product-buy__favorite {
        width: 50px;
    }

    .product-section {
        padding: 19px 15px;
    }

    .product-description {
        font-size: 14px;
        line-height: 1.65;
    }

    .product-specs__row {
        min-height: 0;
        padding: 10px 0;

        grid-template-columns: 1fr;

        gap: 4px;
    }

    .product-specs__row span,
    .product-specs__row strong {
        font-size: 13px;
    }

}

@media (max-width: 380px) {

    .product-detail__title {
        font-size: 26px;
    }

    .product-quick-specs {
        grid-template-columns: 1fr;
    }

}
