/* --- General and Typography --- */
body {
    /* استخدام خط Cairo للعربية و Montserrat للإنجليزية */
    font-family: 'Montserrat', sans-serif;
    padding-top: 70px; /* لإعطاء مساحة للشريط العلوي الثابت */
}

body.rtl {
    font-family: 'Cairo', sans-serif;
}

h1, h2, h3, h4, h5, h6 {
    font-weight: 700; /* خط عريض للعناوين */
}

.btn-primary {
    background-color: #860d02;
    border-color: #860d02;
    transition: all 0.3s ease;
    padding: 10px 25px;
    font-weight: bold;
}

.btn-primary:hover {
    background-color: #c23023;
    border-color: #c23023;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 86, 179, 0.2);
}

/* --- Navbar --- */
.navbar {
    transition: background-color 0.3s ease;
}

.navbar-brand {
    font-size: 1.5rem;
}

.nav-link {
    color: white;
    font-weight: bold;
    transition: color 0.3s ease;
}

.nav-link:hover, .nav-link.active {
    color: #c23023 !important;
}

/* --- Hero Section --- */
.hero-section {
    position: relative;
    height: 70vh;
    background: url('https://placehold.co/1920x1080/212529/ffffff?text=Modern+Car') no-repeat center center/cover;
    color: #fff;
}

.hero-section::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6); /* طبقة معتمة فوق الصورة */
    z-index: 1;
}

.hero-section .container {
    position: relative;
    z-index: 2;
}

/* --- Featured Cars Section --- */

/* --- Featured Cars Section & Car Cards --- */
.car-card {
    border-radius: 15px;
    overflow: hidden;
    transition: all 0.3s ease;
    background-color: #fff;
}
.car-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.1) !important;
}
.car-card-img-container {
    position: relative;
}

/* FIX: Set a fixed height for all car card images */
.car-card .card-img-top {
    height: 220px;
    width: 100%;
    object-fit: cover; /* Ensures the image covers the area without distortion */
    border-bottom: 3px solid #c23023;
}

.car-card-price-tag {
    position: absolute;
    bottom: 10px;
    background-color: #860d02;
    color: #fff;
    padding: 8px 15px;
    border-radius: 0 50px 50px 0;
    font-size: 1.1rem;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}
[dir="rtl"] .car-card-price-tag {
    border-radius: 50px 0 0 50px;
    right: 0;
}
[dir="ltr"] .car-card-price-tag {
    left: 0;
}
.car-card .card-body {
    padding: 1.5rem;
}
.car-specs {
    display: flex;
    justify-content: space-around;
    gap: 10px;
    color: #555;
    background-color: #f8f9fa;
    padding: 10px;
    border-radius: 8px;
}
.car-specs span {
    font-size: 0.9rem;
}
.car-specs i {
    margin-right: 5px;
}
[dir="rtl"] .car-specs i {
    margin-right: 0;
    margin-left: 5px;
}


/* --- Services Section --- */
.service-box {
    transition: all 0.3s ease;
    border-radius: 10px;
}
.service-box:hover {
    background-color: #f8f9fa;
    transform: translateY(-5px);
}

