@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@400;500;600;700;800&display=swap');

:root{
  --black:#0e0d0f;
  --black-soft:#161517;
  --white:#fffdf8;
  --red:#a02321;
  --red-dark:#7d1a19;
  --gray-bg:#f5f4f2;
  --gray-line:#e4e2df;
  --text:#1c1b1a;
  --text-muted:#6b6864;
  --shadow:0 10px 30px rgba(0,0,0,.12);
  --gold:#c9a227;
}

*{box-sizing:border-box;margin:0;padding:0}
html{scroll-behavior:smooth}
/* Sem overflow-x em html/body de propósito (nem "hidden" nem "clip") —
   qualquer antepassado com overflow non-visible, mesmo só num eixo, parte o
   position:sticky no Safari/iOS (o palco de como-funciona.php ficava sem
   colar ao topo no telemóvel por causa disto). A contenção do menu mobile
   fechado (fora do ecrã via transform) é feita localmente em .site-header,
   que não é antepassado de nenhum position:sticky que precise funcionar. */
body{font-family:'Outfit',sans-serif;color:var(--text);background:var(--white);line-height:1.5}
img{max-width:100%;display:block}
a{color:inherit;text-decoration:none}
ul{list-style:none}
button,select,input,textarea{font-family:inherit;font-size:inherit}
.container{max-width:1200px;margin:0 auto;padding:0 1.5rem}

/* ===== Header ===== */
/* Sem backdrop-filter de propósito (o admin, que nunca teve este efeito,
   nunca teve o problema do toque a falhar no botão do menu — um blur
   sempre ativo num cabeçalho sticky é caro de repintar a cada frame de
   scroll, e isso atrasava o hit-test do toque seguinte). Ao fundo já quase
   opaco (.92), o blur mal se notava visualmente — a diferença aqui é
   praticamente impercetível, mas resolve o toque. */
.site-header{position:sticky;top:0;z-index:50;background:rgba(14,13,15,.92);border-bottom:1px solid rgba(255,255,255,.08);transition:background .25s,border-color .25s;overflow-x:clip;overflow-y:visible}
.site-header.header-overlay{background:transparent;border-bottom-color:transparent}
.site-header.header-overlay.scrolled{background:rgba(14,13,15,.92);border-bottom-color:rgba(255,255,255,.08)}
.site-header .container{display:flex;align-items:center;justify-content:space-between;height:78px}
.site-header .logo img{height:50px;width:auto}
.main-nav{display:flex;align-items:center;gap:2rem}
.main-nav a{color:var(--white);font-weight:500;font-size:.92rem;letter-spacing:.02em;transition:color .2s}
.main-nav a:hover{color:var(--red)}
.nav-cta{background:var(--red);color:var(--white)!important;padding:.65rem 1.4rem;border-radius:30px;font-weight:600}
.nav-cta:hover{background:var(--red-dark);color:var(--white)!important}
.burger{display:none;background:none;border:0;color:var(--white);font-size:1.6rem;cursor:pointer;touch-action:manipulation}

@media(max-width:860px){
  /* Sem backdrop-filter no header, o containing block deste menu fixed volta
     a ser o ecrã diretamente — por isso altura em vh explícita continua a
     ser a forma segura (não depende de nenhum antepassado em concreto).
     translateX(-100%) e não (100%): fechado, a gaveta fica deslocada para a
     ESQUERDA do ecrã (fora, em x negativo) em vez de para a direita (x
     positivo) — só assim é que fechada não conta para a largura scrollável
     da página, sem precisar de nenhum truque de overflow no antepassado. */
  .main-nav{position:fixed;top:78px;left:0;right:0;height:calc(100vh - 78px);background:var(--black);flex-direction:column;justify-content:flex-start;padding:2.5rem 1.5rem;gap:1.5rem;transform:translateX(-100%);transition:transform .3s;overflow-y:auto}
  .main-nav.open{transform:translateX(0)}
  .main-nav a{font-size:1.2rem}
  .burger{display:block}
}

/* ===== Hero ===== */
.hero{position:relative;background:var(--black);text-align:center;overflow:hidden;margin-top:-78px}
.hero picture{display:block}
.hero-banner{width:100%;height:auto;display:block}

