/* --- Control Section - Povezivanje sa mobilnim --- */
.control-section {
    position: relative;
    z-index: 2;
    height: auto;
    min-height: 100vh;    
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 60px 0;
    overflow: hidden;
    background-color: #000;
    padding-bottom: 30px;
}

.control-section-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--black);
    background-image: url('../assets/img/product2/klima-mob-wifi-sm.jpg');
    background-size: cover;
    background-position: top;
    background-repeat: no-repeat;
    height: calc(100vh + 86vh);    
}

.control-content.container {
    max-width: 1440px;
    width: 100%;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    color: #fff;
    position: relative;
    /* z-index: 1; */
    padding-bottom: 50px;
}

.control-header {
    margin-bottom: 40px;
    width: 100%;
    max-width: 800px;
    text-align: center;
}

.control-title,
.control-features-title {
    line-height: 1;
    margin-bottom:0;    
    color: #fff;
    
}

.control-subtitle {
    max-width: 100%;
    margin: 0 auto;
    color: #fff;
    margin-top: 24px;
    /* line-height: 1.4;  */
}

.control-phone-and-features {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;   
}

.control-features {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    width: 100%;
    margin-top: 88vh;
}

.control-features-title {   
    margin-bottom: 30px;
    color: #fff;
}

.highlight {
    color: #00D4E9;
}

.control-steps {
    display: flex;
    flex-direction: row;
    justify-content: center;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 50px;
    width: 100%;    
    /* max-width: 100%; */
    margin-top:20px;
}

.control-step {
    flex: 1 1 calc(50% - 8px);
    max-width: calc(50% - 8px); /* Prevent growing wider */
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;   
    background-color: rgba(186, 186, 186, 0.15);
    padding: 22px;
    border-radius: 30px;
    box-sizing: border-box;   
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
}

.step-icon {
    width: 60px;
    height: auto;
    margin-bottom: 15px;
    transition: transform 0.3s ease-in-out;
}

.control-step:hover .step-icon {
    transform: rotateY(180deg);
}

.step-title {
    font-size: 19px;
    line-height: 1;
    font-weight: 700;
    color: #fff;
    margin-top:6px;
}

.step-text {
    color: #fff;
    font-size: 13px;
    line-height: 1;
    font-weight: 400;
    margin-bottom: 0;
}

.control-app-text {    
    color: #fff;
    margin-bottom: 25px;
    /* max-width: 90%; */
    text-align: center;
}

.app-download-buttons {
    display: flex;
    flex-direction: row;
    gap: 15px;
}

.app-button img {    
    width: 170px;
    height: auto;
    display: block;
    margin: 0 auto;
}

/* --- Treca sekcija - zima-leto-section --- */

