/* ─────────────────────────────────────────────────────────────────────────
   featured-carousel.css — Design D v2 final (refonte 2026-05-22)
   Cf. Home Wireframes D v2 chosen direction · directions.jsx D2_Desktop/Mobile
   ───────────────────────────────────────────────────────────────────────── */

/* ── Section ────────────────────────────────────────────────────────── */

.fb-section {
    background: var(--paper, #FAF7F1);
    padding: clamp(20px, 2.5vw, 32px) 0 clamp(28px, 3.5vw, 48px);
    position: relative;
}

.fb-container {
    max-width: 1320px;
    margin: 0 auto;
    padding: 0 clamp(16px, 5vw, 80px);
}

/* ── En-tête (titre + curated chip + see all + nav buttons) ─────────── */

.fb-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
    flex-wrap: wrap;
}

.fb-title-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.fb-title {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: clamp(22px, 2.4vw, 30px);
    font-weight: 700;
    color: #1A1A2E;
    margin: 0;
    letter-spacing: -0.5px;
}

.fb-curated-chip {
    display: inline-flex;
    align-items: center;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    color: var(--primary, #FF6B35);
    padding: 4px 10px;
    border: 1px solid var(--primary, #FF6B35);
    border-radius: 999px;
    line-height: 1;
}

.fb-header-right {
    display: flex;
    align-items: center;
    gap: 14px;
}

.fb-see-all {
    font-size: 13px;
    font-weight: 700;
    color: var(--primary, #FF6B35);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: color 200ms ease;
}

.fb-see-all:hover {
    color: var(--primary-dark, #E55A2B);
}

.fb-see-all .fb-arrow {
    font-size: 16px;
    font-weight: 800;
    transition: transform 200ms ease;
}

.fb-see-all:hover .fb-arrow {
    transform: translateX(3px);
}

/* Nav buttons : un creux (outline) + un plein (ink) — style D v2 */

.fb-nav-small {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1.5px solid #1A1A2E;
    background: transparent;
    color: #1A1A2E;
    font-size: 16px;
    line-height: 1;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background 200ms ease, color 200ms ease, transform 200ms ease;
    font-family: inherit;
    padding: 0;
}

.fb-nav-small:hover {
    background: rgba(26, 26, 46, 0.06);
}

.fb-nav-small-dark {
    background: #1A1A2E;
    color: #fff;
}

.fb-nav-small-dark:hover {
    background: #000;
    transform: scale(1.05);
}

.fb-nav-small.swiper-button-disabled {
    opacity: 0.35;
    cursor: default;
    pointer-events: none;
}

/* ── Swiper wrapper ──────────────────────────────────────────────────── */

.fb-swiper-wrapper {
    position: relative;
}

.featured-vehicles-swiper {
    overflow: hidden;
    padding: 4px 4px 8px;
}

.featured-vehicles-swiper .swiper-slide {
    width: clamp(264px, 22vw, 300px);
    height: auto;
    display: flex;
}

/* ── Rich card véhicule (D v2 variant) ──────────────────────────────── */

.fb-card {
    display: flex;
    flex-direction: column;
    width: 100%;
    background: #ffffff;
    border-radius: 16px;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    border: 1px solid rgba(26, 26, 46, 0.08);
    box-shadow: 0 16px 40px rgba(26, 26, 46, 0.10),
                0 1px 2px rgba(26, 26, 46, 0.04);
    transition: transform 250ms ease, box-shadow 250ms ease;
}

.fb-card:hover,
.fb-card:focus-visible {
    transform: translateY(-3px);
    box-shadow: 0 20px 44px rgba(26, 26, 46, 0.14),
                0 4px 10px rgba(26, 26, 46, 0.06);
}

.fb-card:focus-visible {
    outline: 3px solid rgba(255, 107, 53, 0.4);
    outline-offset: 4px;
}

/* Zone media (image en haut) — fond blanc, photo réduite et centrée
   (style "showroom/catalogue" — cf. design Home Wireframes v2 2026-05-22).
   Le contraste avec la zone body sand crée la séparation visuelle. */
.fb-card-media {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 10;
    background: #ffffff;
    overflow: hidden;
    border-bottom: 1px solid rgba(26, 26, 46, 0.10);
    padding: 14px 22px;
    box-sizing: border-box;
}

.fb-card-media img {
    width: 100%;
    height: 100%;
    object-fit: contain;            /* réduit la photo dans le cadre, conserve le ratio */
    object-position: center;
    display: block;
    transition: transform 600ms ease;
}

.fb-card:hover .fb-card-media img {
    transform: scale(1.04);
}

.fb-card-media-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(26, 26, 46, 0.35);
    font-size: 56px;
}

/* Chips (badge + catégorie) en haut à gauche de l'image — positionnement
   absolu calé sur le bord externe de la carte (compense le padding interne). */
.fb-card-chips {
    position: absolute;
    top: 12px;
    left: 12px;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    z-index: 2;
    pointer-events: none; /* le lien englobant garde le clic */
}

.fb-card-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: var(--primary, #FF6B35);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    padding: 5px 11px;
    border-radius: 999px;
    box-shadow: 0 4px 12px rgba(255, 107, 53, 0.35);
    line-height: 1;
}

.fb-card-badge i {
    font-size: 9px;
}

/* Catégorie : maintenant sur fond blanc (zone media), donc on utilise un fond
   sand avec une bordure visible — plus de blur translucide qui disparaîtrait. */
.fb-card-category {
    display: inline-flex;
    align-items: center;
    background: #FAF7F1;
    color: #1A1A2E;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.3px;
    padding: 5px 10px;
    border-radius: 999px;
    border: 1px solid rgba(26, 26, 46, 0.18);
    line-height: 1;
}

/* Zone body (infos en bas) — fond sand crème pour matérialiser la séparation
   avec la zone media blanche au-dessus (cf. wireframe v2). */
.fb-card-body {
    /* padding-bottom 8 (au lieu de 14) car le footer suit immédiatement et apporte
       déjà son propre padding-top 10 — sinon on cumulait 24px de vide. */
    padding: 14px 16px 8px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
    background: #FBF3EA;
}

.fb-card-titlerow {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 10px;
}

.fb-card-title {
    font-family: 'Playfair Display', Georgia, serif;
    margin: 0;
    font-size: 18px;
    line-height: 1.15;
    color: #1A1A2E;
    font-weight: 700;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
    min-width: 0;
}

.fb-card-rating {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    color: #1A1A2E;
    white-space: nowrap;
    flex-shrink: 0;
}

.fb-card-rating i {
    font-size: 11px;
    color: var(--primary, #FF6B35);
}

.fb-card-rating strong {
    font-weight: 600;
}

.fb-card-rating-count {
    color: rgba(26, 26, 46, 0.55);
    font-weight: 400;
}

/* Specs (icônes : transmission · fuel · seats · A/C) */
.fb-card-specs {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    font-size: 11px;
    color: rgba(26, 26, 46, 0.66);
    font-weight: 500;
    line-height: 1.2;
}

.fb-spec {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    white-space: nowrap;
}

.fb-spec i {
    font-size: 11px;
    color: rgba(26, 26, 46, 0.48);
}

/* Agence + ville */
.fb-card-agency {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 11px;
    color: rgba(26, 26, 46, 0.55);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.fb-card-agency i {
    font-size: 10px;
    color: rgba(26, 26, 46, 0.4);
    flex-shrink: 0;
}

.fb-card-agency span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Footer card (prix + Book) — séparé par un trait fin */
.fb-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 8px;
    /* Padding horizontal = celui de .fb-card-body (16px) pour que le prix/bouton
       restent alignés avec le titre. Padding vertical 10/14 pour respirer.
       Le footer est SORTI du .fb-card-body depuis 2026-05-23 (carte = <div>
       contenant <a class="fb-card-link"> + <div class="fb-card-footer">) pour
       qu'on puisse y placer un <button> Réserver hors du lien parent. */
    padding: 10px 16px 14px;
    background: #FBF3EA; /* continuité visuelle avec .fb-card-body */
    border-top: 1px solid rgba(26, 26, 46, 0.08);
    margin-top: auto;
}

.fb-card-price {
    display: flex;
    align-items: baseline;
    gap: 4px;
    min-width: 0;
}

.fb-price-amount {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 26px;
    font-weight: 700;
    color: #1A1A2E;
    line-height: 1;
}

.fb-price-unit {
    font-size: 12px;
    color: rgba(26, 26, 46, 0.66);
    font-weight: 500;
}

/* CTA Book noir — pill (bouton interactif depuis 2026-05-23) */
.fb-card-book {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: #1A1A2E;
    color: #fff;
    border: none;
    border-radius: 999px;
    padding: 8px 14px;
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
    flex-shrink: 0;
    cursor: pointer;
    font-family: inherit;
    transition: background 200ms ease, transform 200ms ease;
}

.fb-card-book:hover:not(:disabled) {
    background: #000;
    transform: translateY(-1px);
}

.fb-card-book:disabled {
    background: #6B6B7B;
    cursor: not-allowed;
    opacity: 0.85;
}

.fb-card:hover .fb-card-book:not(:disabled) i {
    transform: translateX(2px);
}

/* Lien interne couvrant l'image + le corps de la carte (vers /vehicle/{uid}) */
.fb-card-link {
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: inherit;
    flex: 1 1 auto;
    min-height: 0;
}

.fb-card-link:focus-visible {
    outline: 2px solid #1A1A2E;
    outline-offset: -2px;
    border-radius: 12px;
}

/* État indisponible (après check serveur) */
.fb-card-unavailable .fb-card-link {
    opacity: 0.55;
    filter: grayscale(0.4);
}

.fb-card-error {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 16px 12px;
    padding: 8px 12px;
    background: rgba(220, 38, 38, 0.08);
    color: #b91c1c;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
}

.fb-card-error i { font-size: 14px; }

/* Bandeau d'avis global au-dessus du carrousel ("Choisissez vos dates") */
.fb-notice {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 0 16px;
    padding: 12px 16px;
    background: rgba(46, 125, 50, 0.08);
    color: #2E7D32;
    border: 1px solid rgba(46, 125, 50, 0.25);
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
}

.fb-notice i { font-size: 16px; }

.fb-card-book i {
    font-size: 10px;
    transition: transform 200ms ease;
}

/* ── Pagination (dots) ───────────────────────────────────────────────── */

.fb-pagination {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin-top: 18px;
}

.fb-pagination .swiper-pagination-bullet {
    width: 8px;
    height: 8px;
    background: rgba(26, 26, 46, 0.2);
    opacity: 1;
    border-radius: 4px;
    transition: width 200ms ease, background 200ms ease;
}

.fb-pagination .swiper-pagination-bullet-active {
    background: var(--primary, #FF6B35);
    width: 24px;
}

/* ── Tablette ────────────────────────────────────────────────────────── */

@media (max-width: 1024px) {
    .fb-header {
        gap: 12px;
    }
    .fb-see-all {
        font-size: 12px;
    }
}

/* ── Mobile ──────────────────────────────────────────────────────────── */

@media (max-width: 640px) {
    .fb-section {
        padding: 16px 0 24px;
    }

    .fb-header {
        margin-bottom: 12px;
    }

    .fb-title {
        font-size: 19px;
    }

    .fb-curated-chip {
        font-size: 9px;
        padding: 3px 8px;
    }

    .fb-header-right .fb-nav-small {
        display: none;
    }

    .featured-vehicles-swiper .swiper-slide {
        width: 84vw;
    }

    .fb-card-title {
        font-size: 16px;
    }

    .fb-price-amount {
        font-size: 22px;
    }
}

/* ── Cas dégradé Swiper non chargé ──────────────────────────────────── */

.swiper:not(.swiper-initialized) .swiper-wrapper {
    display: flex;
    gap: 16px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 8px;
}

.swiper:not(.swiper-initialized) .swiper-slide {
    flex: 0 0 clamp(260px, 84vw, 300px);
    scroll-snap-align: start;
}
