/* --- Hero Section --- */
.hero {
    position: relative;
    height: 85vh;
    min-height: 600px;
    background-image: linear-gradient(rgba(0,0,0,0.5), rgba(0,0,0,0.5)), url('/assets/images/car.png');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: var(--white);
    padding: 0 20px;
}

.hero-content {
    max-width: 800px;
}

.hero h1 {
    font-size: 56px;
    color: var(--white);
    margin-bottom: 20px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
    line-height: 1.2;
}

.hero p {
    font-size: 20px;
    margin-bottom: 30px;
    font-weight: 300;
}

.hero-btns {
    display: flex;
    gap: 20px;
    justify-content: center;
}

/* --- Services Section --- */
.services {
    padding: 100px 0;
    text-align: center;
}

.section-title {
    text-align: center;
    margin-bottom: 60px;
    padding: 0 15px; /* Prevent text from touching edges on small screens */
    width: 100%;
    overflow-wrap: break-word;
}

.section-title h2 {
    font-size: 36px;
    margin-bottom: 15px;
    position: relative;
    display: inline-block;
    max-width: 100%;
    overflow-wrap: break-word;
}

.section-title h2::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background-color: var(--primary-color);
}

.section-title p {
    color: #666;
    max-width: 600px;
    margin: 0 auto;
    overflow-wrap: break-word; /* Ensure large words don't push out the block */
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 40px;
}

@media (max-width: 992px) {
    .services-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 30px;
    }
}

.service-card {
    background-color: var(--white);
    padding: 40px 30px;
    border-radius: 10px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.05);
    transition: var(--transition);
}

.service-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.service-icon-wrapper {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 80px;
    height: 80px;
    background: rgba(var(--primary-rgb), 0.1);
    border-radius: 50%;
    margin-bottom: 20px;
    transition: var(--transition);
}

.service-svg {
    width: 40px;
    height: 40px;
    color: var(--primary-color);
    transition: var(--transition);
}

.service-card:hover .service-icon-wrapper {
    background: var(--primary-color);
    transform: rotateY(180deg);
}

.service-card:hover .service-svg {
    color: white;
}

.service-icon {
    font-size: 50px;
    color: var(--primary-color);
    margin-bottom: 20px;
}

.service-card h3 {
    font-size: 22px;
    margin-bottom: 15px;
}

.service-card p {
    color: #666;
    margin-bottom: 20px;
}

/* --- Fleet/Vehicles Section --- */
.fleet {
    background-color: var(--white);
    padding: 100px 0;
}

.fleet-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
}

@media (max-width: 992px) {
    .fleet-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }
}

.vehicle-card {
    border-radius: 10px;
    overflow: hidden;
    background: var(--bg-light);
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
}

.vehicle-img {
    height: 250px;
    width: 100%;
    object-fit: cover;
    transition: var(--transition);
}

.vehicle-card:hover .vehicle-img {
    transform: scale(1.05);
}

.img-wrapper {
    overflow: hidden;
    position: relative;
}

.vehicle-badge {
    position: absolute;
    top: 20px;
    right: 20px;
    background-color: var(--primary-color);
    color: var(--white);
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
}

.vehicle-info {
    padding: 25px;
}

.vehicle-info h3 {
    margin-bottom: 10px;
    font-size: 22px;
}

.vehicle-features {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    color: #666;
    font-size: 14px;
    flex-wrap: wrap; /* Allows wrapping if 2 columns makes it too tight on mobile */
}

.vehicle-features span {
    display: flex;
    align-items: center;
    gap: 5px;
}

.offers-empty,
.offer-loading-card {
    border: 1px solid #ece5d8;
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 10px 26px rgba(0, 0, 0, 0.06);
    text-align: center;
    padding: 28px 18px;
}

.offer-loader {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    margin: 0 auto 12px;
    border: 3px solid #f2f2f2;
    border-top: 3px solid var(--primary-color);
    animation: offer-spin 1s linear infinite;
}

@keyframes offer-spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

