/* Общие стили для страниц товаров (браслеты, кольца и т.д.) */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Source Serif Pro', serif;
    background-color: #FFFFFF;
    color: #2C2C2C;
    line-height: 1.6;
    padding-top: 100px;
}

/* Исправление размера логотипа в footer на страницах товаров */
body .footer-logo-image {
    height: 85px !important;
    width: auto !important;
}

.product-page {
    max-width: 1400px;
    margin: 0 auto;
    padding: 60px 20px 120px;
}

.product-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 100px;
    align-items: start;
}

@media (min-width: 969px) {
    .product-container {
        align-items: stretch;
    }
    .product-image-section,
    .product-carousel-outer {
        grid-column: 1;
        grid-row: 1;
    }
    .product-info-sticky-wrapper {
        grid-column: 2;
        grid-row: 1;
        align-self: start;
    }
    .product-info-section {
        align-self: start;
    }
    .product-info-section--stuck {
        position: fixed;
        z-index: 10;
    }
    .product-info-sticky-placeholder {
        flex-shrink: 0;
    }
}

.product-image-section {
    position: relative;
    width: 100%;
    max-width: 100%;
    margin-top: 160px;
}

/* Первая фотка браслета — прежний размер (4:3) */
.product-main-image {
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    display: block;
    background-color: #F4F4F4;
    cursor: pointer;
}

.product-page-gallery {
    display: flex;
    flex-direction: column;
    gap: 0;
    width: 100%;
}
/* Последующие фотки выше (4:5) */
.product-page-gallery-item {
    position: relative;
    width: 100%;
    aspect-ratio: 4 / 5;
    overflow: hidden;
}
.product-page-gallery-item img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
@media (min-width: 969px) {
    .product-page-gallery-item img {
        cursor: pointer;
    }
}
.product-page-gallery:empty { display: none; }

.product-page-carousel-counter-wrap { display: none; }

/* Мобильная карусель — full-bleed до краёв и сверху */
@media (max-width: 968px) {
    .product-carousel-outer {
        position: relative;
        width: 100%;
        max-width: 100%;
        margin-top: -40px;
        margin-left: 0;
        margin-right: 0;
        max-height: 70vh;
        box-sizing: border-box;
    }
    .product-image-section {
        position: relative;
        display: flex;
        flex-direction: row;
        flex-wrap: nowrap;
        overflow-x: auto;
        overflow-y: hidden;
        scroll-snap-type: x mandatory;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        margin: 0;
        width: 100%;
        max-width: 100%;
        max-height: 70vh;
        box-sizing: border-box;
        isolation: isolate;
    }
    .product-image-section::-webkit-scrollbar { display: none; }
    .product-page-carousel-slide,
    .product-page-carousel-slide-clone {
        flex: 0 0 100%;
        width: 100%;
        min-width: 100%;
        scroll-snap-align: start;
        aspect-ratio: 3 / 4;
        overflow: hidden;
        z-index: 0;
    }
    .product-page-carousel-slide img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        display: block;
    }
    .product-page-gallery { display: contents; }
    .product-page-gallery-item {
        flex: 0 0 100%;
        width: 100%;
        min-width: 100%;
        scroll-snap-align: start;
        aspect-ratio: 3 / 4;
    }
    .product-page-gallery-item img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        display: block;
    }
    .product-carousel-outer .product-page-carousel-counter-wrap {
        display: flex;
        position: absolute;
        left: 0;
        bottom: 0;
        right: 0;
        top: 0;
        z-index: 100;
        pointer-events: none;
        align-items: flex-end;
        justify-content: flex-start;
        padding: 0 0 14px 20px;
        box-sizing: border-box;
    }
    .product-carousel-outer .product-page-carousel-counter-wrap .product-page-carousel-counter {
        display: inline-block;
        white-space: nowrap;
        padding: 6px 20px;
        background: #FFFFFF;
        border-radius: 9999px;
        font-size: 14px;
        font-weight: 500;
        color: #2a0812;
    }
}

/* Блокировка прокрутки основного сайта при открытом лайтбоксе (ползунок страницы скрыт) */
html.lightbox-open,
body.lightbox-open {
    overflow: hidden !important;
}

.image-lightbox {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #FFFFFF;
    z-index: 10000;
    flex-direction: column;
    overflow: hidden;
}

.image-lightbox.active {
    display: flex;
}

.image-lightbox-header {
    position: relative;
    background-color: #FFFFFF;
    padding: 20px 40px;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10001;
    min-height: 70px;
    flex-shrink: 0;
}

.image-lightbox-title {
    display: none !important;
}