/* ===== Search card ===== */
.search-card{position:relative;z-index:2;margin:-3rem auto 0;max-width:1000px;background:var(--white);border-radius:18px;box-shadow:var(--shadow);padding:2rem}
.search-card h2{font-size:1.2rem;font-weight:700;margin-bottom:1.2rem;text-align:center}
.search-form{display:grid;grid-template-columns:repeat(3,1fr) auto;gap:1rem;align-items:end}
.search-form label{display:block;font-size:.72rem;font-weight:700;letter-spacing:.08em;color:var(--text-muted);margin-bottom:.4rem;text-transform:uppercase}
.search-form select{width:100%;padding:.75rem .9rem;border:1px solid var(--gray-line);border-radius:10px;background:var(--gray-bg);color:var(--text)}
.search-form button{background:var(--red);color:var(--white);border:0;padding:.85rem 1.6rem;border-radius:10px;font-weight:700;cursor:pointer;white-space:nowrap;transition:background .2s}
.search-form button:hover{background:var(--red-dark)}
@media(max-width:760px){
  .search-card{margin-top:-4rem;padding:1.25rem}
  .search-form{grid-template-columns:1fr 1fr;gap:.7rem}
  .search-form button{padding:.85rem .5rem;font-size:.85rem;white-space:normal}
}

/* ===== Sections ===== */
.section{padding:4.5rem 0}
.section-head{text-align:center;margin-bottom:2.6rem}
.section-head .eyebrow{color:var(--red);font-weight:700;font-size:.78rem;letter-spacing:.12em;text-transform:uppercase;display:block;margin-bottom:.5rem}
.section-head h2{font-size:clamp(1.6rem,3vw,2.2rem);font-weight:800}
.section-alt{background:var(--gray-bg)}

