/* ==========================================================================
   Klipp Car — Design System
   Identidade: azul confiança + slate escuro, cantos suaves, cartão de veículo
   com a foto como herói. Mobile-first.
   ========================================================================== */

:root {
  --brand:        #ED1C24;
  --brand-dark:   #B71219;
  --brand-soft:   #FDECEC;
  --ink:          #0F172A;
  --ink-2:        #334155;
  --muted:        #64748B;
  --line:         #E2E8F0;
  --bg:           #F6F8FB;
  --card:         #FFFFFF;
  --green:        #16A34A;
  --green-soft:   #E7F7ED;
  --amber:        #D97706;
  --amber-soft:   #FEF3E2;
  --red:          #DC2626;

  --radius:       16px;
  --radius-sm:    10px;
  --shadow-sm:    0 1px 2px rgba(15,23,42,.06), 0 1px 3px rgba(15,23,42,.05);
  --shadow-md:    0 4px 12px rgba(15,23,42,.08), 0 2px 4px rgba(15,23,42,.04);
  --shadow-lg:    0 18px 40px rgba(15,23,42,.16);

  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --maxw: 1200px;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
h1,h2,h3,h4 { line-height: 1.2; margin: 0 0 .4em; letter-spacing: -.02em; }
h1 { font-size: clamp(1.9rem, 4.5vw, 3rem); font-weight: 800; }
h2 { font-size: clamp(1.4rem, 3vw, 2rem); font-weight: 750; }
p { margin: 0 0 1rem; }

.container { max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }
.section { padding: 56px 0; }
.section-tight { padding: 36px 0; }

.eyebrow {
  text-transform: uppercase; letter-spacing: .12em; font-size: .74rem;
  font-weight: 700; color: var(--brand);
}
.muted { color: var(--muted); }
.text-center { text-align: center; }

/* ---------- Botões ---------- */
.btn {
  display: inline-flex; align-items: center; gap: .5rem; justify-content: center;
  font-weight: 650; font-size: .95rem; padding: .7rem 1.25rem;
  border-radius: 999px; border: 1px solid transparent; cursor: pointer;
  transition: transform .12s ease, box-shadow .2s ease, background .2s ease;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--brand); color: #fff; box-shadow: 0 6px 16px rgba(237,28,36,.28); }
.btn-primary:hover { background: var(--brand-dark); }
.btn-wa { background: #25D366; color: #fff; box-shadow: 0 6px 16px rgba(37,211,102,.3); }
.btn-wa:hover { filter: brightness(.95); }
.btn-ghost { background: #fff; border-color: var(--line); color: var(--ink); box-shadow: var(--shadow-sm); }
.btn-ghost:hover { border-color: var(--brand); color: var(--brand); }
.btn-lg { padding: .9rem 1.6rem; font-size: 1.02rem; }
.btn-block { width: 100%; }

/* ---------- Topbar de contato (acima do header) ---------- */
.topbar {
  background: var(--brand); color: #fff; font-size: .82rem;
  border-bottom: 1px solid rgba(0,0,0,.1);
}
.topbar .container {
  display: flex; align-items: center; gap: 1.2rem; min-height: 38px; flex-wrap: wrap;
}
.topbar a { color: #fff; display: inline-flex; align-items: center; gap: .35rem; }
.topbar a:hover { color: rgba(255,255,255,.85); }
.topbar .tb-contacts { display: flex; align-items: center; gap: 1.2rem; flex-wrap: wrap; }
.topbar .tb-social { margin-left: auto; display: flex; align-items: center; gap: .9rem; }
.topbar .tb-wa { color: #fff; font-weight: 600; }
.topbar .tb-sep { color: rgba(255,255,255,.4); }
.topbar .tb-hours { color: rgba(255,255,255,.85); }
@media (max-width: 720px) {
  .topbar .tb-hours { display: none; }
  .topbar .container { gap: .8rem; min-height: 34px; }
  .topbar .tb-contacts { gap: .8rem; }
}
@media (max-width: 480px) {
  .topbar .tb-social { display: none; }
}

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255,255,255,.9); backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--line);
}
.site-header .container {
  display: flex; align-items: center; gap: 1.5rem; height: 68px;
}
.logo { display: flex; align-items: center; gap: .55rem; font-weight: 800; font-size: 1.25rem; letter-spacing: -.03em; }
.logo .mark {
  width: 34px; height: 34px; border-radius: 9px;
  background: linear-gradient(135deg, var(--brand), #FF5A5F);
  display: grid; place-items: center; color: #fff; font-weight: 800; font-size: .95rem;
  box-shadow: 0 4px 10px rgba(237,28,36,.35);
}
/* Logo oficial (imagem) */
.logo-img { height: 38px; width: auto; display: block; }
.site-footer .logo-img { height: 42px; }
.login-logo .logo-img { height: 46px; }
.admin-layout .brand .logo-img { height: 34px; }
.nav { display: flex; gap: .35rem; margin-left: auto; align-items: center; }
.nav a {
  padding: .5rem .85rem; border-radius: 999px; font-weight: 550; font-size: .94rem; color: var(--ink-2);
}
.nav a:hover { background: var(--brand-soft); color: var(--brand); }
.nav a.active { color: var(--brand); font-weight: 650; }
.nav .btn { margin-left: .4rem; }

.nav-toggle { display: none; margin-left: auto; background: none; border: 0; cursor: pointer; padding: .3rem; }
.nav-toggle span { display: block; width: 24px; height: 2px; background: var(--ink); margin: 5px 0; border-radius: 2px; }

@media (max-width: 860px) {
  .nav-toggle { display: block; }
  .nav {
    position: absolute; top: 68px; left: 0; right: 0; flex-direction: column; align-items: stretch;
    background: #fff; border-bottom: 1px solid var(--line); padding: .6rem 20px 1rem;
    gap: .2rem; box-shadow: var(--shadow-md); display: none; margin: 0;
  }
  .nav.open { display: flex; }
  .nav a { padding: .7rem .85rem; }
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  background:
    radial-gradient(1200px 520px at 82% -10%, rgba(237,28,36,.28), transparent 62%),
    linear-gradient(180deg, #141414, #0A0A0A);
  color: #fff; padding: 60px 0 130px;
  overflow: hidden;
}
.hero-bg { position: absolute; inset: 0; z-index: 0; }
.hero-bg-slide {
  position: absolute; inset: 0;
  background-size: cover; background-position: center;
  opacity: 0; transition: opacity 1.4s ease;
}
.hero-bg-slide.is-active { opacity: 1; }
.hero-bg::after {
  content: ""; position: absolute; inset: 0;
  background:
    linear-gradient(100deg, rgba(0,0,0,.72) 0%, rgba(0,0,0,.55) 45%, rgba(0,0,0,.4) 100%),
    radial-gradient(1200px 520px at 82% -10%, rgba(237,28,36,.22), transparent 62%);
}
.hero .container { position: relative; z-index: 1; }
.hero h1 { color: #fff; max-width: 16ch; }
.hero .lead { color: #C7D2E1; font-size: 1.12rem; max-width: 46ch; margin-bottom: 1.6rem; }
.hero .stats { display: flex; gap: 2rem; margin-top: 1.8rem; flex-wrap: wrap; }
.hero .stats b { display: block; font-size: 1.5rem; font-weight: 800; }
.hero .stats span { color: #9FB0C4; font-size: .85rem; }

/* ---------- Barra de filtro ---------- */
.filter-bar {
  background: #fff; border-radius: var(--radius); box-shadow: var(--shadow-lg);
  padding: 18px; display: grid; gap: 12px;
  grid-template-columns: repeat(4, 1fr) auto;
}
.hero .filter-wrap { margin-top: 2.4rem; margin-bottom: -90px; position: relative; z-index: 2; }
.filter-field label {
  display: block; font-size: .72rem; text-transform: uppercase; letter-spacing: .08em;
  font-weight: 700; color: var(--muted); margin-bottom: .3rem;
}
.filter-field select, .filter-field input, .field-input {
  width: 100%; padding: .65rem .7rem; border: 1px solid var(--line); border-radius: var(--radius-sm);
  font: inherit; font-size: .92rem; color: var(--ink); background: #fff; appearance: none;
}
.filter-field select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%2364748B' d='M6 8 0 0h12z'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right .7rem center; padding-right: 1.8rem; }
.filter-field select:focus, .filter-field input:focus, .field-input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.filter-bar .filter-submit { align-self: end; }
@media (max-width: 900px) { .filter-bar { grid-template-columns: 1fr 1fr; } .filter-bar .filter-submit { grid-column: 1 / -1; } .filter-bar .filter-submit .btn { width: 100%; } }
@media (max-width: 520px) { .filter-bar { grid-template-columns: 1fr; } }

/* ---------- Categorias rápidas ---------- */
.chips { display: flex; gap: .6rem; flex-wrap: wrap; }
.chip {
  display: inline-flex; align-items: center; gap: .45rem; padding: .6rem 1.05rem;
  background: #fff; border: 1px solid var(--line); border-radius: 999px; font-weight: 600; font-size: .92rem;
  box-shadow: var(--shadow-sm); transition: all .15s ease;
}
.chip:hover { border-color: var(--brand); color: var(--brand); transform: translateY(-2px); }
.chip .ico { font-size: 1.05rem; }

/* ---------- Grid de veículos ---------- */
.grid-cars { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
@media (max-width: 960px) { .grid-cars { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 620px) { .grid-cars { grid-template-columns: 1fr; } }

.car-card {
  background: var(--card); border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--shadow-sm); border: 1px solid var(--line);
  transition: transform .18s ease, box-shadow .2s ease; display: flex; flex-direction: column;
}
.car-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.car-photo { position: relative; aspect-ratio: 4/3; background: #EEF2F7; overflow: hidden; }
.car-photo img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s ease; }
.car-card:hover .car-photo img { transform: scale(1.04); }
.car-photo .no-photo { width:100%; height:100%; display:grid; place-items:center; color:var(--muted); font-size:.85rem; }
.car-badges { position: absolute; top: 10px; left: 10px; display: flex; gap: 6px; flex-wrap: wrap; }
.badge {
  font-size: .7rem; font-weight: 700; padding: .28rem .6rem; border-radius: 999px;
  background: rgba(15,23,42,.82); color: #fff; backdrop-filter: blur(4px);
}
.badge.green { background: var(--green); }
.badge.brand { background: var(--brand); }
.badge.amber { background: var(--amber); }
.car-status { position: absolute; top: 10px; right: 10px; }

.car-body { padding: 15px 16px 17px; display: flex; flex-direction: column; flex: 1; }
.car-title { font-size: 1.08rem; font-weight: 750; letter-spacing: -.01em; }
.car-version { color: var(--muted); font-size: .85rem; margin: .1rem 0 .7rem; min-height: 1.1em;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.car-specs { display: flex; flex-wrap: wrap; gap: .35rem .8rem; color: var(--ink-2); font-size: .82rem; margin-bottom: .9rem; }
.car-specs span { display: inline-flex; align-items: center; gap: .3rem; }
.car-specs .dot { color: var(--line); }
.car-price { margin-top: auto; display: flex; align-items: baseline; justify-content: space-between; gap: .5rem; }
.car-price .val { font-size: 1.3rem; font-weight: 800; letter-spacing: -.02em; }
.car-price .arrow { color: var(--brand); font-weight: 700; font-size: .85rem; }

.seals { display: flex; gap: .3rem; flex-wrap: wrap; margin: -.2rem 0 .7rem; }
.seal { font-size: .7rem; font-weight: 650; color: var(--green); background: var(--green-soft);
  padding: .2rem .5rem; border-radius: 6px; display: inline-flex; gap: .25rem; align-items: center; }

/* ---------- Estoque layout ---------- */
.estoque-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1.2rem; flex-wrap: wrap; }
.result-count { color: var(--muted); font-size: .92rem; }
.sort-select { padding: .55rem .8rem; border: 1px solid var(--line); border-radius: var(--radius-sm); font: inherit; background: #fff; }

.empty-state { text-align: center; padding: 60px 20px; color: var(--muted); }
.empty-state .big { font-size: 2.4rem; margin-bottom: .4rem; }

/* ---------- Ficha do veículo ---------- */
.ficha-grid { display: grid; grid-template-columns: 1.35fr 1fr; gap: 34px; align-items: start; }
@media (max-width: 900px) { .ficha-grid { grid-template-columns: 1fr; } }

.gallery-main { border-radius: var(--radius); overflow: hidden; background: #EEF2F7; aspect-ratio: 4/3; box-shadow: var(--shadow-md); }
.gallery-main img { width: 100%; height: 100%; object-fit: cover; }
.gallery-thumbs { display: flex; gap: 10px; margin-top: 12px; flex-wrap: wrap; }
.gallery-thumbs img { width: 84px; height: 64px; object-fit: cover; border-radius: 9px; cursor: pointer; border: 2px solid transparent; opacity: .8; transition: all .15s; }
.gallery-thumbs img:hover, .gallery-thumbs img.active { border-color: var(--brand); opacity: 1; }

.ficha-side { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow-sm); position: sticky; top: 88px; }
.ficha-price { font-size: 2.1rem; font-weight: 800; letter-spacing: -.02em; }
.ficha-title { font-size: 1.5rem; font-weight: 780; }

.spec-table { width: 100%; border-collapse: collapse; margin: 1rem 0; }
.spec-table td { padding: .6rem 0; border-bottom: 1px solid var(--line); font-size: .92rem; }
.spec-table td:first-child { color: var(--muted); }
.spec-table td:last-child { text-align: right; font-weight: 600; }

.seal-row { display: flex; flex-wrap: wrap; gap: .5rem; margin: 1rem 0; }
.seal-big { display: inline-flex; align-items: center; gap: .4rem; background: var(--green-soft); color: var(--green); font-weight: 650; font-size: .85rem; padding: .45rem .8rem; border-radius: 999px; }

/* ---------- Institucional / Equipe ---------- */
.team-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px,1fr)); gap: 20px; }
.team-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; text-align: center; box-shadow: var(--shadow-sm); }
.team-avatar { width: 84px; height: 84px; border-radius: 50%; object-fit: cover; margin: 0 auto .8rem; background: var(--brand-soft); display: grid; place-items: center; color: var(--brand); font-weight: 800; font-size: 1.6rem; }
.map-embed { width: 100%; height: 360px; border: 0; border-radius: var(--radius); box-shadow: var(--shadow-md); }

/* ---------- Formulário contato ---------- */
.form-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 28px; box-shadow: var(--shadow-sm); }
.form-row { margin-bottom: 1rem; }
.form-row label { display: block; font-weight: 600; font-size: .88rem; margin-bottom: .35rem; }
.form-row input, .form-row textarea, .form-row select { width: 100%; padding: .7rem .8rem; border: 1px solid var(--line); border-radius: var(--radius-sm); font: inherit; }
.form-row input:focus, .form-row textarea:focus, .form-row select:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.alert-success { background: var(--green-soft); color: #0F5C2E; border: 1px solid #B7E4C7; padding: 1rem; border-radius: var(--radius-sm); margin-bottom: 1rem; }

/* ---------- Footer ---------- */
.site-footer { background: var(--ink); color: #C7D2E1; padding: 46px 0 26px; margin-top: 40px; }
.footer-grid { display: grid; grid-template-columns: 1.5fr 1fr 1fr; gap: 30px; }
@media (max-width: 700px) { .footer-grid { grid-template-columns: 1fr; gap: 22px; } }
.site-footer h4 { color: #fff; font-size: .95rem; }
.site-footer a { color: #C7D2E1; }
.site-footer a:hover { color: #fff; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.1); margin-top: 28px; padding-top: 18px; font-size: .82rem; color: #7E8CA0; display:flex; justify-content:space-between; flex-wrap:wrap; gap:.5rem; }

/* WhatsApp flutuante */
.wa-float { position: fixed; bottom: 22px; right: 22px; width: 56px; height: 56px; border-radius: 50%; background: #25D366; display: grid; place-items: center; box-shadow: 0 8px 24px rgba(37,211,102,.5); z-index: 60; }
.wa-float svg { width: 30px; height: 30px; fill: #fff; }
.wa-float:hover { transform: scale(1.06); }

.loading { opacity: .5; transition: opacity .2s; }
