/* ─────────────────────────────────────────────────────────────────────────
   hero-dv2.css — Hero D v2 (refonte 2026-05-22)
   Cf. design Home Wireframes D v2 chosen direction · directions.jsx D2_Desktop
   Layout vertical centré : eyebrow → headline serif XL → subtitle → search → trust
   Pas de fausses statistiques (50+ agencies, 500+ cars, 4.7 ratings).
   ───────────────────────────────────────────────────────────────────────── */

.hero.hero-dv2 {
    /* Override de l'ancien .hero — compact, sand-light, padding raisonnable */
    background: var(--paper, #FAF7F1);
    min-height: auto;
    padding: 100px 24px 32px;     /* 100px en haut pour passer sous le header fixed (80px) + air */
    margin-top: 0;
    display: block;
    overflow: visible;
}

.hero.hero-dv2::before,
.hero.hero-dv2::after {
    /* Annule les éléments décoratifs de l'ancien hero (gradients orbe, etc.) */
    display: none !important;
    content: none !important;
}

.hero-dv2-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 22px;
}

/* ── Top row : texte (gauche) + image décorative (droite) ─────────────── */

.hero-dv2-top {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 320px);
    align-items: center;
    gap: 32px;
}

/* ── Texte hero ───────────────────────────────────────────────────────── */

.hero-dv2-text {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-width: 760px;
}

/* ── Visuel décoratif (cartes postales empilées — coast road / Tunis medina) ── */

.hero-dv2-visual {
    position: relative;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    min-height: 0;
}

/* Stack des destinations — toutes les images empilées au même endroit,
   seule la .is-active est visible (fondu enchaîné de 600ms). */
.hero-dv2-visual-stack {
    position: relative;
    width: 100%;
    max-width: 300px;
    aspect-ratio: 16 / 10;
    border-radius: 12px;
    overflow: hidden;
    transform: rotate(3deg);
    filter: drop-shadow(0 18px 40px rgba(26, 26, 46, 0.18))
            drop-shadow(0 4px 10px rgba(26, 26, 46, 0.08));
    transition: transform 400ms ease;
    background: #EEE9DD;
}

.hero-dv2-visual-stack:hover {
    transform: rotate(0deg) scale(1.02);
}

/* Rotation auto en CSS pur — 5 images × 3 s chacune = 15 s par cycle.
   Pas de JS requis ; l'animation démarre dès que l'élément est attaché au DOM,
   y compris après un re-render Blazor interactif. */
.hero-dv2-visual-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    opacity: 0;
    pointer-events: none;
    animation: hero-dv2-fade-cycle 15s infinite ease-in-out;
}

.hero-dv2-visual-img:nth-child(1) { animation-delay: 0s; }
.hero-dv2-visual-img:nth-child(2) { animation-delay: 3s; }
.hero-dv2-visual-img:nth-child(3) { animation-delay: 6s; }
.hero-dv2-visual-img:nth-child(4) { animation-delay: 9s; }
.hero-dv2-visual-img:nth-child(5) { animation-delay: 12s; }

@keyframes hero-dv2-fade-cycle {
    /* Cycle 15 s : visible 0–3 s puis fade-out 3–3.3 s, invisible 3.3–14.7 s,
       fade-in 14.7–15 s pour boucler en seamless avec l'image suivante. */
    0%   { opacity: 1; }
    18%  { opacity: 1; }
    22%  { opacity: 0; }
    98%  { opacity: 0; }
    100% { opacity: 1; }
}

/* Pause au hover : l'utilisateur peut s'arrêter sur une destination */
.hero-dv2-visual-stack:hover .hero-dv2-visual-img {
    animation-play-state: paused;
}

/* Respect du préférence "reduced motion" — fige sur la 1ʳᵉ image */
@media (prefers-reduced-motion: reduce) {
    .hero-dv2-visual-img {
        animation: none;
        opacity: 0;
    }
    .hero-dv2-visual-img:nth-child(1) {
        opacity: 1;
    }
    .hero-dv2-visual-stack {
        transition: none;
    }
}

.hero-dv2-title {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: clamp(36px, 5vw, 60px);
    font-weight: 700;
    line-height: 1.02;
    letter-spacing: -1.2px;
    color: #1A1A2E;
    margin: 0;
}

