/* ═══════════════════════════════════════════════
   BDB AUTO DZ — Style Global (Mobile-First)
   ═══════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Bebas+Neue&family=Tajawal:wght@300;400;700;900&display=swap');

/* ── Variables ── */
:root {
    --red:      #e63946;
    --red-dark: #c1121f;
    --red-glow: rgba(230, 57, 70, 0.25);
    --dark:     #0d0d0d;
    --dark2:    #141414;
    --dark3:    #1e1e1e;
    --card:     #191919;
    --border:   rgba(255,255,255,0.07);
    --text:     #f0f0f0;
    --muted:    rgba(240,240,240,0.5);
    --font-display: 'Bebas Neue', sans-serif;
    --font-body:    'Tajawal', sans-serif;
    --radius:   12px;
    --sidebar-w: 280px;
    --header-h: 64px;
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
    font-family: var(--font-body);
    background: var(--dark);
    color: var(--text);
    overflow-x: hidden;
}
a { text-decoration: none; color: inherit; }
img { max-width: 100%; display: block; }

/* ═══════════════════════════════════════════════
   HEADER
   ═══════════════════════════════════════════════ */
.header {
    position: sticky;
    top: 0;
    z-index: 900;
    height: var(--header-h);
    background: rgba(13,13,13,0.92);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--border);
}
.header-container {
    max-width: 1200px;
    margin: 0 auto;
    height: 100%;
    padding: 0 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}
.header-logo {
    font-family: var(--font-display);
    font-size: 1.6rem;
    letter-spacing: 0.1em;
    color: #fff;
    white-space: nowrap;
}
.header-logo span { color: var(--red); }

/* Desktop nav */
.nav-buttons {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

/* Hamburger — hidden on desktop */
.hamburger {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px;
    z-index: 1100;
}
.hamburger span {
    display: block;
    width: 26px;
    height: 2px;
    background: var(--text);
    border-radius: 2px;
    transition: all 0.3s ease;
}
.hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ═══════════════════════════════════════════════
   SIDEBAR (mobile)
   ═══════════════════════════════════════════════ */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.7);
    z-index: 980;
    backdrop-filter: blur(3px);
}
.sidebar-overlay.show { display: block; }

.sidebar {
    position: fixed;
    top: 0;
    right: -100%;
    width: var(--sidebar-w);
    height: 100%;
    background: var(--dark2);
    border-left: 1px solid var(--border);
    z-index: 990;
    padding: 5rem 1.5rem 2rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    transition: right 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    overflow-y: auto;
}
.sidebar.open { right: 0; }

.sidebar-brand {
    font-family: var(--font-display);
    font-size: 1.8rem;
    letter-spacing: 0.1em;
    color: #fff;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
}
.sidebar-brand span { color: var(--red); }

.sidebar .btn {
    width: 100%;
    text-align: left;
    padding: 0.85rem 1rem;
    border-radius: var(--radius);
    font-size: 1rem;
}

/* ═══════════════════════════════════════════════
   BUTTONS
   ═══════════════════════════════════════════════ */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.55rem 1.1rem;
    border-radius: 8px;
    font-family: var(--font-body);
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
    border: none;
    transition: all 0.2s ease;
    white-space: nowrap;
}
.btn-primary {
    background: var(--red);
    color: #fff;
}
.btn-primary:hover {
    background: var(--red-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 20px var(--red-glow);
}
.btn-secondary {
    background: rgba(255,255,255,0.07);
    color: var(--text);
    border: 1px solid var(--border);
}
.btn-secondary:hover {
    background: rgba(255,255,255,0.12);
    border-color: rgba(255,255,255,0.15);
}

/* ═══════════════════════════════════════════════
   HERO
   ═══════════════════════════════════════════════ */
.hero {
    min-height: 60vh;
    display: flex;
    align-items: center;
    position: relative;
    overflow: hidden;
    padding: 3rem 1.25rem;
    background:
        radial-gradient(ellipse 60% 60% at 80% 50%, rgba(230,57,70,0.12) 0%, transparent 60%),
        var(--dark);
}
.hero::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--red), transparent);
}
.hero-container {
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
    display: flex;
    align-items: center;
    gap: 2rem;
}
.hero-left { flex: 1; }
.hero-right {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
}
.hero-content h1 {
    font-family: var(--font-display);
    font-size: clamp(2.4rem, 8vw, 5rem);
    line-height: 1;
    letter-spacing: 0.05em;
    color: #fff;
    animation: heroIn 0.8s ease both;
}
.hero-content h1 em {
    color: var(--red);
    font-style: normal;
}
.hero-content p {
    margin-top: 1rem;
    color: var(--muted);
    font-size: clamp(0.9rem, 2.5vw, 1.05rem);
    line-height: 1.6;
    max-width: 420px;
    animation: heroIn 0.8s 0.15s ease both;
}
@keyframes heroIn {
    from { opacity: 0; transform: translateY(24px); }
    to   { opacity: 1; transform: translateY(0); }
}
.hero-image {
    width: clamp(140px, 30vw, 300px);
    animation: heroCar 0.9s 0.2s cubic-bezier(0.34, 1.56, 0.64, 1) both;
    filter: drop-shadow(0 0 40px var(--red-glow));
}
@keyframes heroCar {
    from { opacity: 0; transform: translateX(60px) scale(0.8); }
    to   { opacity: 1; transform: translateX(0) scale(1); }
}

