/* global React */
const { useState, useEffect, useRef, useCallback } = React;

/* ----------------------------- ICONS ----------------------------- */
const Ic = {
  phone:(p)=> <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="1.7" strokeLinecap="round" strokeLinejoin="round" {...p}><path d="M22 16.9v3a2 2 0 0 1-2.2 2 19.8 19.8 0 0 1-8.6-3.1 19.5 19.5 0 0 1-6-6A19.8 19.8 0 0 1 2.1 4.2 2 2 0 0 1 4.1 2h3a2 2 0 0 1 2 1.7c.1 1 .4 1.9.7 2.8a2 2 0 0 1-.5 2.1L8.1 9.9a16 16 0 0 0 6 6l1.3-1.3a2 2 0 0 1 2.1-.5c.9.3 1.8.6 2.8.7a2 2 0 0 1 1.7 2.1Z"/></svg>,
  whatsapp:(p)=> <svg viewBox="0 0 24 24" fill="currentColor" {...p}><path d="M17.5 14.4c-.3-.2-1.7-.8-2-.9-.3-.1-.5-.2-.7.1-.2.3-.7.9-.9 1.1-.2.2-.3.2-.6.1-1.6-.8-2.7-1.5-3.7-3.3-.3-.5.3-.5.8-1.5.1-.2 0-.4 0-.5-.1-.2-.7-1.6-.9-2.2-.2-.6-.5-.5-.7-.5h-.6c-.2 0-.5.1-.8.4-.3.3-1 1-1 2.5s1.1 2.9 1.2 3.1c.2.2 2.1 3.3 5.2 4.6 1.9.8 2.7.9 3.6.8.6-.1 1.7-.7 1.9-1.4.2-.7.2-1.2.2-1.4-.1-.1-.3-.2-.6-.4M12 2a10 10 0 0 0-8.6 15l-1.3 4.7 4.8-1.3A10 10 0 1 0 12 2"/></svg>,
  mail:(p)=> <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="1.7" strokeLinecap="round" strokeLinejoin="round" {...p}><rect x="2" y="4" width="20" height="16" rx="2"/><path d="m22 7-10 6L2 7"/></svg>,
  pin:(p)=> <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="1.7" strokeLinecap="round" strokeLinejoin="round" {...p}><path d="M20 10c0 6-8 12-8 12s-8-6-8-12a8 8 0 0 1 16 0Z"/><circle cx="12" cy="10" r="3"/></svg>,
  clock:(p)=> <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="1.7" strokeLinecap="round" strokeLinejoin="round" {...p}><circle cx="12" cy="12" r="9"/><path d="M12 7v5l3 2"/></svg>,
  cal:(p)=> <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="1.7" strokeLinecap="round" strokeLinejoin="round" {...p}><rect x="3" y="4" width="18" height="18" rx="2"/><path d="M16 2v4M8 2v4M3 10h18"/></svg>,
  search:(p)=> <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="1.9" strokeLinecap="round" strokeLinejoin="round" {...p}><circle cx="11" cy="11" r="7"/><path d="m21 21-4.3-4.3"/></svg>,
  shield:(p)=> <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="1.6" strokeLinecap="round" strokeLinejoin="round" {...p}><path d="M12 2 4 5v6c0 5 3.5 8.5 8 11 4.5-2.5 8-6 8-11V5l-8-3Z"/><path d="m9 12 2 2 4-4"/></svg>,
  tag:(p)=> <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="1.6" strokeLinecap="round" strokeLinejoin="round" {...p}><path d="M20.6 13.4 13.4 20.6a2 2 0 0 1-2.8 0l-7.2-7.2A2 2 0 0 1 2.8 12V4.8A2 2 0 0 1 4.8 2.8H12a2 2 0 0 1 1.4.6l7.2 7.2a2 2 0 0 1 0 2.8Z"/><circle cx="7.5" cy="7.5" r="1.3"/></svg>,
  fuel:(p)=> <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="1.6" strokeLinecap="round" strokeLinejoin="round" {...p}><path d="M4 22V5a2 2 0 0 1 2-2h6a2 2 0 0 1 2 2v17M3 22h12M14 9h2.5a2 2 0 0 1 2 2v5a1.5 1.5 0 0 0 3 0V9.8a2 2 0 0 0-.6-1.4L18 6"/><path d="M7 7h4"/></svg>,
  gear:(p)=> <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="1.6" strokeLinecap="round" strokeLinejoin="round" {...p}><path d="M6 5v14M6 5h12v6a6 6 0 0 1-6 6M18 5v6M6 12h6"/><circle cx="6" cy="4" r="1.4"/><circle cx="18" cy="4" r="1.4"/><circle cx="6" cy="20" r="1.4"/></svg>,
  seat:(p)=> <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="1.6" strokeLinecap="round" strokeLinejoin="round" {...p}><path d="M5 4a1 1 0 0 1 1 1v8h9a3 3 0 0 1 3 3v3M5 13H4M18 19v2M6 13a1 1 0 0 1-1-1V5"/><path d="M6 13h2"/></svg>,
  cars:(p)=> <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="1.6" strokeLinecap="round" strokeLinejoin="round" {...p}><path d="M5 13 6.5 8.2A2 2 0 0 1 8.4 7h7.2a2 2 0 0 1 1.9 1.2L19 13M5 13h14a2 2 0 0 1 2 2v3h-2M5 13a2 2 0 0 0-2 2v3h2m0 0h14M6.5 18v1.5M17.5 18v1.5"/><circle cx="7.5" cy="15.5" r="0.6"/><circle cx="16.5" cy="15.5" r="0.6"/></svg>,
  star:(p)=> <svg viewBox="0 0 24 24" fill="currentColor" {...p}><path d="m12 2 2.9 6.3 6.8.7-5.1 4.6 1.5 6.7L12 17.5 5.9 20.3l1.5-6.7L2.3 9l6.8-.7L12 2Z"/></svg>,
  users:(p)=> <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="1.6" strokeLinecap="round" strokeLinejoin="round" {...p}><path d="M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2"/><circle cx="9" cy="7" r="3.2"/><path d="M22 21v-2a4 4 0 0 0-3-3.9M16 3.1a4 4 0 0 1 0 7.8"/></svg>,
  arrow:(p)=> <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="1.8" strokeLinecap="round" strokeLinejoin="round" {...p}><path d="M5 12h14M13 6l6 6-6 6"/></svg>,
  chev:(p)=> <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round" {...p}><path d="m9 6 6 6-6 6"/></svg>,
  chevDown:(p)=> <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round" {...p}><path d="m6 9 6 6 6-6"/></svg>,
  check:(p)=> <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2.2" strokeLinecap="round" strokeLinejoin="round" {...p}><path d="M20 6 9 17l-5-5"/></svg>,
  menu:(p)=> <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="1.9" strokeLinecap="round" {...p}><path d="M3 6h18M3 12h18M3 18h18"/></svg>,
  x:(p)=> <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="1.9" strokeLinecap="round" {...p}><path d="M18 6 6 18M6 6l12 12"/></svg>,
  spark:(p)=> <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="1.6" strokeLinecap="round" strokeLinejoin="round" {...p}><path d="M12 3v4M12 17v4M3 12h4M17 12h4M5.6 5.6l2.8 2.8M15.6 15.6l2.8 2.8M18.4 5.6l-2.8 2.8M8.4 15.6l-2.8 2.8"/></svg>,
  heart:(p)=> <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="1.6" strokeLinecap="round" strokeLinejoin="round" {...p}><path d="M19 5.5a4.5 4.5 0 0 0-7 .9 4.5 4.5 0 0 0-7-.9 5 5 0 0 0 0 7L12 20l7-7.5a5 5 0 0 0 0-7Z"/></svg>,
  key:(p)=> <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="1.6" strokeLinecap="round" strokeLinejoin="round" {...p}><circle cx="7.5" cy="15.5" r="4.5"/><path d="m10.5 12.5 8-8M16 5l3 3M14 7l2 2"/></svg>,
  sparkle:(p)=> <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="1.6" strokeLinecap="round" strokeLinejoin="round" {...p}><path d="m12 3 2 5 5 2-5 2-2 5-2-5-5-2 5-2 2-5Z"/></svg>,
  fb:(p)=> <svg viewBox="0 0 24 24" fill="currentColor" {...p}><path d="M14 9h3V6h-3c-2.2 0-4 1.8-4 4v2H7v3h3v6h3v-6h3l1-3h-4v-2c0-.6.4-1 1-1Z"/></svg>,
  ig:(p)=> <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="1.7" {...p}><rect x="3" y="3" width="18" height="18" rx="5"/><circle cx="12" cy="12" r="4"/><circle cx="17.5" cy="6.5" r="1" fill="currentColor" stroke="none"/></svg>,
  quote:(p)=> <svg viewBox="0 0 24 24" fill="currentColor" {...p}><path d="M10 7H6a3 3 0 0 0-3 3v7h7v-7H6c0-1 .5-2 2-2V7Zm11 0h-4a3 3 0 0 0-3 3v7h7v-7h-4c0-1 .5-2 2-2V7Z" opacity=".5"/></svg>,
};

