/* ═══════════════════════════════════════════════════════════════════════════
   RGMOTOROSMX — Estilos públicos (Mobile First)
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Variables ─────────────────────────────────────────────────────────── */
:root {
  --rg-red:    #c0392b;
  --rg-red2:   #e74c3c;
  --rg-dark:   #0d1117;
  --rg-dark2:  #161b22;
  --rg-gray:   #f8f9fa;
  --rg-border: #e9ecef;
  --radius:    12px;
  --shadow:    0 4px 24px rgba(0,0,0,.08);
  --shadow-lg: 0 8px 40px rgba(0,0,0,.14);
}

/* ── Base ──────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Inter', sans-serif;
  background: #fff;
  color: #1a1a2e;
  line-height: 1.6;
}

/* ── Utilidades ─────────────────────────────────────────────────────────── */
.text-rg  { color: var(--rg-red) !important; }
.bg-rg    { background: var(--rg-red) !important; }
.text-gradient {
  background: linear-gradient(135deg, var(--rg-red), var(--rg-red2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ── Botones ───────────────────────────────────────────────────────────── */
.btn-rg {
  background: linear-gradient(135deg, var(--rg-red), var(--rg-red2));
  color: #fff !important;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  transition: opacity .2s, transform .15s;
}
.btn-rg:hover        { opacity: .9; transform: translateY(-1px); color: #fff; }
.btn-outline-rg {
  border: 2px solid var(--rg-red);
  color: var(--rg-red);
  border-radius: 8px;
  font-weight: 600;
  background: transparent;
  transition: .2s;
}
.btn-outline-rg:hover { background: var(--rg-red); color: #fff; }

.btn-wa {
  background: #25D366;
  color: #fff !important;
  border: none;
  border-radius: 8px;
  font-size: 1.1rem;
  padding: .3rem .65rem;
  transition: opacity .2s;
  flex-shrink: 0;
}
.btn-wa:hover { opacity: .9; }
.btn-wa-lg {
  background: #25D366;
  color: #fff !important;
  border: none;
  border-radius: 10px;
  font-weight: 700;
  padding: .75rem 1rem;
  font-size: 1rem;
  transition: opacity .2s;
}
.btn-wa-lg:hover { opacity: .9; }

/* ── Navbar ────────────────────────────────────────────────────────────── */
.rg-navbar {
  background: rgba(13,17,23,.97);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255,255,255,.06);
  padding: .6rem 0;
}
.brand-icon {
  width: 34px; height: 34px;
  background: linear-gradient(135deg, var(--rg-red), var(--rg-red2));
  border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  font-size: .95rem; color: #fff;
  flex-shrink: 0;
}
.brand-icon.small { width: 28px; height: 28px; font-size: .8rem; border-radius: 7px; }
.brand-text {
  font-weight: 800;
  font-size: 1rem;
  letter-spacing: .5px;
  color: #fff;
}
.rg-navbar .nav-link {
  font-weight: 500;
  font-size: .9rem;
  color: rgba(255,255,255,.8) !important;
  border-radius: 7px;
  padding: .4rem .8rem;
  transition: .2s;
}
.rg-navbar .nav-link:hover,
.rg-navbar .nav-link.active {
  color: #fff !important;
  background: rgba(255,255,255,.08);
}

/* ── Hero ──────────────────────────────────────────────────────────────── */
.rg-hero {
  position: relative;
  background:
    linear-gradient(135deg, rgba(13,17,23,.92) 0%, rgba(192,57,43,.4) 100%),
    url('https://images.unsplash.com/photo-1494976388531-d1058494cdd8?w=1600&q=80') center/cover no-repeat;
  min-height: 92vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 5rem 0 0;
}
.hero-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(to bottom, transparent 50%, rgba(13,17,23,.5) 100%);
}
.hero-title {
  font-size: clamp(1.9rem, 6vw, 4rem);
  font-weight: 900;
  color: #fff;
  line-height: 1.1;
}
.hero-subtitle {
  font-size: clamp(.9rem, 2vw, 1.1rem);
  color: rgba(255,255,255,.75);
  max-width: 520px;
}
.min-vh-75 { min-height: 60vh; }

/* Stats bar */
.hero-stats {
  background: rgba(13,17,23,.8);
  backdrop-filter: blur(8px);
  border-top: 1px solid rgba(255,255,255,.08);
  margin-top: 3rem;
}
.stat-item {
  padding: 1rem .5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  border-right: 1px solid rgba(255,255,255,.08);
}
.stat-item:last-child { border-right: none; }
.stat-num   { font-size: clamp(1.2rem,3vw,1.6rem); font-weight: 800; color: var(--rg-red2); }
.stat-label { font-size: .7rem; color: rgba(255,255,255,.55); text-transform: uppercase; letter-spacing: 1px; text-align: center; }

/* ── Section titles ────────────────────────────────────────────────────── */
.section-title { font-size: clamp(1.4rem,3vw,2rem); font-weight: 800; }
.label-line {
  display: inline-block;
  font-size: .75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--rg-red);
  margin-bottom: .4rem;
}
.label-line.light { color: var(--rg-red2); }

/* ── Brand pills ───────────────────────────────────────────────────────── */
.brand-pill {
  display: inline-flex; align-items: center;
  background: #fff;
  border: 1.5px solid var(--rg-border);
  border-radius: 50px;
  padding: .35rem .85rem;
  font-size: .82rem;
  font-weight: 600;
  color: #333;
  text-decoration: none;
  transition: .2s;
}
.brand-pill:hover {
  border-color: var(--rg-red);
  color: var(--rg-red);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

/* ── Car Card ──────────────────────────────────────────────────────────── */
.car-card {
  background: #fff;
  border: 1.5px solid var(--rg-border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform .25s, box-shadow .25s;
  height: 100%;
  display: flex;
  flex-direction: column;
}
.car-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: transparent;
}
.car-img-wrap {
  position: relative;
  overflow: hidden;
  /* Proporción fija 4:3 — se adapta a cualquier resolución */
  aspect-ratio: 4 / 3;
  width: 100%;
  background: #f0f0f0;
}
.car-img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform .4s;
}
.car-card:hover .car-img { transform: scale(1.04); }
.car-img-placeholder {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  font-size: 3rem; color: #ccc;
  background: linear-gradient(135deg, #f5f5f5, #e8e8e8);
}
.car-badge {
  position: absolute; top: 8px; left: 8px;
  background: linear-gradient(135deg, var(--rg-red), var(--rg-red2));
  color: #fff;
  font-size: .65rem;
  font-weight: 700;
  padding: .2rem .55rem;
  border-radius: 50px;
}
.car-cond-badge {
  position: absolute; bottom: 8px; right: 8px;
  background: rgba(0,0,0,.6); color: #fff;
  font-size: .65rem; font-weight: 600;
  padding: .18rem .5rem; border-radius: 50px;
  backdrop-filter: blur(4px);
}
.car-cond-badge.nuevo { background: rgba(39,174,96,.8); }

.car-body {
  padding: .75rem;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: .3rem;
}
.car-meta {
  display: flex;
  gap: .5rem;
  flex-wrap: wrap;
  font-size: .7rem;
  color: #888;
}
.car-meta span { display: flex; align-items: center; gap: .2rem; }
.car-title {
  font-size: .88rem;
  font-weight: 700;
  color: #1a1a2e;
  margin: 0;
  line-height: 1.3;
}
.car-brand-label { font-size: .75rem; color: #aaa; margin: 0; }
.car-price       { font-size: 1.1rem; font-weight: 800; color: var(--rg-red); margin: 0; }

/* ── Feature cards ─────────────────────────────────────────────────────── */
.bg-dark-rg { background: #0d1117; }
.feature-card { padding: 1.25rem .75rem; }
.feature-card p { color: rgba(255,255,255,.7) !important; }
.feature-icon {
  width: 52px; height: 52px;
  background: rgba(192,57,43,.15);
  border: 1px solid rgba(192,57,43,.3);
  border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.3rem; color: var(--rg-red2);
  margin: 0 auto;
}

/* ── CTA ────────────────────────────────────────────────────────────────── */
.cta-section {
  background: linear-gradient(135deg, var(--rg-red), var(--rg-red2));
}

/* ── Footer ────────────────────────────────────────────────────────────── */
.rg-footer {
  background: #0d1117;
  border-top: 1px solid rgba(255,255,255,.06);
  padding: 2.5rem 0 1.5rem;
}
.social-btn {
  width: 36px; height: 36px;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  color: #aaa; text-decoration: none;
  transition: .2s;
}
.social-btn:hover { background: var(--rg-red); color: #fff; border-color: transparent; }
.footer-link { color: rgba(255,255,255,.65); text-decoration: none; transition: .15s; }
.footer-link:hover { color: var(--rg-red2); }

/* Textos del footer en blanco */
.rg-footer .text-muted       { color: rgba(255,255,255,.7) !important; }
.rg-footer ul.list-unstyled li { color: rgba(255,255,255,.75); }
.rg-footer ul.list-unstyled a  { color: rgba(255,255,255,.75); text-decoration: none; }
.rg-footer ul.list-unstyled a:hover { color: var(--rg-red2); }
.rg-footer small, .rg-footer p.small { color: rgba(255,255,255,.55) !important; }

/* ── Page header ───────────────────────────────────────────────────────── */
.page-header {
  background: linear-gradient(135deg, #0d1117, #1a1a2e);
  padding: 2rem 0;
  border-bottom: 1px solid rgba(255,255,255,.06);
}
.page-title    { color: #fff; font-weight: 800; margin: 0; font-size: clamp(1.3rem,4vw,1.75rem); }
.page-subtitle { color: rgba(255,255,255,.55); margin: .25rem 0 0; font-size: .85rem; }
.breadcrumb-item a { color: rgba(255,255,255,.5); text-decoration: none; }
.breadcrumb-item a:hover { color: var(--rg-red2); }
.breadcrumb-item.active { color: rgba(255,255,255,.8); }
.breadcrumb-item + .breadcrumb-item::before { color: rgba(255,255,255,.3); }

/* ════════════════════════════════════════════════════════════════════════
   FILTROS — PANEL (corrección de botones desbordados)
   ════════════════════════════════════════════════════════════════════════ */
.filter-panel {
  background: #fff;
  border: 1.5px solid var(--rg-border);
  border-radius: var(--radius);
  overflow: hidden;
  /* Móvil: no sticky */
}
.filter-header {
  background: #0d1117;
  color: #fff;
  padding: .85rem 1rem;
  font-weight: 600;
  font-size: .9rem;
  /* Solo visible en desktop, en móvil lo reemplaza el botón toggle */
  display: none;
}
/* Mostrar encabezado solo en desktop */
@media (min-width: 992px) {
  .filter-header { display: block; }
}

.filter-body {
  padding: .5rem 0;
}
.filter-group {
  padding: .7rem 1rem;
  border-bottom: 1px solid var(--rg-border);
}
.filter-group:last-of-type { border-bottom: none; }
.filter-label {
  display: block;
  font-size: .72rem;
  font-weight: 700;
  color: #666;
  margin-bottom: .3rem;
  text-transform: uppercase;
  letter-spacing: .5px;
}

/* Botones de filtro — dentro de su propio contenedor con padding */
.filter-actions {
  padding: .85rem 1rem 1rem;
}
/* Los botones usan w-100 de Bootstrap, ya no necesitan cálculos de margen */

/* Desktop: panel sticky */
@media (min-width: 992px) {
  .filter-panel {
    position: sticky;
    top: 76px;
  }
}

/* ── Detalle de auto ───────────────────────────────────────────────────── */
.detail-info-card {
  background: #fff;
  border: 1.5px solid var(--rg-border);
  border-radius: var(--radius);
  padding: 1.25rem;
}
.detail-price {
  font-size: clamp(1.5rem,4vw,2rem);
  font-weight: 900;
  color: var(--rg-red);
}
.specs-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .6rem;
}
.spec-item {
  display: flex;
  align-items: center;
  gap: .55rem;
  background: var(--rg-gray);
  border-radius: 8px;
  padding: .55rem .7rem;
}
.spec-icon {
  width: 30px; height: 30px;
  background: rgba(192,57,43,.1);
  border-radius: 7px;
  display: flex; align-items: center; justify-content: center;
  color: var(--rg-red); font-size: .85rem;
  flex-shrink: 0;
}
.spec-label { display: block; font-size: .68rem; color: #999; }
.spec-val   { display: block; font-size: .82rem; font-weight: 700; color: #1a1a2e; }

.detail-desc-card {
  background: #fff;
  border: 1.5px solid var(--rg-border);
  border-radius: var(--radius);
  padding: 1.25rem;
}
.detail-thumb {
  cursor: pointer;
  border: 2px solid transparent;
  border-radius: 6px;
  transition: border-color .2s;
}
.detail-thumb.active,
.detail-thumb:hover { border-color: var(--rg-red); }

/* ── Breakpoints: tablet ───────────────────────────────────────────────── */
@media (min-width: 576px) {
  .car-body     { padding: .9rem; }
  .car-title    { font-size: .92rem; }
  .car-price    { font-size: 1.15rem; }
}

/* ── Breakpoints: desktop ──────────────────────────────────────────────── */
@media (min-width: 992px) {
  .car-body          { padding: 1rem; gap: .4rem; }
  .car-title         { font-size: .95rem; }
  .car-price         { font-size: 1.2rem; }
  .detail-info-card  { position: sticky; top: 80px; }
}

/* ── Hero: desktop más compacto que móvil ─────────────────────────────── */
@media (min-width: 992px) {
  .rg-hero { min-height: 78vh; }
}