/* ═══════════════════════════════════════════════
   VITRINE / GRID
   ═══════════════════════════════════════════════ */
.vitrine {
    max-width: 1200px;
    margin: 0 auto;
    padding: 3rem 1.25rem;
}
.vitrine > h2 {
    font-family: var(--font-display);
    font-size: clamp(1.8rem, 5vw, 2.8rem);
    letter-spacing: 0.05em;
    margin-bottom: 1.5rem;
    color: #fff;
}
.vitrine > h2::after {
    content: '';
    display: block;
    width: 48px;
    height: 3px;
    background: var(--red);
    margin-top: 0.4rem;
    border-radius: 2px;
}

/* Filter buttons */
.filter-buttons {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}
.filter-btn {
    padding: 0.5rem 1.2rem;
    border-radius: 50px;
    border: 1px solid var(--border);
    background: transparent;
    color: var(--muted);
    font-family: var(--font-body);
    font-weight: 700;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s;
}
.filter-btn.active,
.filter-btn:hover {
    background: var(--red);
    border-color: var(--red);
    color: #fff;
}

/* Car grid */
.voitures-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.25rem;
}

/* Car card */
.voiture-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}
.voiture-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 40px rgba(0,0,0,0.5), 0 0 0 1px rgba(230,57,70,0.3);
    border-color: rgba(230,57,70,0.3);
}
.voiture-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    display: block;
    transition: transform 0.4s ease;
}
.voiture-card:hover .voiture-image { transform: scale(1.04); }