.zima-leto-section {
    height: 100vh;
    position: sticky;
    top: 0;
    z-index: 2;
    background-image: url('../assets/img/klima3/klima-trava-sneg-mob.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    color: white;    
    width: 100%; 
    background-position: 30% center;
    -webkit-transform: translate3d(0, 0, 0);
    transform: translate3d(0, 0, 0);
    will-change: transform;
    display: none;
}

/* --- Cetvrta sekcija - zima-leto-overlay-section --- */
.zima-leto-overlay-section {
    display: none;
}
.zima-leto-section-mobile {
    background-image: url('/assets/img/klima3/klima-trava-sneg-mob.jpg');
    background-size: cover;
    background-repeat: no-repeat;
    background-position: center;
    position: relative;
    background-color: #fff;
    min-height: 100svh;
    padding-top:60px;
    padding-left: 24px;
    padding-right: 24px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: center;
    padding-bottom: 60svh;
    z-index: 5;
}
.section-content-zima-leto-mob {
    position: relative;
    text-align: center;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    background-color: rgba(0, 0, 0, 0.05);
    border-radius: 33px;    
    padding: 30px 24px 20px 24px;    
}
.section-img-zima-leto-mob {    
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
}
.section-img-zima-leto-mob img {
    max-width: 67px;
    height: auto;    
}
.section-subtitle-mob {
    color:#fff;    
    line-height: 1.05;
    margin-top: 14px;
}
.section-title-mob {
    color:#fff;
}

.zima-leto-overlay {
    width: 100%;
    max-width: 600px;
    min-height: 300px;
    background-color: rgba(0, 0, 0, 0.05);   
    position: relative;
    z-index: 2;
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    padding: 40px 30px;
    border-radius:30px;
    display: flex;
    flex-direction: column;
    align-items: center;
}
.zima-leto-overlay-section .container {
    max-width: 1440px;
    display: flex;
    justify-content: center;
    position: relative;
    /* top: -396px; */
     top: -100px; 
}

.zima-leto-content {
    position: absolute;    
    top: 0;
    right: 15%;    
    /* z-index: 1;      */
    max-width: 600px;
    width: 100%;
    font-family: 'Roboto Condensed', sans-serif;
    text-align: left;
}

.zima-leto-img {
    display: flex;
    justify-content: center;
    margin-bottom: 1rem;
}
.zima-leto-img  img {
    max-width: 40%;    
}
.zima-leto-subtitle,
.zima-leto-title {
    color: #fff;
    text-align: center;
    /* line-height: 1.2; */
    margin-top: 16px;
}

/* --- Peta sekcija - product-cloud-bed --- */

.product-cloud-bed {   
    min-height: 100vh;
    color: #333;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    top:0px;
    z-index: 2;
    background-image: url('../assets/img/product2/energy-saving.webp');    
    background-repeat: no-repeat;    
    background-position: 0% center;
    justify-content: center;
    background-size: cover;
    background-color: #d7d6d4;
}

.product-cloud-bed .container {
    max-width: 1440px;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: flex-start;    
}
.energy-saving-content {    
    color: #000;
    width: 100%;
    max-width: 500px;
    text-align: center;
    margin-top: 74px;
}
.energy-saving-icon {
    margin-bottom: 20px;
    width: 100px;
    height: auto;
}
.energy-saving-mobile {
    width: 100%;
}
.product-warranty {
    position: relative;
    margin-top: -100vh !important;
    z-index: 20 !important;
    padding-top: 100vh;
    height: auto; 
    /* min-height: 100vh; */
    /* margin-top: -50vh !important;  */
}
/* .product-self-clean-section {    
    z-index: 6 !important;
} */
.table-section {    
    z-index: 7 !important;    
}

/* --- RESPONSIVE DIZAJN --- */

/* SM - Small devices (landscape phones, 576px and up) */
@media (max-width: 320px) {
    .zima-leto-section-mobile {
        padding-bottom: 60svh;
        padding-left: 15px;
        padding-right: 15px;
    }
}
@media (min-width: 576px) {
   
    .control-subtitle {
        max-width: 70%;
    }
    .control-steps {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;        
        max-width: none;
    }
    .control-step {
        flex-basis: calc(33.33% - 20px);        
    }
    .app-download-buttons {
        flex-direction: row;
        justify-content: center;        
        gap: 20px;
    }    
    .app-button img {   
        height: auto;
        display: block;
    }
}
@media (min-width: 320px) and (max-width: 389px) and (min-height: 700px) {
    .control-section-background {
        height: calc(100vh + 67vh);
    }
}
@media (min-width: 320px) and (max-width: 389px) and (min-height: 750px) {
    .zima-leto-section-mobile {
        padding-bottom: 51svh;
    }
}
@media (min-width: 375px) and (max-width: 389px) and (min-height: 650px) {
    .control-section-background {
        height: calc(100vh + 45vh);
    }    
     .control-features {
        margin-top: 78vh;
    }
}
@media (min-width: 375px) and (max-width: 389px) and (min-height: 800px) {
    .control-section-background {
        height: calc(100vh + 38vh);
    }
     .control-features {
        margin-top: 70vh;
    }
    .zima-leto-section-mobile {
        padding-bottom: 53svh;
    }
}
/* Za šire mobilne uređaje sa visinom od 700px i više */
@media (min-width: 390px) and (max-width: 767px) and (min-height: 700px) {
    .control-section-background {
        height: calc(100vh + 57vh);
    }
}

/* Za šire mobilne uređaje sa visinom od 800px i više */
@media (min-width: 390px) and (max-width: 767px) and (min-height: 800px) {
    .control-section-background {
        height: calc(100vh + 32vh);
    }
    .control-features {
        margin-top: 70vh;
    }
    .zima-leto-section-mobile {
        padding-bottom: 43svh;
    }
}
/* Za šire mobilne uređaje sa visinom od 850px i više */
@media (min-width: 390px) and (max-width: 767px) and (min-height: 850px) {
    .control-section-background {
        height: calc(100vh + 26vh);
    }
    .zima-leto-section-mobile {
        padding-bottom: 45svh;
    }
}

/* MD - Medium devices (tablets, 768px and up) */
@media (min-width: 768px) {
    .zima-leto-section-mobile {
        display: none;
    }
    .zima-leto-overlay-section {
        display: block;
    }
    .zima-leto-section {
        display: block;
    }
    .zima-leto-section {
        /* background-position: center; */
        background-position: 55% 50%;
        background-image: url('../assets/img/klima3/zima-leto2.webp');
    }
    .zima-leto-overlay-section .container {
        justify-content: flex-end;
        top: -396px;
    }
    .zima-leto-overlay {
        width: 60%;        
    }
    .control-section {
        padding: 80px 0;
        align-items: center;
    }
    .control-section-background {
        height: 100%;
    }
    .control-phone-and-features {
        width: auto;        
        align-self: flex-end;    
    }    
    .control-subtitle {
        max-width: 60%;
    }    
    .control-step {
        display: flex;
        flex-direction: column;
        align-items: center;
        text-align: center; 
        background-color: rgba(186, 186, 186, 0.1); 
        /* background-color: #2f2e33d9;     */
        padding: 30px 45px 10px 45px;
        border-radius: 30px;
        max-width: 172px;
        flex-basis: calc(34% - 21.2px);
        padding: 30px 5px 5px 5px;
    } 
    .control-features {
        margin-top: 0;
    }
    .app-download-buttons {
        align-self: center;
        gap:15px;
    } 
    .control-app-text  {
        align-self: center;
    }
    .product-cloud-bed {
       padding: 0 20px;
    }
    .product-cloud-bed .container {        
        max-width: 720px;
        padding: 0 20px;
    }
    .product-cloud-bed {
        background-position: 39% center;
        justify-content: center;
        background-size: 200%;
    }
    .energy-saving-content {        
        text-align: left;
        margin-top: 0;
    }
    .control-section-background {
        background-image: url('../assets/img/product2/klima-mob-wifi.webp');
        background-size: cover;
        background-position: center;
        background-repeat: no-repeat;
    }
    .control-steps {
        flex-direction: column;
        flex-wrap: nowrap;
        width: auto;
    }
    .step-title {
        font-size: 28px;
        line-height: 1;
    }
    .step-text {
        font-size: 18px;
    }
    .control-app-text {    
        max-width: 90%;
    }
    .product-cloud-bed {
        position: sticky;
    }
    .energy-saving-mobile {
        display: none;
    }
    .product-warranty {
        margin-top: -50vh !important; 
    }
    @supports (-webkit-touch-callout: none) {       
        .product-cloud-bed {
            position: -webkit-sticky;
            -webkit-transform: translate3d(0, 0, 0);
            transform: translate3d(0, 0, 0);
            will-change: transform;
            isolation: isolate;
            background-attachment: scroll;
            -webkit-background-size: cover;
            background-size: cover;
        }
    }
    
    /* iOS Safari specific za .product-cloud-bed od 768px */
    @supports (-webkit-touch-callout: none) and (pointer: coarse) {
        .product-cloud-bed {
            height: auto;
            min-height: 100vh;
            -webkit-overflow-scrolling: touch;
        }
    }
}

/* LG - Large devices (desktops, 992px and up) */
@media (min-width: 992px) {
    .control-section {
        padding: 100px 0;
    }
    .control-subtitle {
        max-width: 50%;       
    }
    .control-step {
       flex-basis: calc(33.33% - 27px); 
       padding: 30px 25px 15px 25px;                
    }
    .step-icon {
        width: 70px;
    }
    .control-phone-and-features {       
        padding-right: 0px;      
    }
    .zima-leto-overlay-section .container {       
        max-width: 960px;        
    }
    .product-cloud-bed .container {
        max-width: 960px;        
    }
}
@media (min-width: 1024px) and (max-height:1366px) {
    .product-cloud-bed .container {
        max-width: 960px;
        padding: 0 20px;
    }
    .product-cloud-bed {
        background-position: 50% center;
        background-size: cover;        
    }
}
@media (min-width: 1024px) and (max-height:768px){
   .product-cloud-bed .container {
        max-width: 960px;
        padding: 0 80px;
    }
    .product-cloud-bed {
        background-position: -20% center;
        background-size: cover;      
    }
    .zima-leto-overlay {
        width: 50%;
    }
}
@media (min-width: 1024px) and (max-height:600px) {
    .product-cloud-bed .container {
        max-width: 960px;
        padding: 0 80px;
    }
    .product-cloud-bed {
        background-size: cover;
        background-position: -160% center;        
    }
}

/* XL - Extra large devices (large desktops, 1200px and up) */
@media (min-width: 1200px) {
    .zima-leto-section {
        background-position: center;
    }
    .zima-leto-overlay {
        width: 45%;
    }

    .control-content.container {
        margin-top:30px;    
    }

    .control-header {       
        width: 100%;
        max-width: 800px;
        margin-bottom: 60px;
        text-align: center;
    }
    .control-title {
        margin-top:12px;
    }

    .control-subtitle {
        max-width: 50%;
        margin-left: auto;
        margin-right: auto;        
    }

    .control-phone-and-features {        
        width: 100%;
        max-width: 720px;        
        text-align: left;
        align-items: flex-start;
    }

    .control-features-title {        
        margin-bottom: 30px;
    }

    .control-steps {
        flex-direction: row;       
        gap: 16px;       
    }

    .control-step {
        flex-basis: auto;        
        flex-direction: column;
        align-items: center;
        max-width: 260px;
        padding: 30px 35px 15px 35px;
    }

    .step-icon {
        width: auto;       
        margin-bottom: 0;
    }    

    .control-app-text {        
        max-width: 60%;        
    }

    .app-download-buttons {
        justify-content: flex-start;     
    }
    .zima-leto-overlay-section .container {
        justify-content: flex-end;
        max-width: 1140px;
        padding: 0 20px;
    }
     .product-cloud-bed .container {
        max-width: 1140px;
        padding: 0 110px;
    }
    .product-cloud-bed {
        background-size: 90%;
        background-position: 100% center;
    }
}

@media (min-width: 1300px) {
    .zima-leto-overlay {
        width: 45%;
    }
    .product-cloud-bed .container {        
        padding: 0px 100px;
    }
    .product-cloud-bed {
        background-size: 90%;
        background-position: 100% center;
    }
}

@media (min-width: 1400px) {
    .zima-leto-overlay {
        width: 50%;
    }
    .control-content.container {
        max-width: 1600px;
        padding: 0 60px;
        padding-top: 120px;
        padding-bottom: 120px;        
    }
    .control-header {
        max-width: 900px;
        margin-bottom: 80px;
    }
    .control-section-background {
        background-position-x: 70%;
    }

    .control-phone-and-features {
        align-self: flex-end;
        max-width: 800px;
        margin-right: 50px;
    }
    
    .control-steps {
        max-width: 100%;
        gap: 16px;
    }
    .app-button img {
        width: 230px;
    }
    .zima-leto-overlay-section .container {        
        max-width: 1320px;        
    }
    .product-cloud-bed .container {
        max-width: 1320px;
        padding: 0px 160px;               
    }    
}

@media (min-width: 1500px) {
    .control-header {       
        margin-bottom: 160px;
    }
    .product-cloud-bed .container {
        padding: 0px 140px; 
    }
    .product-cloud-bed {
        background-size: 95%;
    } 
    .control-section-background {        
        background-position-x: 70%;
    }
}

@media (min-width: 1600px) {
    .zima-leto-img  img {
        max-width: 100%;
    }
    .zima-leto-overlay {
        width: auto;
        padding:50px 30px;
    }
    .control-content.container {
        max-width: 1800px;
        padding: 0 80px;
        padding-top: 150px;
        padding-bottom: 150px;
    }
    .control-header {
        max-width: 1000px;
        margin-bottom: 160px;        
    }
   
    .control-phone-and-features {
        max-width: 900px;
    }
    .control-app-text {
        margin-top:60px;
        width: 50%;
    }    
    .product-cloud-bed {
        background-size: cover;
        background-position: 38% center;
    }
}
@media (min-width: 1920px) {
    .product-cloud-bed {
        background-size: 95%;
        background-position: 60% center;
    }
    .energy-saving-icon {        
        width: 120px;
        margin-bottom: 35px;
    }
    .product-cloud-bed .container {
        padding: 0px 130px;
    }
}
@media (min-width: 2048px) {
    .product-cloud-bed .container {
        padding: 0px 110px;
    }
}
@media (min-width: 2048px) {
    .zima-leto-overlay {
        max-width: 700px; 
        padding:70px 50px;
    }
    .zima-leto-overlay-section .container {
        max-width: 1600px;        
    }
    .control-step {
        padding: 30px 50px 15px 50px;
    }
    .app-button img {
        width: 100%;
    }
}

@media (min-width: 2560px) {
    .zima-leto-overlay-section .container {
        max-width: 1800px;            
    }
    .zima-leto-overlay {
        max-width: 750px; 
        padding:120px 30px;
    }

    .control-content.container {
        padding-bottom: 10%;
    }
    .control-header {            
        margin-bottom: 16%;
    }
    .control-section-background {
        background-position: left top; 
    } 
    .product-cloud-bed .container {
        padding: 0px 50px;
    }
    .product-cloud-bed {
        background-position: 50% center;
    }
}
    
/* === SAFARI & IPHONE OPTIMIZATIONS === */
/* Safari backdrop-filter fix */
@supports not (backdrop-filter: blur(30px)) {
    .zima-leto-overlay {
        background-color: rgba(0, 0, 0, 0.3);
        border: 1px solid rgba(255, 255, 255, 0.1);
    }
}

/* Safari sticky positioning fix */
@supports (-webkit-touch-callout: none) {
    .zima-leto-section {
        position: -webkit-sticky;
        position: sticky;
        -webkit-transform: translate3d(0, 0, 0);
        transform: translate3d(0, 0, 0);
        will-change: transform;
    }
}

/* iOS Safari background image fix */
@supports (-webkit-touch-callout: none) {
    .control-section-background {
        background-attachment: scroll;
        -webkit-background-size: cover;
        background-size: cover;
    }
    
    .zima-leto-section {
        background-attachment: scroll;
        -webkit-background-size: cover;
        background-size: cover;
    }
}

/* iPhone specific fixes - iOS Safari only */
@supports (-webkit-touch-callout: none) and (pointer: coarse) {
    .control-section {
        height: auto;
        min-height: 100vh;
        -webkit-overflow-scrolling: touch;
    }
    
    .zima-leto-section {
        height: auto;
        min-height: 100vh;
        -webkit-overflow-scrolling: touch;
    }
    
    .zima-leto-overlay {
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
        background-color: rgba(0, 0, 0, 0.4);
        border: 1px solid rgba(255, 255, 255, 0.2);
    }
    
    .control-step {
        background-color: rgba(47, 46, 51, 0.9);
    }
    
    /* Optimizacija za background pozadine */
    .control-section-background {
        -webkit-transform: translate3d(0, 0, 0);
        transform: translate3d(0, 0, 0);
    }
}

/* Fix z-index layering issues */
.zima-leto-overlay-section {
    position: relative;
    z-index: 2;
    isolation: isolate;
}

/* === ADDITIONAL SAFARI PERFORMANCE OPTIMIZATIONS === */
/* Force hardware acceleration on problematic elements - Safari/iOS only */
@supports (-webkit-touch-callout: none) {
    .control-section-background,
    .zima-leto-section,
    .zima-leto-overlay,
    .product-cloud-bed {
        -webkit-transform: translateZ(0);
        transform: translateZ(0);
        will-change: transform;
    }
}

/* Safari-specific scroll improvements - iOS Safari only */
@supports (-webkit-touch-callout: none) and (pointer: coarse) {
    .control-section {
        -webkit-overflow-scrolling: touch;
    }
}