function Stars({ n=5, size }){
  return <span className="stars" style={size?{fontSize:0}:null}>
    {[1,2,3,4,5].map(i=> <Ic.star key={i} className={i<=Math.round(n)?"":"off"} style={size?{width:size,height:size}:null}/> )}
  </span>;
}

/* ----------------------------- LOGO ----------------------------- */
function Logo({ h=42, onClick }){
  return <a href="#/" onClick={onClick} style={{display:"flex",alignItems:"center"}} aria-label="Hamza LVH — accueil">
    <img src="assets/logo-hamza-lvh.png" alt="Hamza LVH" style={{height:h,width:"auto"}}/>
  </a>;
}

/* --------------------- SCROLL REVEAL HOOK --------------------- */
function useReveal(){
  useEffect(()=>{
    const els=document.querySelectorAll('.reveal:not(.in)');
    const io=new IntersectionObserver((ents)=>{
      ents.forEach(e=>{ if(e.isIntersecting){ e.target.classList.add('in'); io.unobserve(e.target);} });
    },{threshold:.12,rootMargin:"0px 0px -8% 0px"});
    els.forEach(el=>io.observe(el));
    return ()=>io.disconnect();
  });
}

/* --------------------- IMAGE / PLACEHOLDER --------------------- */
function CarImage({ car, className, style }){
  if(car.image){
    return <img src={car.image} alt={car.name} loading="lazy" className={className}
      style={{width:"100%",height:"100%",objectFit:"cover",...style}}/>;
  }
  return <div className={"ph "+(className||"")} style={style}>
    <div className="ph-glow"></div>
    <div className="ph-brand">{car.brand}</div>
    <div className="ph-label">Visuel — {car.name}</div>
  </div>;
}

