/* Olymp Group — Custom CSS */
/* Tailwind est chargé depuis CDN. Ce fichier contient uniquement les overrides et animations custom. */

/* ── Transitions globales */
* { scroll-behavior: smooth; }

/* ── Cards voitures */
.car-card {
    transition: box-shadow 0.2s, transform 0.2s;
}
.car-card:hover {
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
    transform: translateY(-2px);
}

/* ── Prix badge */
.prix-badge {
    background: linear-gradient(135deg, #b8242a, #9c1f25);
    color: #fff;
}

/* ── Ruban diagonal (badge tendance / vedette / promo) */
.ribbon-coin {
    position: absolute;
    top: 0; left: 0;
    width: 130px; height: 130px;
    overflow: hidden;
    pointer-events: none;
    z-index: 10;
}
.ribbon-coin span {
    position: absolute;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    width: 180px;
    padding: 6px 0;
    top: 24px; left: -42px;
    transform: rotate(-45deg);
    text-align: center;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    color: #fff;
    box-shadow: 0 2px 6px rgba(0,0,0,0.25);
}
.ribbon-coin .ribbon-icon {
    width: 12px;
    height: 12px;
    flex-shrink: 0;
}
.ribbon-tendance span { background: linear-gradient(135deg, #1a1a2e, #0f3460); }
.ribbon-vedette   span { background: linear-gradient(135deg, #d4af37, #b8860b); }
.ribbon-promo     span { background: linear-gradient(135deg, #b8242a, #9c1f25); }

/* ── Carte avec bandeau (ruban) : bordure + fond dérivés de la couleur principale */
.car-card.car-card--ruban {
    background: #fbeeee;
    border: 1px solid rgba(184, 36, 42, 0.35);
}
.car-card.car-card--ruban:hover {
    border-color: rgba(184, 36, 42, 0.55);
    box-shadow: 0 10px 30px rgba(184, 36, 42, 0.2);
}
/* Éléments internes réajustés pour rester lisibles sur le fond teinté */
.car-card.car-card--ruban .img-skel { background: #f3dede; }
.car-card.car-card--ruban .prix-badge {
    box-shadow: 0 1px 3px rgba(184, 36, 42, 0.3);
}

/* ── Bascule vue liste / carte pour les grilles de voitures */
.voitures-affichage.vue-liste {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}
.voitures-affichage.vue-liste .car-card {
    display: flex;
    flex-direction: row;
    align-items: stretch;
}
.voitures-affichage.vue-liste .car-card > div:first-child {
    width: 220px;
    height: 150px;
    flex-shrink: 0;
}
.voitures-affichage.vue-liste .car-card > div:not(:first-child) {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
}
.voitures-affichage.vue-liste .car-card > div:not(:first-child) > div:last-child {
    margin-top: auto;
}
.voitures-affichage.vue-liste .car-card .ribbon-coin {
    transform: scale(0.65);
    transform-origin: top left;
}
@media (max-width: 640px) {
    .voitures-affichage.vue-liste .car-card > div:first-child {
        width: 6.5rem;
        height: 5.5rem;
    }
    .voitures-affichage.vue-liste .car-card > div:not(:first-child) {
        padding: 0.75rem;
    }
    .voitures-affichage.vue-liste .car-card .car-card-arrow {
        display: none;
    }
}

/* ── Hero gradient */
.hero-bg {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
}

/* ── Section alternée */
.section-alt {
    background: #eaeaf5;
}

/* ── Bouton principal */
.btn-primary {
    background: #b8242a;
    color: #fff;
    font-weight: 700;
    transition: background 0.2s, transform 0.1s;
}
.btn-primary:hover {
    background: #9c1f25;
    transform: translateY(-1px);
}

/* ── Input focus */
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: #b8242a;
    box-shadow: 0 0 0 3px rgba(184, 36, 42, 0.2);
}

/* ── Air Datepicker override */
.air-datepicker-cell.-selected- {
    background: #1a1a2e !important;
    color: #fff !important;
}
.air-datepicker-cell.-selected-.-focus- {
    background: #1a1a2e !important;
}
.air-datepicker--button {
    color: #b8242a !important;
}

/* ── Lightbox overlay */
#lightbox {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.92);
    z-index: 999;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}
#lightbox.active {
    display: flex;
}
#lightbox img {
    max-width: 90vw;
    max-height: 85vh;
    object-fit: contain;
    border-radius: 4px;
}
#lightbox .lightbox-viewport {
    overflow: auto;
}
#lightbox-img {
    cursor: zoom-in;
}
#lightbox-img.is-zoomed {
    max-width: none;
    max-height: none;
    cursor: zoom-out;
}

/* ── Negociation slider */
.nego-slider {
    accent-color: #b8242a;
}

/* ── Scrollbar stylée (desktop) */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: #f1f1f1; }
::-webkit-scrollbar-thumb { background: #b8242a; border-radius: 3px; }

/* ── Skeleton loading (images en attente de chargement réseau) */
.img-skel {
    position: relative;
    overflow: hidden;
    background: #e5e7eb;
}
.img-skel::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(100deg, transparent 30%, rgba(255,255,255,0.55) 50%, transparent 70%);
    background-size: 200% 100%;
    animation: skel-shimmer 1.3s ease-in-out infinite;
    z-index: 1;
}
.img-skel img {
    opacity: 0;
    transition: opacity 0.35s ease;
}
.img-skel.is-loaded {
    background: transparent;
}
.img-skel.is-loaded::before {
    animation: none;
    content: none;
}
.img-skel.is-loaded img {
    opacity: 1;
}
@keyframes skel-shimmer {
    0%   { background-position: 150% 0; }
    100% { background-position: -50% 0; }
}
@media (prefers-reduced-motion: reduce) {
    .img-skel::before { animation: none; }
}

/* ── Badge statut */
.badge-statut {
    font-size: 11px;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 9999px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

/* ── Animations GSAP (Public/assets/js/animations.js) ── */

/* Neutralise le keyframe .anim-fade CSS quand GSAP pilote la révélation (évite le double-anim) */
.gsap-anim-active .car-card.anim-fade,
.gsap-anim-active .service-card.anim-fade { animation: none; }
@media (prefers-reduced-motion: reduce) {
    .anim-fade { animation: none; }
}

/* ── Tilt + glow au survol des cartes voiture (desktop, piloté par animations.js via GSAP quickTo) */
.car-card { position: relative; --mx: 50%; --my: 50%; }
.car-card.gsap-tilt-active { transform-style: preserve-3d; }
.car-card::after {
    content: '';
    position: absolute; inset: 0;
    background: radial-gradient(circle at var(--mx) var(--my), rgba(184,36,42,.16), transparent 60%);
    opacity: 0; transition: opacity 0.25s ease;
    pointer-events: none; z-index: 5;
}
.car-card.gsap-tilt-active:hover::after { opacity: 1; }

/* ── Bouton WhatsApp — respiration idle */
@keyframes wa-breathe {
    0%, 100% { box-shadow: 0 0 0 0 rgba(34,197,94,.45); }
    50%      { box-shadow: 0 0 0 12px rgba(34,197,94,0); }
}
.wa-float { animation: wa-breathe 2.8s ease-in-out infinite; }
@media (prefers-reduced-motion: reduce) { .wa-float { animation: none; } }

/* ── CTA / boutons — support ripple au clic (piloté par animations.js) */
.btn-primary { position: relative; overflow: hidden; }
.btn-ripple {
    position: absolute; border-radius: 50%;
    background: rgba(255,255,255,.5);
    transform: scale(0); pointer-events: none;
}

/* ── Zone négociation — pulse au franchissement du prix plancher */
@keyframes nego-pulse {
    0%   { box-shadow: 0 0 0 0 rgba(220,38,38,.55); }
    70%  { box-shadow: 0 0 0 14px rgba(220,38,38,0); }
    100% { box-shadow: 0 0 0 0 rgba(220,38,38,0); }
}
.nego-pulse { animation: nego-pulse .6s ease-out; border-radius: 1rem; }
@media (prefers-reduced-motion: reduce) { .nego-pulse { animation: none; } }

/* ── Rail cartes images accueil (swipe mobile, grille desktop) */
.image-card-rail {
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
}
.image-card-rail .image-card {
    height: 100%;
}
@media (min-width: 768px) {
    .image-card-rail {
        overscroll-behavior-x: auto;
    }
}

/* ── Carrousel visuels pages services (après section titre) */
.visuels-carousel-frame {
    height: 14rem;
    overflow: hidden;
}
@media (min-width: 768px) {
    .visuels-carousel-frame {
        height: 28rem;
    }
}
.visuels-carousel-slide {
    background: #000;
}
.visuels-carousel-iframe {
    width: 100%;
    height: 100%;
    border: 0;
}
.visuels-carousel-iframe--portrait {
    width: auto;
    height: 100%;
    aspect-ratio: 9 / 16;
    max-width: 100%;
}
.visuels-carousel-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 2;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 9999px;
    background: rgba(0, 0, 0, 0.45);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 0;
    cursor: pointer;
}
.visuels-carousel-nav:hover { background: rgba(0, 0, 0, 0.7); }
.visuels-carousel-nav--prev { left: 0.75rem; }
.visuels-carousel-nav--next { right: 0.75rem; }
.visuels-carousel-dots {
    position: absolute;
    bottom: 2.75rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2;
    display: flex;
    gap: 0.4rem;
}
.visuels-carousel-dot {
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 9999px;
    background: rgba(255, 255, 255, 0.45);
    border: 0;
    padding: 0;
    cursor: pointer;
}
.visuels-carousel-dot.is-active { background: #fff; }
@media (prefers-reduced-motion: reduce) {
    .visuels-carousel-slide { transition: none; }
}