/* --- Call to Action --- */
.cta {
    background: linear-gradient(rgba(44, 62, 80, 0.85), rgba(44, 62, 80, 0.85)), url('https://images.unsplash.com/photo-1539020140153-e479b8c22e70?ixlib=rb-4.0.3&auto=format&fit=crop&w=1920&q=80') center/cover no-repeat fixed;
    color: var(--white);
    padding: 100px 0;
    text-align: center;
    position: relative;
    border-radius: 20px;
    margin: 40px auto;
    max-width: 95%;
    box-shadow: 0 15px 40px rgba(0,0,0,0.2);
}

.cta h2 {
    color: var(--white);
    font-size: 38px;
    margin-bottom: 20px;
    font-weight: 700;
}

.cta p {
    font-size: 18px;
    margin-bottom: 30px;
    opacity: 0.95;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .hero h1 {
        font-size: 40px;
    }
    .hero p {
        font-size: 16px;
    }
    
    .services-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    
    /* Make the 3rd item span full width */
    .services-grid .service-card:nth-child(3) {
        grid-column: span 2;
        max-width: 80%;
        margin: 0 auto;
    }

    .service-card {
        padding: 15px 10px;
    }
    .service-card h3 {
        font-size: 14px;
        margin-bottom: 8px;
    }
    
    .service-icon-wrapper {
        width: 50px;
        height: 50px;
        margin-bottom: 10px;
    }
    
    .service-svg {
        width: 24px;
        height: 24px;
    }

    .service-icon {
        font-size: 28px;
        margin-bottom: 10px;
    }
    .service-card p {
        font-size: 11px;
        margin-bottom: 0;
        display: -webkit-box;
        -webkit-line-clamp: 4;
        line-clamp: 4;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    .fleet-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    .vehicle-img {
        height: 110px;
    }
    .vehicle-info {
        padding: 10px;
    }
    .vehicle-info h3 {
        font-size: 14px;
        margin-bottom: 5px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    .vehicle-features {
        font-size: 10px;
        flex-direction: column;
        gap: 3px;
        margin-bottom: 5px;
    }
    .vehicle-features span {
        margin-right: 0; 
    }
    .vehicle-info p {
        display: none; /* Hide paragraph on mobile to save vertical space */
    }
    .vehicle-badge {
        font-size: 10px;
        padding: 4px 8px;
        top: 10px;
        right: 10px;
    }
    .vehicle-info .btn {
        margin-top: 8px !important;
        padding: 8px !important;
        font-size: 12px;
    }
}

/* --- New Sections Styling --- */

/* Booking Widget */
.booking-widget {
    background: rgba(255, 255, 255, 0.95);
    padding: 20px;
    border-radius: 10px;
    margin-top: 50px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
    backdrop-filter: blur(10px);
}

.booking-widget form {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    align-items: center;
}

.input-group {
    flex: 1;
    min-width: 200px;
    display: flex;
    align-items: center;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 5px;
    padding: 10px 15px;
}

.input-group i {
    color: var(--primary-color);
    margin-right: 10px;
}

.input-group input {
    border: none;
    outline: none;
    width: 100%;
    color: var(--text-color);
    font-family: inherit;
}

.widget-btn {
    flex: 1;
    min-width: 150px;
}

/* Stats Section */
.stats-section {
    background-color: var(--secondary-color);
    color: var(--white);
    padding: 60px 0;
}

.stats-grid {
    display: flex;
    justify-content: space-around;
    flex-wrap: wrap;
    gap: 30px;
    text-align: center;
}

.stat-box i {
    font-size: 40px;
    color: var(--primary-color);
    margin-bottom: 15px;
}

.stat-box h3 {
    font-size: 36px;
    color: var(--white);
    margin-bottom: 5px;
}

/* Why Choose Us */
.why-us {
    padding: 100px 0;
    overflow: hidden;
}

.why-content {
    flex: 1;
}

.why-image {
    flex: 1;
    position: relative;
}

.why-image::before {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    background: var(--primary-color);
    border-radius: 15px;
    top: 20px;
    left: 20px;
    z-index: 0;
    opacity: 0.1;
}

.why-image img {
    position: relative;
    z-index: 1;
    border-radius: 15px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.15);
    transition: transform 0.3s ease;
}

.why-image img:hover {
    transform: translateY(-10px);
}

.feature-list {
    list-style: none;
    padding: 0;
    margin: 30px 0;
}

.feature-list li {
    margin-bottom: 20px;
    font-size: 16px;
    line-height: 1.6;
    display: flex;
    align-items: flex-start;
    gap: 15px;
    color: var(--text-color);
}

.feature-list li i {
    color: var(--primary-color);
    font-size: 20px;
    margin-top: 2px;
}

.feature-list li strong {
    color: var(--secondary-color);
    display: block;
    margin-bottom: 4px;
}

/* Destinations */
.destinations-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.dest-card {
    position: relative;
    border-radius: 15px;
    overflow: hidden;
    height: 350px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.dest-card img {
    height: 100%;
    width: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.dest-card:hover img {
    transform: scale(1.1);
}

.dest-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    background: linear-gradient(transparent, rgba(0,0,0,0.8));
    padding: 50px 20px 20px;
    color: var(--white);
}

.dest-overlay h3 {
    color: var(--white);
    font-size: 24px;
    margin-bottom: 5px;
}

.dest-overlay p.dest-subtitle {
    color: var(--primary-color);
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 5px;
}

.dest-overlay p.dest-desc {
    color: rgba(255, 255, 255, 0.8);
    font-size: 13px;
    line-height: 1.4;
    margin: 0;
    display: none; /* Hidden on normal grid to save space, visible on 3D */
}

/* 3D Destinations Showcase */
@keyframes dest-zoom-in {
    0% {
        transform: translateZ(-2000px);
        opacity: 0;
        filter: blur(15px);
    }
    30%, 70% {
        transform: translateZ(0px);
        opacity: 1;
        filter: blur(0px);
    }
    100% {
        transform: translateZ(2000px) scale(1.5);
        opacity: 0;
        filter: blur(15px);
    }
}

@supports (animation-timeline: view()) {
    @media (prefers-reduced-motion: no-preference) {
        .destinations-showcase-wrapper {
            /* Create scroll room for the effect */
            min-block-size: 300vh;
            view-timeline-name: --dest-showcase;
            view-timeline-axis: block;
            margin: 0; /* Remove margin to flush against screen */
        }

        .destinations-stuck {
            position: sticky;
            top: 0;
            block-size: 100svh;
            width: 100vw;
            overflow: hidden;
            perspective: 2000px;
            transform-style: preserve-3d;
            background: #000;
            display: flex;
            align-items: center;
            justify-content: center;
        }

        .destinations-stuck > .container {
            max-width: 100% !important;
            padding: 0 !important;
            margin: 0 !important;
        }

        .destinations-stuck .section-title {
            position: absolute;
            top: 10vh; /* Lowered from 5vh */
            left: 0;
            right: 0;
            z-index: 20;
            text-align: center;
            color: var(--white);
            text-shadow: 0 4px 15px rgba(0,0,0,0.8);
        }

        .destinations-stuck .section-title h2 {
            color: var(--white);
        }

        .destinations-stuck .section-title p {
            color: rgba(255, 255, 255, 0.8);
        }

        .destinations-grid-3d {
            display: grid;
            grid-template-columns: 1fr;
            grid-template-rows: 1fr;
            place-items: center;
            width: 100vw;
            height: 100vh;
            transform-style: preserve-3d;
            z-index: 5;
        }

        .destinations-grid-3d .dest-card-3d {
            grid-area: 1 / 1;
            width: 100vw;
            height: 100vh;
            max-width: none;
            max-height: none;
            border-radius: 0;
            box-shadow: none;
            /* Scroll animation hook */
            animation: dest-zoom-in linear both;
            animation-timeline: --dest-showcase;
            will-change: transform, opacity, filter;
            transition: none; /* override hover transitions while animated */
            overflow: hidden;
            position: relative;
        }

        .destinations-grid-3d .dest-card-3d img {
            width: 100%;
            height: 100%;
            object-fit: cover;
            transform: none; /* remove hover zoom on Desktop */
        }

        .destinations-grid-3d .dest-card-3d .dest-overlay {
            height: 100%;
            background: linear-gradient(to bottom, rgba(0,0,0,0.3) 0%, rgba(0,0,0,0.7) 100%);
            display: flex;
            flex-direction: column;
            justify-content: center; /* Center the text vertically */
            align-items: center;
            text-align: center;
            padding: 50px 20px;
        }

        .destinations-grid-3d .dest-card-3d .dest-overlay h3 {
            font-family: 'Playfair Display', serif;
            font-size: 5.5rem;
            font-weight: 700;
            text-transform: capitalize;
            letter-spacing: 1px;
            margin-bottom: 5px;
            text-shadow: 2px 3px 20px rgba(0,0,0,0.9);
        }

        .destinations-grid-3d .dest-card-3d .dest-overlay p.dest-subtitle {
            font-size: 1.5rem;
            font-weight: 600;
            color: var(--primary-color);
            text-transform: uppercase;
            letter-spacing: 4px;
            margin: 0 0 20px 0;
            text-shadow: 1px 1px 10px rgba(0,0,0,0.8);
        }

        .destinations-grid-3d .dest-card-3d .dest-overlay p.dest-desc {
            display: block; /* Make sure it overrides display: none from mobile base */
            font-size: 1.3rem;
            font-weight: 300;
            font-style: italic;
            color: #ffffff;
            max-width: 800px;
            line-height: 1.6;
            margin: 0;
            text-shadow: 2px 2px 8px rgba(0,0,0,0.9);
        }
        
        .destinations-grid-3d .dest-card-3d:hover img {
            transform: none; /* disable hover scale to prevent stuttering */
        }

        /* Stagger the cards throughout the wrapper's scroll range */
        .destinations-grid-3d .dest-card-3d:nth-child(1) {
            animation-range: contain 0% contain 40%;
            z-index: 1;
        }
        .destinations-grid-3d .dest-card-3d:nth-child(2) {
            animation-range: contain 30% contain 70%;
            z-index: 2;
        }
        .destinations-grid-3d .dest-card-3d:nth-child(3) {
            animation-range: contain 60% contain 100%;
            z-index: 3;
        }

        /* Mobile specific overrides for fullscreen 3D view */
        @media (max-width: 768px) {
            .destinations-stuck .section-title {
                top: 15vh; /* Lowered significantly so it doesn't collide with mobile browser UI */
                padding: 0 15px;
            }
            .destinations-stuck .section-title h2 {
                font-size: 24px;
            }
            .destinations-stuck .section-title p {
                font-size: 12px;
            }
            
            .destinations-grid-3d .dest-card-3d .dest-overlay {
                padding: 30px 15px;
            }

            .destinations-grid-3d .dest-card-3d .dest-overlay h3 {
                font-size: 2.8rem;
                margin-bottom: 2px;
            }

            .destinations-grid-3d .dest-card-3d .dest-overlay p.dest-subtitle {
                font-size: 1rem;
                letter-spacing: 2px;
                margin-bottom: 15px;
            }

            .destinations-grid-3d .dest-card-3d .dest-overlay p.dest-desc {
                font-size: 1rem;
                line-height: 1.5;
            }
        }
    }
}

/* Testimonials */
.testimonial-carousel {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 30px;
    margin-top: 40px;
}

.testimonial-box {
    background: var(--white);
    padding: 40px;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.05);
    text-align: left;
    position: relative;
}

.testimonial-box::before {
    content: '\201C';
    position: absolute;
    top: 20px;
    right: 30px;
    font-size: 80px;
    color: rgba(230, 126, 34, 0.1);
    font-family: serif;
    line-height: 1;
}

.stars i {
    color: #f1c40f;
    margin-bottom: 20px;
}

.review-text {
    font-style: italic;
    margin-bottom: 30px;
    color: #555;
}

.client-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.client-info img {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    object-fit: cover;
}

.client-details h4 {
    margin: 0;
    font-size: 16px;
}

.client-details span {
    font-size: 14px;
    color: #888;
}
/* Fix for iOS / iPhone background-attachment: fixed bug */
@media (max-width: 992px) {
    /* iOS heavily distorts fixed backgrounds by pinning them to document height rather than element height */
    .hero, .cta {
        background-attachment: scroll !important;
        background-position: center center !important;
        background-size: cover !important;
    }
}

/* Fix for Button Sizes & Find Vehicle button on Mobile */
@media (max-width: 768px) {
    .hero-btns {
        flex-direction: column;
        width: 100%;
        max-width: 300px;
        margin: 0 auto;
    }
    .hero-btns .btn {
        width: 100%;
        font-size: 15px !important;
        padding: 12px 20px !important;
    }
    .widget-btn {
        font-size: 16px !important;
        padding: 15px 20px !important;
        font-weight: bold;
    }
}