.image-lightbox-close {
    background: rgba(255, 255, 255, 0.7);
    border-radius: 50%;
    border: none;
    color: #2c2c2c;
    cursor: pointer;
    padding: 8px;
    font-size: 24px;
    width: 44px;
    height: 44px;
    display: flex !important;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease;
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10002;
}

.image-lightbox-close:hover {
    background: rgba(255, 255, 255, 0.85);
}

.image-lightbox-close svg {
    width: 24px;
    height: 24px;
    stroke: #2c2c2c;
    pointer-events: none;
}

.image-lightbox-body {
    flex: 1;
    display: flex;
    min-height: 0;
    overflow: hidden;
}
@media (min-width: 769px) {
    .image-lightbox-body {
        align-items: center;
    }
}

.image-lightbox-thumbs {
    display: none;
    flex-direction: column;
    gap: 12px;
    padding: 24px 20px 24px 28px;
    overflow-y: auto;
    align-items: center;
    flex-shrink: 0;
    max-height: calc(100vh - 80px);
}
@media (min-width: 769px) {
    .image-lightbox-thumbs {
        min-width: 320px;
    }
    .image-lightbox.active .image-lightbox-thumbs:not(:empty) {
        display: flex;
        flex-direction: column;
        justify-content: flex-end;
        align-items: flex-start;
    }
    .image-lightbox-thumb {
        width: 59px;
        height: 83px;
        min-height: 83px;
        max-height: 83px;
        object-fit: cover;
    }
}