/* --- Footer --- */
.footer a.text-reset {
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer a.text-reset:hover {
    color: #860d02 !important;
}

/* --- Brands Section --- */
.brands-section {
    background-color: #fff;
}

@keyframes scroll-ltr {
    0% { transform: translateX(0); }
    100% { transform: translateX(calc(-170px * 7)); } /* -170px (width+margin) * 7 logos */
}

@keyframes scroll-rtl {
    0% { transform: translateX(0); }
    100% { transform: translateX(calc(170px * 7)); }
}

.brands-slider {
    background: white;
    box-shadow: 0 10px 20px -5px rgba(0, 0, 0, 0.08);
    height: 100px;
    margin: auto;
    overflow: hidden;
    position: relative;
    width: 100%;
    border-radius: 10px;
}

.brands-slider::before,
.brands-slider::after {
    content: "";
    height: 100px;
    position: absolute;
    width: 15%;
    z-index: 2;
}

.brands-slider::before {
    left: 0;
    top: 0;
    background: linear-gradient(to right, white 0%, rgba(255, 255, 255, 0) 100%);
}
[dir="rtl"] .brands-slider::before {
    left: auto;
    right: 0;
    background: linear-gradient(to left, white 0%, rgba(255, 255, 255, 0) 100%);
}

.brands-slider::after {
    right: 0;
    top: 0;
    transform: rotateZ(180deg);
    background: linear-gradient(to right, white 0%, rgba(255, 255, 255, 0) 100%);
}
[dir="rtl"] .brands-slider::after {
    right: auto;
    left: 0;
    transform: rotateZ(0deg);
    background: linear-gradient(to left, white 0%, rgba(255, 255, 255, 0) 100%);
}


.brands-slide-track {
    display: flex;
    width: calc(170px * 14); /* 170px (width+margin) * 14 logos (7 original + 7 duplicates) */
    animation: scroll-ltr 30s linear infinite;
}
[dir="rtl"] .brands-slide-track {
    animation-name: scroll-rtl;
}

.brands-slider:hover .brands-slide-track {
    animation-play-state: paused;
}

.brand-slide {
    height: 100px;
    width: 150px;
    margin: 0 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.brand-slide img {
    max-width: 120px;
    height: auto;
    filter: grayscale(100%);
    opacity: 0.7;
    transition: all 0.3s ease;
}

.brand-slide img:hover {
    filter: grayscale(0%);
    opacity: 1;
    transform: scale(1.1);
}
.text-primary{
    color: #860d02 !important;
}

.btn-outline-primary{
    color: #860d02 !important;
    border-color: #860d02;
}
.btn-outline-primary:hover{
    color: #f8f9fa !important;
}

.btn:hover{
    
    background-color: #c23023 !important;
    border-color: #c23023;
}


/* --- WhatsApp Floating Button --- */
.whatsapp-float {
    position: fixed;
    width: 60px;
    height: 60px;
    bottom: 40px;
    background-color: #25d366;
    color: #FFF;
    border-radius: 50px;
    text-align: center;
    font-size: 30px;
    box-shadow: 2px 2px 3px #999;
    z-index: 100;
    transition: transform 0.3s ease;
}
.whatsapp-float:hover {
    transform: scale(1.1);
    color: #fff;
}
.whatsapp-float i {
    margin-top: 15px;
}
[dir="ltr"] .whatsapp-float {
    right: 40px;
}
[dir="rtl"] .whatsapp-float {
    left: 40px;
}

/* --- General Page Header --- */
.page-header {
    background-color: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
}


/* --- Car Details Page --- */
/* Splide.js Gallery Customization */
#main-slider .splide__slide img {
    width: 100%;
    height: 500px;
    object-fit: cover;
    border-radius: 15px;
}

#thumbnail-slider .splide__slide img {
    width: 100%;
    height: 100px;
    object-fit: cover;
    opacity: 0.6;
    transition: opacity 0.3s ease;
    cursor: pointer;
    border-radius: 5px;
}

#thumbnail-slider .splide__slide.is-active img {
    opacity: 1;
    border: 2px solid #0056b3;
}

.splide__arrow {
    background: rgba(0, 0, 0, 0.5);
}
.splide__arrow svg {
    fill: #fff;
}

/* Fallback for old gallery style (just in case) */
.main-image-container img {
    width: 100%;
    height: auto;
    max-height: 500px;
    object-fit: cover;
}
.thumbnail-container {
    gap: 10px;
    overflow-x: auto;
}
.thumb-item {
    flex: 0 0 100px;
}
.thumb-item .img-thumbnail {
    width: 100px;
    height: 75px;
    object-fit: cover;
    cursor: pointer;
    border: 2px solid transparent;
    transition: border-color 0.3s ease;
}
.thumb-item .img-thumbnail:hover {
    border-color: #0056b3;
}