/* ----------------------------- NAV ----------------------------- */
const NAV_ITEMS=[
  ["Accueil","#/"],["Nos voitures","#/voitures"],["Réservation","#/reservation"],
  ["À propos","#/a-propos"],["Conditions","#/conditions"],["Contact","#/contact"],
];
function Nav({ route }){
  const [scrolled,setScrolled]=useState(false);
  const [open,setOpen]=useState(false);
  useEffect(()=>{
    const f=()=>setScrolled(window.scrollY>16); f();
    window.addEventListener('scroll',f,{passive:true});
    return ()=>window.removeEventListener('scroll',f);
  },[]);
  useEffect(()=>{ setOpen(false); },[route]);
  useEffect(()=>{ document.body.classList.toggle('no-scroll',open); },[open]);
  const base=route.split('/')[1]||"";
  const isActive=(href)=>{ const h=href.replace('#/',''); return h===base || (h===""&&base===""); };
  return <>
    <header style={{position:"fixed",top:0,left:0,right:0,zIndex:60,transition:"all .35s",
      background: scrolled? "rgba(11,11,13,.82)":"linear-gradient(180deg,rgba(11,11,13,.9),rgba(11,11,13,0))",
      backdropFilter: scrolled?"blur(16px) saturate(140%)":"blur(2px)",
      borderBottom: scrolled?"1px solid var(--border)":"1px solid transparent"}}>
      <div className="wrap" style={{height:"var(--nav-h)",display:"flex",alignItems:"center",justifyContent:"space-between",gap:24}}>
        <Logo h={scrolled?40:46}/>
        <nav style={{display:"flex",alignItems:"center",gap:30}} className="nav-desktop">
          {NAV_ITEMS.map(([l,h])=> <a key={h} href={h} className={"nav-link"+(isActive(h)?" active":"")}>{l}</a> )}
        </nav>
        <div style={{display:"flex",alignItems:"center",gap:14}}>
          <a href="#/a-propos" className="nav-rating" aria-label={`Noté ${window.BUSINESS.rating} sur 5 sur Google`}><GoogleRating/></a>
          <a href="#/a-propos" className="nav-rating-mobile" aria-label={`Avis Google ${window.BUSINESS.rating} sur 5`}>
            <span className="g-glyph">G</span>
            <Stars n={4.8} size={11}/>
            <strong>{window.BUSINESS.rating}</strong>
          </a>
          <a href={"tel:"+window.BUSINESS.phonePrimaryTel} className="btn btn-gold btn-sm nav-tel">
            <Ic.phone/> {window.BUSINESS.phonePrimary}
          </a>
          <button className="nav-burger" onClick={()=>setOpen(true)} aria-label="Menu" style={{display:"none",width:44,height:44,borderRadius:12,border:"1px solid var(--border)",alignItems:"center",justifyContent:"center"}}>
            <Ic.menu style={{width:22,height:22}}/>
          </button>
        </div>
      </div>
    </header>
    {/* mobile drawer */}
    <div className="drawer" style={{position:"fixed",inset:0,zIndex:80,pointerEvents:open?"auto":"none"}}>
      <div onClick={()=>setOpen(false)} style={{position:"absolute",inset:0,background:"rgba(0,0,0,.6)",backdropFilter:"blur(4px)",opacity:open?1:0,transition:"opacity .35s"}}></div>
      <div style={{position:"absolute",top:0,right:0,bottom:0,width:"min(82vw,340px)",background:"var(--bg-2)",borderLeft:"1px solid var(--border)",
        transform:open?"translateX(0)":"translateX(100%)",transition:"transform .4s cubic-bezier(.2,.7,.2,1)",padding:"24px",display:"flex",flexDirection:"column",gap:6}}>
        <div style={{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:14}}>
          <Logo h={38}/>
          <button onClick={()=>setOpen(false)} aria-label="Fermer" style={{width:42,height:42,borderRadius:10,border:"1px solid var(--border)",display:"flex",alignItems:"center",justifyContent:"center"}}><Ic.x style={{width:20,height:20}}/></button>
        </div>
        <div style={{display:"flex",alignItems:"center",gap:10,padding:"11px 13px",marginBottom:10,borderRadius:12,border:"1px solid var(--border)",background:"rgba(230,199,110,.05)"}}>
          <GoogleRating/>
        </div>
        {NAV_ITEMS.concat([["FAQ","#/faq"]]).map(([l,h])=>
          <a key={h} href={h} onClick={()=>setOpen(false)} style={{padding:"15px 6px",borderBottom:"1px solid var(--border-soft)",fontFamily:"'Sora',sans-serif",fontSize:17,fontWeight:600,color:isActive(h)?"var(--gold-2)":"var(--text)",textTransform:"uppercase",letterSpacing:".02em"}}>{l}</a>
        )}
        <a href={"tel:"+window.BUSINESS.phonePrimaryTel} className="btn btn-gold" style={{marginTop:18}}><Ic.phone/> {window.BUSINESS.phonePrimary}</a>
        <a href={window.BUSINESS.whatsappLink} target="_blank" rel="noopener" className="btn btn-wa"><Ic.whatsapp/> WhatsApp</a>
      </div>
    </div>
  </>;
}

