/* ============================================================
   IPHONE MOCKUP STACK HERO SPECIFIC STYLES
   ============================================================ */

.hero-layout-iphone .service_details-hero-visual {
    margin-top: 54px;
}

.iphone-stack-container {
    position: relative;
    width: 100%;
    max-width: 620px;
    height: 440px;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    z-index: 15;
    margin: 0;
}

.iphone-mockup {
    position: absolute;
    width: 195px;
    top: 0;
    left: 50%;
    transform-origin: center;
    aspect-ratio: 1 / 2.1;
    border-radius: 34px;
    overflow: hidden;
    background: #000;
    border: 5px solid #1a1a1a;
    box-shadow: -15px 30px 45px rgba(0, 0, 0, 0.7);
    will-change: transform, opacity;
    opacity: 0;
}

.iphone-mockup img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* DESKTOP HOVER STATES */
@media (min-width: 1025px) {
    .iphone-mockup.active-hover {
        opacity: 1;
        filter: brightness(1.05);
        z-index: 20;
    }

    .iphone-mockup.dimmed {
        opacity: 0.35;
        filter: brightness(0.7);
    }
}

/* DESKTOP STACK POSITIONS */
.s-left-2 {
    left: 0%;
    top: 5%;
    z-index: 4;
}

.s-left-1 {
    left: 21%;
    top: 0%;
    z-index: 3;
}

.s-right-1 {
    left: 42%;
    top: 5%;
    z-index: 2;
}

.s-front {
    left: 63%;
    top: 0%;
    z-index: 1;
}

/* TABLET & INTERMEDIATE DESKTOP (1025px – 1280px) */
@media (min-width: 1025px) and (max-width: 1280px) {
    .hero-layout-iphone .service_details-hero-visual {
        margin-top: 54px;
    }
    .iphone-stack-container {
        max-width: 520px;
        height: 410px;
    }
    .iphone-mockup {
        width: 170px;
        border-radius: 28px;
    }
    .s-left-2 {
        left: 0%;
        top: 5%;
    }
    .s-left-1 {
        left: 18%;
        top: 0%;
    }
    .s-right-1 {
        left: 36%;
        top: 5%;
    }
    .s-front {
        left: 54%;
        top: 0%;
    }
}

/* TABLET (768px – 1024px) */
@media (max-width: 1024px) {
    .iphone-stack-container {
        width: 100%;
        max-width: 650px;
        height: 500px;
        margin: 0 auto;
    }

    .iphone-mockup {
        position: absolute;
        width: 175px;
        top: 22%;
        left: 50%;
        margin-left: -87.5px;
        transform-origin: center;
    }

    .s-left-2 {
        transform: translate(-170px, -10px) rotate(-14deg);
        z-index: 1;
    }

    .s-left-1 {
        transform: translate(-58px, -24px) rotate(-5deg);
        z-index: 2;
    }

    .s-right-1 {
        transform: translate(58px, -24px) rotate(5deg);
        z-index: 3;
    }

    .s-front {
        transform: translate(170px, -10px) rotate(14deg);
        z-index: 4;
    }
}

