/* =========================================================
   B2K AUTO — feuille de style
   Couleurs reprises du logo : noir chromé + rouge
   ========================================================= */
:root {
    /* Fond du site : noir. Les "cases" (cartes) sont blanches. */
    --bg: #0b0b0d;
    --bg-alt: #121216;
    --text: #f3f3f5;
    --surface: #ffffff;
    --ink: #121215;
    --ink-2: #2b2b31;
    --muted: #a3a3ad;
    --line: rgba(255, 255, 255, .12);
    --red-bright: #ff3036;
    --red: #c3161c;
    --red-dark: #9b0f14;
    --red-soft: #fdecec;
    --dark: #0f0f12;
    --wa: #1fb355;
    --wa-dark: #178a41;
    --ok: #138a4b;
    --ok-soft: #e6f6ed;
    --radius: 16px;
    --radius-sm: 10px;
    --shadow: 0 1px 2px rgba(16, 16, 20, .05), 0 8px 24px rgba(16, 16, 20, .06);
    --shadow-lg: 0 2px 4px rgba(16, 16, 20, .06), 0 20px 48px rgba(16, 16, 20, .12);
    --font: 'Outfit', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    --font-ar: 'Cairo', 'Outfit', system-ui, sans-serif;
    --header-h: 76px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 12px); -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    font-family: var(--font);
    font-size: 16px;
    line-height: 1.6;
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
}
/* Cases blanches : on bascule les couleurs pour le contenu à l'intérieur */
.site-header, .feature, .brand-tile, .car-card, .contact-card, .car-panel, .card, .login-box, .stat, .admin-row, .search, .mq-item {
    --muted: #686873;
    --line: #e5e5ea;
    --bg-alt: #f4f4f6;
    color: var(--ink);
}
html[lang="ar"] body, [lang="ar"] { font-family: var(--font-ar); }
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, h4 { line-height: 1.15; margin: 0 0 .5em; letter-spacing: -.02em; }
html[lang="ar"] h1, html[lang="ar"] h2, html[lang="ar"] h3 { letter-spacing: 0; line-height: 1.35; }
h1 { font-size: clamp(2rem, 5vw, 3.4rem); font-weight: 800; }
h2 { font-size: clamp(1.6rem, 3.2vw, 2.4rem); font-weight: 700; }
h3 { font-size: 1.1rem; font-weight: 600; }
p { margin: 0 0 1em; }
.muted { color: var(--muted); }
.big { font-size: 1.12rem; }
code { background: var(--bg-alt); padding: 2px 6px; border-radius: 6px; font-size: .9em; }
[dir="rtl"] .flip-rtl { transform: scaleX(-1); }

.container { width: 100%; max-width: 1240px; margin-inline: auto; padding-inline: 20px; }
@media (max-width: 560px) { .container { padding-inline: 16px; } }

/* ---------- Boutons ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: .55em;
    padding: .8em 1.4em; border-radius: 999px; border: 1.5px solid transparent;
    font: inherit; font-weight: 600; font-size: .98rem; line-height: 1.2;
    cursor: pointer; transition: background .2s, color .2s, border-color .2s, transform .15s, box-shadow .2s;
    white-space: nowrap; text-align: center;
}
.btn:active { transform: translateY(1px); }
.btn-sm { padding: .55em 1em; font-size: .88rem; }
.btn-lg { padding: 1em 1.7em; font-size: 1.04rem; }
.btn-block { display: flex; width: 100%; }
.btn-accent { background: var(--red); color: #fff; }
.btn-accent:hover { background: var(--red-dark); box-shadow: 0 8px 22px rgba(195, 22, 28, .28); }
.btn-ghost { background: transparent; color: inherit; border-color: var(--line); }
.btn-ghost:hover { border-color: currentColor; }
.btn-shine { position: relative; overflow: hidden; }
.btn-shine::after {
    content: ""; position: absolute; top: 0; bottom: 0; width: 40%; left: -60%;
    background: linear-gradient(100deg, transparent, rgba(255, 255, 255, .45), transparent);
    animation: shine 3.6s ease-in-out 1.6s infinite;
}
@keyframes shine { 0% { left: -60%; } 35%, 100% { left: 130%; } }
.btn-wa { background: var(--wa); color: #fff; }
.btn-wa:hover { background: var(--wa-dark); box-shadow: 0 8px 22px rgba(31, 179, 85, .3); }
.btn-danger { background: var(--red-soft); color: var(--red); }
.btn-danger:hover { background: var(--red); color: #fff; }
.btn-sold { background: var(--ink); color: #fff; }
.btn-sold:hover { background: var(--red); }
.btn-disabled, .btn[disabled] { background: var(--bg-alt); color: var(--muted); cursor: not-allowed; }

/* ---------- Logo ---------- */
/* Le logo d'origine est carré avec beaucoup de blanc : on recadre sur le texte */
.logo { --h: 54px; position: relative; display: block; width: calc(var(--h) * 1.3); height: var(--h); overflow: hidden; flex: none; }
.logo img {
    position: absolute; max-width: none;
    width: calc(var(--h) * 1.78); height: auto;
    left: calc(var(--h) * -.27); top: calc(var(--h) * -.34);
    mix-blend-mode: multiply;
}