/* ----------------------------- FOOTER ----------------------------- */
function Footer(){
  const B=window.BUSINESS;
  const Col=({title,children})=> <div>
    <div style={{fontFamily:"'Sora',sans-serif",fontSize:12,letterSpacing:".22em",textTransform:"uppercase",color:"var(--gold-2)",marginBottom:18,fontWeight:600}}>{title}</div>
    <div style={{display:"flex",flexDirection:"column",gap:12}}>{children}</div>
  </div>;
  const FL=({href,children})=> <a href={href} style={{color:"var(--muted)",fontSize:14.5,transition:"color .2s"}} onMouseEnter={e=>e.currentTarget.style.color="var(--text)"} onMouseLeave={e=>e.currentTarget.style.color="var(--muted)"}>{children}</a>;
  return <footer style={{borderTop:"1px solid var(--border)",background:"linear-gradient(180deg,var(--bg),#070708)",position:"relative",overflow:"hidden"}}>
    <div className="halo halo-gold-soft" style={{width:520,height:520,bottom:-300,left:"50%",transform:"translateX(-50%)"}}></div>
    <div className="wrap" style={{padding:"72px 28px 0",position:"relative",zIndex:1}}>
      <div className="footer-grid" style={{display:"grid",gridTemplateColumns:"1.4fr 1fr 1.2fr 1fr",gap:48,paddingBottom:56}}>
        <div>
          <img src="assets/logo-hamza-lvh.png" alt="Hamza LVH" style={{height:54,marginBottom:20}}/>
          <p style={{color:"var(--muted)",fontSize:14.5,maxWidth:"34ch",lineHeight:1.7}}>
            Votre agence de location de voitures à Bordj El Bahri. Des véhicules propres, récents et un accueil chaleureux — pour rouler l'esprit tranquille.
          </p>
          <div style={{display:"flex",gap:12,marginTop:24}}>
            {[[Ic.fb,"#"],[Ic.ig,"#"],[Ic.whatsapp,B.whatsappLink]].map(([I,h],i)=>
              <a key={i} href={h} target="_blank" rel="noopener" aria-label="Réseau social" style={{width:42,height:42,borderRadius:"50%",border:"1px solid var(--border)",display:"flex",alignItems:"center",justifyContent:"center",color:"var(--gold-2)",transition:"all .25s"}}
                onMouseEnter={e=>{e.currentTarget.style.borderColor="rgba(230,199,110,.6)";e.currentTarget.style.background="rgba(230,199,110,.08)";}}
                onMouseLeave={e=>{e.currentTarget.style.borderColor="var(--border)";e.currentTarget.style.background="transparent";}}>
                <I style={{width:18,height:18}}/></a>
            )}
          </div>
        </div>
        <Col title="Liens rapides">
          <FL href="#/">Accueil</FL><FL href="#/voitures">Nos voitures</FL>
          <FL href="#/reservation">Réservation</FL><FL href="#/a-propos">À propos</FL>
          <FL href="#/conditions">Conditions</FL><FL href="#/faq">FAQ</FL>
        </Col>
        <Col title="Contactez-nous">
          <a href={"tel:"+B.phonePrimaryTel} style={{display:"flex",gap:11,color:"var(--muted)",fontSize:14.5,alignItems:"flex-start"}}><Ic.phone style={{width:17,height:17,color:"var(--gold-2)",marginTop:2,flexShrink:0}}/><span>{B.phones[0]}<br/>{B.phones[1]}</span></a>
          <a href={B.whatsappLink} target="_blank" rel="noopener" style={{display:"flex",gap:11,color:"var(--muted)",fontSize:14.5,alignItems:"center"}}><Ic.whatsapp style={{width:17,height:17,color:"var(--whatsapp)",flexShrink:0}}/>{B.whatsapp}</a>
          <a href={"mailto:"+B.email} style={{display:"flex",gap:11,color:"var(--muted)",fontSize:14.5,alignItems:"center",wordBreak:"break-all"}}><Ic.mail style={{width:17,height:17,color:"var(--gold-2)",flexShrink:0}}/>{B.email}</a>
          <div style={{display:"flex",gap:11,color:"var(--muted)",fontSize:14.5,alignItems:"flex-start"}}><Ic.pin style={{width:17,height:17,color:"var(--gold-2)",marginTop:2,flexShrink:0}}/><span>{B.addressFull}<br/><span className="mono" style={{fontSize:12,color:"var(--muted-2)"}}>Plus Code {B.plusCode}</span></span></div>
        </Col>
        <Col title="Horaires">
          {B.hours.map((h,i)=> <div key={i} style={{fontSize:14}}>
            <div style={{color:"var(--text)"}}>{h.d}</div>
            <div style={{color:"var(--muted)",fontSize:13}}>{h.h}</div>
          </div>)}
        </Col>
      </div>
      <div style={{borderTop:"1px solid var(--border)",padding:"22px 0",display:"flex",justifyContent:"space-between",flexWrap:"wrap",gap:12,color:"var(--muted-2)",fontSize:13}}>
        <span>© {new Date().getFullYear()} {B.name} — {B.tagline}. Tous droits réservés.</span>
        <span>Location de voiture Alger · Bordj El Bahri</span>
      </div>
    </div>
  </footer>;
}

