/* styles_models.css */
body {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 0;
    background-color: #000000;
    overflow-x: hidden; /* hide horizontal scrollbar */
}


.page-title {
    text-align: center;
    color: #fff;
    font-size: 1.2em;
    margin: 32px 0  20px; /* Add some space below the title */
    font-family: Arial, sans-serif;
}



.container {
    width: 800px;
    height: 800px;
    position: relative;
    margin: 0 auto;
}

.carousel {
    width: 100%;
    height: 100%;
}

.carousel-track {
    display: flex;
    transition: transform 0.5s ease-in-out;
    position: relative;
    height: 100%;
    align-items: center;
}

.car-image {
    width: 350px;
    height: 350px;
    object-fit: cover;
    position: absolute;
    top: 50%;
    border-radius: 10px;
    transform: translateY(-50%) translateX(calc( (800px - 350px) / 2 - var(--offset) * 370px )); /* Adjusted translateX */
    opacity: 0.5;
    transition: transform 0.5s ease-in-out, opacity 0.1s ease-in-out, width 0.5s ease-in-out, height 0.5s ease-in-out, filter 0.5s ease-in-out; /* Added filter transition */
    z-index: 1;
    filter: blur(2px); /* Blur inactive images */
}

.car-image.active {
    width: 800px;
    height: 800px;
    opacity: 1;
    z-index: 2;
    transform: translateY(-50%) translateX(0);
    top: 50%;
    filter: none; /* Remove blur on active image */
}


.prev, .next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    font-size: 30px;
    padding: 10px 20px;
    color: rgb(193, 193, 193);
    border: none;
    background-color: transparent; /* Make the background transparent */
    cursor: pointer;
    z-index: 10;
}

.prev {
    left: -10%;
    transform: translateY(-50%); /* Adjust the scaleY value */

}

.next {
    right: -10%;
    transform: translateY(-50%); /* Adjust the scaleY value */

}

/* CAR INFO AND SPECS */


.car-info {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    color: rgb(193, 193, 193);
    text-align: center;
    z-index: 5;
    padding: 10px 10px;
    border-radius: 10px;
    max-width: 100%;
    font-family: Arial, sans-serif;
    opacity: 0; /* Initially hidden */
    transition: opacity 0.5s ease-in-out; /* Smooth fade-in and fade-out */
}

.car-info.visible {
    opacity: 1; /* Make the text visible */
}

.car-info h2 {
    color: rgb(255, 255, 255);
    font-size: 1.8em;
    margin: 0;
}

.car-info p {
    font-size: 1em;
}

.configure-btn {
    margin-top: 10px;
    padding: 10px 20px;
    background-color: rgba(68, 68, 68, 0.5); /* Transparent background */
    color: #fff;
    border-radius: 25px;
    border: 1.7px solid #ededed;
    cursor: pointer;
    font-size: 1em;
    transition: background-color 0.3s;
}

.configure-btn:hover {
    background-color: #ffffff;
    color: #000000;

}

