/* Single Product Detail Style 1 */

/* ── Elementor ancestor overflow fix ────────────────────────────────────────
   position:sticky (and our JS-fixed approach) requires that no ancestor
   between the element and the scroll container has overflow set to anything
   other than "visible". Elementor sections/columns commonly set
   overflow:hidden. These rules force all wrappers that contain our widget
   to stop clipping.                                                         */
.elementor-widget-pretpot_single_product_detail_style1,
.elementor-widget-pretpot_single_product_detail_style1 > .elementor-widget-container,
.elementor-section:has(.pretpot-spd1-wrapper),
.elementor-column:has(.pretpot-spd1-wrapper),
.e-container:has(.pretpot-spd1-wrapper),
.e-con:has(.pretpot-spd1-wrapper),
.e-con-inner:has(.pretpot-spd1-wrapper) {
    overflow: visible !important;
}

/* ── Wrapper (the tall scroll section) ─────────────────────────────────────
   Height is set inline by PHP via scroll_section_height (e.g. 300vh).
   This is the "runway" — keep relative so absolute children resolve to it. */
.pretpot-spd1-wrapper {
    position: relative;
    width: 100%;
    /* height set inline by PHP */
}

/* ── Sticky panel ───────────────────────────────────────────────────────────
   JS switches this between position:absolute (before/after the sticky zone)
   and position:fixed (during the sticky zone).
   Initial state is absolute/top:0 — JS takes over immediately on scroll.   */
.pretpot-spd1-sticky {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    /* height set by JS to (100vh - stickyTop) */
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    background: transparent;
    box-sizing: border-box;
}

/* ── 3-column layout ─────────────────────────────────────────────────────── */
.pretpot-spd1-container {
    width: 100%;
    max-width: 1200px;
    height: 100%;
    padding: 2rem;
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 2rem;
    align-items: start;
    background: inherit;
    box-sizing: border-box;
}

/* ── Info column ──────────────────────────────────────────────────────────── */
.pretpot-spd1-info {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.pretpot-spd1-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin: 0;
}

.pretpot-spd1-description {
    font-size: 0.95rem;
    line-height: 1.5;
}

.pretpot-spd1-tags-label {
    font-size: 0.9rem;
    font-weight: 500;
    margin-top: 0.5rem;
}

.pretpot-spd1-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.pretpot-spd1-tag {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: 2px solid currentColor;
    background: transparent;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.pretpot-spd1-tag.active,
.pretpot-spd1-tag:hover {
    background: currentColor;
    color: #fff;
}

/* ── Gallery (centre column) ─────────────────────────────────────────────── */
.pretpot-spd1-gallery {
    position: relative;
    overflow: hidden;
    width: 100%;
    height: 100%; /* fills the sticky panel height set by JS */
}

.pretpot-spd1-gallery-track {
    display: flex;
    flex-direction: column;
    will-change: transform;
    gap: 0;
    height: 100%;
}

/* Track direction is controlled by a class the JS adds to the wrapper:
   .pretpot-spd1-wrapper.is-horizontal → row (left/right slide)
   Default (no class)                  → column (up/down slide)
   JS adds/removes .is-horizontal each frame via getActiveDirection().     */
.pretpot-spd1-wrapper.is-horizontal .pretpot-spd1-gallery-track {
    flex-direction: row;
}

/* Each image wrapper fills 100% of the gallery viewport */
.pretpot-spd1-gallery-image-wrapper {
    flex-shrink: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
}

.pretpot-spd1-gallery-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* ── Image counter ─────────────────────────────────────────────────────────*/
.pretpot-spd1-image-counter {
    position: absolute;
    bottom: 1rem;
    left: 50%;
    transform: translateX(-50%);
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.85rem;
    background: rgba(0,0,0,0.6);
    color: #fff;
    z-index: 2;
    pointer-events: none;
}

/* ── Actions column ─────────────────────────────────────────────────────────*/
.pretpot-spd1-actions {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    align-items: flex-start;
}

.pretpot-spd1-price {
    font-size: 1.2rem;
    font-weight: 600;
}

.pretpot-spd1-quantity-selector {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.pretpot-spd1-qty-btn,
.pretpot-spd1-qty-value {
    width: 36px;
    height: 36px;
    border: 2px solid #ccc;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    cursor: pointer;
    font-size: 1rem;
}

.pretpot-spd1-qty-value {
    font-weight: 600;
    cursor: default;
}

.pretpot-spd1-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.6rem 1.2rem;
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 500;
    transition: all 0.2s ease;
    border: none;
    cursor: pointer;
}

/* ── Progress dots ──────────────────────────────────────────────────────────*/
.pretpot-spd1-progress {
    position: absolute;
    right: 2rem;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    z-index: 2;
}

.pretpot-spd1-progress-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: 2px solid currentColor;
    background: transparent;
    transition: all 0.2s;
    cursor: pointer;
}

.pretpot-spd1-progress-dot.active {
    background: currentColor;
    transform: scale(1.2);
}

/* ── Popup ──────────────────────────────────────────────────────────────────*/
.pretpot-spd1-popup {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pretpot-spd1-popup-overlay {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0,0,0,0.85);
    cursor: pointer;
}

.pretpot-spd1-popup-content {
    position: relative;
    z-index: 2;
    max-width: 90vw;
    max-height: 90vh;
}

.pretpot-spd1-popup-image {
    max-width: 100%;
    max-height: 90vh;
    object-fit: contain;
    border-radius: 8px;
}

.pretpot-spd1-popup-close {
    position: absolute;
    top: -40px; right: 0;
    background: none;
    border: none;
    color: #fff;
    font-size: 2rem;
    cursor: pointer;
}

/* ── Responsive ─────────────────────────────────────────────────────────────
   Tablet (768px+): inherits the full desktop 3-column layout — no overrides.
   Mobile (≤767px): stacked single-column layout.                            */
@media (max-width: 767px) {

    /* Single-column stacked layout */
    .pretpot-spd1-container {
        grid-template-columns: 1fr;
        grid-template-rows: auto auto auto;
        gap: 1.5rem;
        padding: 1rem;
        height: auto;
        align-items: start;
        overflow-y: auto;
    }

    /* Stack order: title/desc → gallery → actions */
    .pretpot-spd1-info    { order: 1; }
    .pretpot-spd1-gallery {
        order: 2;
        width: 100% !important;
        /* Explicit height is required — without it image wrappers in a
           horizontal flex row collapse to 0px tall.                     */
        height: 75vw !important;
    }
    .pretpot-spd1-actions {
        order: 3;
        width: 100%;
        align-items: stretch;
    }
    .pretpot-spd1-btn { width: 100% !important; }

    /* Progress dots: horizontal row, centred below the gallery */
    .pretpot-spd1-progress {
        flex-direction: row;
        right: auto;
        left: 50%;
        transform: translateX(-50%);
        top: auto;
        bottom: 0.75rem;
    }
}