.voiture-info {
    padding: 1rem 1.1rem 1.2rem;
}
.voiture-info h3 {
    font-weight: 900;
    font-size: 1.05rem;
    color: #fff;
    margin-bottom: 0.5rem;
}
.voiture-details {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    font-size: 0.8rem;
    color: var(--muted);
    margin-bottom: 0.75rem;
}
.voiture-badge {
    padding: 0.2rem 0.55rem;
    border-radius: 50px;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.badge-neuf     { background: rgba(34,197,94,0.15); color: #4ade80; }
.badge-occasion { background: rgba(251,191,36,0.15); color: #fbbf24; }

.voiture-prix {
    font-family: var(--font-display);
    font-size: 1.35rem;
    letter-spacing: 0.05em;
    color: var(--red);
}

/* ═══════════════════════════════════════════════
   MODALS
   ═══════════════════════════════════════════════ */
.modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: rgba(0,0,0,0.75);
    backdrop-filter: blur(6px);
    align-items: center;
    justify-content: center;
    padding: 1rem;
}
.modal.open,
.modal[style*="flex"] { display: flex !important; }
.modal-content {
    background: var(--dark2);
    border: 1px solid var(--border);
    border-radius: 16px;
    width: 100%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    animation: modalIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes modalIn {
    from { opacity: 0; transform: scale(0.9) translateY(20px); }
    to   { opacity: 1; transform: scale(1) translateY(0); }
}
.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    background: var(--dark2);
    z-index: 1;
}
.modal-header h2 {
    font-family: var(--font-display);
    font-size: 1.4rem;
    letter-spacing: 0.05em;
    color: #fff;
}
.close-modal {
    cursor: pointer;
    font-size: 1.5rem;
    color: var(--muted);
    transition: color 0.2s;
    line-height: 1;
    padding: 0.2rem 0.5rem;
}
.close-modal:hover { color: var(--red); }

/* Tracking form */
#trackingForm { padding: 1.5rem; }
.form-group { margin-bottom: 1.25rem; }
.form-group label {
    display: block;
    font-weight: 700;
    font-size: 0.85rem;
    margin-bottom: 0.5rem;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.form-group input {
    width: 100%;
    padding: 0.8rem 1rem;
    background: var(--dark3);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    font-family: var(--font-body);
    font-size: 1rem;
    transition: border-color 0.2s;
    outline: none;
}
.form-group input:focus { border-color: var(--red); }

/* Contact modal */
.contact-modal-body { padding: 1.5rem; }
.contact-section {
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border);
}
.contact-section:last-child { border-bottom: none; margin-bottom: 0; }
.contact-section h3 {
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--muted);
    margin-bottom: 0.75rem;
}
.contact-links { display: flex; flex-direction: column; gap: 0.4rem; }
.contact-link {
    display: inline-block;
    color: var(--text) !important;
    font-size: 1rem;
    padding: 0.5rem 0;
    transition: color 0.2s;
}
.contact-link:hover { color: var(--red) !important; }

.social-links { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.social-link {
    padding: 0.45rem 1rem;
    background: var(--dark3);
    border: 1px solid var(--border);
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text);
    transition: all 0.2s;
}
.social-link:hover {
    background: var(--red);
    border-color: var(--red);
    color: #fff;
}

/* Car modal body */
.car-modal-body { padding: 1.5rem; }
.car-carousel { position: relative; margin-bottom: 1.25rem; border-radius: 10px; overflow: hidden; }
.car-carousel img { width: 100%; height: 260px; object-fit: cover; }

.car-detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
}
.car-detail-item {
    background: var(--dark3);
    padding: 0.75rem;
    border-radius: 8px;
    border: 1px solid var(--border);
}
.car-detail-item .label {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--muted);
    margin-bottom: 0.25rem;
}
.car-detail-item .value {
    font-weight: 700;
    color: #fff;
}
.car-price-big {
    font-family: var(--font-display);
    font-size: 2rem;
    letter-spacing: 0.05em;
    color: var(--red);
    text-align: center;
    padding: 1rem;
    background: var(--dark3);
    border-radius: 10px;
    border: 1px solid rgba(230,57,70,0.2);
}

/* ═══════════════════════════════════════════════
   FOOTER
   ═══════════════════════════════════════════════ */
.footer {
    background: var(--dark2);
    border-top: 1px solid var(--border);
    padding: 2rem 1.25rem;
    margin-top: 3rem;
    text-align: center;
}
.footer-content { max-width: 1200px; margin: 0 auto; }
.footer-info { margin-bottom: 1rem; color: var(--muted); font-size: 0.9rem; line-height: 1.8; }
.footer-info strong { color: #fff; }
.footer p { font-size: 0.8rem; color: rgba(240,240,240,0.3); }

/* Error message */
.error-message {
    background: rgba(230,57,70,0.1);
    border: 1px solid rgba(230,57,70,0.3);
    color: var(--red);
    padding: 1rem 1.25rem;
    border-radius: var(--radius);
    margin-bottom: 1.5rem;
    text-align: center;
}

/* ═══════════════════════════════════════════════
   TRACKING PAGE
   ═══════════════════════════════════════════════ */
.tracking-container {
    max-width: 820px;
    margin: 2rem auto;
    padding: 0 1.25rem 3rem;
}
.tracking-container h1 {
    font-family: var(--font-display);
    font-size: clamp(1.8rem, 5vw, 2.8rem);
    letter-spacing: 0.05em;
    text-align: center;
    margin-bottom: 2rem;
}

/* Progress bar */
.progress-bar {
    width: 100%;
    height: 6px;
    background: rgba(255,255,255,0.08);
    border-radius: 10px;
    overflow: hidden;
    margin: 2rem 0;
}
.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--red-dark), var(--red));
    border-radius: 10px;
    transition: width 1s cubic-bezier(0.4,0,0.2,1);
    box-shadow: 0 0 12px var(--red-glow);
}

