:root{
  --bg:#0f1215; --panel:#151a1f; --muted:#9aa4ad; --text:#e7edf3;
  --line:#242b33; --brand:#e53935; --brand2:#ff7043;
  --shadow: 0 10px 20px rgba(0,0,0,.35);
  --radius:16px;
  --radius2:22px;
  --max:1100px;
  --font: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
}
*{box-sizing:border-box}
html,body{height:100%}
body{margin:0; font-family:var(--font); background:linear-gradient(180deg,#0b0e11,#0f1215 40%,#0b0e11); color:var(--text)}
a{color:inherit; text-decoration:none}
.container{max-width:var(--max); margin:0 auto; padding:0 18px}

.topbar{
  position:sticky; top:0; z-index:10;
  backdrop-filter:saturate(1.4) blur(10px);
  background:rgba(10,12,15,.72);
  border-bottom:1px solid rgba(255,255,255,.06)
}
.topbar__inner{
  display:flex; align-items:center; justify-content:space-between;
  padding:14px 0; gap:16px
}
.brand{display:flex; align-items:center; gap:10px; font-weight:800; letter-spacing:.5px}
.brand__logo{width:34px;height:34px;border-radius:10px;background:linear-gradient(135deg,var(--brand),var(--brand2)); display:grid;place-items:center; font-weight:900}
.brand__text{opacity:.95}

.nav{display:flex; gap:16px}
.nav a{color:var(--muted); font-weight:600; white-space:nowrap}
.nav a:hover{color:var(--text)}

.btn{
  display:inline-flex; align-items:center; justify-content:center; gap:8px;
  border:1px solid rgba(255,255,255,.12);
  padding:10px 14px; border-radius:12px;
  font-weight:700; cursor:pointer
}
.btn--primary{background:linear-gradient(135deg,var(--brand),var(--brand2)); border:0}
.btn--ghost{background:rgba(255,255,255,.04)}

.hero{
  margin:22px 0 18px; padding:26px;
  border:1px solid rgba(255,255,255,.08);
  background:linear-gradient(180deg,rgba(255,255,255,.05),rgba(255,255,255,.02));
  border-radius:var(--radius2)
}
.hero__grid{display:grid; grid-template-columns: 1.2fr .8fr; gap:18px; align-items:center}
.hero h1{margin:0 0 10px; font-size:38px; line-height:1.05}
.hero p{margin:0 0 16px; color:var(--muted); font-size:15px}

.badges{display:flex; flex-wrap:wrap; gap:8px}
.badge{font-size:12px; color:var(--muted); border:1px solid rgba(255,255,255,.10); padding:7px 10px; border-radius:999px}

.card{background:var(--panel); border:1px solid rgba(255,255,255,.08); border-radius:var(--radius); overflow:hidden}
.card__body{padding:14px}

.grid{display:grid; gap:14px}
.grid--3{grid-template-columns:repeat(3,1fr)}
.grid--2{grid-template-columns:repeat(2,1fr)}

.thumb{aspect-ratio: 16/10; background:linear-gradient(135deg,rgba(255,255,255,.06),rgba(255,255,255,.02)); display:grid;place-items:center}
.thumb img{width:100%;height:100%;object-fit:cover}

.meta{display:flex; flex-wrap:wrap; gap:10px; color:var(--muted); font-size:13px}
.price{font-size:18px; font-weight:900}
.kicker{color:var(--muted); font-weight:700; letter-spacing:.4px; text-transform:uppercase; font-size:12px}

.section{margin:18px 0}
.section__head{display:flex; align-items:end; justify-content:space-between; gap:12px; margin-bottom:10px}
.section__head h2{margin:0; font-size:18px}

.filters{
  display:grid; gap:10px; grid-template-columns:repeat(6,1fr);
  background:rgba(255,255,255,.03);
  border:1px solid rgba(255,255,255,.08);
  padding:12px; border-radius:16px
}
.filters input,.filters select,.filters textarea{
  width:100%; padding:10px 10px; border-radius:12px;
  border:1px solid rgba(255,255,255,.10);
  background:rgba(0,0,0,.25); color:var(--text)
}
.filters label{display:flex; flex-direction:column; gap:6px; font-size:12px; color:var(--muted); font-weight:700}
.filters .span2{grid-column:span 2}
.filters .span3{grid-column:span 3}

.table{width:100%; border-collapse:collapse}
.table th,.table td{padding:10px 10px; border-bottom:1px solid rgba(255,255,255,.06); font-size:14px}
.table th{color:var(--muted); text-align:left; font-size:12px; text-transform:uppercase; letter-spacing:.3px}

.notice{padding:12px 14px; border:1px solid rgba(255,255,255,.10); border-radius:14px; background:rgba(46,204,113,.08); color:#d9ffe8}

.footer{border-top:1px solid rgba(255,255,255,.06); margin-top:28px; padding:18px 0; color:var(--muted)}

.gallery{display:grid; grid-template-columns: 2fr 1fr; gap:12px}
.gallery img{width:100%; height:100%; object-fit:cover; border-radius:14px; border:1px solid rgba(255,255,255,.08)}
.gallery__side{display:grid; gap:12px}

/* tablets */
@media (max-width:920px){
  .hero__grid{grid-template-columns:1fr}
  .grid--3{grid-template-columns:repeat(2,1fr)}
  .filters{grid-template-columns:repeat(2,1fr)}
  .filters .span2,.filters .span3{grid-column:auto}
  .topbar__inner{padding:12px 0}
}

/* móviles */
@media (max-width:620px){
  .container{padding:0 12px}

  /* TOPBAR: menú visible (scroll horizontal) */
  .topbar__inner{flex-wrap:wrap; gap:10px}
  .brand img{height:34px !important}
  .nav{
    display:flex;
    width:100%;
    gap:14px;
    overflow-x:auto;
    overflow-y:hidden;
    -webkit-overflow-scrolling:touch;
    padding-bottom:6px;
    border-top:1px solid rgba(255,255,255,.06);
    padding-top:10px;
  }
  .nav a{font-size:14px}

  .btn{padding:9px 12px; border-radius:12px; font-weight:800}

  .grid--3,.grid--2{grid-template-columns:1fr}

  h1{font-size:26px !important; line-height:1.15 !important}
  h2{font-size:20px !important}

  /* HOME hero inline: apilar y quitar anchuras fijas */
  section[style*="max-width:1100px"] > div[style*="padding:22px"]{
    padding:16px !important;
    gap:14px !important;
    flex-direction:column !important;
  }
  div[style*="width:420px"][style*="min-height:220px"]{
    width:100% !important;
    max-width:100% !important;
    min-height:180px !important;
  }

  /* CAR: bajar alto de foto grande (inline 420px) */
  div[style*="height:420px"][style*="display:flex"]{
    height:240px !important;
  }

  /* TARJETAS HOME/STOCK: imagen cuadrada y sin recorte (ataca inline height:170px) */
  div[style*="height:170px"]{
    aspect-ratio: 1 / 1 !important;
    height:auto !important;
    background:#0b0e11 !important;
    overflow:hidden !important;
  }
  div[style*="height:170px"] img{
    width:100% !important;
    height:100% !important;
    object-fit:contain !important;
    background:#0b0e11 !important;
  }

  /* ✅ COMPACTAR TEXTO EN TARJETA (pisar inline) */
  a[href*="car.php"] div[style*="padding:14px"]{
    padding:12px !important;
  }
  /* precio (inline font-size:22px) */
  a[href*="car.php"] div[style*="font-size:22px"]{
    font-size:18px !important;
    margin-bottom:6px !important;
  }
  /* título (inline font-size:18px) */
  a[href*="car.php"] div[style*="font-size:18px"]{
    font-size:16px !important;
    margin-bottom:6px !important;
  }
  /* meta (inline font-size:13px) */
  a[href*="car.php"] div[style*="font-size:13px"]{
    font-size:12px !important;
    gap:8px !important;
  }

  /* tarjeta más “compacta” y centrada (evita aspecto estirado) */
  a[href*="car.php"] > div{
    max-width:340px !important;
    margin:0 auto !important;
  }

  .card__body{padding:12px}
  .footer{padding:14px 0}
}