/* ----------------------------- WHATSAPP FAB ----------------------------- */
function GoogleRating(){
  const B=window.BUSINESS;
  return <span className="g-rating">
    <span className="g-glyph">G</span>
    <Stars n={4.8} size={12}/>
    <span className="g-rating-txt"><strong>{B.rating}</strong> · {B.clients} clients</span>
  </span>;
}

/* ---- Mobile sticky action bar : Téléphone · WhatsApp · Réservation ---- */
function MobileActionBar(){
  const B=window.BUSINESS;
  return <nav className="mobile-bar" aria-label="Actions rapides">
    <a href={"tel:"+B.phonePrimaryTel} className="mbar-btn mbar-call"><Ic.phone/><span>Appeler</span></a>
    <a href={B.whatsappLink} target="_blank" rel="noopener" className="mbar-btn mbar-wa"><Ic.whatsapp/><span>WhatsApp</span></a>
    <a href="#/reservation" className="mbar-btn mbar-resa"><Ic.key/><span>Réserver</span></a>
  </nav>;
}

function WhatsAppFab(){
  return <a href={window.BUSINESS.whatsappLink} target="_blank" rel="noopener" aria-label="Réserver sur WhatsApp"
    style={{position:"fixed",right:22,bottom:22,zIndex:70,display:"flex",alignItems:"center",gap:0}}
    className="wa-fab">
    <span style={{width:60,height:60,borderRadius:"50%",background:"var(--whatsapp)",display:"flex",alignItems:"center",justifyContent:"center",
      boxShadow:"0 14px 34px -10px rgba(37,211,102,.6)",color:"#06310f"}}>
      <Ic.whatsapp style={{width:30,height:30}}/>
    </span>
  </a>;
}