/* --- Car Details Page --- */
/* Splide.js Gallery Customization */
#main-slider .splide__slide img {
    width: 100%;
    height: 500px;
    /* FIX: Change from cover to contain to show the full image */
    object-fit: contain; 
    border-radius: 15px;
    background-color: #f8f9fa; /* Add a background for the contain effect */
    cursor: pointer; /* Show that the image is clickable */
}

#thumbnail-slider .splide__slide img {
    width: 100%;
    height: 100px;
    object-fit: cover;
    opacity: 0.6;
    transition: opacity 0.3s ease;
    cursor: pointer;
    border-radius: 5px;
}

#thumbnail-slider .splide__slide.is-active img {
    opacity: 1;
    border: 2px solid #0056b3;
}

.splide__arrow {
    background: rgba(0, 0, 0, 0.5);
}
.splide__arrow svg {
    fill: #fff;
}


@keyframes fadeInSlideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}


/* --- How It Works Section --- */
.step-icon {
    width: 80px;
    height: 80px;
    background-color: #e9ecef;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: #860d02;
    transition: all 0.3s ease;
}
.col-md-4:hover .step-icon {
    background-color: #860d02;
    color: #fff;
    transform: scale(1.1);
}

/* --- Testimonials Section --- */
.testimonial-card {
    min-height: 320px;
}
.testimonial-card img {
    border: 3px solid #dee2e6;
}

/* --- Hero Slider Section --- */
/* The main container for the section */
.hero-slider-section {
    position: relative;
    height: 90vh; /* Set the desired height */
    min-height: 500px;
    width: 100%;
    overflow: hidden;
    background-color: #212529; /* Fallback background */
}

/* The Splide root element */
#hero-slider {
    height: 100%; /* Make the slider fill the section height */
}

/* Ensure track and list also fill the height */
#hero-slider .splide__track,
#hero-slider .splide__list {
    height: 100%;
}

/* Each slide should be a positioned container */
#hero-slider .splide__slide {
    position: relative;
    overflow: hidden;
    height: 100%;
}

/* The image inside the slide */
#hero-slider .splide__slide img {
    position: absolute; /* Position image absolutely to fill the slide */
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover; /* This will cover the area, might crop edges */
}

/* The dark overlay on top of the image */
#hero-slider .splide__slide::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 22, 44, 0.6);
    z-index: 1; /* Overlay should be above the image */
}

/* The text content container */
.hero-slide-content {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2; /* Content should be above the overlay */
    color: #fff;
    text-align: center;
    display: flex; /* Use flexbox for easy centering */
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 2rem;
}

/* Ken Burns Effect for the image in the active slide */
@keyframes kenburns-effect {
    0% { transform: scale(1); }
    100% { transform: scale(1.15); }
}

#hero-slider .splide__slide.is-active img {
    animation: kenburns-effect 8s ease-out forwards;
}

/* Animation for text on active slide */
.hero-slide-content h1, .hero-slide-content p {
    opacity: 0;
    transform: translateY(40px);
}

.splide__slide.is-active .hero-slide-content h1 {
    animation: fadeInSlideUp 1s 0.5s ease-out forwards;
}
.splide__slide.is-active .hero-slide-content p {
    animation: fadeInSlideUp 1s 0.8s ease-out forwards;
}

@keyframes fadeInSlideUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* --- YouTube Video Section --- */
.video-section {
    margin-top: 3rem;
}
.video-responsive {
    overflow: hidden;
    position: relative;
    height: 0;
    padding-bottom: 56.25%; /* 16:9 Aspect Ratio */
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}
.video-responsive iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}


/* --- After Sales Section --- */
.after-sales-card {
    background-color: #fff;
    border: 1px solid #e9ecef;
    border-radius: 15px;
    padding: 2rem;
    text-align: center;
    transition: all 0.3s ease;
    height: 100%;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}
.after-sales-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
}
.after-sales-icon {
    font-size: 2.5rem;
    color: #0056b3;
    margin-bottom: 1rem;
}
.after-sales-card p {
    font-size: 1.1rem;
    font-weight: 500;
    color: #343a40;
    margin-bottom: 0;
}
.discount-card .after-sales-icon {
    color: #198754; /* Green for discount */
}


