/* AUTO GIRO – estilos */
:root {
  --red: #D61A20;
  --red-dark: #B3151A;
  --ink: #111111;
  --text: #3F3F46;
  --muted: #52525B;
  --line: #E4E4E7;
  --line-strong: #D4D4D8;
  --bg: #F4F4F5;
  --white: #FFFFFF;
  --green: #1F8A4C;
  --radius: 14px;
  --display: 'Saira', 'Arial Narrow', sans-serif;
  --body: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--body); font-size: 16px; line-height: 1.5; }
img { max-width: 100%; display: block; }
a { color: var(--ink); text-decoration: none; }
a:hover { color: var(--red-dark); }
h1, h2, h3 { line-height: 1.15; margin: 0; }
.container { max-width: 1280px; margin: 0 auto; padding: 0 20px; }
.display { font-family: var(--display); font-weight: 800; text-transform: uppercase; }
.muted { color: var(--muted); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.hp { position: absolute; left: -9999px; }

/* Botones */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 12px 20px; border-radius: 10px; font: inherit; font-weight: 700; font-size: 15px; border: 1px solid transparent; cursor: pointer; text-align: center; }
.btn-red { background: var(--red); color: var(--white); }
.btn-red:hover { background: var(--red-dark); color: var(--white); }
.btn-dark { background: var(--ink); color: var(--white); }
.btn-dark:hover { background: #2a2a2a; color: var(--white); }
.btn-outline { background: var(--white); color: var(--ink); border-color: var(--ink); }
.btn-light { background: var(--white); color: var(--ink); border-color: var(--line-strong); }
.btn-green { background: var(--green); color: var(--white); }
.btn-green:hover { background: #18703d; color: var(--white); }
.btn-sm { min-height: 38px; padding: 8px 12px; font-size: 14px; }
.btn-block { width: 100%; }
.link-btn { background: none; border: none; padding: 8px 0; font: inherit; font-weight: 600; color: var(--red-dark); cursor: pointer; }

/* Encabezado */
.site-header { background: var(--white); border-bottom: 1px solid var(--line); }
.site-header .container { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 32px; padding-top: 12px; padding-bottom: 12px; }
.logo img { height: 44px; width: auto; }
.main-nav { display: flex; flex-wrap: wrap; gap: 6px 24px; flex: 1 1 auto; font-weight: 600; font-size: 15px; }
.main-nav a.active { color: var(--red-dark); }
.header-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.header-actions form { margin: 0; }

/* Mensajes */
.flashes { display: flex; flex-direction: column; gap: 8px; margin: 16px auto 0; }
.flash { padding: 12px 16px; border-radius: 10px; font-weight: 500; border: 1px solid; }
.flash-success { background: #E7F6EC; color: #14532D; border-color: #B7E1C3; }
.flash-error { background: #FDECEC; color: #8A1116; border-color: #F5B8BA; }
.flash-info { background: #EEF2FF; color: #1E3A8A; border-color: #C7D2FE; }

/* Hero y buscador */
.hero { background: var(--ink); color: var(--white); }
.hero .container { padding-top: 56px; padding-bottom: 64px; display: flex; flex-direction: column; gap: 24px; }
.hero h1 { font-family: var(--display); font-style: italic; font-weight: 900; font-size: clamp(34px, 5vw, 56px); text-transform: uppercase; max-width: 780px; }
.hero p { margin: 0; color: #D4D4D8; font-size: 18px; }
.search-box { background: var(--white); color: var(--ink); border-radius: 16px; padding: 20px; box-shadow: 0 20px 40px rgba(0,0,0,.25); display: flex; flex-direction: column; gap: 16px; }
.pills { display: flex; flex-wrap: wrap; gap: 8px; }
.pill { display: inline-flex; align-items: center; min-height: 40px; padding: 8px 16px; border-radius: 999px; border: 1px solid var(--line-strong); background: var(--white); font-weight: 600; font-size: 14px; }
.pill.active { background: var(--ink); color: var(--white); border-color: var(--ink); }
.search-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; align-items: end; }

/* Formularios */
.field { display: flex; flex-direction: column; gap: 6px; font-size: 14px; font-weight: 600; color: var(--ink); }
.field .hint { font-weight: 400; color: var(--muted); font-size: 13px; }
input[type=text], input[type=email], input[type=tel], input[type=password], input[type=number], input[type=search], input[type=date], select, textarea {
  font: inherit; font-weight: 400; font-size: 16px; color: var(--ink); background: var(--white);
  border: 1px solid var(--line-strong); border-radius: 10px; padding: 11px 12px; min-height: 46px; width: 100%; min-width: 0;
}
textarea { min-height: 120px; resize: vertical; }
input:focus, select:focus, textarea:focus, .btn:focus-visible, a:focus-visible { outline: 3px solid #93C5FD; outline-offset: 1px; }
.check { display: flex; gap: 10px; align-items: center; font-size: 15px; font-weight: 500; }
.check input { width: 20px; height: 20px; accent-color: var(--ink); }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.card { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.between { justify-content: space-between; }

/* Secciones */
.section { padding-top: 44px; }
.section-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 8px; margin-bottom: 18px; }
.section-head h2 { font-family: var(--display); font-weight: 800; font-size: 28px; text-transform: uppercase; }

/* Tarjetas de vehículos */
.car-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 20px; }
.car-card { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; }
.car-card:hover { border-color: var(--ink); color: var(--ink); }
.car-photo { position: relative; aspect-ratio: 4 / 3; background: var(--line); display: flex; align-items: center; justify-content: center; }
.car-photo img { width: 100%; height: 100%; object-fit: cover; }
.badge { position: absolute; top: 12px; left: 12px; font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: 999px; }
.badge-red { background: var(--red); color: var(--white); }
.badge-dark { background: var(--ink); color: var(--white); }
.badge-light { background: var(--white); color: var(--ink); }
.car-body { padding: 16px; display: flex; flex-direction: column; gap: 4px; }
.car-title { font-weight: 700; font-size: 16px; }
.car-meta { font-size: 14px; color: var(--muted); }
.car-price { font-family: var(--display); font-weight: 800; font-size: 24px; margin-top: 4px; }

/* Lista de resultados */
.results-layout { display: flex; flex-wrap: wrap; gap: 24px; align-items: flex-start; }
.filters { flex: 1 1 260px; max-width: 300px; display: flex; flex-direction: column; gap: 18px; }
.results { flex: 999 1 560px; min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.result { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; display: flex; flex-wrap: wrap; }
.result.featured { border: 2px solid var(--red); }
.result .car-photo { flex: 1 1 240px; max-width: 320px; aspect-ratio: auto; min-height: 190px; }
.result-body { flex: 999 1 300px; padding: 20px; display: flex; flex-wrap: wrap; gap: 16px; justify-content: space-between; }
.result-info { display: flex; flex-direction: column; gap: 8px; min-width: 220px; }
.result-side { display: flex; flex-direction: column; align-items: flex-end; justify-content: space-between; gap: 12px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; font-size: 13px; }
.chip { background: var(--bg); padding: 4px 10px; border-radius: 6px; }
.pagination { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; padding-top: 8px; }
.pagination a, .pagination span { min-width: 44px; height: 44px; padding: 0 14px; display: inline-flex; align-items: center; justify-content: center; border-radius: 10px; background: var(--white); border: 1px solid var(--line-strong); font-weight: 600; }
.pagination .current { background: var(--ink); color: var(--white); border-color: var(--ink); }
.empty { text-align: center; padding: 48px 24px; }

/* Anuncio */
.detail-layout { display: flex; flex-wrap: wrap; gap: 24px; align-items: flex-start; }
.detail-main { flex: 999 1 560px; min-width: 0; display: flex; flex-direction: column; gap: 20px; }
.detail-side { flex: 1 1 340px; max-width: 440px; display: flex; flex-direction: column; gap: 20px; }
.gallery-main { background: var(--line); border-radius: 16px; overflow: hidden; aspect-ratio: 4 / 3; display: flex; align-items: center; justify-content: center; position: relative; }
.gallery-main img { width: 100%; height: 100%; object-fit: contain; background: #1b1b1b; }
.gallery-count { position: absolute; bottom: 14px; right: 14px; background: rgba(17,17,17,.82); color: var(--white); font-size: 13px; font-weight: 600; padding: 6px 12px; border-radius: 999px; }
.gallery-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 44px; height: 44px; border-radius: 999px; border: none; background: rgba(255,255,255,.92); cursor: pointer; font-size: 22px; font-weight: 700; }
.gallery-nav.prev { left: 12px; } .gallery-nav.next { right: 12px; }
.thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 8px; }
.thumbs button { padding: 0; border: 3px solid transparent; border-radius: 10px; overflow: hidden; background: var(--line); cursor: pointer; aspect-ratio: 4 / 3; }
.thumbs button.active { border-color: var(--ink); }
.thumbs img { width: 100%; height: 100%; object-fit: cover; }
.specs { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 16px 24px; }
.spec small { display: block; color: var(--muted); font-size: 13px; }
.spec strong { font-size: 16px; font-weight: 600; }
.price-big { font-family: var(--display); font-weight: 800; font-size: 40px; line-height: 1.1; }
.seller { display: flex; gap: 14px; align-items: center; }
.avatar { width: 56px; height: 56px; border-radius: 12px; background: var(--ink); color: var(--white); display: flex; align-items: center; justify-content: center; font-family: var(--display); font-weight: 800; font-size: 20px; overflow: hidden; flex: none; }
.avatar img { width: 100%; height: 100%; object-fit: cover; background: var(--white); }
.description { white-space: pre-line; color: var(--text); }

/* CTA y planes */
.cta-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 20px; padding: 48px 0 64px; }
.cta { border-radius: 18px; padding: 32px; display: flex; flex-direction: column; gap: 12px; align-items: flex-start; }
.cta h3 { font-family: var(--display); font-weight: 800; font-size: 30px; text-transform: uppercase; }
.cta p { margin: 0; }
.cta-light { background: var(--white); border: 1px solid var(--line); }
.cta-dark { background: var(--ink); color: var(--white); }
.cta-dark p { color: #D4D4D8; }
.eyebrow { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; color: var(--red-dark); }
.cta-dark .eyebrow { color: #FCA5A5; }
.plans-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 20px; padding: 44px 0 24px; }
.plan { background: var(--white); border: 1px solid var(--line); border-radius: 18px; padding: 30px; display: flex; flex-direction: column; gap: 16px; position: relative; }
.plan.popular { border: 3px solid var(--ink); }
.plan ul { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.plan li { display: flex; gap: 10px; }
.plan li::before { content: "✓"; color: var(--green); font-weight: 800; }

/* Panel */
.panel-layout { display: flex; flex-wrap: wrap; gap: 24px; align-items: flex-start; padding: 24px 0 64px; }
.panel-nav { flex: 1 1 220px; max-width: 260px; background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px; display: flex; flex-direction: column; gap: 2px; font-weight: 600; }
.panel-nav a { padding: 12px 14px; border-radius: 10px; }
.panel-nav a.active { background: var(--bg); }
.panel-main { flex: 999 1 560px; min-width: 0; display: flex; flex-direction: column; gap: 20px; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; }
.kpi strong { display: block; font-family: var(--display); font-weight: 800; font-size: 32px; }
.progress { height: 10px; background: var(--bg); border-radius: 999px; overflow: hidden; }
.progress > div { height: 100%; background: var(--ink); }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; color: var(--muted); font-weight: 600; padding: 10px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 12px 8px; border-bottom: 1px solid var(--bg); vertical-align: middle; }
.status { font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: 999px; white-space: nowrap; }
.status-activo { background: #E7F6EC; color: #14532D; }
.status-pausado, .status-pendiente { background: #FEF3C7; color: #78350F; }
.status-vendido { background: #E0E7FF; color: #1E3A8A; }
.status-vencido, .status-suspendida { background: #FDECEC; color: #8A1116; }
.status-activa { background: #E7F6EC; color: #14532D; }
.status-destacado { background: var(--ink); color: var(--white); }
.mini-thumb { width: 72px; height: 54px; border-radius: 8px; object-fit: cover; background: var(--line); flex: none; }
.actions { display: flex; flex-wrap: wrap; gap: 6px; }
.actions form { margin: 0; }
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.photo-item { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--white); }
.photo-item img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.photo-item .actions { padding: 8px; }
.previews { display: grid; grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: 8px; }
.previews img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 8px; }
.tabs { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; }
.tab-card { display: flex; flex-direction: column; gap: 8px; padding: 22px; border-radius: 16px; background: var(--white); border: 1px solid var(--line-strong); }
.tab-card.active { border: 3px solid var(--ink); }
.tag { font-size: 13px; font-weight: 700; padding: 4px 10px; border-radius: 999px; }
.tag-green { background: #E7F6EC; color: #14532D; }
.tag-dark { background: var(--ink); color: var(--white); }

/* Pie */
.site-footer { background: var(--ink); color: #D4D4D8; margin-top: 48px; }
.site-footer .container { padding-top: 44px; padding-bottom: 44px; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 32px; }
.site-footer a { color: #D4D4D8; }
.site-footer a:hover { color: var(--white); }
.footer-cols { display: flex; flex-wrap: wrap; gap: 48px; font-size: 14px; }
.footer-cols div { display: flex; flex-direction: column; gap: 8px; }
.footer-cols strong { color: var(--white); }

@media (max-width: 640px) {
  .result .car-photo { max-width: none; }
  .result-side { align-items: flex-start; }
  .filters { max-width: none; }
  .detail-side { max-width: none; }
  .panel-nav { max-width: none; flex-direction: row; flex-wrap: wrap; }
}