.image-lightbox-thumb {
    width: 59px;
    height: 83px;
    object-fit: cover;
    display: block;
    cursor: pointer;
    border: 2px solid transparent;
    border-radius: 0;
    opacity: 0.75;
    transition: opacity 0.2s, border-color 0.2s;
}
.image-lightbox-thumb:hover { opacity: 1; }
.image-lightbox-thumb.active { border-color: #722F37; opacity: 1; }

.image-lightbox-content {
    flex: 1;
    position: relative;
    padding: 40px 32px;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: calc(100vh - 80px);
    min-width: 0;
    overflow: visible;
}

.image-lightbox-image {
    max-width: 85%;
    max-height: calc(100vh - 150px);
    display: block;
}

@media (min-width: 769px) {
    .image-lightbox.active {
        background: transparent;
    }
    .image-lightbox.active .image-lightbox-header,
    .image-lightbox.active .image-lightbox-body {
        background: transparent;
    }
    .image-lightbox.active .image-lightbox-content {
        position: fixed;
        inset: 0;
        overflow-y: auto;
        overflow-x: hidden;
        z-index: 0;
        display: block;
        padding: 0;
        -webkit-overflow-scrolling: touch;
    }
    .image-lightbox.active .image-lightbox-slide {
        min-height: 100vh;
        display: flex;
        justify-content: center;
        align-items: flex-start;
        box-sizing: border-box;
    }
    .image-lightbox.active .image-lightbox-slide img,
    .image-lightbox.active .image-lightbox-image {
        position: static;
        transform: none;
        left: auto;
        top: auto;
        width: 100vw;
        max-width: 100%;
        min-height: 100vh;
        height: auto;
        max-height: none;
        object-position: top center;
        display: block;
        vertical-align: top;
        z-index: 0;
    }
    .image-lightbox.active .image-lightbox-thumbs:not(:empty) {
        position: fixed;
        left: 0;
        bottom: 0;
        top: auto;
        transform: none;
        z-index: 10;
        max-height: calc(100vh - 40px);
        padding: 20px 20px 28px 28px;
        justify-content: flex-end;
    }
    .image-lightbox.active .image-lightbox-close {
        position: fixed;
        top: 20px;
        right: 32px;
        z-index: 11;
    }
}

.image-lightbox-nav {
    display: none;
    flex-shrink: 0;
    justify-content: center;
    align-items: center;
    gap: 16px;
    padding: 16px 20px 24px;
    background: rgba(255, 255, 255, 0.95);
}
@media (max-width: 768px) {
    .image-lightbox.active .image-lightbox-nav {
        display: flex;
        gap: 0;
        padding: 2px 0 2px;
        background: rgba(255, 255, 255, 0.65);
        border-radius: 9999px;
    }
    .image-lightbox.active .image-lightbox-prev,
    .image-lightbox.active .image-lightbox-next {
        background: transparent;
        border-radius: 0;
    }
    .image-lightbox.active .image-lightbox-prev:hover,
    .image-lightbox.active .image-lightbox-next:hover {
        background: transparent;
    }
    .image-lightbox.active .image-lightbox-counter {
        font-size: 14px;
        font-weight: 500;
        min-width: 36px;
    }
}

.image-lightbox-prev,
.image-lightbox-next {
    width: 44px;
    height: 44px;
    border: none;
    background: rgba(0, 0, 0, 0.08);
    border-radius: 50%;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #1b1b1b;
    transition: background 0.2s;
}
.image-lightbox-prev:hover,
.image-lightbox-next:hover { background: rgba(0, 0, 0, 0.14); }
.image-lightbox-counter { font-size: 14px; color: #4B4B4B; min-width: 48px; text-align: center; }

/* Лайтбокс на мобилке — копия из shared/product-page.css (HTML): без белой полосы сверху, крестик как в HTML */
@media (max-width: 768px) {
    .image-lightbox.active {
        inset: 0;
        width: 100vw;
        left: 0;
        right: 0;
        top: 0;
        bottom: 0;
        height: 100vh;
        height: 100dvh;
        max-width: none;
    }
    html.lightbox-open, body.lightbox-open { overflow-x: hidden !important; }
    /* Хедер — оверлей, без белой полосы */
    .image-lightbox.active .image-lightbox-header {
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        z-index: 10;
        flex-shrink: 0;
        background: transparent !important;
        padding: 0 !important;
        min-height: 0 !important;
    }
    /* Крестик — как в HTML, без transform от базового стиля */
    .image-lightbox.active .image-lightbox-close {
        position: fixed !important;
        top: 15px !important;
        right: 20px !important;
        width: 36px !important;
        height: 36px !important;
        transform: none !important;
        z-index: 11;
    }
    .image-lightbox.active .image-lightbox-close svg {
        width: 20px;
        height: 20px;
    }
    .image-lightbox.active .image-lightbox-nav {
        position: absolute;
        bottom: 24px;
        left: 50%;
        transform: translateX(-50%);
        width: 120px;
        justify-content: center;
        z-index: 10;
        flex-shrink: 0;
    }
    .image-lightbox.active .image-lightbox-body {
        position: relative;
        flex: 1;
        min-height: 0;
        width: 100%;
        padding: 0;
        margin: 0;
    }
    .image-lightbox.active .image-lightbox-thumbs {
        display: none !important;
        width: 0 !important;
        min-width: 0 !important;
        overflow: hidden !important;
    }
    .image-lightbox.active .image-lightbox-content {
        display: block;
        padding: 0 !important;
        margin: 0 !important;
        flex: 1 1 0;
        min-height: 0;
        width: 100%;
        overflow: hidden;
        box-sizing: border-box;
    }
    .image-lightbox.active .image-lightbox-content .image-lightbox-slides-strip {
        display: flex;
        flex-direction: row;
        flex-wrap: nowrap;
        height: 100%;
        width: calc(var(--slides-count, 1) * 100%);
        flex-shrink: 0;
        will-change: transform;
        transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    }
    /* Слайд = горизонтальная прокрутка (свайп для осмотра фото) — как в shared/product-page.css */
    .image-lightbox.active .image-lightbox-content .image-lightbox-slides-strip .image-lightbox-slide {
        flex: 0 0 calc(100% / var(--slides-count, 1));
        width: calc(100% / var(--slides-count, 1));
        min-width: calc(100% / var(--slides-count, 1));
        height: 100%;
        overflow-x: auto;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
        touch-action: pan-x;
        scrollbar-width: none;
        display: flex;
        align-items: center;
        justify-content: flex-start;
        box-sizing: border-box;
        padding: 0;
        margin: 0;
        border: none;
    }
    .image-lightbox.active .image-lightbox-content .image-lightbox-slides-strip .image-lightbox-slide::-webkit-scrollbar {
        display: none;
    }
    /* Фото 150% ширины — свайп влево-вправо; object-fit: cover + height 100% — без белой полосы сверху/снизу */
    .image-lightbox.active .image-lightbox-content .image-lightbox-slides-strip .image-lightbox-slide img,
    .image-lightbox.active .image-lightbox-content .image-lightbox-slides-strip .image-lightbox-image {
        display: block;
        flex-shrink: 0;
        width: 150%;
        height: 100%;
        min-width: 150%;
        min-height: 100%;
        object-fit: cover;
        object-position: center center;
        pointer-events: auto;
        padding: 0;
        margin: 0;
        border: none;
    }
    .image-lightbox-mobile-overlay {
        position: absolute;
        inset: 0;
        z-index: 5;
        overflow: hidden;
        pointer-events: none;
    }
    .image-lightbox-mobile-strip {
        display: flex;
        width: 200%;
        height: 100%;
        transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    }
    .image-lightbox-mobile-strip img {
        width: 50%;
        height: 100%;
        object-fit: cover;
        object-position: center;
        display: block;
        flex-shrink: 0;
    }
}

.product-info-section {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

@media (min-width: 969px) {
    .product-info-section {
        margin-top: 160px;
    }
}

.product-title {
    font-family: 'Source Serif Pro', serif;
    font-size: 2rem;
    font-weight: 600;
    color: #440a0a;
    margin: 0 0 0 0;
    line-height: 1.3;
    padding: 0;
}

.product-collection {
    font-family: 'Source Serif Pro', serif;
    font-size: 0.95rem;
    color: #440a0a;
    text-decoration: none;
    margin: 0 0 2px 0;
    display: inline-block;
    transition: color 0.2s ease;
}

.product-collection:hover {
    color: #360808;
    text-decoration: underline;
}

.product-price {
    font-family: 'Source Serif Pro', serif;
    font-size: 1.3rem;
    color: #440a0a;
    letter-spacing: 0.5px;
    margin: 0 0 20px 0;
}

.product-description {
    font-family: 'Source Serif Pro', serif;
    font-size: 1rem;
    color: #4A4A4A;
    line-height: 1.7;
    margin-bottom: 24px;
}

.product-color-section {
    margin-bottom: 24px;
}

.product-color-label {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    font-family: 'Source Serif Pro', serif;
    font-size: 0.95rem;
}

.product-color-label-text {
    color: #2C2C2C;
}

.product-color-label-value {
    color: #666;
}

.color-options {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.color-swatch {
    width: 18px;
    height: 18px;
    min-width: 18px;
    min-height: 18px;
    border-radius: 50%;
    border: 1px solid #2a0812;
    background: var(--swatch-color, #ccc) !important;
    cursor: pointer;
    position: relative;
    display: inline-block;
    box-sizing: border-box;
}

.color-swatch:hover {
    border-color: #2a0812;
}

.color-swatch.active {
    border-color: transparent !important;
    outline: 1px solid #480607;
    outline-offset: 2px;
}

.color-swatch[data-sold-out="true"] {
    opacity: 0.5;
    cursor: not-allowed;
    position: relative;
}

.color-swatch[data-sold-out="true"]::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 14px;
    height: 1px;
    background-color: #000;
    transform: translate(-50%, -50%) rotate(45deg);
}

.add-to-cart-button {
    width: 100%;
    padding: 16px;
    background-color: #5d0d21;
    color: #F8F7F4;
    border: none;
    font-family: 'Source Serif Pro', serif;
    font-size: 1rem;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: background-color 0.3s ease;
    margin-bottom: 24px;
}

.add-to-cart-button:hover:not(:disabled) {
    background-color: #4a0a1a;
}

.add-to-cart-button:disabled {
    background-color: #7A7A7A;
    cursor: not-allowed;
}

.product-faq-section {
    margin-top: 24px;
}

.product-faq-item {
    border-bottom: 1px solid #E8E3D8;
    margin-bottom: 12px;
}

.product-faq-item:last-child {
    border-bottom: none;
}

.product-faq-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 0;
    cursor: pointer;
    user-select: none;
}

.product-faq-title {
    font-family: 'Source Serif Pro', serif;
    font-size: 1rem;
    color: #2C2C2C;
}

.product-faq-arrow {
    font-size: 1.2rem;
    color: #666;
    transition: transform 0.2s ease;
}

.product-faq-item.active .product-faq-arrow {
    transform: rotate(180deg);
}

.product-faq-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.product-faq-item.active .product-faq-content {
    max-height: 1000px;
}

.product-faq-text {
    padding-bottom: 16px;
    font-family: 'Source Serif Pro', serif;
    font-size: 0.95rem;
    color: #4A4A4A;
    line-height: 1.7;
}

.product-faq-text ul {
    list-style: none;
    padding-left: 0;
}

.product-faq-text li {
    margin-bottom: 8px;
}

.product-faq-text strong {
    font-weight: 600;
}

@media (max-width: 968px) {
    .product-container {
        grid-template-columns: 1fr;
        gap: 40px;
    }

    .product-image-section {
        margin-top: -80px;
    }
    
    .product-page {
        padding: 40px 0 80px;
        overflow-x: hidden;
    }
    
    .product-info-section {
        padding-left: 20px;
        padding-right: 20px;
        position: relative;
        z-index: 2;
    }
    
    .product-title {
        font-size: 1.6rem;
    }
}