/* ---------- Header ---------- */
.site-header {
    position: sticky; top: 0; z-index: 50;
    background: #fff;
    backdrop-filter: saturate(160%) blur(12px); -webkit-backdrop-filter: saturate(160%) blur(12px);
    border-bottom: 1px solid var(--line);
}
.nav { display: flex; align-items: center; gap: 24px; height: var(--header-h); }
.menu { display: flex; gap: 4px; margin-inline-start: auto; }
.menu a {
    padding: .5em .9em; border-radius: 999px; font-weight: 500; color: var(--ink-2);
    transition: background .2s, color .2s;
}
.menu a:hover { background: var(--bg-alt); color: var(--ink); }
.menu a.active { color: var(--red); }
.nav-actions { display: flex; align-items: center; gap: 10px; }
.lang-switch {
    display: inline-flex; align-items: center; gap: .4em;
    padding: .5em .9em; border-radius: 999px; border: 1.5px solid var(--line);
    font-weight: 600; font-size: .9rem;
}
.lang-switch:hover { border-color: var(--ink); }
.lang-switch[lang="ar"] { font-family: var(--font-ar); }
.lang-switch[lang="fr"] { font-family: var(--font); }
.burger { display: none; width: 44px; height: 44px; border: 0; background: var(--bg-alt); border-radius: 12px; cursor: pointer; padding: 12px 11px; flex-direction: column; justify-content: space-between; }
.burger span { display: block; height: 2px; background: var(--ink); border-radius: 2px; transition: transform .25s, opacity .2s; }
.burger[aria-expanded="true"] span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
.burger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.burger[aria-expanded="true"] span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

@media (max-width: 980px) {
    .nav-phone { display: none; }
    .burger { display: flex; }
    .menu {
        position: absolute; inset-inline: 0; top: var(--header-h);
        flex-direction: column; gap: 0; padding: 8px 16px 18px;
        background: #fff; border-bottom: 1px solid var(--line); box-shadow: var(--shadow-lg);
        display: none;
    }
    .menu.open { display: flex; }
    .menu a { padding: .9em .6em; border-radius: 10px; font-size: 1.05rem; }
    .nav-actions { margin-inline-start: auto; }
}
@media (max-width: 420px) {
    .logo { --h: 46px; }
    .lang-switch .fa-globe { display: none; }
}

/* ---------- Sections ---------- */
.section { padding: 96px 0; }
.section-tight { padding: 40px 0 96px; }
.section-alt { background: var(--bg-alt); }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 36px; flex-wrap: wrap; }
.section-head h2 { margin: 0; }
.kicker {
    display: inline-flex; align-items: center; gap: .5em;
    font-size: .8rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase;
    color: var(--red-bright); margin-bottom: 12px;
}
.contact-card .kicker { color: var(--red); }
html[lang="ar"] .kicker { letter-spacing: 0; font-size: .92rem; }
.kicker::before { content: ""; width: 22px; height: 2px; background: currentColor; border-radius: 2px; }
.link-more { display: inline-flex; align-items: center; gap: .5em; font-weight: 600; color: var(--red-bright); }
.link-more:hover { gap: .8em; }
.link-more, .link-more i { transition: gap .2s; }
.empty { text-align: center; color: var(--muted); padding: 60px 20px; display: flex; flex-direction: column; align-items: center; gap: 14px; font-size: 1.05rem; }
.empty i { font-size: 2.6rem; color: var(--line); }
@media (max-width: 700px) { .section { padding: 64px 0; } }