/* ===== Vehicle cards ===== */
.vehicle-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(280px,1fr));gap:1.6rem}
.vehicle-card{background:var(--white);border:1px solid var(--gray-line);border-radius:16px;overflow:hidden;transition:transform .2s,box-shadow .2s;display:flex;flex-direction:column}
.vehicle-card:hover{transform:translateY(-4px);box-shadow:var(--shadow)}
.vehicle-media{position:relative;aspect-ratio:4/3;background:linear-gradient(135deg,#1a1919 0%,#0e0d0f 100%);display:flex;align-items:center;justify-content:center;overflow:hidden}
.vehicle-media img{width:100%;height:100%;object-fit:cover}
.badge{position:absolute;top:.7rem;left:.7rem;background:var(--red);color:var(--white);font-size:.68rem;font-weight:700;letter-spacing:.05em;padding:.3rem .65rem;border-radius:6px;text-transform:uppercase}
.badge.sold{background:#333}
.badge.reserved{background:#8a6d1f}
.vehicle-body{padding:1.1rem 1.2rem 1.3rem;display:flex;flex-direction:column;gap:.5rem;flex:1}
.vehicle-meta{display:flex;gap:.7rem;font-size:.76rem;color:var(--text-muted);flex-wrap:wrap}
.vehicle-brand{font-size:.75rem;color:var(--red);font-weight:700;letter-spacing:.05em;text-transform:uppercase}
.vehicle-title{font-size:1.05rem;font-weight:700;line-height:1.3}
.vehicle-price{margin-top:auto;padding-top:.6rem;display:flex;align-items:baseline;gap:.5rem}
.vehicle-price .now{font-size:1.25rem;font-weight:800;color:var(--red)}
.vehicle-price .before{font-size:.85rem;color:var(--text-muted);text-decoration:line-through}
.vehicle-card-link{display:block}

.view-all{text-align:center;margin-top:2.4rem}
.btn{display:inline-block;border:2px solid var(--black);color:var(--black);padding:.75rem 1.8rem;border-radius:30px;font-weight:700;font-size:.9rem;transition:all .2s}
.btn:hover{background:var(--black);color:var(--white)}
.btn-red{background:var(--red);border-color:var(--red);color:var(--white)}
.btn-red:hover{background:var(--red-dark);border-color:var(--red-dark)}

/* ===== Services ===== */
.services-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(230px,1fr));gap:1.6rem}
.service-card{background:var(--white);border:1px solid var(--gray-line);border-radius:16px;padding:2rem 1.6rem;text-align:center}
.service-card .icon{width:52px;height:52px;margin:0 auto 1.1rem;color:var(--red)}
.service-card h3{font-size:1.05rem;font-weight:700;margin-bottom:.5rem}
.service-card p{font-size:.88rem;color:var(--text-muted)}

/* ===== Filters (catalog) ===== */
.filters-bar{background:var(--white);border:1px solid var(--gray-line);border-radius:16px;padding:1.4rem;margin-bottom:2rem;display:grid;grid-template-columns:repeat(auto-fit,minmax(160px,1fr));gap:1rem;align-items:end}
.filters-bar .field label{display:block;font-size:.7rem;font-weight:700;color:var(--text-muted);text-transform:uppercase;letter-spacing:.06em;margin-bottom:.35rem}
.filters-bar select,.filters-bar input{width:100%;padding:.65rem .8rem;border:1px solid var(--gray-line);border-radius:8px;background:var(--gray-bg)}
.filters-bar .actions{display:flex;gap:.6rem}
.filters-bar .actions button,.filters-bar .actions a{flex:1;text-align:center;padding:.7rem .9rem;border-radius:8px;font-weight:700;font-size:.85rem;cursor:pointer;border:0}
.filters-bar .actions button{background:var(--red);color:var(--white)}
.filters-bar .actions a{background:var(--gray-bg);border:1px solid var(--gray-line);color:var(--text)}
.results-count{color:var(--text-muted);font-size:.9rem;margin-bottom:1.2rem}

/* ===== Vehicle detail ===== */
.vehicle-detail{display:grid;grid-template-columns:1.4fr 1fr;gap:3rem;align-items:start}
.detail-gallery-main{aspect-ratio:4/3;border-radius:16px;overflow:hidden;background:linear-gradient(135deg,#1a1919 0%,#0e0d0f 100%);display:flex;align-items:center;justify-content:center;margin-bottom:.8rem}
.detail-gallery-main img{width:100%;height:100%;object-fit:cover}
.detail-gallery-main.zoomable img{cursor:zoom-in}
.detail-thumbs{display:flex;gap:.6rem;flex-wrap:wrap}
.detail-thumbs img{width:80px;height:60px;object-fit:cover;border-radius:8px;cursor:pointer;border:2px solid transparent}
.detail-thumbs img.active{border-color:var(--red)}
.detail-header{margin-bottom:1rem}
.detail-header .vehicle-brand{font-size:.85rem}
.detail-header h1{font-size:1.7rem;font-weight:800;margin:.3rem 0 .8rem}
.spec-grid{display:grid;grid-template-columns:repeat(2,1fr);gap:.9rem;margin:1.4rem 0;padding:1.3rem;background:var(--gray-bg);border-radius:14px}
.spec-grid div{font-size:.85rem}
.spec-grid dt{color:var(--text-muted);font-size:.72rem;text-transform:uppercase;letter-spacing:.05em;margin-bottom:.15rem}
.spec-grid dd{font-weight:700}
.detail-price{display:flex;align-items:baseline;gap:.7rem;margin-bottom:1.4rem}
.detail-price .now{font-size:2rem;font-weight:800;color:var(--red)}
.detail-price .before{color:var(--text-muted);text-decoration:line-through}
.detail-desc{color:var(--text-muted);font-size:.92rem;line-height:1.7;margin-bottom:1.6rem}
.contact-box{background:var(--gray-bg);border-radius:16px;padding:1.6rem}
.contact-box h3{font-size:1.05rem;font-weight:700;margin-bottom:1rem}
.form-row{margin-bottom:.9rem}
.form-row label{display:block;font-size:.78rem;font-weight:600;margin-bottom:.35rem}
.form-row input,.form-row textarea{width:100%;padding:.7rem .85rem;border:1px solid var(--gray-line);border-radius:8px;background:var(--white)}
.form-row textarea{min-height:90px;resize:vertical}
.radio-group{display:flex;flex-direction:column;gap:.6rem}
.radio-group .radio-option{display:flex!important;align-items:center;gap:.6rem;font-weight:400!important;font-size:.88rem;margin-bottom:0!important;cursor:pointer}
.radio-group .radio-option input{width:auto!important;flex-shrink:0;margin:0;accent-color:var(--red)}

.finance-sim{background:var(--white);border-radius:18px;box-shadow:var(--shadow);padding:1.8rem;margin-bottom:1.6rem}
.finance-sim h3{font-size:1.1rem;font-weight:800;margin-bottom:1.5rem}
.finance-sim-body{display:grid;grid-template-columns:1fr 1fr;gap:1.8rem;align-items:stretch}
.finance-sim-inputs{display:flex;flex-direction:column;justify-content:flex-start;gap:1.3rem}
.finance-sim-field-top{display:flex;justify-content:space-between;align-items:baseline;margin-bottom:.7rem}
.finance-sim-field label{font-size:.75rem;font-weight:700;text-transform:uppercase;letter-spacing:.04em;color:var(--text-muted)}
.finance-sim-field-value{font-size:1.15rem;font-weight:800}
.finance-sim-range-labels{display:flex;justify-content:space-between;font-size:.72rem;color:var(--text-muted);margin-top:.4rem}

.finance-sim input[type=range]{-webkit-appearance:none;appearance:none;width:100%;height:6px;border-radius:999px;background:var(--gray-line);outline:none;margin:0}
.finance-sim input[type=range]::-webkit-slider-thumb{-webkit-appearance:none;appearance:none;width:22px;height:22px;border-radius:50%;background:var(--red);border:3px solid var(--white);box-shadow:0 2px 6px rgba(0,0,0,.3);cursor:pointer}
.finance-sim input[type=range]::-moz-range-thumb{width:16px;height:16px;border-radius:50%;background:var(--red);border:3px solid var(--white);box-shadow:0 2px 6px rgba(0,0,0,.3);cursor:pointer}

.finance-sim-output{background:var(--gray-bg);border-radius:14px;padding:1.5rem;display:flex;flex-direction:column;align-items:flex-start}
.finance-sim-output-label{font-size:.75rem;font-weight:700;text-transform:uppercase;letter-spacing:.04em;color:var(--text-muted)}
.finance-sim-output-value{font-size:2.2rem;font-weight:800;color:var(--red);margin:.2rem 0 .6rem;line-height:1.1}
.finance-sim-metrics{display:flex;gap:1.4rem;margin-bottom:.9rem;flex-wrap:wrap}
.finance-sim-metrics div{display:flex;flex-direction:column}
.finance-sim-metrics span{font-size:.68rem;font-weight:700;text-transform:uppercase;letter-spacing:.04em;color:var(--text-muted)}
.finance-sim-metrics strong{font-size:1rem;font-weight:800}
.finance-sim-output-note{font-size:.78rem;color:var(--text-muted);margin-bottom:1.1rem;line-height:1.5}
.finance-sim-cta{width:100%;text-align:center;margin-top:auto}
.finance-sim-disclaimer{font-size:.72rem;color:var(--text-muted);line-height:1.5;margin:1.3rem 0 0}
@media(max-width:600px){.finance-sim-body{grid-template-columns:1fr}}
.whatsapp-btn{display:flex;align-items:center;justify-content:center;gap:.5rem;width:100%;background:#25D366;color:#fff;padding:.85rem;border-radius:10px;font-weight:700;margin-top:.7rem}
@media(max-width:900px){.vehicle-detail{grid-template-columns:1fr}}

/* ===== Lightbox (galeria em ecrã cheio) ===== */
.lightbox{display:none;position:fixed;inset:0;z-index:200;background:rgba(5,5,5,.97);flex-direction:column;align-items:center;justify-content:center}
.lightbox.open{display:flex}
.lightbox-counter{position:absolute;top:1.1rem;left:1.2rem;color:rgba(255,255,255,.65);font-size:.82rem;z-index:2}
.lightbox-close{position:absolute;top:.8rem;right:.8rem;background:rgba(255,255,255,.1);border:0;color:#fff;width:44px;height:44px;border-radius:50%;font-size:1.6rem;line-height:1;cursor:pointer;z-index:2}
.lightbox-close:hover{background:rgba(255,255,255,.2)}
.lightbox-nav{position:absolute;top:50%;transform:translateY(-50%);background:rgba(255,255,255,.1);border:0;color:#fff;width:52px;height:52px;border-radius:50%;font-size:1.4rem;cursor:pointer;display:flex;align-items:center;justify-content:center;z-index:2}
.lightbox-nav:hover{background:rgba(255,255,255,.2)}
.lightbox-nav.prev{left:.8rem}
.lightbox-nav.next{right:.8rem}
.lightbox-main{flex:1;width:100%;display:flex;align-items:center;justify-content:center;overflow:hidden;padding:1rem;touch-action:pan-y}
.lightbox-main img{max-width:100%;max-height:100%;object-fit:contain;user-select:none;-webkit-user-drag:none}
.lightbox-thumbs{display:flex;gap:.5rem;padding:.9rem 1rem;overflow-x:auto;max-width:100%;-webkit-overflow-scrolling:touch}
.lightbox-thumbs img{width:64px;height:48px;object-fit:cover;border-radius:6px;cursor:pointer;opacity:.5;border:2px solid transparent;flex-shrink:0}
.lightbox-thumbs img.active{opacity:1;border-color:var(--red)}
@media(max-width:700px){
  .lightbox-nav{width:44px;height:44px;font-size:1.2rem}
  .lightbox-nav.prev{left:.4rem}
  .lightbox-nav.next{right:.4rem}
  .lightbox-thumbs img{width:52px;height:40px}
}

/* ===== Atendimento 100% Online ===== */
.online-card{background:var(--black);color:var(--white);border-radius:16px;padding:3rem 2rem;text-align:center;max-width:640px;margin:0 auto}
.trust-seal{display:inline-flex;align-items:center;gap:.5rem;background:rgba(160,35,33,.15);border:1px solid rgba(160,35,33,.5);color:var(--white);padding:.5rem 1.1rem;border-radius:30px;font-weight:700;font-size:.85rem;letter-spacing:.03em;margin-bottom:1.4rem}
.trust-seal svg{width:20px;height:20px;color:var(--red)}
.online-text{color:rgba(255,253,248,.7);font-size:.95rem;line-height:1.8;max-width:480px;margin:0 auto 1.8rem}
.online-text strong{color:var(--white);font-size:1.05rem}
.whatsapp-cta{display:inline-flex;align-items:center;justify-content:center;gap:.6rem;background:#25D366;color:#fff;padding:1rem 2rem;border-radius:30px;font-size:1rem;font-weight:700;margin-bottom:1.6rem;transition:background .2s,transform .2s}
.whatsapp-cta:hover{background:#1ebc59;transform:translateY(-1px)}
.whatsapp-cta svg{width:22px;height:22px}
.online-contacts{display:flex;flex-wrap:wrap;justify-content:center;gap:1.2rem}
.online-contacts a{display:inline-flex;align-items:center;gap:.5rem;border:1px solid rgba(255,255,255,.2);color:var(--white);padding:.7rem 1.3rem;border-radius:30px;font-size:.88rem;font-weight:600;transition:background .2s,border-color .2s}
.online-contacts a:hover{background:var(--white);color:var(--black);border-color:var(--white)}
.online-contacts svg{width:18px;height:18px}

/* ===== Footer ===== */
.site-footer{background:var(--black);color:rgba(255,253,248,.6);padding:3rem 0 1.5rem;margin-top:2rem}
.footer-top{display:flex;flex-wrap:wrap;gap:2rem;justify-content:space-between;margin-bottom:2rem}
.footer-top img{height:42px;margin-bottom:.8rem}
.footer-links h4{color:var(--white);font-size:.85rem;margin-bottom:.8rem;text-transform:uppercase;letter-spacing:.06em}
.footer-links a{display:block;font-size:.85rem;margin-bottom:.5rem;color:rgba(255,253,248,.6)}
.footer-links a:hover{color:var(--red)}
.footer-bottom{border-top:1px solid rgba(255,255,255,.08);padding-top:1.3rem;font-size:.78rem;display:flex;flex-wrap:wrap;gap:.5rem;justify-content:space-between}

.whatsapp-float{position:fixed;bottom:1.6rem;right:1.6rem;z-index:60;background:#25D366;color:#fff;width:56px;height:56px;border-radius:50%;display:flex;align-items:center;justify-content:center;box-shadow:var(--shadow)}
.whatsapp-float svg{width:28px;height:28px}

.placeholder-note{background:#fff3cd;border:1px solid #ffe08a;color:#7a5c00;font-size:.82rem;padding:.9rem 1.2rem;border-radius:10px;margin-bottom:1.5rem}

.empty-state{text-align:center;padding:3rem 1rem;color:var(--text-muted)}

.alert-success{background:#e6f7ec;border:1px solid #a9e3bf;color:#1a7a3d;padding:1rem 1.2rem;border-radius:10px;margin-bottom:1rem;font-size:.9rem}
