/**
 * iPhone Mockup Slider Widget - CSS
 * Version: 1.2.0
 *
 * Mit Header-Offset Support für korrekte Zentrierung
 */

/* ===== PINNED SECTION ===== */
.imw-pinned-section {
    position: relative;
    width: 100%;
}

/* ===== STICKY WRAPPER ===== */
/* Header-Offset fest auf 200px gesetzt */
.imw-sticky-wrapper {
    position: sticky;
    top: 200px;
    height: calc(100vh - 200px);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: visible;
    -webkit-overflow-scrolling: touch;
}

/* ===== CONTENT LAYOUT ===== */
.imw-content-layout {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 80px;
    max-width: 1200px;
    width: 100%;
    padding: 0 40px;
}

/* Text rechts = iPhone links (default) */
.imw-content-layout.imw-text-right {
    flex-direction: row;
}

/* Text links = iPhone rechts */
.imw-content-layout.imw-text-left {
    flex-direction: row-reverse;
}

/* Text oben = iPhone unten */
.imw-content-layout.imw-text-top {
    flex-direction: column-reverse;
    gap: 50px;
}

/* Text unten = iPhone oben */
.imw-content-layout.imw-text-bottom {
    flex-direction: column;
    gap: 50px;
}

/* Vertikale Layouts: Text-Container Anpassungen */
.imw-content-layout.imw-text-top .imw-text-slides-container,
.imw-content-layout.imw-text-bottom .imw-text-slides-container {
    width: 100%;
    max-width: 600px;
    height: 200px;
}

.imw-content-layout.imw-text-top .imw-text-slide,
.imw-content-layout.imw-text-bottom .imw-text-slide {
    height: 200px;
    align-items: center;
}

/* Vertikale Layouts: Kleineres iPhone */
.imw-content-layout.imw-text-top .imw-iphone-container,
.imw-content-layout.imw-text-bottom .imw-iphone-container {
    width: 240px;
}

/* ===== IPHONE CONTAINER ===== */
.imw-iphone-container {
    position: relative;
    width: 300px;
   /* max-height: calc(100vh - 280px);*/
    aspect-ratio: 300 / 612;
    flex-shrink: 0;
}

/* ===== IPHONE FRAME ===== */
.imw-iphone-frame {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 10;
}

.imw-iphone-frame::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border: 11px solid #1c1c1e;
    border-radius: 52px;
}

/* ===== DYNAMIC ISLAND / NOTCH ===== */
.imw-notch {
    position: absolute;
    top: 3%;
    left: 50%;
    transform: translateX(-50%);
    width: 36%;
    height: 5.2%;
    background: #000;
    border-radius: 18px;
    z-index: 20;
}

/* ===== SCREEN ===== */
.imw-screen {
    position: absolute;
    top: 1.8%;
    left: 3.7%;
    right: 3.7%;
    bottom: 1.8%;
    border-radius: 42px;
    overflow: hidden;
    background: #000;
}

/* ===== SCREEN IMAGES ===== */
.imw-screen-images {
    position: relative;
    width: 100%;
    height: 100%;
}

.imw-screen-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    opacity: 0;
    transform: scale(1.05);
    transition: opacity 0.7s ease, transform 0.7s ease;
}

.imw-screen-image.imw-active {
    opacity: 1;
    transform: scale(1);
}

/* ===== TEXT SLIDES CONTAINER ===== */
.imw-text-slides-container {
    position: relative;
    height: 300px;
    width: 450px;
    overflow: hidden;
}