/* ---------- Hero ---------- */
.hero {
    position: relative; overflow: hidden; isolation: isolate;
    background: radial-gradient(1200px 500px at 85% 10%, rgba(195, 22, 28, .45), transparent 60%), linear-gradient(160deg, #1b1b20 0%, #0b0b0d 70%);
    color: #fff; min-height: min(86vh, 760px); display: flex; align-items: flex-end;
}
.hero-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -2; }
.hero-shade { position: absolute; inset: 0; z-index: -1; background: linear-gradient(0deg, rgba(8, 8, 10, .92) 0%, rgba(8, 8, 10, .55) 45%, rgba(8, 8, 10, .25) 100%); }
.hero:not(.has-image) .hero-shade { background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='1600' height='600' viewBox='0 0 1600 600'%3E%3Cpath d='M-50 470 C 400 330, 900 170, 1650 140' fill='none' stroke='%23c3161c' stroke-width='6' stroke-linecap='round' opacity='.85'/%3E%3C/svg%3E") center 70% / cover no-repeat; opacity: .8; }
.hero-inner { padding-top: 120px; padding-bottom: 72px; position: relative; }
.hero .kicker { color: #fff; background: rgba(255, 255, 255, .1); padding: .5em 1em; border-radius: 999px; backdrop-filter: blur(6px); }
.hero .kicker::before { display: none; }
.hero h1 { max-width: 15ch; margin-bottom: .35em; }
html[lang="ar"] .hero h1 { max-width: 18ch; }
.hero .lead { max-width: 56ch; font-size: 1.14rem; color: rgba(255, 255, 255, .82); }
.hero-cta { display: flex; gap: 12px; flex-wrap: wrap; margin: 30px 0 44px; }
.hero .btn-ghost { color: #fff; border-color: rgba(255, 255, 255, .35); }
.hero .btn-ghost:hover { border-color: #fff; background: rgba(255, 255, 255, .08); }
.hero-stats { list-style: none; padding: 0; margin: 0; display: flex; gap: 40px; flex-wrap: wrap; }
.hero-stats li { display: flex; flex-direction: column; }
.hero-stats strong { font-size: 1.8rem; font-weight: 700; line-height: 1.1; }
.hero-stats span { color: rgba(255, 255, 255, .65); font-size: .9rem; }
.hero-car {
    position: absolute; inset-inline-end: 20px; bottom: 72px;
    display: inline-flex; align-items: center; gap: .7em;
    padding: .7em 1.1em; border-radius: 999px; background: rgba(255, 255, 255, .12);
    backdrop-filter: blur(8px); font-weight: 600; font-size: .92rem;
}
.hero-car:hover { background: rgba(255, 255, 255, .22); }
@media (max-width: 860px) {
    .hero-car { position: static; margin-top: 28px; }
    .hero-inner { padding-top: 90px; padding-bottom: 48px; }
    .hero-stats { gap: 28px; }
}

/* ---------- À propos ---------- */
.about-grid { display: grid; grid-template-columns: 1.1fr 1fr; gap: 64px; align-items: center; }
.features { display: grid; gap: 14px; }
.feature {
    display: flex; gap: 18px; align-items: flex-start;
    padding: 22px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface);
    transition: border-color .2s, box-shadow .2s;
}
.feature:hover { border-color: transparent; box-shadow: var(--shadow-lg); }
.feature > i {
    flex: none; width: 48px; height: 48px; display: grid; place-items: center;
    border-radius: 12px; background: var(--red-soft); color: var(--red); font-size: 1.25rem;
}
.feature h3 { margin-bottom: .25em; }
.feature p { margin: 0; color: var(--muted); font-size: .96rem; }
@media (max-width: 860px) { .about-grid { grid-template-columns: 1fr; gap: 36px; } }

/* ---------- Marques ---------- */
.brands-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 14px; }
.brand-tile {
    display: flex; flex-direction: column; align-items: center; gap: 6px;
    padding: 26px 16px 20px; border-radius: var(--radius); background: var(--surface);
    border: 1px solid var(--line); text-align: center;
    transition: transform .2s, box-shadow .2s, border-color .2s;
}
.brand-tile:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); border-color: transparent; }
.brand-logo { height: 64px; display: grid; place-items: center; width: 100%; }
.brand-logo img { max-height: 60px; max-width: 120px; object-fit: contain; }
.brand-word { font-weight: 800; font-size: 1.25rem; letter-spacing: .02em; text-transform: uppercase; color: var(--ink); }
.brand-tile:hover .brand-word { color: var(--red); }
.brand-name { font-weight: 600; font-size: .95rem; }
.brand-count { font-size: .8rem; color: var(--muted); }
@media (max-width: 480px) { .brands-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; } }