/* ----------------------------- CAR CARD ----------------------------- */
function fmtPrice(p){ return p.toLocaleString('fr-FR'); }
function CarCard({ car, delay }){
  return <a href={"#/voiture/"+car.id} className={"card lift reveal "+(delay||"")} style={{overflow:"hidden",display:"flex",flexDirection:"column"}}>
    <div style={{position:"relative",aspectRatio:"16/11",overflow:"hidden",background:"#0E0F12"}}>
      <CarImage car={car} style={{transition:"transform .7s cubic-bezier(.2,.7,.2,1)"}}/>
      <div style={{position:"absolute",inset:0,background:"linear-gradient(180deg,transparent 55%,rgba(11,11,13,.85))"}}></div>
      <span className="badge-gold" style={{position:"absolute",top:14,left:14}}>{car.category}</span>
      {car.real && <span className="chip" style={{position:"absolute",top:14,right:14,background:"rgba(11,11,13,.7)",backdropFilter:"blur(6px)"}}><Ic.check style={{width:13,height:13}}/>Photo réelle</span>}
    </div>
    <div style={{padding:"20px 22px 22px",display:"flex",flexDirection:"column",gap:14,flex:1}}>
      <div style={{display:"flex",justifyContent:"space-between",alignItems:"baseline",gap:10}}>
        <h3 style={{fontSize:21,fontWeight:700}}>{car.name}</h3>
        <span style={{color:"var(--muted)",fontSize:13}}>{car.year}</span>
      </div>
      <div style={{display:"flex",flexWrap:"wrap",gap:8}}>
        <span className="chip"><Ic.fuel/>{car.fuel}</span>
        <span className="chip"><Ic.gear/>{car.gearbox}</span>
        <span className="chip"><Ic.seat/>{car.seats} pl</span>
      </div>
      <div style={{marginTop:"auto",display:"flex",alignItems:"flex-end",justifyContent:"space-between",paddingTop:8}}>
        <div>
          <span className="gold" style={{fontFamily:"'Sora',sans-serif",fontWeight:800,fontSize:24}}>{fmtPrice(car.price)} DA</span>
          <span style={{color:"var(--muted)",fontSize:13}}> / jour</span>
        </div>
        <span style={{display:"inline-flex",alignItems:"center",gap:7,fontSize:13,fontWeight:600,color:"var(--gold-2)",fontFamily:"'Sora',sans-serif",textTransform:"uppercase",letterSpacing:".06em"}}>
          Détails <Ic.arrow style={{width:15,height:15}}/>
        </span>
      </div>
    </div>
  </a>;
}

Object.assign(window,{ Ic, Stars, Logo, useReveal, CarImage, Nav, Footer, WhatsAppFab, CarCard, fmtPrice, GoogleRating, MobileActionBar });