/* Portrait Orientation for Mobile/Tablet */
@media (max-width: 992px) and (orientation: portrait) {
    .container {
        display: flex;

        width: 100dvw !important;
        height: 100dvh;
        overflow: hidden;
        justify-content: flex-start; /* Align title to top */
        position: relative;
    }

    .page-title {
        margin-top: 40px;
        margin-bottom: 20px;
        align-items: center;
        left: 50%;
        transform: translateX(-50%);
        position: absolute;
    }

    .carousel {
        flex-direction: column;
        justify-content: center;
        align-items: center;
        height: calc(100% - 72px); /* Adjust height for title */
        width: 100dvw !important;
        position: relative; /* Ensure it's the positioning context for its children */

    }

    .carousel-track {
        flex-direction: column; /* Stack images vertically */
        height: 100dvh !important;
        width: 100dvw;
        justify-content: center;
        align-items: center;
    }

    .car-image {
        position: absolute;
        width: 80dvw; /* Adjusted for better fit */
        height: auto;
        max-height: 50dvh; /* Max height relative to viewport */
        left: 50%;
        /* Adjusted transform for vertical carousel */
        transform: translateX(-50%) translateY(calc(-50% + var(--offset) * 45dvh)); /* Change from vh to dvh */
        opacity: 0.3;
        filter: blur(2px);
        transition: transform 0.5s ease, opacity 0.5s ease, filter 0.5s ease;
        border-radius: 10px;
    }

    .car-image.active {
        transform: translateX(-50%) translateY(-50%); /* Center the active image */
        opacity: 1;
        filter: none;
        z-index: 2;
        width: 90dvw; /* Active image is slightly larger */
        max-height: 65dvh;
    }

    .prev,
    .next {
        position: absolute; /* Already absolute */
        left: 50%;
        transform: translateX(-50%) rotate(90deg); /* Rotate arrows to point up/down */
        font-size: 28px;
        padding: 0px;
        width: 60px; /* Example fixed width */
        height: 60px; /* Example fixed height */
        color: #fff;
        background-color: transparent;
        border-radius: 10px;
        border: none;
        z-index: 20;
    }

    .prev {
        top: 10dvh; /* Position above images */
    }

    .next {
        top: 85dvh; /* Position below images */
    }

    .car-info {
        position: absolute;
        bottom: 15%; /* Position relative to the bottom */
        left: 50%;
        transform: translateX(-50%);
        width: 90%;
        text-align: center;
        color: rgb(255, 255, 255);
        padding: 10px 20px;
        background-color: transparent;
        border-radius: 10px;
        z-index: 10;
        opacity: 1; /* Always visible in portrait mode */
        box-sizing: border-box; /* Ensure padding doesn't push width over 90% */

    }

    .car-info h2 {
        font-size: 1.5em;
        margin: 0;
    }

    .car-info p {
        font-size: 1em;
        margin: 8px 0;
    }

    .configure-btn {
        margin-top: 10px;
        font-size: 1em;
        padding: 10px 16px;
        background-color: rgba(68, 68, 68, 0.5); /* Transparent background */
        color: #fff;
        border-radius: 25px;
        border: 1.7px solid #ededed;
        cursor: pointer;
    }

    .configure-btn:hover {
        background-color: #fff;
    }
}



/* Landscape Orientation for Mobile/Tablet */
@media (max-width: 992px) and (orientation: landscape) {



    body, html {
        margin: 0;
        padding: 0;
        overflow: hidden; /* or scroll, depending on your goal */
    }

    .container {
        width: 100dvw;
        height: 100dvh;
        flex-direction: row; /* Layout content horizontally */
        justify-content: center;
        align-items: center;
        position: relative;
    }

    .page-title {
        position: relative;
        top: 0;
        left: 50%;
        size: 1rem;
        transform: translateX(-50%);
        width: 100%;
        position:relative
    }

    .carousel {
        flex-direction: row; /* Keep elements in a row */
        height: 70dvh;
        width: 70dvw;
        position: relative;
    }

    .car-image {
        width: 50vw; /* Smaller in landscape to fit more on screen */
        height: 50vh;
        left: 30%;
        /* Revert to horizontal positioning */
        transform: translateY(-50%) translateX(calc( -50% + var(--offset) * 320px));
   
    }

    .car-image.active {
        width: 60vw; /* Adjust active image size for landscape */
        height: auto;
        max-height: 80dvh;
        transform: translateY(-50%) translateX(0);
    }

    .car-info {
        bottom: 30%;
        font-size: 0.9em;
        /* Adjust positioning for landscape */
        transform: translateX(-25%);
        width: auto; /* Allow width to be determined by content */
        position: relative;
    }

    .car-info h2 {
        font-size: 1.5em;
    }

    .configure-btn {
        font-size: 1em;
        padding: 8px 16px;
        margin:0;
    }

    .prev,
    .next {
        font-size: 24px;
        padding: 6px 12px;
        color: #fff;
        /* Revert arrow rotation for horizontal */
        transform: translateY(-50%);
        display: flex;
        
    }

    .prev {
        left: 10dvh;
    }

    .next {
        right:10dvh;
    }
}