/* ---------- Cartes véhicules ---------- */
.cars-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 22px; }
@media (max-width: 380px) { .cars-grid { grid-template-columns: 1fr; } }
.car-card {
    display: flex; flex-direction: column; border-radius: var(--radius); overflow: hidden;
    background: var(--surface); border: 1px solid var(--line);
    transition: transform .25s, box-shadow .25s, border-color .25s;
}
.car-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); border-color: transparent; }
.car-media { position: relative; aspect-ratio: 16 / 10; background: var(--bg-alt); overflow: hidden; }
.car-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s; }
.car-card:hover .car-media img { transform: scale(1.04); }
.car-noimg { width: 100%; height: 100%; display: grid; place-items: center; color: #c9c9d0; font-size: 3rem; min-height: 200px; }
.badge {
    position: absolute; top: 12px; inset-inline-start: 12px;
    padding: .3em .8em; border-radius: 999px; font-size: .78rem; font-weight: 700;
    background: #fff; box-shadow: 0 2px 8px rgba(0, 0, 0, .12);
}
.badge.inline { position: static; display: inline-block; box-shadow: none; }
.badge-ok { color: var(--ok); background: var(--ok-soft); }
.car-media .badge-ok { background: #fff; }
.badge-sold { color: #fff; background: var(--red); }
.car-card.is-sold .car-media img { filter: grayscale(1) brightness(.85); }
.sold-ribbon {
    position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%) rotate(-12deg);
    padding: .35em 1.4em; border: 3px solid #fff; color: #fff; background: rgba(195, 22, 28, .92);
    font-weight: 800; font-size: 1.3rem; letter-spacing: .12em; text-transform: uppercase; border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, .25); pointer-events: none;
}
.sold-ribbon.big { font-size: 2rem; }
html[lang="ar"] .sold-ribbon { letter-spacing: 0; }
.car-body { padding: 18px 20px 20px; display: flex; flex-direction: column; flex: 1; }
.car-brand { font-size: .76rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--red); }
html[lang="ar"] .car-brand { letter-spacing: .04em; }
.car-title { font-size: 1.2rem; margin: 4px 0 12px; font-weight: 700; }
.chips { list-style: none; padding: 0; margin: 0 0 16px; display: flex; flex-wrap: wrap; gap: 6px; }
.chips li { font-size: .8rem; padding: .3em .7em; border-radius: 999px; background: var(--bg-alt); color: var(--ink-2); }
.car-foot { margin-top: auto; display: flex; align-items: center; justify-content: space-between; padding-top: 14px; border-top: 1px solid var(--line); }
.car-price { font-weight: 700; font-size: 1.1rem; }
.car-go { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; background: var(--bg-alt); transition: background .2s, color .2s; }
[dir="rtl"] .car-go i { transform: scaleX(-1); }
.car-card:hover .car-go { background: var(--red); color: #fff; }

/* ---------- Liste véhicules ---------- */
.page-head { background: var(--bg-alt); padding: 56px 0 40px; border-bottom: 1px solid var(--line); }
.page-head h1 { font-size: clamp(1.9rem, 4vw, 2.8rem); margin-bottom: .2em; }
.page-head p { margin: 0; }
.filters { display: flex; gap: 14px; flex-wrap: wrap; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.search {
    display: flex; align-items: center; gap: 10px; flex: 1 1 340px; max-width: 520px;
    background: #fff; border: 1.5px solid var(--line); border-radius: 999px; padding: 5px 5px 5px 18px;
}
[dir="rtl"] .search { padding: 5px 18px 5px 5px; }
.search:focus-within { border-color: var(--ink); }
.search i { color: var(--muted); }
.search input { flex: 1; min-width: 0; border: 0; outline: 0; font: inherit; background: transparent; padding: 6px 0; }
.seg { display: inline-flex; background: var(--bg-alt); padding: 4px; border-radius: 999px; }
.seg a { padding: .5em 1.1em; border-radius: 999px; font-weight: 600; font-size: .9rem; color: var(--muted); }
.seg a.on { background: #fff; color: var(--ink); box-shadow: var(--shadow); }
.brand-chips { display: flex; gap: 8px; overflow-x: auto; padding: 4px 0 18px; margin-bottom: 18px; scrollbar-width: thin; }
.brand-chips a {
    flex: none; padding: .5em 1.1em; border-radius: 999px; border: 1.5px solid var(--line);
    font-weight: 600; font-size: .9rem; transition: border-color .2s, background .2s, color .2s;
}
.brand-chips a:hover { border-color: #fff; }
.brand-chips a.on { background: var(--red); border-color: var(--red); color: #fff; }
.seg a:not(.on):hover { color: #fff; }

/* ---------- Page véhicule ---------- */
.back-link { display: inline-flex; align-items: center; gap: .5em; font-weight: 600; color: var(--muted); margin-bottom: 22px; }
.back-link:hover { color: #fff; }
.car-layout { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(320px, 1fr); gap: 36px; align-items: start; }
@media (max-width: 960px) { .car-layout { grid-template-columns: 1fr; gap: 24px; } }
.gallery-main {
    position: relative; aspect-ratio: 16 / 10; border-radius: var(--radius); overflow: hidden; background: var(--bg-alt);
}
.gallery-main img { width: 100%; height: 100%; object-fit: cover; cursor: zoom-in; }
.gallery-main.is-sold img { filter: grayscale(.85); }
.g-nav, .g-zoom, .lb-nav, .lb-close {
    position: absolute; border: 0; cursor: pointer; display: grid; place-items: center;
    background: #fff; color: var(--ink); box-shadow: 0 4px 14px rgba(0, 0, 0, .18);
    transition: background .2s, transform .2s;
}
.g-nav { top: 50%; transform: translateY(-50%); width: 46px; height: 46px; border-radius: 50%; font-size: 1rem; }
.g-nav:hover { background: #fff; }
.g-prev { left: 14px; }
.g-next { right: 14px; }
.g-zoom { bottom: 14px; inset-inline-end: 14px; display: inline-flex; gap: .5em; padding: .55em 1em; border-radius: 999px; font: inherit; font-weight: 600; font-size: .85rem; }
.thumbs { display: flex; gap: 10px; margin-top: 12px; overflow-x: auto; padding-bottom: 6px; scrollbar-width: thin; }
.thumb { flex: none; width: 104px; aspect-ratio: 4 / 3; border-radius: 10px; overflow: hidden; border: 2px solid transparent; padding: 0; cursor: pointer; background: var(--bg-alt); opacity: .7; transition: opacity .2s, border-color .2s; }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb:hover { opacity: 1; }
.thumb.on { border-color: var(--red); opacity: 1; }

.car-panel {
    position: sticky; top: calc(var(--header-h) + 20px);
    padding: 28px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow);
    display: flex; flex-direction: column; gap: 12px;
}
.car-panel h1 { font-size: clamp(1.6rem, 3vw, 2.1rem); margin: 0; }
.car-panel .badge { align-self: flex-start; }
.panel-price { display: flex; flex-direction: column; padding: 14px 0; border-block: 1px solid var(--line); margin: 6px 0; }
.panel-price strong { font-size: 1.8rem; line-height: 1.2; }
.sold-note { margin: 0; padding: 12px 14px; border-radius: var(--radius-sm); background: var(--red-soft); color: var(--red-dark); font-size: .93rem; }
.panel-h { font-size: 1.05rem; margin: 14px 0 0; }
.specs { margin: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--line); border-radius: var(--radius-sm); overflow: hidden; border: 1px solid var(--line); }
.specs div { background: #fff; padding: 10px 12px; }
.specs dt { font-size: .78rem; color: var(--muted); }
.specs dd { margin: 0; font-weight: 600; }
@media (max-width: 960px) { .car-panel { position: static; padding: 22px; } }

.car-desc { margin-top: 44px; max-width: 860px; }
.car-desc h2 { font-size: 1.5rem; }
.desc-text { color: rgba(255, 255, 255, .82); font-size: 1.04rem; line-height: 1.8; white-space: normal; }

/* Lightbox */
.lightbox { position: fixed; inset: 0; z-index: 100; background: rgba(8, 8, 10, .96); display: grid; place-items: center; padding: 60px 70px; }
.lightbox[hidden] { display: none; }
.lightbox img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 8px; }
.lb-close { top: 16px; right: 16px; width: 46px; height: 46px; border-radius: 50%; font-size: 1.2rem; }
.lb-nav { top: 50%; transform: translateY(-50%); width: 50px; height: 50px; border-radius: 50%; }
.lb-prev { left: 14px; }
.lb-next { right: 14px; }
.lb-count { position: absolute; bottom: 18px; left: 50%; transform: translateX(-50%); color: rgba(255, 255, 255, .8); font-weight: 600; direction: ltr; }
@media (max-width: 640px) { .lightbox { padding: 60px 8px; } .lb-nav { top: auto; bottom: 8px; transform: none; } }

/* ---------- Contact ---------- */
.contact-grid { display: grid; grid-template-columns: 1fr 1.25fr; gap: 28px; align-items: stretch; }
.contact-card { padding: 36px; background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); }
.contact-list { list-style: none; padding: 0; margin: 24px 0 28px; display: grid; gap: 22px; }
.contact-list li { display: flex; gap: 16px; align-items: flex-start; }
.contact-list li > i { flex: none; width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: var(--red-soft); color: var(--red); }
.contact-list strong { display: block; margin-bottom: 2px; }
.contact-list span, .contact-list a { display: block; color: var(--ink-2); }
.contact-list a:hover { color: var(--red); }
.contact-list .socials { margin-top: 6px; }
.contact-cta { display: flex; gap: 10px; flex-wrap: wrap; }
.map-wrap { border-radius: var(--radius); overflow: hidden; min-height: 420px; box-shadow: var(--shadow); background: #ddd; }
.map-wrap iframe { width: 100%; height: 100%; min-height: 420px; border: 0; display: block; }
@media (max-width: 900px) { .contact-grid { grid-template-columns: 1fr; } .contact-card { padding: 26px; } .map-wrap, .map-wrap iframe { min-height: 320px; } }

.socials { display: flex; gap: 8px; flex-wrap: wrap; }
.socials a {
    width: 42px; height: 42px; border-radius: 50%; display: grid !important; place-items: center;
    background: var(--bg-alt); color: var(--ink); font-size: 1.05rem; transition: background .2s, color .2s, transform .2s;
}
.socials a:hover { background: var(--red); color: #fff; transform: translateY(-2px); }

/* ---------- Footer ---------- */
.site-footer { background: var(--dark); color: rgba(255, 255, 255, .85); padding: 64px 0 0; }
.site-footer .logo { --h: 62px; background: #fff; border-radius: 14px; width: calc(var(--h) * 1.5); }
.site-footer .logo img { mix-blend-mode: normal; left: calc(var(--h) * -.16); }
.site-footer .muted { color: rgba(255, 255, 255, .55); margin-top: 16px; }
.site-footer h4 { color: #fff; font-size: 1rem; margin-bottom: 16px; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 40px; padding-bottom: 48px; }
.footer-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.footer-list i { width: 18px; color: var(--red); }
.footer-list a:hover { color: #fff; text-decoration: underline; }
.site-footer .socials a { background: rgba(255, 255, 255, .08); color: #fff; }
.site-footer .socials a:hover { background: var(--red); }
.footer-bottom { border-top: 1px solid rgba(255, 255, 255, .1); padding-block: 22px; font-size: .88rem; color: rgba(255, 255, 255, .5); }
@media (max-width: 760px) { .footer-grid { grid-template-columns: 1fr; gap: 30px; } }

.wa-float {
    position: fixed; bottom: 20px; inset-inline-end: 20px; z-index: 60;
    width: 60px; height: 60px; border-radius: 50%; display: grid; place-items: center;
    background: var(--wa); color: #fff; font-size: 1.9rem; box-shadow: 0 10px 28px rgba(31, 179, 85, .45);
    transition: transform .2s;
}
.wa-float:hover { transform: scale(1.08); }

/* =========================================================
   ADMIN
   ========================================================= */
body.admin { background: var(--bg-alt); min-height: 100vh; }
.brand-wrap { display: flex; align-items: center; gap: 10px; }
.admin-tag { font-size: .72rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; background: var(--ink); color: #fff; padding: .3em .7em; border-radius: 6px; }
.admin .menu a { font-size: .92rem; }
.admin .menu a i { margin-inline-end: 4px; opacity: .7; }
.admin-main { padding: 32px 0 80px; }
.admin-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.admin-head h1 { font-size: 1.9rem; margin: 0; }
.flash { padding: 14px 18px; border-radius: var(--radius-sm); margin-bottom: 20px; font-weight: 500; }
.flash-ok { background: var(--ok-soft); color: var(--ok); }
.flash-err { background: var(--red-soft); color: var(--red-dark); }

.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 22px; }
.stat { background: #fff; border-radius: var(--radius); padding: 18px 20px; border: 2px solid transparent; display: flex; flex-direction: column; box-shadow: var(--shadow); }
.stat strong { font-size: 1.9rem; line-height: 1.1; }
.stat span { color: var(--muted); font-size: .9rem; }
.stat.on { border-color: var(--red); }

.admin-list { display: grid; gap: 10px; }
.admin-row {
    display: grid; grid-template-columns: 96px 1fr auto auto; gap: 18px; align-items: center;
    background: #fff; padding: 12px; border-radius: var(--radius); box-shadow: var(--shadow);
}
.admin-row.is-sold .admin-thumb img { filter: grayscale(1); }
.admin-thumb { width: 96px; aspect-ratio: 4 / 3; border-radius: 10px; overflow: hidden; background: var(--bg-alt); display: grid; place-items: center; color: #c5c5cc; font-size: 1.6rem; }
.admin-thumb img { width: 100%; height: 100%; object-fit: cover; }
.admin-info { min-width: 0; display: flex; flex-direction: column; }
.admin-info strong { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.admin-info .muted { font-size: .88rem; }
.admin-info .fa-star { color: #e0a100; }
.admin-actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.admin-actions form { margin: 0; }
@media (max-width: 820px) {
    .admin-row { grid-template-columns: 80px 1fr; gap: 12px; }
    .admin-thumb { width: 80px; }
    .admin-row .badge { grid-column: 2; justify-self: start; }
    .admin-actions { grid-column: 1 / -1; justify-content: flex-start; }
}

.card { background: #fff; border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); margin-bottom: 18px; }
.card h2 { font-size: 1.2rem; margin-bottom: 16px; }
.card.narrow { max-width: 560px; }
.form { display: grid; gap: 14px; }
.form label { display: flex; flex-direction: column; gap: 6px; font-weight: 600; font-size: .9rem; color: var(--ink-2); }
.form small { font-weight: 400; }
.form small a { color: var(--red); }
.form input[type="text"], .form input[type="email"], .form input[type="number"], .form input[type="password"], .form input[type="search"], .form select, .form textarea {
    font: inherit; font-weight: 400; color: var(--ink); width: 100%;
    padding: .75em .9em; border: 1.5px solid var(--line); border-radius: var(--radius-sm); background: #fff;
    transition: border-color .2s, box-shadow .2s;
}
.form textarea { resize: vertical; line-height: 1.6; }
.form textarea[dir="rtl"] { font-family: var(--font-ar); }
.form input:focus, .form select:focus, .form textarea:focus { outline: 0; border-color: var(--ink); box-shadow: 0 0 0 3px rgba(18, 18, 21, .08); }
.form input[type="file"] { font: inherit; font-size: .88rem; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 18px; }
@media (max-width: 700px) { .grid-2 { grid-template-columns: 1fr; } }

.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; margin-bottom: 16px; }
.photo-item { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: #fff; }
.photo-item img { aspect-ratio: 4 / 3; width: 100%; object-fit: cover; }
.ph-opt { flex-direction: row !important; align-items: center; gap: 8px !important; padding: 6px 10px; font-weight: 500 !important; font-size: .85rem !important; cursor: pointer; }
.ph-opt.danger { color: var(--red); }
.photo-item:has(input[type="checkbox"]:checked) img { opacity: .3; }
.dropzone {
    flex-direction: column !important; align-items: center; justify-content: center; text-align: center;
    padding: 30px 20px; border: 2px dashed var(--line); border-radius: var(--radius); cursor: pointer; color: var(--muted) !important;
    transition: border-color .2s, background .2s;
}
.dropzone:hover { border-color: var(--red); background: var(--red-soft); }
.dropzone i { font-size: 2rem; color: var(--red); }
.dropzone input { max-width: 100%; margin-top: 6px; }
.upload-preview { display: grid; grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: 8px; margin-top: 12px; }
.upload-preview img { aspect-ratio: 4 / 3; object-fit: cover; border-radius: 8px; width: 100%; }
.upload-status { grid-column: 1 / -1; font-size: .88rem; color: var(--muted); }

.switch { flex-direction: row !important; align-items: center; gap: 12px !important; cursor: pointer; padding: 8px 0; font-size: 1rem !important; }
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch span { width: 46px; height: 26px; border-radius: 999px; background: #d4d4da; position: relative; transition: background .2s; flex: none; }
.switch span::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: transform .2s; box-shadow: 0 1px 3px rgba(0, 0, 0, .25); }
.switch input:checked + span { background: var(--red); }
.switch input:checked + span::after { transform: translateX(20px); }
.switch input:focus-visible + span { outline: 2px solid var(--ink); outline-offset: 2px; }

.form-bar {
    position: sticky; bottom: 0; z-index: 5; display: flex; justify-content: flex-end; gap: 10px;
    padding: 14px 0; background: linear-gradient(transparent, var(--bg-alt) 35%);
}

.brand-add { grid-template-columns: 1.2fr 1.2fr .5fr auto; align-items: end; }
@media (max-width: 800px) { .brand-add { grid-template-columns: 1fr; } }
.brand-admin-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.brand-admin { display: grid; grid-template-columns: 90px 1fr auto; gap: 10px 14px; align-items: center; margin: 0; }
.brand-admin .brand-logo { height: 56px; }
.brand-admin .brand-word { font-size: .95rem; }
.brand-meta { display: flex; flex-direction: column; min-width: 0; }
.brand-meta .muted { font-size: .82rem; }
.brand-admin details { grid-column: 1 / 3; }
.brand-admin summary { list-style: none; display: inline-flex; }
.brand-admin summary::-webkit-details-marker { display: none; }
.brand-admin details[open] form { margin-top: 12px; }
.brand-admin > form { grid-column: 3; grid-row: 2; justify-self: end; }

.login-box { max-width: 400px; margin: 8vh auto 0; background: #fff; padding: 36px; border-radius: 20px; box-shadow: var(--shadow-lg); text-align: center; }
.login-box .logo { --h: 90px; margin: 0 auto 12px; }
.login-box h1 { font-size: 1.4rem; margin-bottom: 20px; }
.login-box .form { text-align: start; }

/* =========================================================
   MOTION — page d'accueil
   ========================================================= */

/* ----- Hero animé ----- */
.hero:not(.has-image) .hero-shade { background: none; }
.hero { background: radial-gradient(900px 480px at 80% 0%, rgba(195, 22, 28, .35), transparent 60%), linear-gradient(170deg, #17171b 0%, #070708 75%); }
.hero.has-image .hero-bg { animation: kenburns 22s ease-in-out infinite alternate; }
@keyframes kenburns { from { transform: scale(1); } to { transform: scale(1.12) translate(-1.5%, -1%); } }

.hero-glow { position: absolute; z-index: -1; border-radius: 50%; filter: blur(70px); opacity: .55; pointer-events: none; }
.hero-glow.g1 { width: 420px; height: 420px; background: #c3161c; top: -120px; inset-inline-end: -80px; animation: float1 14s ease-in-out infinite; }
.hero-glow.g2 { width: 320px; height: 320px; background: #6e0b0e; bottom: -140px; inset-inline-start: 10%; animation: float2 18s ease-in-out infinite; }
@keyframes float1 { 50% { transform: translate(-80px, 60px) scale(1.15); } }
@keyframes float2 { 50% { transform: translate(120px, -40px) scale(.9); } }

.hero-swoosh { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -1; pointer-events: none; }
.hero-swoosh path { fill: none; stroke: url(#sw); stroke-linecap: round; stroke-dasharray: 2000; stroke-dashoffset: 2000; }
.hero-swoosh .sw1 { stroke-width: 7; animation: draw 2.4s cubic-bezier(.65, 0, .35, 1) .3s forwards, glowpulse 4s ease-in-out 2.7s infinite; }
.hero-swoosh .sw2 { stroke-width: 2; opacity: .5; animation: draw 2.8s cubic-bezier(.65, 0, .35, 1) .7s forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes glowpulse { 50% { filter: drop-shadow(0 0 10px rgba(255, 48, 54, .8)); } }

.anim-up { opacity: 0; transform: translateY(26px); animation: up .9s cubic-bezier(.2, .7, .2, 1) forwards; animation-delay: calc(var(--d, 0) * 120ms + 150ms); }
@keyframes up { to { opacity: 1; transform: none; } }

.scroll-hint { position: absolute; bottom: 22px; left: 50%; transform: translateX(-50%); width: 26px; height: 42px; border: 2px solid rgba(255, 255, 255, .45); border-radius: 14px; }
.scroll-hint span { position: absolute; top: 7px; left: 50%; width: 4px; height: 8px; margin-left: -2px; border-radius: 2px; background: var(--red-bright); animation: wheel 1.8s ease-in-out infinite; }
@keyframes wheel { 0% { opacity: 0; transform: translateY(0); } 30% { opacity: 1; } 100% { opacity: 0; transform: translateY(14px); } }
@media (max-width: 860px) { .scroll-hint { display: none; } }

/* ----- Logos de marques (masque SVG coloré en CSS) ----- */
.brand-svg { display: block; width: 100%; height: 100%; background-color: currentColor; -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat; -webkit-mask-position: center; mask-position: center; -webkit-mask-size: contain; mask-size: contain; }

/* ----- Bande défilante ----- */
.marquee-band {
    position: relative; padding: 34px 0; overflow: hidden;
    background: linear-gradient(180deg, #070708, #0e0e11);
    border-block: 1px solid rgba(255, 255, 255, .06);
    display: grid; gap: 16px;
}
.marquee {
    overflow: hidden;
    -webkit-mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
    mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
}
.marquee-track { display: flex; gap: 16px; width: max-content; animation: marquee 45s linear infinite; }
.marquee.reverse .marquee-track { animation-direction: reverse; animation-duration: 55s; }
.marquee:hover .marquee-track { animation-play-state: paused; }
@keyframes marquee { to { transform: translateX(-33.3333%); } }
.mq-item {
    flex: none; display: flex; align-items: center; gap: 14px;
    padding: 12px 22px 12px 14px; border-radius: 999px; background: #fff;
    box-shadow: 0 6px 20px rgba(0, 0, 0, .35);
    transition: transform .3s, box-shadow .3s;
}
.mq-item:hover { transform: translateY(-3px); box-shadow: 0 10px 28px rgba(195, 22, 28, .45); }
.mq-logo {
    width: 46px; height: 46px; padding: 9px; border-radius: 50%; background: var(--ink); color: #fff;
    display: grid; place-items: center; overflow: hidden;
    animation: spin3d 6s ease-in-out infinite; animation-delay: calc(var(--i, 0) * -.6s);
}
.mq-logo img { max-width: 100%; max-height: 100%; object-fit: contain; filter: brightness(0) invert(1); }
.mq-logo .brand-word { font-size: .65rem; color: #fff; }
.mq-item:hover .mq-logo { background: var(--red); }
.mq-name { font-weight: 700; font-size: 1rem; white-space: nowrap; }
@keyframes spin3d { 0%, 70% { transform: perspective(300px) rotateY(0); } 85%, 100% { transform: perspective(300px) rotateY(360deg); } }

/* ----- Grille des marques (accueil) : logo + nom ----- */
.brands-section { position: relative; overflow: hidden; }
.brands-section::before {
    content: ""; position: absolute; width: 600px; height: 600px; border-radius: 50%;
    background: radial-gradient(circle, rgba(195, 22, 28, .22), transparent 65%);
    top: -200px; inset-inline-start: -200px; pointer-events: none;
}
.brands-grid { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 16px; position: relative; }
.brand-tile { padding: 30px 16px 22px; gap: 8px; position: relative; overflow: hidden; border: 0; }
.brand-tile::after {
    content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 4px; background: var(--red);
    transform: scaleX(0); transition: transform .35s cubic-bezier(.2, .7, .2, 1);
}
.brand-tile:hover { transform: translateY(-6px); box-shadow: 0 20px 40px rgba(195, 22, 28, .25); }
.brand-tile:hover::after { transform: scaleX(1); }
.brand-tile .brand-logo { height: 76px; width: 76px; color: var(--ink); transition: color .3s; perspective: 400px; }
.brand-tile .brand-logo > * { transition: transform .8s cubic-bezier(.2, .7, .2, 1); }
.brand-tile:hover .brand-logo { color: var(--red); }
.brand-tile:hover .brand-logo > * { transform: rotateY(360deg); }
.brand-tile .brand-logo img { max-height: 72px; max-width: 100%; }
.brand-tile .brand-name { font-weight: 800; font-size: 1.05rem; margin-top: 6px; }
.brand-tile .brand-count { color: var(--muted); }
@media (max-width: 480px) {
    .brands-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    .brand-tile .brand-logo { height: 60px; width: 60px; }
}

/* ----- Apparition au défilement ----- */
.js [data-reveal] { opacity: 0; transform: translateY(34px); transition: opacity .8s cubic-bezier(.2, .7, .2, 1), transform .8s cubic-bezier(.2, .7, .2, 1); transition-delay: calc(var(--d, 0) * 90ms); }
.js [data-reveal].is-in { opacity: 1; transform: none; }
.brand-tile[data-reveal].is-in:hover { transform: translateY(-6px); }
.feature { border: 0; }
.js .feature.is-in:hover, .feature:hover { transform: translateX(6px); }
.js [data-reveal].is-in:hover { transition-delay: 0s; }
[dir="rtl"] .feature:hover, .js[dir="rtl"] .feature.is-in:hover { transform: translateX(-6px); }
.feature { transition: transform .3s, box-shadow .3s; }

/* Admin : le logo intégré garde une taille correcte */
.brand-admin .brand-logo { width: 56px; color: var(--ink); }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
    .marquee-track { animation: none; }
    .anim-up, .js [data-reveal] { opacity: 1; transform: none; }
    .hero-swoosh path { stroke-dashoffset: 0; }
}

/* ---------- Version Netlify ---------- */
.setup-banner { display: flex; gap: 14px; align-items: flex-start; margin: 24px 0; padding: 18px 20px; border-radius: var(--radius); background: #fff4d6; color: #5c4400; }
.setup-banner i { font-size: 1.4rem; margin-top: 2px; }
.setup-banner code { background: rgba(0, 0, 0, .08); }
.pending-item { position: relative; }
.pending-item img { aspect-ratio: 4 / 3; object-fit: cover; border-radius: 8px; width: 100%; }
.pending-x { position: absolute; top: 4px; inset-inline-end: 4px; width: 26px; height: 26px; border-radius: 50%; border: 0; background: rgba(0, 0, 0, .7); color: #fff; font-size: 1.1rem; line-height: 1; cursor: pointer; }
.pending-x:hover { background: var(--red); }
.footer-bottom { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.admin-link { color: rgba(255, 255, 255, .45); font-size: .85rem; display: inline-flex; align-items: center; gap: .45em; }
.admin-link:hover { color: #fff; }
