/* --- DTR Vente Cars: Home Page Stylesheet --- */

/* --- 1. Root Variables and Reset --- */
:root {
    --color-primary: #0056b3;
    --color-primary-dark: #004085;
    --color-dark: #222;
    --color-text: #333;
    --color-text-light: #666;
    --color-bg: #f8f9fa;
    --color-white: #ffffff;
    --shadow-light: 0 4px 12px rgba(0,0,0,0.08);
    --shadow-dark: 0 2px 8px rgba(0,0,0,0.1);
    --font-heading: 'Poppins', sans-serif;
    --font-body: 'Lato', sans-serif;
    --border-radius-main: 12px;
    --border-radius-pill: 25px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-body);
    background: var(--color-bg);
    color: var(--color-text);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
}


/* --- 2. Navbar --- */
.navbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--color-white);
    padding: 0.75rem 1.5rem;
    box-shadow: var(--shadow-light);
    position: relative;
    z-index: 1000; 
}

.navbar .title {
    font-family: var(--font-heading);
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--color-dark);
}

.navbar .logo {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
}

.navbar .logo img {
    height: 40px;
}

.navbar .nav-links {
    display: flex;
    gap: 0.75rem;
}

.navbar .nav-links a {
    /* --- FIX: Center the text horizontally and vertically --- */
    display: flex;
    align-items: center;
    justify-content: center;
    /* -------------------------------------------------------- */
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: var(--border-radius-pill);
    background: transparent;
    color: var(--color-text-light);
    font-weight: 700;
    transition: all 0.3s ease;
}

.navbar .nav-links a:hover,
.navbar .nav-links a.current-page {
    background: var(--color-primary);
    color: var(--color-white);
}

.hamburger {
    display: none;
    flex-direction: column;
    cursor: pointer;
    gap: 5px;
    transition: all 0.3s ease;
}

.hamburger span {
    width: 25px;
    height: 3px;
    background: var(--color-dark);
    border-radius: 5px;
    transition: all 0.3s ease;
}

.hamburger.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}
.hamburger.active span:nth-child(2) {
    opacity: 0;
}
.hamburger.active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}


/* --- 3. Hero Section (Animated Image Background & Text Overlay) */
.hero {
    position: relative;
    width: 100%;
    min-height: 450px; 
    display: flex; 
    align-items: center;
    justify-content: center;
    overflow: hidden;
    margin-bottom: 3rem;
    box-shadow: var(--shadow-dark);
}

/* Image Slideshow (Background) */
.hero-image-slider {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1; 
}

.hero-image-slider .slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain; 
    opacity: 0;
    transition: opacity 1.5s ease-in-out; 
}

.hero-image-slider .slide.active {
    opacity: 1;
}

/* Content Overlay & Text Styling */
.hero-content-overlay {
    position: absolute;
    z-index: 2; /* Still lower than the navbar (1000) */
    padding: 2rem 1.5rem;
    text-align: center;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    
    background: rgba(0, 0, 0, 0.55); 
}

/* --- TEXT ANIMATION STYLES APPLY DIRECTLY TO H1 and P --- */
#dynamic-greeting-h1 {
    font-family: var(--font-heading);
    font-size: 3.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--color-white); 
    text-shadow: 2px 2px 5px rgba(0, 0, 0, 0.7); 
    
    /* Animation properties for H1 */
    opacity: 0;
    transition: opacity 0.5s ease-in-out;
}

#dynamic-greeting-p {
    font-size: 1.4rem;
    color: #f0f0f0;
    max-width: 700px;
    margin: 0 auto 2.5rem auto;
    line-height: 1.6;
    
    /* Animation properties for P */
    opacity: 0;
    transition: opacity 0.5s ease-in-out;
}

.fade-in {
    opacity: 1 !important;
}

.fade-out {
    opacity: 0 !important;
}
/* --- END TEXT ANIMATION --- */

.hero .btn-primary {
    display: inline-block;
    padding: 1rem 2.5rem;
    text-decoration: none;
    font-weight: 700;
    font-size: 1.1rem;
    border-radius: var(--border-radius-main);
    background: var(--color-primary); 
    color: var(--color-white);
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.4); 
    transition: all 0.3s ease;
}

.hero .btn-primary:hover {
    background: var(--color-primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.5);
}


/* --- 4. Services Section & Card Styles --- */

.services {
    padding: 3rem 0;
}

.services h2 {
    font-family: var(--font-heading);
    text-align: center;
    margin-bottom: 2rem;
    font-size: 2.25rem;
    color: var(--color-dark);
}

.card-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}

.card {
    background: var(--color-white);
    border-radius: var(--border-radius-main);
    box-shadow: var(--shadow-dark);
    padding: 1rem;
    text-align: center;
    transition: all 0.3s ease;
    overflow: hidden;
}

.card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-light);
}

.card-image-slider {
    position: relative;
    width: 100%;
    border-radius: 10px;
    margin-bottom: 1rem;
    aspect-ratio: 16 / 10;
    overflow: hidden;
}

.card-image-slider .slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    opacity: 0;
    transition: opacity 0.5s ease-in-out;
}

.card-image-slider .slide.active {
    opacity: 1;
}

.card h3 {
    font-family: var(--font-heading);
    margin-bottom: 0.5rem;
    color: var(--color-primary);
    font-size: 1.25rem;
}

.card p {
    color: var(--color-text-light);
    font-size: 0.95rem;
    line-height: 1.5;
}

/* --- 5. Footer --- */
.footer {
    text-align: center;
    padding: 2rem 0;
    background: var(--color-white);
    color: var(--color-text-light);
    font-size: 0.9rem;
}

/* --- 6. Responsive (Mobile) --- */
@media (max-width: 768px) {
    /* Navbar */
    .navbar .logo { display: none; }
    .navbar .nav-links {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        flex-direction: column;
        background: var(--color-white);
        padding: 1rem;
        box-shadow: var(--shadow-light);
        z-index: 100;
    }
    .navbar .nav-links.active { display: flex; }
    .hamburger { display: flex; }

    /* Hero Adjustments */
    .hero {
        min-height: 350px;
    }
    
    #dynamic-greeting-h1 {
        font-size: 2.25rem;
    }
    #dynamic-greeting-p {
        font-size: 1.1rem;
        margin-bottom: 1.5rem;
    }
    .hero .btn-primary { 
        padding: 0.75rem 1.5rem; 
        font-size: 1rem; 
    }
}