/* Tracking steps */
.tracking-steps {
    display: flex;
    justify-content: space-between;
    margin: 2.5rem 0;
    position: relative;
    gap: 0.25rem;
    overflow-x: auto;
    padding-bottom: 0.5rem;
}
.tracking-steps::before {
    content: '';
    position: absolute;
    top: 19px;
    left: 0;
    right: 0;
    height: 3px;
    background: rgba(255,255,255,0.08);
    z-index: 0;
}
.tracking-step {
    flex: 1;
    text-align: center;
    position: relative;
    z-index: 1;
    min-width: 70px;
}
.step-circle {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: var(--dark3);
    border: 2px solid rgba(255,255,255,0.1);
    margin: 0 auto 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 900;
    font-size: 0.85rem;
    color: var(--muted);
    transition: all 0.3s ease;
}
.tracking-step.completed .step-circle {
    background: var(--red);
    border-color: var(--red);
    color: #fff;
}
.tracking-step.active .step-circle {
    background: var(--red);
    border-color: var(--red);
    color: #fff;
    box-shadow: 0 0 0 5px var(--red-glow);
    animation: pulse 2s ease infinite;
}
@keyframes pulse {
    0%, 100% { box-shadow: 0 0 0 4px var(--red-glow); }
    50% { box-shadow: 0 0 0 8px rgba(230,57,70,0.1); }
}
.step-label {
    font-size: 0.72rem;
    color: var(--muted);
    line-height: 1.3;
}
.tracking-step.completed .step-label,
.tracking-step.active .step-label {
    color: var(--red);
    font-weight: 700;
}

/* Command details card */
.commande-details {
    background: var(--card);
    border: 1px solid var(--border);
    padding: 1.5rem;
    border-radius: var(--radius);
    margin-top: 2rem;
}
.commande-details h2 {
    font-family: var(--font-display);
    font-size: 1.4rem;
    letter-spacing: 0.04em;
    margin-bottom: 1.25rem;
    color: #fff;
}
.detail-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.85rem 0;
    border-bottom: 1px solid var(--border);
    gap: 1rem;
    flex-wrap: wrap;
}
.detail-row:last-child { border-bottom: none; }
.detail-label {
    font-weight: 700;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--muted);
}
.detail-value {
    color: var(--text);
    font-weight: 700;
    text-align: right;
}

/* Container tracking card */
.container-card {
    background: rgba(0, 102, 204, 0.08);
    border: 1px solid rgba(0, 102, 204, 0.3);
    border-left: 4px solid #0066cc;
    padding: 1.5rem;
    border-radius: var(--radius);
    margin-bottom: 1.5rem;
}
.container-card h2 { color: #4a9eff; font-family: var(--font-display); font-size: 1.3rem; letter-spacing: 0.04em; margin-bottom: 1rem; }
.btn-track {
    background: #0066cc;
    color: #fff;
    margin-top: 1rem;
}
.btn-track:hover { background: #0052a3; }

/* ═══════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════ */
@media (max-width: 768px) {
    /* Show hamburger, hide desktop nav */
    .hamburger { display: flex; }
    .nav-buttons { display: none; }

    /* Hero stack */
    .hero-container { flex-direction: column; text-align: center; }
    .hero-right { order: -1; }
    .hero-content p { margin: 0.75rem auto 0; }
    .hero-image { width: clamp(120px, 50vw, 200px); }

    /* Grid single column on small phones */
    .voitures-grid { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }

    /* Car detail grid full-width */
    .car-detail-grid { grid-template-columns: 1fr; }

    /* Tracking steps scroll on mobile */
    .tracking-steps { flex-wrap: nowrap; }
    .tracking-step { min-width: 60px; }
    .step-label { font-size: 0.65rem; }

    .detail-row { flex-direction: column; align-items: flex-start; }
    .detail-value { text-align: left; }
}

@media (max-width: 480px) {
    .voitures-grid { grid-template-columns: 1fr; }
    .hero { padding: 2rem 1rem; }
}

/* ═══════════════════════════════════════════════
   SCROLLBAR
   ═══════════════════════════════════════════════ */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--dark); }
::-webkit-scrollbar-thumb { background: rgba(230,57,70,0.4); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--red); }
