/* ==========================================================================
   THEME LEVEL FLUSH RESET
   Aggressively strips padding and margins from Astra/Elementor parent wrappers
   specifically on your Scroll Wipe pages to force the layout flush-top.
   ========================================================================== */
.site-content,
#content,
.ast-container,
.entry-content,
.elementor-section-wrap,
.elementor-section {
    padding-top: 0 !important;
    margin-top: 0 !important;
}

/* Discards padding from Astra's site content container on single posts/pages */
.single .site-content,
.page .site-content,
.ast-plain-container .site-content,
#content .ast-container {
    padding-top: 0 !important;
    margin-top: 0 !important;
}

/* Corrects block margins generated by WordPress default inner group blocks */
.wp-block-group,
.wp-block-columns {
    margin-top: 0 !important;
    padding-top: 0 !important;
}

/* ==========================================================================
   Scroll Product Wipe Frontend Styles
   ========================================================================== */

.wipe-section {
    position: relative;
    width: 100%;
    margin: 0 !important;
    padding: 0 !important;
    box-sizing: border-box;
    background-color: transparent; 
}

.wipe-sticky {
    position: relative; 
    width: 100%;
    height: 100vh;
    overflow: hidden;
    margin: 0;
    padding: 0;
}

.wipe-container {
    position: relative;
    width: 100%;
    height: 100%;
    margin-top: 0px !important; 
}

.wipe-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    display: flex;
    align-items: flex-end;
    pointer-events: none;
}

/* ==========================================================================
   CINEMATIC DESKTOP ENGINE (Fills 100% viewport width and height)
   ========================================================================== */
.wipe-slide img,
.wipe-slide .wipe-video,
.wipe-overlay img,
.wipe-overlay .wipe-video {
    position: absolute; 
    top: 0 !important;   
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    object-fit: cover !important;     
    /* Note: Dynamic inline styles now override object-position cleanly */
    object-position: center center !important; 
    display: block;
    margin: 0;
    padding: 0;
    pointer-events: auto;
}

/* ==========================================================================
   WIPE CONTENT BASE CONTAINER
   ========================================================================== */
.wipe-content {
    position: absolute;
    z-index: 10;
    pointer-events: none;
    max-width: 650px;
    width: 100%;
}

/* ==========================================================================
   DYNAMIC ALIGNMENT & ELEMENT POSITIONING
   ========================================================================== */

/* Left Corner (Low on the edge, matching screenshot) */
.wipe-content.align-left {
    bottom: 4% !important;
    left: 4% !important;
    right: auto !important;
    text-align: left !important;
}
.wipe-content.align-left .wipe-action-btn {
    margin-right: auto;
    margin-left: 0;
}

/* Center Layout */
.wipe-content.align-center {
    bottom: 8% !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    right: auto !important;
    text-align: center !important;
}
.wipe-content.align-center .wipe-action-btn {
    margin-left: auto;
    margin-right: auto;
}

/* Right Corner Layout */
.wipe-content.align-right {
    bottom: 4% !important;
    right: 4% !important;
    left: auto !important;
    text-align: right !important;
}
.wipe-content.align-right .wipe-action-btn {
    margin-left: auto;
    margin-right: 0;
}

.wipe-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    will-change: transform;
    pointer-events: none;
}

.wipe-overlay .wipe-content {
    position: absolute;
    width: 90vw;
}

.wipe-slide:not(:first-child) {
    visibility: hidden;
    opacity: 0;
}

/* Dynamic Action Button Styling */
.wipe-action-btn {
    display: inline-block;
    margin-top: 25px;
    padding: clamp(10px, 1vw, 14px) clamp(22px, 2vw, 34px);
    font-size: clamp(11px, 0.9vw, 14px);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    text-decoration: none;
    pointer-events: auto; 
    transition: transform 0.3s cubic-bezier(0.25, 1, 0.5, 1), opacity 0.3s ease;
}

.wipe-action-btn:hover {
    transform: translateY(-2px);
    opacity: 0.9;
}

/* ==========================================================================
   DYNAMIC MOBILE & TABLET LAYOUT LOCK (max-width: 781px)
   ========================================================================== */
@media screen and (max-width: 781px) {
    .wipe-section {
        background-color: transparent !important; 
    }

    .wipe-sticky {
        height: auto !important;
        overflow: visible !important;
    }

    .wipe-container {
        display: flex;
        flex-direction: column;
        height: auto !important;
    }

    .wipe-slide {
        position: relative !important;
        display: block !important;
        width: 100% !important;
        height: auto !important;
        min-height: 100vh;
        margin-bottom: 40px; 
        background-color: inherit; 
    }

    .wipe-overlay {
        position: relative !important;
        width: 100% !important;
        height: auto !important;
        overflow: visible !important;
    }

    .wipe-slide img,
    .wipe-slide .wipe-video,
    .wipe-overlay img,
    .wipe-overlay .wipe-video {
        position: relative !important;
        top: 0 !important;
        left: 0 !important;
        width: 100vw !important;
        height: auto !important;
        max-height: 56.25vw !important; 
        object-fit: contain !important;  
        object-position: top center !important;
        transform: none !important;
    }

    .wipe-content,
    .wipe-overlay .wipe-content {
        position: relative !important;
        margin-top: 15px !important;
        top: auto !important;
        bottom: auto !important;
        left: 5% !important;
        right: 5% !important;
        width: 90% !important;
        max-width: 90% !important;
        padding-bottom: 30px;
        transform: none !important;
        text-align: left !important;
    }

    .wipe-content.align-center {
        left: auto !important;
        transform: none !important;
        margin: 15px auto 0 auto !important;
        text-align: center !important;
    }

    .wipe-action-btn {
        margin-top: 15px !important;
        padding: 10px 24px !important;
    }

    .wipe-slide:not(:first-child) {
        visibility: visible !important;
        opacity: 1 !important;
    }
}

/* ==========================================================================
   DESKTOP OPTIMIZATION (Proportional Safe Margins)
   ========================================================================== */
@media screen and (min-width: 782px) {
    .wipe-sticky {
        height: 100vh;
    }

    /* Enforce tight corners on desktop viewports */
    .wipe-content.align-left,
    .wipe-overlay .wipe-content.align-left {
        bottom: 5% !important;
        left: 5% !important;
    }
    .wipe-content.align-right,
    .wipe-overlay .wipe-content.align-right {
        bottom: 5% !important;
        right: 5% !important;
    }
}

/* ==========================================================================
   WP ADMIN BAR OFFSET OFFSET
   ========================================================================== */
.admin-bar .wipe-sticky {
    height: calc(100vh - 32px);
}
@media screen and (max-width: 782px) {
    .admin-bar .wipe-sticky {
        height: calc(100vh - 46px);
    }
}