.model-carousel {
    position: relative;
    width: 100dvw;
    height: 100dvh; /* Changed to dvh */
    overflow: hidden;
    background: var(--color-primary);
}

.model-carousel__background {
    position: absolute;
    inset: 0;
    width: 100dvw; /* Changed to dvw */
    height: 100dvh; /* Changed to dvh */
}

.model-carousel__background img {
    width: 100%;
    height: 100dvh; /* Changed to dvh */
    object-fit: cover;
    object-position: center center;
    transform: translateZ(0);
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

/* Background image handling for desktop/mobile */
.model-carousel__background img.mobile-bg {
    display: block;
}

.model-carousel__background img.desktop-bg {
    display: none;
}

/* Show desktop background for iPad Pro and larger */
@media screen and (min-width: 1024px) {
    .model-carousel__background img.mobile-bg {
        display: none;
    }
    .model-carousel__background img.desktop-bg {
        display: block;
    }
}

/* Title styling */
.model-carousel__title {
    position: absolute;
    left: clamp(2rem, 5dvw, 36px);
    top: clamp(2rem, 8dvh, 85px);
    color: #DCB77C;
    font-family: 'Adamina', serif;
    font-size: clamp(48px, 8vw, 60px);
    font-weight: 400;
    text-shadow: 0px 4px 4px rgba(37, 56, 57, 0.5);
    z-index: 2;
}

[dir="rtl"] .model-carousel__title {
    left: auto;
    right: clamp(2rem, 5dvw, 36px);
}

/* Main carousel container */
.model-carousel__container {
    position: relative;
    width: 100%;
    height: 100%;
    max-width: 1920px;
    margin: 0 auto;
}

/* Light effect overlay */
.model-carousel__light-effect {
    position: absolute;
    left: 50%;
    top: 0;
    transform: translateX(-50%);
    width: clamp(300px, 70vw, 1365px);
    height: auto;
    z-index: 1;
    pointer-events: none;
    opacity: 0.5;
}

.model-carousel__light-effect img {
    width: 100%;
    height: auto;
    transform: translateZ(0);
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

/* Carousel track container */
.model-carousel__wrapper {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.model-carousel__track {
    display: flex;
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    height: 100%;
    transition: transform 0.5s ease-out;
}

/* Desktop and larger tablet styles (keeping original desktop design) */
.model-carousel__slide {
    position: absolute;
    height: clamp(300px, 80vh, 854px);
    transition: all 0.5s ease-out;
}

.model-carousel__slide:nth-child(1) {
    left: calc(40% - clamp(400px, 40vw, 880px));
    width: clamp(200px, 25vw, 325px);
    transform: translateY(20%);
    opacity: 1;
    filter: grayscale(100%);
}

.model-carousel__slide:nth-child(2) {
    left: 50%;
    transform: translateX(-50%);
    width: clamp(200px, 35vw, 498px);
    z-index: 2;
}

.model-carousel__slide:nth-child(3) {
    left: calc(40% + clamp(400px, 40vw, 800px));
    width: clamp(200px, 25vw, 325px);
    transform: translateY(15%);
    opacity: 1;
    filter: grayscale(100%);
}

/* Image styles */
.model-carousel__image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

/* Navigation buttons */
.model-carousel__nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 48px;
    height: 48px;
    border: 2px solid #DCB77C;
    border-radius: 50%;
    background: transparent;
    cursor: pointer;
    z-index: 3;
    transition: all 0.3s ease;
}

.model-carousel__nav--prev {
    left: clamp(1rem, 5vw, 3rem);
}

.model-carousel__nav--next {
    right: clamp(1rem, 5vw, 3rem);
}

.model-carousel__nav:hover {
    background: rgba(220, 183, 124, 0.1);
}

.model-carousel__nav:active {
    transform: translateY(-50%) scale(0.95);
}

/* Apply grayscale to side images below 1024px */
@media screen and (max-width: 1023px) {
    .model-carousel__slide:nth-child(1) .model-carousel__image,
    .model-carousel__slide:nth-child(3) .model-carousel__image {
        filter: grayscale(100%);
    }
}

/* iPhone SE */
@media (min-width: 320px) and (max-width: 375px) {
    .model-carousel__slide:nth-child(1) {
        left: 0%;
        width: clamp(120px, 32vw, 140px);
        height: 40vh;
        top: 50%;
        transform: translateY(0);
    }
    
    .model-carousel__slide:nth-child(2) {
        width: clamp(180px, 45vw, 200px);
        height: 70vh;
        top: 25%;
        transform: translateX(-50%);
    }
    
    .model-carousel__slide:nth-child(3) {
        right: 0%;
        left: auto;
        width: clamp(120px, 32vw, 140px);
        height: 40vh;
        top: 50%;
        transform: translateY(0);
    }
}

/* iPhone 11/12/13 Pro */
@media (min-width: 376px) and (max-width: 390px) {
    .model-carousel__slide:nth-child(1) {
        left: -2%;
        width: clamp(130px, 35vw, 150px);
        height: 40vh;
        top: 50%;
        transform: translateY(0);
    }
    
    .model-carousel__slide:nth-child(2) {
        width: clamp(200px, 48vw, 220px);
        height: 70vh;
         top: max(15dvh, 120px);
        transform: translateX(-50%);
    }
    
    .model-carousel__slide:nth-child(3) {
        right: -2%;
        left: auto;
        width: clamp(130px, 35vw, 150px);
        height: 40vh;
        top: 50%;
        transform: translateY(0);
    }
}

/* iPhone 14 Pro Max */
@media (min-width: 391px) and (max-width: 430px) {
    .model-carousel__slide:nth-child(1) {
        left: -5%;
        width: clamp(140px, 38vw, 160px);
        height: 40vh;
        top: 40%;
        transform: translateY(0);
    }
    
    .model-carousel__slide:nth-child(2) {
        width: clamp(220px, 52vw, 240px);
        height: 70vh;
        top: 18%;
        transform: translateX(-50%);
    }
    
    .model-carousel__slide:nth-child(3) {
        right: -5%;
        left: auto;
        width: clamp(140px, 38vw, 160px);
        height: 40vh;
        top: 40%;
        transform: translateY(0);
    }
}

/* iPad Mini */
@media (min-width: 431px) and (max-width: 768px) {
    .model-carousel__slide:nth-child(1) {
        left: calc(40% - clamp(250px, 30vw, 500px));
        width: clamp(150px, 20vw, 250px);
        height: 60vh;
        top: 42%;
        transform: translateY(0);
    }
    
    .model-carousel__slide:nth-child(2) {
        width: clamp(200px, 28vw, 350px);
        height: 80vh;
        top: 20%;
        transform: translateX(-50%);
    }
    
    .model-carousel__slide:nth-child(3) {
        left: calc(60% + clamp(100px, 10vw, 200px));
        width: clamp(150px, 20vw, 250px);
        height: 60vh;
        top: 42%;
        transform: translateY(0);
    }
}

/* iPad */
@media (min-width: 769px) and (max-width: 820px) {
    .model-carousel__slide:nth-child(1) {
        left: calc(40% - clamp(280px, 32vw, 550px));
        width: clamp(170px, 22vw, 270px);
        height: 55vh;
        top: 45%;
        transform: translateY(0);
    }
    
    .model-carousel__slide:nth-child(2) {
        width: clamp(220px, 30vw, 380px);
        height: 80vh;
        top: 20%;
        transform: translateX(-50%);
    }
    
    .model-carousel__slide:nth-child(3) {
        left: calc(60% + clamp(120px, 12vw, 220px));
        width: clamp(170px, 22vw, 270px);
        height: 55vh;
        top: 45%;
        transform: translateY(0);
    }
}

/* iPad Pro 12.9" */
@media (min-width: 821px) and (max-width: 1024px) {
    .model-carousel__slide:nth-child(1) {
        left: calc(40% - clamp(300px, 35vw, 600px));
        width: clamp(180px, 22vw, 280px);
        height: 60vh;
        top: 30%;
        transform: translateY(0);
    }
    
    .model-carousel__slide:nth-child(2) {
        width: clamp(250px, 32vw, 450px);
        height: 70vh;
        top: 10%;
        transform: translateX(-50%);
    }
    
    .model-carousel__slide:nth-child(3) {
        left: calc(60% + clamp(150px, 13vw, 250px));
        width: clamp(180px, 22vw, 280px);
        height: 60vh;
        top: 30%;
        transform: translateY(0);
    }
}

/* Nest Hub */
@media (min-width: 1024px) and (max-width: 1024px) and (min-height: 600px) and (max-height: 600px) {
    .model-carousel__slide:nth-child(1) {
        height: 70vh;
        top: 30%;
        transform: translateY(0);
    }
    
    .model-carousel__slide:nth-child(2) {
        height: 85vh;
        top: 5%;
    }
    
    .model-carousel__slide:nth-child(3) {
        height: 70vh;
        top: 30%;
        transform: translateY(0);
    }
}

/* General widescreen under 767 pixels */
@media (max-width: 1024px) and (min-height: 600px) and (max-height: 800px) {
    .model-carousel__slide:nth-child(1),
    .model-carousel__slide:nth-child(3) {
        filter: grayscale(100%);
    }
}
}

/* Ultra-wide screens */
@media screen and (min-width: 1921px) {
    .model-carousel__slide:nth-child(1),
    .model-carousel__slide:nth-child(3) {
        width: 325px;
    }
    
    .model-carousel__slide:nth-child(2) {
        width: 498px;
    }
}