.imw-text-slides-track {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ===== TEXT SLIDES ===== */
.imw-text-slide {
    height: 300px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    opacity: 0.3;
    transform: translateY(20px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.imw-text-slide.imw-active {
    opacity: 1;
    transform: translateY(0);
}

/* Tag */
.imw-text-slide .imw-tag {
    display: inline-block;
    background: rgba(246, 194, 67, 0.15);
    color: #f6c243;
    padding: 8px 16px;
    border-radius: 30px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-bottom: 20px;
    width: fit-content;
}

/* Headline */
.imw-text-slide h2 {
    font-size: 42px;
    font-weight: 700;
    line-height: 1.1;
    margin: 0 0 16px 0;
    color: #fff;
}

/* Description */
.imw-text-slide p {
    font-size: 17px;
    line-height: 1.6;
    color: #888;
    max-width: 400px;
    margin: 0;
}

/* ===== PROGRESS BAR ===== */
.imw-progress-bar {
    position: absolute;
    bottom: 60px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
}

.imw-progress-segment {
    width: 60px;
    height: 3px;
    background: rgba(255,255,255,0.15);
    border-radius: 2px;
    overflow: hidden;
    cursor: pointer;
    transition: background 0.3s;
}

.imw-progress-segment:hover {
    background: rgba(255,255,255,0.25);
}

.imw-progress-segment .imw-fill {
    height: 100%;
    width: 0%;
    background: #f6c243;
    border-radius: 2px;
    transition: width 0.1s linear;
}

.imw-progress-segment.imw-completed .imw-fill {
    width: 100%;
}

/* ===== SLIDE COUNTER ===== */
.imw-slide-counter {
    position: absolute;
    top: 40px;
    right: 40px;
    font-size: 14px;
    color: #666;
    font-weight: 500;
}

.imw-slide-counter .imw-current {
    color: #f6c243;
    font-size: 24px;
    font-weight: 700;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1024px) {
    .imw-content-layout {
        gap: 50px;
        padding: 0 30px;
    }

    .imw-text-slide h2 {
        font-size: 36px;
    }

    .imw-text-slides-container {
        width: 380px;
    }
    
    .imw-content-layout.imw-text-top .imw-text-slides-container,
    .imw-content-layout.imw-text-bottom .imw-text-slides-container {
        max-width: 500px;
    }
}

@media (max-width: 900px) {
    .imw-content-layout {
        flex-direction: column !important;
        gap: 40px;
        padding: 20px;
    }
    
    /* Bei Text oben: Text zuerst, dann Phone */
    .imw-content-layout.imw-text-top {
        flex-direction: column-reverse !important;
    }
    
    /* Bei Text unten: Phone zuerst, dann Text */
    .imw-content-layout.imw-text-bottom {
        flex-direction: column !important;
    }
    
    /* Bei Text links/rechts: Phone zuerst auf Mobile */
    .imw-content-layout.imw-text-left,
    .imw-content-layout.imw-text-right {
        flex-direction: column !important;
    }

    .imw-iphone-container {
        width: 240px;
    }

    .imw-iphone-frame::before {
        border-width: 9px;
        border-radius: 44px;
    }

    .imw-screen {
        border-radius: 36px;
    }

    .imw-notch {
        top: 2.8%;
    }

    .imw-text-slides-container {
        width: 100%;
        max-width: 400px;
        height: 250px;
        text-align: center;
    }

    .imw-text-slide {
        height: 250px;
        align-items: center;
    }

    .imw-text-slide h2 {
        font-size: 28px;
    }

    .imw-text-slide p {
        font-size: 15px;
    }

    .imw-slide-counter {
        top: 20px;
        right: 20px;
    }

    .imw-progress-segment {
        width: 45px;
    }
}

@media (max-width: 480px) {
    .imw-iphone-container {
        width: 200px;
    }

    .imw-text-slide h2 {
        font-size: 24px;
    }

    .imw-text-slide p {
        font-size: 14px;
    }

    .imw-text-slide .imw-tag {
        font-size: 10px;
        padding: 6px 12px;
    }

    .imw-progress-segment {
        width: 35px;
    }
}

/* ===== EDITOR PREVIEW ===== */
.elementor-editor-active .imw-pinned-section {
    height: auto !important;
    min-height: 100vh;
}

.elementor-editor-active .imw-sticky-wrapper {
    position: relative;
}

.elementor-editor-active .imw-screen-image {
    opacity: 1;
    transform: scale(1);
}

.elementor-editor-active .imw-screen-image:not(:first-child) {
    opacity: 0;
}

.elementor-editor-active .imw-text-slide {
    opacity: 1;
    transform: translateY(0);
}

.elementor-editor-active .imw-text-slide:not(:first-child) {
    display: none;
}

/* Editor: Vertikale Layouts Preview */
.elementor-editor-active .imw-content-layout.imw-text-top,
.elementor-editor-active .imw-content-layout.imw-text-bottom {
    min-height: 80vh;
}

.elementor-editor-active .imw-content-layout.imw-text-top .imw-text-slide,
.elementor-editor-active .imw-content-layout.imw-text-bottom .imw-text-slide {
    height: auto;
    min-height: 150px;
}