/* ============================================================
   HOME.CSS — Style "Prime Motors" appliqué à la page d'accueil.
   Cette feuille de style est propre à index.php (elle n'est pas
   chargée par les autres pages, qui gardent le design existant).
   ============================================================ */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Poppins', sans-serif;
}

:root {
    --primary: #cc001b;
    --primary-hover: #a30015;
    --dark-bg: #0b111e;
    --light-bg: #f8f9fa;
    --text-dark: #1f2937;
    --text-light: #9ca3af;
    --border-color: #e5e7eb;
}

body {
    color: var(--text-dark);
    background-color: #ffffff;
    overflow-x: hidden;
}

a { text-decoration: none; color: inherit; }
ul { list-style: none; }

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* --- TOP BAR --- */
.top-bar {
    background-color: var(--dark-bg);
    color: #ffffff;
    font-size: 12px;
    padding: 10px 0;
    border-bottom: 1px solid #1f2937;
}
.top-bar .container { display: flex; justify-content: space-between; align-items: center; }
.top-bar-info span { margin-right: 20px; }
.top-bar-info i { color: var(--primary); margin-right: 5px; }
.top-bar-socials a { margin-left: 15px; color: #ffffff; transition: color 0.3s; }
.top-bar-socials a:hover { color: var(--primary); }

/* --- NAVBAR --- */
.navbar {
    background-color: #ffffff;
    padding: 20px 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    position: sticky;
    top: 0;
    z-index: 1000;
}
.navbar .container { display: flex; justify-content: space-between; align-items: center; gap: 20px; }

.logo { font-weight: 800; font-size: 24px; letter-spacing: 1px; line-height: 1; display: flex; align-items: center; gap: 10px; }
.logo span { display: block; font-size: 11px; font-weight: 400; letter-spacing: 4px; color: var(--text-light); margin-top: 2px; }
.logo-red { color: var(--primary); }
.logo-img { height: 42px; width: auto; }

.nav-links { display: flex; gap: 25px; }
.nav-links a {
    font-size: 13px;
    font-weight: 400;
    text-transform: uppercase;
    color: var(--text-dark);
    padding-bottom: 5px;
    transition: color 0.3s;
}
.nav-links a:hover, .nav-links a.active { color: var(--primary); border-bottom: 2px solid var(--primary); }

.btn-nav {
    background-color: var(--primary);
    color: #ffffff !important;
    padding: 10px 20px;
    border-radius: 4px;
    font-weight: 400;
    font-size: 13px;
    text-transform: uppercase;
    transition: background-color 0.3s;
}
.btn-nav:hover { background-color: var(--primary-hover); }

/* Menu burger (mobile) — conserve le comportement JS existant */
.burger {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
}
.burger span { width: 24px; height: 2px; background: var(--text-dark); border-radius: 2px; }

/* --- HERO SECTION (carousel) --- */
.hero {
    background-color: #f3f4f6;
    padding: 100px 0 140px 0;
    position: relative;
    overflow: hidden;
}
.hero-slides { position: absolute; inset: 0; z-index: 0; }
.hero-slide {
    position: absolute;
    inset: 0;
    background-repeat: no-repeat;
    background-position: center;
    background-size: cover;
    opacity: 0;
    transition: opacity 1.4s ease;
}
.hero-slide.active { opacity: 1; }
.hero-overlay {
    position: absolute;
    inset: 0;
    z-index: 1;
    background: linear-gradient(100deg, #f3f4f6 32%, rgba(243,244,246,.72) 52%, rgba(243,244,246,.15) 75%);
}
.hero .container { position: relative; z-index: 2; }
.hero-dots {
    position: absolute;
    left: 50%;
    bottom: 28px;
    transform: translateX(-50%);
    z-index: 3;
    display: flex;
    gap: 8px;
}
.hero-dots button {
    width: 9px; height: 9px;
    border-radius: 50%;
    border: none;
    padding: 0;
    background: rgba(31,41,55,.25);
    cursor: pointer;
    transition: background .3s, transform .3s;
}
.hero-dots button.active { background: var(--primary); transform: scale(1.2); }
.hero-content { max-width: 550px; }
.hero-subtitle {
    color: var(--primary);
    text-transform: uppercase;
    font-weight: 400;
    font-size: 13px;
    letter-spacing: 2px;
    margin-bottom: 10px;
    display: inline-block;
}
.hero-title { font-size: 54px; font-weight: 800; line-height: 1.1; text-transform: uppercase; margin-bottom: 20px; }
.hero-title span { color: var(--primary); }
.hero-text { color: #4b5563; font-size: 15px; margin-bottom: 30px; line-height: 1.6; }
.hero-buttons { display: flex; gap: 15px; }

.btn {
    padding: 14px 28px;
    border-radius: 4px;
    font-weight: 400;
    font-size: 13px;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.3s;
    border: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}
.btn-primary { background-color: var(--primary); color: white; }
.btn-primary:hover { background-color: var(--primary-hover); }
.btn-secondary { background-color: white; color: var(--text-dark); border: 1px solid var(--border-color); }
.btn-secondary:hover { background-color: var(--light-bg); }

/* --- SEARCH FILTER BAR --- */
.search-filter-box {
    background-color: var(--dark-bg);
    border-radius: 8px;
    padding: 30px;
    color: white;
    margin-top: -60px;
    position: relative;
    z-index: 10;
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
}
.filter-grid { display: grid; grid-template-columns: 1fr 1fr 1fr 1fr 1fr; gap: 15px; align-items: flex-end; }
.filter-title { grid-column: 1 / -1; font-size: 14px; font-weight: 400; text-transform: uppercase; letter-spacing: 1px; margin-bottom: 5px; }
.filter-group { display: flex; flex-direction: column; }
.filter-group label { font-size: 12px; color: var(--text-light); margin-bottom: 8px; }
.filter-group select,
.filter-group input {
    background-color: white;
    color: var(--text-dark);
    border: none;
    padding: 12px;
    border-radius: 4px;
    font-size: 13px;
    outline: none;
    cursor: pointer;
    width: 100%;
    font-family: inherit;
}
.btn-search {
    background-color: var(--primary);
    color: white;
    width: 100%;
    height: 45px;
    border: none;
    border-radius: 4px;
    font-weight: 400;
    text-transform: uppercase;
    font-size: 13px;
    cursor: pointer;
    transition: background 0.3s;
}
.btn-search:hover { background-color: var(--primary-hover); }
.advanced-search { text-align: right; margin-top: 15px; font-size: 12px; color: var(--text-light); }
.advanced-search a:hover { color: white; }

/* --- INVENTORY SECTION --- */
.inventory-section { padding: 80px 0; background-color: #ffffff; }
.section-header { text-align: center; margin-bottom: 40px; }
.section-subtitle { color: var(--primary); text-transform: uppercase; font-weight: 400; font-size: 12px; letter-spacing: 1px; }
.section-title { font-size: 32px; font-weight: 800; text-transform: uppercase; margin-top: 5px; }

.inventory-tabs {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 25px;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 40px;
}
.tab-item {
    padding: 12px 5px;
    font-size: 13px;
    font-weight: 400;
    text-transform: uppercase;
    color: #6b7280;
    cursor: pointer;
    transition: all 0.3s;
}
.tab-item.active, .tab-item:hover { color: var(--primary); border-bottom: 3px solid var(--primary); margin-bottom: -2px; }

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

.car-card {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    overflow: hidden;
    transition: transform 0.3s, box-shadow 0.3s;
}
.car-card:hover { transform: translateY(-5px); box-shadow: 0 10px 20px rgba(0,0,0,0.05); }

.car-image-wrapper { position: relative; height: 180px; background-color: #f3f4f6; }
.car-image-wrapper img { width: 100%; height: 100%; object-fit: cover; }
.car-badge {
    position: absolute;
    top: 10px; left: 10px;
    background-color: rgba(0, 0, 0, 0.75);
    color: white;
    padding: 3px 8px;
    font-size: 11px;
    font-weight: 400;
    border-radius: 2px;
}

.car-details { padding: 20px; }
.car-name { font-size: 15px; font-weight: 700; margin-bottom: 10px; }
.car-specs { display: flex; gap: 15px; font-size: 12px; color: #6b7280; margin-bottom: 15px; }
.car-specs i { margin-right: 4px; }
.car-price {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-dark);
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 15px;
    margin-bottom: 15px;
}
.car-price span { font-size: 12px; font-weight: 500; color: var(--text-light); text-transform: none; }
.view-details-link { display: block; text-align: center; font-size: 12px; font-weight: 400; color: var(--primary); text-transform: uppercase; }
.view-details-link:hover { color: var(--primary-hover); }

/* --- FEATURES BAR --- */
.features-bar { background-color: var(--dark-bg); color: white; padding: 40px 0; }
.features-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 30px; }
.feature-item { display: flex; align-items: flex-start; gap: 15px; }
.feature-icon { font-size: 28px; color: var(--primary); margin-top: 5px; }
.feature-title { font-size: 13px; font-weight: 400; text-transform: uppercase; margin-bottom: 4px; letter-spacing: 0.5px; }
.feature-desc { font-size: 12px; color: var(--text-light); line-height: 1.5; }

/* --- ABOUT/PROMO SECTION --- */
.about-promo { padding: 80px 0; background-color: #ffffff; }
.about-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 50px; align-items: center; }
.about-image img { width: 100%; border-radius: 4px; box-shadow: 0 10px 30px rgba(0,0,0,0.1); }
.about-subtitle { color: var(--primary); text-transform: uppercase; font-weight: 400; font-size: 12px; letter-spacing: 1px; margin-bottom: 5px; }
.about-title { font-size: 36px; font-weight: 800; text-transform: uppercase; line-height: 1.2; margin-bottom: 20px; }
.about-text { color: #4b5563; font-size: 14px; line-height: 1.7; margin-bottom: 30px; }

/* --- PROMO SPLIT (réserver / whatsapp) --- */
.promo-split { padding: 0 0 80px 0; background-color: #ffffff; }
.promo-split-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.promo-card {
    position: relative;
    min-height: 260px;
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    align-items: center;
    padding: 40px;
}
.promo-card-dark { background-color: var(--dark-bg); color: white; }
.promo-card-light { background-color: var(--light-bg); color: var(--text-dark); border: 1px solid var(--border-color); }
.promo-card-bg {
    position: absolute;
    inset: 0;
    background-repeat: no-repeat;
    background-position: center;
    background-size: cover;
    opacity: .22;
    z-index: 0;
}
.promo-card-body { position: relative; z-index: 1; max-width: 320px; }
.promo-card-tag {
    color: var(--primary);
    text-transform: uppercase;
    font-weight: 400;
    font-size: 12px;
    letter-spacing: 1px;
    display: block;
    margin-bottom: 10px;
}
.promo-card-title { font-size: 24px; font-weight: 800; text-transform: uppercase; line-height: 1.25; margin-bottom: 14px; }
.promo-card-text { font-size: 13px; line-height: 1.6; margin-bottom: 22px; opacity: .85; }
.promo-card-light .promo-card-text { color: #4b5563; opacity: 1; }

/* --- BRANDS STRIP --- */
.brands-strip { padding: 40px 0; background-color: var(--light-bg); border-top: 1px solid var(--border-color); border-bottom: 1px solid var(--border-color); }
.brands-strip-title { text-align: center; font-size: 12px; font-weight: 400; text-transform: uppercase; letter-spacing: 1.5px; color: var(--text-light); margin-bottom: 22px; }
.brands-strip-list { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; }
.brands-strip-list a {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 999px;
    padding: 8px 20px;
    font-size: 13px;
    font-weight: 400;
    color: var(--text-dark);
    transition: all .3s;
}
.brands-strip-list a:hover { color: white; background: var(--primary); border-color: var(--primary); }

/* --- ICON BUTTONS (favoris / comparer / aperçu sur les cartes) --- */
.icon-btn {
    width: 38px; height: 38px;
    display: flex; align-items: center; justify-content: center;
    background: rgba(255,255,255,.92);
    border: 1px solid var(--border-color);
    border-radius: 50%;
    color: var(--text-dark);
    cursor: pointer;
    transition: all .3s;
}
.icon-btn:hover, .icon-btn.active { background: var(--primary); color: #fff; border-color: var(--primary); }

/* --- BADGE PILLS (statut sur les cartes) --- */
.badge-pill { display: inline-flex; align-items: center; gap: 4px; padding: 5px 13px; border-radius: 999px; font-size: .72rem; font-weight: 700; }
.badge-pill-available { background: #dcfce7; color: #15803d; }
.badge-pill-unavailable { background: #fee2e2; color: var(--primary); }
.badge-pill-new { background: var(--primary); color: #fff; }

/* --- VEHICLE CARDS (rendues par renderVehicleCard() en JS) --- */
.vehicle-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 24px; }
.vehicle-card {
    background: #fff;
    border-radius: 4px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,.05);
    border: 1px solid var(--border-color);
    transition: transform .3s, box-shadow .3s;
    display: flex;
    flex-direction: column;
}
.vehicle-card:hover { transform: translateY(-4px); box-shadow: 0 10px 20px rgba(0,0,0,0.08); }
.vehicle-card-media { position: relative; aspect-ratio: 4 / 3; overflow: hidden; background: var(--light-bg); }
.vehicle-card-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s ease; }
.vehicle-card:hover .vehicle-card-media img { transform: scale(1.06); }
.vehicle-card-badges { position: absolute; top: 14px; left: 14px; display: flex; flex-direction: column; gap: 6px; z-index: 2; }
.vehicle-card-actions {
    position: absolute; top: 14px; right: 14px;
    display: flex; flex-direction: column; gap: 8px;
    z-index: 2; opacity: 0; transform: translateX(8px);
    transition: all .3s;
}
.vehicle-card:hover .vehicle-card-actions,
.vehicle-card-actions:focus-within { opacity: 1; transform: translateX(0); }
.vehicle-card-actions .icon-btn { width: 36px; height: 36px; font-size: .85rem; }
.vehicle-card-body { padding: 20px 22px 22px; flex: 1; display: flex; flex-direction: column; }
.vehicle-card-tag { display: inline-block; font-size: .72rem; font-weight: 400; color: var(--primary); background: #fee2e2; padding: 3px 10px; border-radius: 999px; margin-bottom: .6rem; align-self: flex-start; }
.vehicle-card-title { font-size: 1.1rem; font-weight: 700; margin-bottom: .6rem; }
.vehicle-card-title a { color: var(--text-dark); }
.vehicle-card-title a:hover { color: var(--primary); }
.vehicle-card-specs { display: flex; flex-wrap: wrap; gap: 8px 16px; color: #6b7280; font-size: .85rem; margin-bottom: 1rem; }
.vehicle-card-specs li { display: flex; align-items: center; gap: 6px; }
.vehicle-card-specs i { color: var(--primary); font-size: .8rem; width: 16px; text-align: center; }
.vehicle-card-footer { margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-top: 14px; border-top: 1px solid var(--border-color); }
.vehicle-card-price { line-height: 1.1; }
.vehicle-card-price .amount { font-size: 1.25rem; font-weight: 700; color: var(--primary); }
.vehicle-card-price .unit { display: block; font-size: .75rem; font-weight: 400; color: var(--text-light); }

/* --- MODALS (aperçu rapide / comparateur) --- */
.modal-overlay {
    position: fixed; inset: 0;
    background: rgba(0,0,0,.6);
    display: none;
    align-items: center; justify-content: center;
    z-index: 2000;
}
.modal-overlay.open { display: flex; }
.modal-box { background: #fff; border-radius: 8px; max-width: 600px; width: 90%; padding: 24px; position: relative; max-height: 85vh; overflow-y: auto; }
.modal-close { position: absolute; top: 16px; right: 16px; background: none; border: none; font-size: 18px; cursor: pointer; }
.modal-body img { width: 100%; border-radius: 4px; margin-bottom: 16px; }
.compare-table { width: 100%; border-collapse: collapse; }
.compare-table th, .compare-table td { padding: 8px 12px; border-bottom: 1px solid var(--border-color); font-size: 13px; text-align: left; }
.compare-table th { color: var(--text-light); font-weight: 400; white-space: nowrap; }

.compare-bar {
    position: fixed; bottom: 20px; right: 20px;
    background: var(--dark-bg);
    color: #fff;
    padding: 12px 20px;
    border-radius: 8px;
    display: none;
    align-items: center;
    gap: 16px;
    z-index: 1500;
    box-shadow: 0 10px 25px rgba(0,0,0,.12);
}
.compare-bar.visible { display: flex; }
.compare-bar-items { display: flex; flex-wrap: wrap; gap: 8px; max-width: 420px; }
.compare-bar-chip { display: inline-flex; align-items: center; gap: 6px; background: rgba(255,255,255,.1); border-radius: 999px; padding: 6px 10px; font-size: 12px; }
.compare-bar-chip button { background: none; border: none; color: var(--text-light); cursor: pointer; font-size: 11px; }
.compare-bar-chip button:hover { color: #fff; }

/* --- FOOTER --- */
footer.site-footer-home {
    background-color: var(--dark-bg);
    color: white;
    padding: 60px 0 20px 0;
    font-size: 13px;
    border-top: 1px solid #1f2937;
}
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1.5fr 1.5fr; gap: 30px; margin-bottom: 5px; }
.footer-col-title { font-size: 12px; font-weight: 400; text-transform: uppercase; letter-spacing: 1px; margin-bottom: 20px; }
.footer-logo-desc p { color: var(--text-light); line-height: 1.6; margin: 15px 0; }
.footer-socials a {
    display: inline-block;
    width: 32px; height: 32px;
    background-color: #1f2937;
    border-radius: 50%;
    text-align: center;
    line-height: 32px;
    margin-right: 8px;
    color: white;
    transition: background 0.3s;
}
.footer-socials a:hover { background-color: var(--primary); }
.footer-links li { margin-bottom: 10px; }
.footer-links a { color: var(--text-light); transition: color 0.3s; }
.footer-links a:hover { color: white; }
.footer-contact li { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 12px; color: var(--text-light); }
.footer-contact i { color: var(--primary); margin-top: 3px; }
.footer-hours table { width: 100%; color: var(--text-light); }
.footer-hours td { padding-bottom: 8px; }
.footer-hours td:last-child { text-align: right; color: white; }
.footer-bottom {
    border-top: 1px solid #1f2937;
    padding-top: 20px;
    margin-top: 40px;
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
    color: var(--text-light);
    font-size: 12px;
}
.footer-bottom-links a { margin-left: 20px; }
.footer-bottom-links a:hover { color: white; }

/* --- RESPONSIVE --- */
@media (max-width: 1024px) {
    .inventory-grid { grid-template-columns: repeat(2, 1fr); }
    .filter-grid { grid-template-columns: 1fr 1fr; }
    .features-grid { grid-template-columns: repeat(2, 1fr); }
    .footer-grid { grid-template-columns: repeat(2, 1fr); }
    .promo-split-grid { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
    .hero { padding: 60px 0; }
    .hero-overlay { background: rgba(243,244,246,.82); }
    .hero-dots { display: none; }
    .top-bar { display: none !important; }
    .navbar .container { justify-content: space-between; }

    .nav-links {
        display: none;
        position: fixed;
        top: 78px; left: 0; right: 0;
        background: #ffffff;
        flex-direction: column;
        gap: 0;
        padding: 10px 20px 16px;
        box-shadow: 0 10px 20px rgba(0,0,0,0.08);
        z-index: 999;
    }
    .nav-links.open { display: flex; }
    .nav-links a { padding: 12px 0; border-bottom: 1px solid var(--border-color); }
    .nav-links a.active { border-bottom-color: var(--primary); }

    .about-grid { grid-template-columns: 1fr; }
    .inventory-grid, .features-grid, .footer-grid { grid-template-columns: 1fr; }
    .vehicle-grid { grid-template-columns: 1fr; }
    .filter-grid { grid-template-columns: 1fr; }
    .hero-title { font-size: 38px; }
    .promo-card { padding: 28px; min-height: 220px; }
    .promo-card-title { font-size: 20px; }
    .brands-strip-list a { padding: 7px 16px; font-size: 12px; }
    .burger { display: flex; }

    .inventory-section, .about-promo { padding: 48px 0; }
    .promo-split { padding: 0 0 48px 0; }
    .features-bar { padding: 32px 0; }
    .brands-strip { padding: 28px 0; }
    .section-title { font-size: 26px; }
    .about-title { font-size: 26px; }
    .hero-buttons { flex-direction: column; }
    .hero-buttons .btn { width: 100%; }

    /* Pas de :hover tactile : ces boutons doivent rester visibles sur mobile */
    .vehicle-card-actions { opacity: 1; transform: none; }
}

@media (max-width: 480px) {
    .container { padding: 0 16px; }
    .hero { padding: 44px 0; }
    .hero-title { font-size: 30px; }
    .hero-text { font-size: 14px; }
    .search-filter-box { padding: 20px 16px; margin-top: -36px; }
    .filter-title { font-size: 13px; }
    .btn { padding: 12px 20px; font-size: 12px; }
    .section-title { font-size: 22px; }
    .about-title { font-size: 22px; }
    .promo-card-title { font-size: 18px; }
    .logo { font-size: 19px; }
    .btn-nav { padding: 8px 14px; font-size: 12px; }
    .inventory-tabs { gap: 14px; justify-content: flex-start; overflow-x: auto; flex-wrap: nowrap; padding-bottom: 8px; }
    .tab-item { flex: 0 0 auto; white-space: nowrap; }

    .compare-bar { left: 12px; right: 12px; bottom: 12px; flex-wrap: wrap; }
    .compare-bar-items { max-width: 100%; }
    .modal-box { padding: 18px; }
}