.hero-dv2-accent {
    font-style: italic;
    color: var(--primary, #FF6B35);
    font-weight: 700;
}

.hero-dv2-subtitle {
    font-size: clamp(15px, 1.5vw, 18px);
    color: #1A1A2E;
    line-height: 1.5;
    margin: 0;
    max-width: 680px;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.hero-dv2-subtitle strong {
    font-weight: 700;
    color: #1A1A2E;
}

.hero-dv2-subtitle-soft {
    color: rgba(26, 26, 46, 0.78);
    font-weight: 400;
}

/* ── Search bar — pill blanche, ombre forte (search dominant D v2) ──── */

.hero-dv2-search {
    margin-top: 4px;
}

.hero-dv2-search-fields {
    display: flex;
    align-items: stretch;
    background: #ffffff;
    border-radius: 999px;
    padding: 8px;
    box-shadow: 0 28px 70px rgba(26, 26, 46, 0.18),
                0 4px 14px rgba(26, 26, 46, 0.06),
                0 0 0 1px rgba(26, 26, 46, 0.05);
    gap: 0;
    min-height: 76px;
}

.hero-dv2-field {
    flex: 1 1 0;
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 8px 18px;
    min-width: 0;
    border-right: 1px solid rgba(26, 26, 46, 0.08);
}

.hero-dv2-field:last-of-type {
    border-right: none;
}

.hero-dv2-field-location {
    flex: 1.3;
}

.hero-dv2-field-dates {
    flex: 1.5;
}

.hero-dv2-field-label {
    display: block;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.6px;
    text-transform: uppercase;
    color: rgba(26, 26, 46, 0.66);
    margin-bottom: 2px;
    line-height: 1.2;
}

.hero-dv2-field-value {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 500;
    color: #1A1A2E;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.hero-dv2-field-value i {
    color: var(--primary, #FF6B35);
    font-size: 13px;
    flex-shrink: 0;
}

.hero-dv2-field-value-muted {
    font-style: italic;
    color: rgba(26, 26, 46, 0.55);
}

/* Case à cocher discrète "Restituer dans un autre lieu"
   Le champ retour est caché par défaut (cas peu fréquent). */
.return-toggle {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 12px;
    padding: 6px 10px;
    font-size: 13px;
    color: rgba(26, 26, 46, 0.7);
    cursor: pointer;
    user-select: none;
    border-radius: 6px;
    transition: color 200ms ease, background 200ms ease;
}

.return-toggle:hover {
    color: var(--primary, #FF6B35);
    background: rgba(255, 107, 53, 0.06);
}

.return-toggle input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--primary, #FF6B35);
    cursor: pointer;
    margin: 0;
}

/* Bouton Search principal — orange, pleine hauteur, ombre prononcée */
.hero-dv2-search-btn {
    flex: 0 0 auto;
    background: var(--primary, #FF6B35);
    color: #fff;
    font-weight: 700;
    font-size: 16px;
    border: none;
    border-radius: 999px;
    padding: 0 36px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    white-space: nowrap;
    align-self: stretch;
    box-shadow: 0 10px 24px rgba(255, 107, 53, 0.40),
                inset 0 -2px 0 rgba(0, 0, 0, 0.10);
    transition: transform 200ms ease, box-shadow 200ms ease, background 200ms ease;
    font-family: inherit;
}

.hero-dv2-search-btn:hover {
    background: var(--primary-dark, #E55A2B);
    transform: translateY(-1px);
    box-shadow: 0 14px 30px rgba(255, 107, 53, 0.50),
                inset 0 -2px 0 rgba(0, 0, 0, 0.12);
}

.hero-dv2-search-btn i {
    font-size: 16px;
}

/* ── Trust strip ──────────────────────────────────────────────────────── */

.hero-dv2-trust {
    list-style: none;
    margin: 6px 0 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 22px;
    font-size: 13px;
    color: rgba(26, 26, 46, 0.78);
    font-weight: 500;
}

.hero-dv2-trust li {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.hero-dv2-trust i {
    color: var(--primary, #FF6B35);
    font-size: 12px;
}

/* ── LocationPicker / DateRangePicker — overrides pour s'intégrer ───── */
/* Les composants internes doivent paraître "intégrés" dans la pill blanche.
   On retire leurs propres bordures/fonds visibles. */

.hero-dv2-field :is(.location-picker, .date-range-picker, .picker-wrapper) {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
    margin: 0 !important;
}

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

@media (max-width: 1024px) {
    .hero.hero-dv2 {
        padding: 96px 20px 28px;
    }

    /* Sur tablette le texte prend toute la largeur — l'image décorative se réduit */
    .hero-dv2-top {
        grid-template-columns: minmax(0, 1fr) minmax(0, 220px);
        gap: 20px;
    }

    .hero-dv2-visual-stack {
        max-width: 220px;
    }

    .hero-dv2-search-fields {
        flex-wrap: wrap;
        border-radius: 24px;
        min-height: auto;
    }

    .hero-dv2-field {
        flex: 1 1 calc(50% - 4px);
        border-right: none;
        border-bottom: 1px solid rgba(26, 26, 46, 0.08);
        padding: 12px 18px;
    }

    .hero-dv2-field:nth-last-of-type(2) {
        border-bottom: none;
    }

    .hero-dv2-search-btn {
        flex: 1 0 100%;
        padding: 16px 24px;
        border-radius: 14px;
    }
}

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

@media (max-width: 640px) {
    .hero.hero-dv2 {
        /* Mobile : header → search direct → trust → carrousel (cf. user feedback)
           Pas de texte hero pour gagner de l'air, comme dans la maquette D v2 mobile. */
        padding: 80px 14px 18px;
    }

    .hero-dv2-text {
        display: none; /* texte masqué sur mobile — search prend tout */
    }

    .hero-dv2-top {
        display: none; /* visuel décoratif masqué sur mobile */
    }

    .hero-dv2-visual {
        display: none;
    }

    .hero-dv2-search-fields {
        flex-direction: column;
        border-radius: 16px;
        padding: 8px;
        gap: 6px;
        min-height: auto;
    }

    .hero-dv2-field {
        flex: 1 1 100%;
        border-bottom: none;
        background: var(--paper, #FAF7F1);
        border-radius: 10px;
        padding: 8px 14px;
        min-height: 52px;
        justify-content: center;
    }

    .hero-dv2-search-btn {
        flex: 1 0 100%;
        padding: 14px 0;
        border-radius: 10px;
        font-size: 15px;
    }

    .hero-dv2-trust {
        gap: 12px;
        font-size: 11px;
        justify-content: center;
    }
}

/* ═════════════════════════════════════════════════════════════════════════
   Popovers Search D v2 — handoff spec Claude Code (cf. design/popovers.jsx)
   Chaque dropdown s'étend sur 2 cellules (≈ 576 px) :
   - Pickup → ouvre vers la DROITE (couvre Pickup + Return)
   - Return → ouvre vers la GAUCHE (couvre Pickup + Return)
   - Dates  → ouvre vers la GAUCHE (couvre Return + Dates)
   ═════════════════════════════════════════════════════════════════════════ */

/* La cellule active flotte au-dessus, l'overlap ne crée pas de clipping */
.hero-dv2-search-fields {
    position: relative;
}

/* Pill blanche + ring orange autour de la cellule active (état "is-open") */
.hero-dv2-search-fields .hero-dv2-field-pickup:has(.location-input-container.is-open),
.hero-dv2-search-fields .hero-dv2-field-return:has(.location-input-container.is-open),
.hero-dv2-search-fields .hero-dv2-field-dates:has(.locaris-date-picker.is-open) {
    border-radius: 999px;
    background: #fff;
    box-shadow: 0 0 0 2px var(--primary, #FF6B35);
    z-index: 4;
    border-right-color: transparent;
}

/* LocationPicker dropdown — Pickup étend vers la droite */
.hero-dv2-search-fields .hero-dv2-field-pickup .location-dropdown {
    left: 0 !important;
    right: auto !important;
    width: 576px !important;
    max-width: calc(100vw - 32px);
}

/* LocationPicker dropdown — Return étend vers la gauche */
.hero-dv2-search-fields .hero-dv2-field-return .location-dropdown {
    left: auto !important;
    right: 0 !important;
    width: 576px !important;
    max-width: calc(100vw - 32px);
}

/* DateRangePicker (mode position-dropdown) — étend vers la gauche, 576 px */
.hero-dv2-search-fields .hero-dv2-field-dates .locaris-date-picker.position-dropdown .date-picker-calendar {
    left: auto !important;
    right: 0 !important;
    width: 576px !important;
    max-width: calc(100vw - 32px);
}

/* Sur tablette (< 1024 px) la search bar passe en grille 2×2 — on retombe
   sur le comportement par défaut des pickers (sous la cellule, largeur 1 cell)
   parce que la notion de "2 cellules adjacentes" n'a plus de sens. */
@media (max-width: 1024px) {
    .hero-dv2-search-fields .hero-dv2-field-pickup .location-dropdown,
    .hero-dv2-search-fields .hero-dv2-field-return .location-dropdown,
    .hero-dv2-search-fields .hero-dv2-field-dates .locaris-date-picker.position-dropdown .date-picker-calendar {
        left: 0 !important;
        right: 0 !important;
        width: auto !important;
    }
}

/* =============================================================================
   Pulse highlight — quand l'utilisateur clique "Réserver" sur une carte vedette
   sans avoir sélectionné de dates (cf. FeaturedVehiclesCarousel.HandleReserveAsync
   → Home.HighlightDatePickerAsync → home-search.js#highlightDates).
   ============================================================================= */
.hero-dv2-field-dates.is-pulsing {
    position: relative;
    animation: lc-hero-dates-pulse 0.6s ease-in-out 0s 3;
    box-shadow: 0 0 0 0 rgba(46, 125, 50, 0);
    border-radius: 12px;
}
@keyframes lc-hero-dates-pulse {
    0%   { box-shadow: 0 0 0 0    rgba(46, 125, 50, 0.55); }
    50%  { box-shadow: 0 0 0 10px rgba(46, 125, 50, 0.18); }
    100% { box-shadow: 0 0 0 0    rgba(46, 125, 50, 0); }
}