/* MOBILE 3D ROTATING SHOWCASE (<768px) */
@media (max-width: 767px) {
    .hero-layout-iphone .service_details-hero-visual {
        margin-top: 36px;
        perspective: 1100px;
        display: flex;
        justify-content: center;
        align-items: center;
        overflow: visible;
    }

    .iphone-stack-container {
        position: relative;
        width: 100%;
        max-width: 440px;
        height: 380px;
        margin: 0 auto;
        display: flex;
        align-items: center;
        justify-content: center;
        transform-style: preserve-3d;
        perspective: 1100px;
        overflow: visible;
    }

    .iphone-mockup {
        position: absolute;
        width: 155px;
        aspect-ratio: 9 / 19.5;
        top: 50%;
        left: 50%;
        margin-left: -77.5px;
        margin-top: -168px;
        border-radius: 24px;
        border: 3.5px solid #1a1a1a;
        background: #000;
        box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.15), 0 20px 45px -6px rgba(0, 0, 0, 0.85);
        overflow: hidden;
        will-change: transform, opacity, filter;
        transform-style: preserve-3d;
        backface-visibility: hidden;
        box-sizing: border-box;
        opacity: 0;
        display: block;
    }

    .iphone-mockup:nth-child(4) {
        display: none; /* Show 3 screens for perfect 3D trio rotation */
    }

    .iphone-mockup:nth-child(1) {
        z-index: 10;
        transform: translate3d(0, 0, 36px) rotateY(0deg) scale(1.04);
    }
    .iphone-mockup:nth-child(2) {
        z-index: 4;
        transform: translate3d(85px, 6px, -15px) rotateY(-14deg) scale(0.92);
        filter: brightness(0.88);
    }
    .iphone-mockup:nth-child(3) {
        z-index: 3;
        transform: translate3d(-85px, 6px, -15px) rotateY(14deg) scale(0.92);
        filter: brightness(0.88);
    }

    /* 3D Continuous Axis Rotator Classes (active after entrance animation) */
    .iphone-stack-container.is-rotating .iphone-mockup:nth-child(1) {
        animation: rotateAxisMobileSlot1 9s cubic-bezier(0.45, 0.05, 0.55, 0.95) infinite;
    }

    .iphone-stack-container.is-rotating .iphone-mockup:nth-child(2) {
        animation: rotateAxisMobileSlot2 9s cubic-bezier(0.45, 0.05, 0.55, 0.95) infinite;
    }

    .iphone-stack-container.is-rotating .iphone-mockup:nth-child(3) {
        animation: rotateAxisMobileSlot3 9s cubic-bezier(0.45, 0.05, 0.55, 0.95) infinite;
    }

    /* Keyframes for Mobile 3D Rotator */
    @keyframes rotateAxisMobileSlot1 {
        0%, 27% {
            transform: translate3d(0, 0, 36px) rotateY(0deg) scale(1.04);
            z-index: 10;
            filter: brightness(1);
            box-shadow: 0 0 0 1.2px rgba(255, 255, 255, 0.35), 0 26px 55px -6px rgba(0, 0, 0, 0.88);
        }
        33.3%, 60.3% {
            transform: translate3d(85px, 6px, -15px) rotateY(-14deg) scale(0.92);
            z-index: 4;
            filter: brightness(0.88);
            box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.15), 0 16px 36px -6px rgba(0, 0, 0, 0.7);
        }
        66.6%, 93.6% {
            transform: translate3d(-85px, 6px, -15px) rotateY(14deg) scale(0.92);
            z-index: 3;
            filter: brightness(0.88);
            box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.15), 0 16px 36px -6px rgba(0, 0, 0, 0.7);
        }
        100% {
            transform: translate3d(0, 0, 36px) rotateY(0deg) scale(1.04);
            z-index: 10;
            filter: brightness(1);
            box-shadow: 0 0 0 1.2px rgba(255, 255, 255, 0.35), 0 26px 55px -6px rgba(0, 0, 0, 0.88);
        }
    }

    @keyframes rotateAxisMobileSlot2 {
        0%, 27% {
            transform: translate3d(85px, 6px, -15px) rotateY(-14deg) scale(0.92);
            z-index: 4;
            filter: brightness(0.88);
            box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.15), 0 16px 36px -6px rgba(0, 0, 0, 0.7);
        }
        33.3%, 60.3% {
            transform: translate3d(-85px, 6px, -15px) rotateY(14deg) scale(0.92);
            z-index: 3;
            filter: brightness(0.88);
            box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.15), 0 16px 36px -6px rgba(0, 0, 0, 0.7);
        }
        66.6%, 93.6% {
            transform: translate3d(0, 0, 36px) rotateY(0deg) scale(1.04);
            z-index: 10;
            filter: brightness(1);
            box-shadow: 0 0 0 1.2px rgba(255, 255, 255, 0.35), 0 26px 55px -6px rgba(0, 0, 0, 0.88);
        }
        100% {
            transform: translate3d(85px, 6px, -15px) rotateY(-14deg) scale(0.92);
            z-index: 4;
            filter: brightness(0.88);
            box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.15), 0 16px 36px -6px rgba(0, 0, 0, 0.7);
        }
    }

    @keyframes rotateAxisMobileSlot3 {
        0%, 27% {
            transform: translate3d(-85px, 6px, -15px) rotateY(14deg) scale(0.92);
            z-index: 3;
            filter: brightness(0.88);
            box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.15), 0 16px 36px -6px rgba(0, 0, 0, 0.7);
        }
        33.3%, 60.3% {
            transform: translate3d(0, 0, 36px) rotateY(0deg) scale(1.04);
            z-index: 10;
            filter: brightness(1);
            box-shadow: 0 0 0 1.2px rgba(255, 255, 255, 0.35), 0 26px 55px -6px rgba(0, 0, 0, 0.88);
        }
        66.6%, 93.6% {
            transform: translate3d(85px, 6px, -15px) rotateY(-14deg) scale(0.92);
            z-index: 4;
            filter: brightness(0.88);
            box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.15), 0 16px 36px -6px rgba(0, 0, 0, 0.7);
        }
        100% {
            transform: translate3d(-85px, 6px, -15px) rotateY(14deg) scale(0.92);
            z-index: 3;
            filter: brightness(0.88);
            box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.15), 0 16px 36px -6px rgba(0, 0, 0, 0.7);
        }
    }
}

@media (max-width: 360px) {
    .iphone-stack-container {
        height: 340px;
    }
    .iphone-mockup {
        width: 135px;
        margin-left: -67.5px;
        margin-top: -146px;
    }
}

