/* ============================================================
   Autocenter Coyoacán – Estilos Principales
   ============================================================ */

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

/* ── Variables ─────────────────────────────────────────── */
:root {
  --primary:       #1B3A6B;
  --primary-dark:  #0f2448;
  --primary-light: #2a5298;
  --primary-pale:  #e8effc;
  --accent:        #C49A0A;
  --dark:          #111827;
  --darker:        #0d1b2a;
  --darkest:       #07111c;
  --gray:          #6b7280;
  --gray-light:    #9ca3af;
  --gray-border:   #e5e7eb;
  --light:         #F2F3F5;
  --white:         #ffffff;
  --success:       #16a34a;
  --warning:       #f59e0b;
  --danger:        #dc2626;
  --price-dark:    #1a1a2e;
  --shadow-sm:     0 1px 3px rgba(0,0,0,.06);
  --shadow:        0 4px 16px rgba(0,0,0,.08);
  --shadow-lg:     0 8px 32px rgba(0,0,0,.12);
  --shadow-xl:     0 20px 60px rgba(0,0,0,.18);
  --radius-sm:     6px;
  --radius:        12px;
  --radius-lg:     16px;
  --radius-xl:     24px;
  --transition:    all .25s cubic-bezier(.4,0,.2,1);
}

/* ── Reset ──────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  color: #111827; background: var(--light);
  line-height: 1.6; -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a   { color: inherit; text-decoration: none; }
ul  { list-style: none; }
button { cursor: pointer; border: none; background: none; font-family: inherit; }
input, select, textarea { font-family: inherit; }

/* ── Scrollbar ──────────────────────────────────────────── */
::-webkit-scrollbar { width: 7px; }
::-webkit-scrollbar-track { background: var(--light); }
::-webkit-scrollbar-thumb { background: var(--primary-light); border-radius: 4px; }

/* ── Typography ─────────────────────────────────────────── */
h1, h2, h3, h4, h5 { line-height: 1.25; font-weight: 700; }
h1 { font-size: clamp(2rem, 5vw, 3.5rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2.25rem); }
h3 { font-size: 1.25rem; }
p  { color: var(--gray); }

/* ── Utility ────────────────────────────────────────────── */
.container   { max-width: 1240px; margin: 0 auto; padding: 0 1.5rem; }
.section     { padding: 5rem 0; }
.text-center { text-align: center; }
.badge {
  display: inline-flex; align-items: center; gap: .35rem;
  padding: .25rem .75rem; border-radius: 50px; font-size: .75rem;
  font-weight: 600; letter-spacing: .5px; text-transform: uppercase;
}
.badge-teal   { background: var(--primary-pale); color: var(--primary); }
.badge-green  { background: #dcfce7; color: #15803d; }
.badge-orange { background: #fef3c7; color: #92400e; }
.badge-red    { background: #fee2e2; color: #991b1b; }
.badge-gray   { background: #f3f4f6; color: #374151; }

/* ── Buttons ────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  padding: .75rem 1.75rem; border-radius: var(--radius-sm); font-size: .95rem;
  font-weight: 600; transition: var(--transition); white-space: nowrap;
  cursor: pointer; border: 2px solid transparent;
}
.btn-primary  { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); transform: translateY(-1px); box-shadow: 0 6px 20px rgba(27,58,107,.35); }
.btn-outline  { background: transparent; border-color: var(--primary); color: var(--primary); }
.btn-outline:hover { background: var(--primary); color: #fff; }
.btn-dark     { background: var(--price-dark); color: #fff; }
.btn-dark:hover { background: #000; }
.btn-danger   { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #b91c1c; }
.btn-sm   { padding: .5rem 1.1rem; font-size: .85rem; }
.btn-lg   { padding: 1rem 2.5rem; font-size: 1.05rem; border-radius: var(--radius); }
.btn-full { width: 100%; }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none !important; }

/* ── Navbar ─────────────────────────────────────────────── */
.navbar {
  position: sticky; top: 0; z-index: 1000;
  background: #fff;
  border-bottom: 1px solid rgba(0,0,0,.08);
  box-shadow: 0 2px 10px rgba(0,0,0,.07);
}
.navbar-inner {
  display: flex; align-items: center; justify-content: space-between;
  height: 68px; padding: 0 1.5rem; max-width: 1240px; margin: 0 auto;
}
.navbar-brand {
  font-size: 1.05rem; font-weight: 800; color: var(--primary);
  letter-spacing: -.3px; white-space: nowrap; line-height: 1.2;
}
.navbar-brand span { display: block; font-size: .72rem; font-weight: 500; color: var(--gray); letter-spacing: .5px; }
.navbar-links {
  display: flex; align-items: center; gap: .15rem;
}
.navbar-links a {
  padding: .5rem 1rem; border-radius: var(--radius-sm);
  color: var(--dark); font-size: .9rem; font-weight: 500;
  transition: var(--transition);
}
.navbar-links a:hover, .navbar-links a.active { color: var(--primary); background: var(--primary-pale); }
.navbar-links .btn-primary { color: #fff; }
.navbar-links .btn-primary:hover { background: var(--primary-dark); color: #fff; }
.navbar-logo-badge {
  height: 48px; display: flex; align-items: center;
  flex-shrink: 0;
}
.navbar-logo-badge img {
  height: 48px; width: auto; max-width: 120px;
  object-fit: contain; display: block;
}
/* Fallback si la imagen no carga */
.navbar-logo-badge svg { width: 22px; height: 22px; color: #fff; }
.navbar-toggle {
  display: none; flex-direction: column; gap: 5px; padding: .5rem; cursor: pointer;
}
.navbar-toggle span {
  display: block; width: 24px; height: 2px; background: var(--dark);
  border-radius: 2px; transition: var(--transition);
}

/* ── Hero Chat ──────────────────────────────────────────── */
.hero-chat {
  background: var(--darkest);
  min-height: calc(100vh - 68px);
  display: flex; flex-direction: column;
  position: relative; overflow: hidden;
}
.hero-video {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover; opacity: .5;
  pointer-events: none; z-index: 0;
}
.hero-chat::before {
  content: '';
  position: absolute; inset: 0; pointer-events: none;
  background:
    linear-gradient(to bottom, rgba(7,17,28,.55) 0%, rgba(7,17,28,.3) 40%, rgba(7,17,28,.7) 100%);
  z-index: 1;
}
.hero-chat-inner {
  flex: 1; position: relative; z-index: 2;
  display: flex; flex-direction: column; align-items: center;
  justify-content: space-between;
  max-width: 820px; margin: 0 auto; width: 100%;
  padding: 4rem 1.5rem 3rem;
  gap: 2.5rem;
}
.hero-eyebrow {
  text-align: center;
}
.hero-title {
  font-size: clamp(3rem, 8vw, 5.5rem); font-weight: 900;
  color: #fff; letter-spacing: -2px; line-height: 1; text-align: center;
  text-transform: uppercase;
}
.hero-title span { color: var(--accent); }
.hero-subtitle {
  font-size: 1.15rem; color: rgba(255,255,255,.65);
  text-align: center; margin-top: .75rem;
}

/* Status badge */
.chat-status-badge {
  display: inline-flex; align-items: center; gap: .55rem;
  background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.2);
  color: rgba(255,255,255,.85); padding: .45rem 1.1rem;
  border-radius: 50px; font-size: .8rem; font-weight: 600; letter-spacing: .3px;
}
.chat-status-dot {
  width: 8px; height: 8px; background: #22c55e; border-radius: 50%;
  flex-shrink: 0; animation: dot-pulse 2.2s ease-in-out infinite;
}
@keyframes dot-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: .5; transform: scale(.75); }
}

/* Display area */
.hero-chat-display {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  text-align: center; gap: .85rem; min-height: 130px;
}
.chat-user-msg {
  font-size: .9rem; color: rgba(255,255,255,.45);
  font-style: italic; line-height: 1.5; display: none;
}
.chat-main-text {
  font-size: clamp(1.5rem, 3.5vw, 2.5rem);
  font-weight: 800; color: #fff; line-height: 1.2;
  transition: opacity .2s;
}
.chat-name { color: var(--accent); }
.chat-typing-dots span {
  display: inline-block; font-size: 2.5rem;
  color: rgba(255,255,255,.4);
  animation: dot-bounce 1.3s ease-in-out infinite;
}
.chat-typing-dots span:nth-child(2) { animation-delay: .16s; }
.chat-typing-dots span:nth-child(3) { animation-delay: .32s; }
@keyframes dot-bounce {
  0%, 60%, 100% { transform: translateY(0); }
  30%            { transform: translateY(-10px); }
}

/* Suggestion chips */
.chat-suggestions {
  display: flex; flex-wrap: wrap; gap: .6rem; justify-content: center;
  transition: opacity .3s;
}
.chat-chip {
  padding: .6rem 1.1rem;
  background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.2);
  border-radius: 50px; color: rgba(255,255,255,.8);
  font-size: .85rem; font-family: inherit; cursor: pointer;
  transition: var(--transition);
}
.chat-chip:hover {
  background: rgba(255,255,255,.2); border-color: rgba(255,255,255,.4);
  color: #fff; transform: translateY(-2px);
}

/* Input area */
.chat-form-wrap { width: 100%; }
.hero-chat-form {
  display: flex; align-items: center;
  background: rgba(255,255,255,.1); border: 1.5px solid rgba(255,255,255,.2);
  border-radius: 14px; padding: 6px 6px 6px 20px;
  transition: var(--transition);
}
.hero-chat-form:focus-within {
  border-color: rgba(255,255,255,.5); background: rgba(255,255,255,.15);
  box-shadow: 0 0 0 4px rgba(255,255,255,.08);
}
.hero-chat-input {
  flex: 1; background: transparent; border: none; outline: none;
  color: #fff; font-size: 1rem; padding: 10px 12px 10px 0; font-family: inherit;
}
.hero-chat-input::placeholder { color: rgba(255,255,255,.35); }
.hero-chat-send {
  width: 46px; height: 46px; background: var(--primary);
  color: #fff; border-radius: 10px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  transition: var(--transition);
}
.hero-chat-send:hover:not(:disabled) { background: var(--primary-dark); transform: scale(1.06); }
.hero-chat-send:disabled { opacity: .45; }
.chat-hint {
  text-align: center; font-size: .78rem; color: rgba(255,255,255,.25);
  margin-top: .65rem;
}
.chat-reset-link {
  background: none; border: none; color: rgba(255,255,255,.35);
  font-size: .78rem; cursor: pointer; font-family: inherit;
  text-decoration: underline; padding: 0; transition: color .2s;
}
.chat-reset-link:hover { color: rgba(255,255,255,.7); }

/* ── Car Results Panel ───────────────────────────────────── */
.car-panel-backdrop {
  position: fixed; inset: 0; background: rgba(0,0,0,.5);
  backdrop-filter: blur(3px); z-index: 9988;
  opacity: 0; pointer-events: none; transition: opacity .3s;
}
.car-panel-backdrop.show { opacity: 1; pointer-events: all; }
.car-results-panel {
  position: fixed; top: 0; right: 0;
  width: 420px; max-width: 100vw; height: 100dvh;
  background: #fff; z-index: 9989;
  display: flex; flex-direction: column;
  box-shadow: -6px 0 40px rgba(0,0,0,.2);
  transform: translateX(105%);
  transition: transform .38s cubic-bezier(.4,0,.2,1);
  overflow: hidden;
}
.car-results-panel.open { transform: translateX(0); }
.car-panel-header {
  background: var(--primary); padding: 1.1rem 1.4rem;
  display: flex; align-items: center; justify-content: space-between; flex-shrink: 0;
}
.car-panel-title {
  display: flex; align-items: center; gap: .55rem;
  color: #fff; font-size: .95rem; font-weight: 700;
}
.car-panel-title span { color: var(--accent); }
.car-panel-title svg { color: rgba(255,255,255,.8); flex-shrink: 0; }
.car-panel-close {
  width: 34px; height: 34px; border-radius: var(--radius-sm);
  background: rgba(255,255,255,.15); color: rgba(255,255,255,.8);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: var(--transition); flex-shrink: 0;
}
.car-panel-close:hover { background: rgba(255,255,255,.25); color: #fff; }
.car-panel-close svg { width: 17px; height: 17px; }
.car-panel-msg {
  padding: .85rem 1.4rem; flex-shrink: 0;
  background: var(--primary-pale); border-bottom: 1px solid rgba(27,58,107,.15);
  font-size: .875rem; color: var(--primary); font-weight: 500; line-height: 1.5;
}
.car-panel-body {
  flex: 1; overflow-y: auto; padding: 1rem;
  display: flex; flex-direction: column; gap: .85rem;
}
.car-panel-body::-webkit-scrollbar { width: 5px; }
.car-panel-body::-webkit-scrollbar-thumb { background: var(--primary-light); border-radius: 4px; }

/* Panel car cards */
.panel-car-card {
  display: flex; flex-direction: column;
  background: #fff; border: 1.5px solid var(--gray-border);
  border-radius: var(--radius); overflow: hidden;
  transition: var(--transition); cursor: pointer;
  text-decoration: none; color: inherit;
}
.panel-car-card:hover { border-color: var(--primary); box-shadow: 0 4px 16px rgba(27,58,107,.15); transform: translateY(-2px); }
.panel-car-img { height: 170px; overflow: hidden; background: var(--light); flex-shrink: 0; }
.panel-car-img img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s; }
.panel-car-card:hover .panel-car-img img { transform: scale(1.05); }
.panel-car-img-placeholder {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #e5e7eb, #d1d5db);
}
.panel-car-info { padding: 1rem 1.1rem 1.1rem; display: flex; flex-direction: column; gap: .65rem; }
.panel-car-header { display: flex; align-items: flex-start; justify-content: space-between; gap: .5rem; }
.panel-car-name { font-size: 1rem; font-weight: 700; color: var(--primary); line-height: 1.25; }
.panel-car-meta { font-size: .8rem; color: var(--gray); margin-top: .15rem; }
.panel-car-specs-row { display: flex; gap: .4rem; flex-wrap: wrap; }
.panel-spec-item {
  display: flex; align-items: center; gap: .3rem;
  background: var(--light); border: 1px solid var(--gray-border);
  border-radius: 50px; padding: .25rem .65rem;
  font-size: .75rem; font-weight: 500; color: var(--gray);
}
.panel-spec-item svg { width: 12px; height: 12px; flex-shrink: 0; }
.panel-car-footer {
  display: flex; align-items: center; justify-content: space-between;
  padding-top: .75rem; border-top: 1px solid var(--gray-border); margin-top: auto;
}
.panel-car-price { font-size: 1.2rem; font-weight: 800; color: var(--primary); line-height: 1; }
.panel-car-currency { font-size: .7rem; font-weight: 500; color: var(--gray); margin-left: .15rem; }
.panel-car-cta {
  display: inline-flex; align-items: center; gap: .35rem;
  background: var(--primary); color: #fff;
  padding: .5rem 1rem; border-radius: var(--radius-sm);
  font-size: .82rem; font-weight: 700;
  transition: var(--transition); white-space: nowrap;
}
.panel-car-card:hover .panel-car-cta { background: var(--primary-dark); }
.panel-empty { text-align: center; padding: 3rem 1.5rem; color: var(--gray); }
.panel-empty svg { width: 60px; height: 60px; opacity: .2; margin: 0 auto 1rem; display: block; }
.panel-empty h3 { font-size: 1rem; color: var(--dark); margin-bottom: .4rem; }

@media (max-width: 600px) {
  .car-results-panel {
    width: 100vw; height: 88dvh; top: auto; bottom: 0;
    border-radius: 20px 20px 0 0; transform: translateY(105%);
  }
  .car-results-panel.open { transform: translateY(0); }
  .car-panel-body { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; padding: .6rem; }
  .panel-car-img { height: 105px; }
  .panel-car-info { padding: .6rem .65rem .7rem; gap: .35rem; }
  .panel-car-name { font-size: .8rem; }
  .panel-car-meta { font-size: .68rem; }
  .panel-car-specs-row { display: none; }
  .panel-car-price { font-size: .9rem; }
  .panel-car-cta { font-size: .7rem; padding: .28rem .45rem; }
}

/* ── Hero Chat compact (catalog page) ───────────────────── */
.hero-chat--compact {
  min-height: auto; padding: 0;
  background: var(--primary);
}
.hero-chat--compact::before { display: none; }
.hero-chat--compact .hero-chat-inner {
  padding: 1.5rem 1rem 1.25rem; justify-content: flex-start; gap: 1rem;
}
.hero-chat--compact .hero-chat-display { flex: none; min-height: 0; }
.hero-chat--compact .chat-main-text { font-size: 1.2rem; }
.hero-chat--compact .chat-status-badge {
  background: rgba(255,255,255,.15); border-color: rgba(255,255,255,.2);
}
.hero-chat--compact .hero-chat-form {
  background: rgba(255,255,255,.12); border-color: rgba(255,255,255,.25);
}
.hero-chat--compact .hero-chat-form:focus-within {
  background: rgba(255,255,255,.2); border-color: rgba(255,255,255,.5);
}
.hero-chat--compact .hero-chat-send { background: #fff; color: var(--primary); }
.hero-chat--compact .hero-chat-send:hover:not(:disabled) { background: var(--primary-pale); }

/* ── Section Headers ────────────────────────────────────── */
.section-header { text-align: center; margin-bottom: 2.5rem; }
.section-label {
  display: inline-block; color: var(--primary); font-weight: 700;
  font-size: .78rem; letter-spacing: 2.5px; text-transform: uppercase; margin-bottom: .6rem;
}
.section-header h2 { color: var(--dark); margin-bottom: .6rem; }
.section-header p  { max-width: 520px; margin: 0 auto; }
.section-divider {
  width: 48px; height: 4px;
  background: linear-gradient(90deg, var(--primary), var(--primary-light));
  border-radius: 2px; margin: .9rem auto 0;
}

/* ── Catalog Filters Bar ────────────────────────────────── */
.catalog-filters-bar {
  background: #fff; border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 1rem 1.25rem;
  display: flex; align-items: center; gap: .85rem; flex-wrap: wrap;
  margin-bottom: 2rem; border: 1px solid var(--gray-border);
}
.filter-search-wrap {
  flex: 1; min-width: 200px; position: relative;
}
.filter-search-wrap svg {
  position: absolute; left: .9rem; top: 50%; transform: translateY(-50%);
  color: var(--gray-light); pointer-events: none;
}
.filter-search-input {
  width: 100%; padding: .65rem .9rem .65rem 2.5rem;
  border: 1.5px solid var(--gray-border); border-radius: var(--radius-sm);
  font-size: .9rem; outline: none; transition: var(--transition);
  background: var(--light); color: var(--dark); font-family: inherit;
}
.filter-search-input:focus { border-color: var(--primary); background: #fff; box-shadow: 0 0 0 3px rgba(27,58,107,.1); }
.filter-search-input::placeholder { color: var(--gray-light); }
.filter-select-wrap { position: relative; }
.filter-select-wrap svg {
  position: absolute; right: .75rem; top: 50%; transform: translateY(-50%);
  pointer-events: none; color: var(--gray);
}
.filter-select {
  appearance: none; padding: .65rem 2.2rem .65rem 1rem;
  border: 1.5px solid var(--gray-border); border-radius: var(--radius-sm);
  font-size: .9rem; outline: none; transition: var(--transition);
  background: var(--light); color: var(--dark); font-family: inherit;
  cursor: pointer; min-width: 130px;
}
.filter-select:focus { border-color: var(--primary); background: #fff; box-shadow: 0 0 0 3px rgba(27,58,107,.1); }
.filter-clear-btn {
  padding: .65rem 1.1rem; border-radius: var(--radius-sm);
  font-size: .85rem; font-weight: 600; color: var(--gray);
  border: 1.5px solid var(--gray-border); background: #fff;
  transition: var(--transition); cursor: pointer; white-space: nowrap; font-family: inherit;
}
.filter-clear-btn:hover { border-color: var(--danger); color: var(--danger); }

/* ── Car Grid ───────────────────────────────────────────── */
.cars-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.25rem;
}

/* ── Car Card (Autocenter Style) ────────────────────────── */
.car-card {
  background: #fff; border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm); overflow: hidden;
  transition: var(--transition); display: flex; flex-direction: column;
  border: 1px solid rgba(0,0,0,.06);
}
.car-card:hover { transform: translateY(-5px); box-shadow: var(--shadow-lg); }
.car-card-header {
  padding: .85rem 1rem .5rem;
}
.car-card-brand {
  font-size: .9rem; font-weight: 800; color: var(--primary);
  text-transform: uppercase; letter-spacing: .5px; line-height: 1.2;
}
.car-card-model { font-size: .78rem; color: var(--gray); margin-top: .15rem; }
.car-card-meta  {
  font-size: .75rem; color: var(--gray-light); margin-top: .25rem;
  display: flex; align-items: center; gap: .4rem;
}
.car-card-sucursal {
  display: flex; align-items: center; gap: .3rem;
  font-size: .72rem; color: var(--gray-light); margin-top: .3rem;
}
.car-card-sucursal svg { width: 11px; height: 11px; flex-shrink: 0; color: var(--primary); opacity: .7; }
.car-card-image {
  position: relative; overflow: hidden; background: #f3f4f6;
  height: 180px;
}
.car-card-image img {
  width: 100%; height: 100%; object-fit: cover; transition: transform .4s ease;
}
.car-card:hover .car-card-image img { transform: scale(1.04); }
.car-card-image .car-placeholder {
  width: 100%; height: 100%; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #e5e7eb, #d1d5db);
  color: var(--gray-light); flex-direction: column; gap: .5rem;
}
.car-card-image .car-placeholder svg { width: 52px; height: 52px; opacity: .35; }
.car-condition-badge { position: absolute; top: .6rem; left: .6rem; }
.car-available-badge { position: absolute; top: .6rem; right: .6rem; }
.car-card-body { padding: .8rem 1rem; flex: 1; display: flex; flex-direction: column; gap: .65rem; }
.car-card-specs {
  display: flex; gap: .45rem; flex-wrap: wrap;
}
.spec-chip {
  display: flex; align-items: center; gap: .25rem;
  background: var(--light); color: var(--gray); border-radius: 50px;
  padding: .22rem .6rem; font-size: .72rem; font-weight: 500;
  border: 1px solid var(--gray-border);
}
.spec-chip svg { width: 11px; height: 11px; flex-shrink: 0; }
.car-card-motor { font-size: .72rem; color: var(--gray); }
.car-card-colors {
  display: flex; align-items: center; gap: .5rem;
  font-size: .7rem; color: var(--gray-light);
}
.color-dot {
  width: 13px; height: 13px; border-radius: 50%;
  border: 1.5px solid rgba(0,0,0,.12); flex-shrink: 0;
}
.car-card-footer {
  margin-top: auto;
}
.car-price-btn {
  display: block; width: 100%;
  background: var(--price-dark); color: #fff;
  padding: .75rem 1rem; text-align: center;
  font-size: .88rem; font-weight: 700; border: none;
  cursor: pointer; transition: var(--transition);
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  font-family: inherit; letter-spacing: .3px;
}
.car-price-btn:hover { background: #000; }

/* ── Car Status Ribbon ──────────────────────────────────── */
.car-ribbon-wrap {
  position: absolute; inset: 0;
  overflow: hidden; z-index: 4; pointer-events: none;
}
.car-ribbon-label {
  position: absolute;
  top: 26px; left: -34px;
  width: 148px; text-align: center;
  transform: rotate(-45deg);
  font-size: .65rem; font-weight: 900;
  letter-spacing: 2px; text-transform: uppercase;
  padding: 7px 0; color: #fff;
  box-shadow: 0 2px 8px rgba(0,0,0,.35);
}
.car-ribbon-apartado { background: #f59e0b; }
.car-ribbon-vendido  { background: #1a1a2e; }

/* ── Load More Button ───────────────────────────────────── */
.load-more-wrap { text-align: center; margin-top: 2.5rem; }
.btn-load-more {
  background: #fff; border: 2px solid var(--primary); color: var(--primary);
  padding: .85rem 3rem; border-radius: var(--radius); font-size: .95rem;
  font-weight: 700; cursor: pointer; font-family: inherit;
  transition: var(--transition); display: inline-flex; align-items: center; gap: .6rem;
}
.btn-load-more:hover { background: var(--primary); color: #fff; }
.btn-load-more:disabled { opacity: .45; cursor: default; }

/* ── Results toolbar ────────────────────────────────────── */
.catalog-toolbar {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 1.25rem; gap: 1rem; flex-wrap: wrap;
}
.results-count { font-size: .9rem; color: var(--gray); }
.results-count strong { color: var(--dark); }
.sort-select {
  padding: .55rem 1rem; border: 1.5px solid var(--gray-border); border-radius: var(--radius-sm);
  font-size: .875rem; outline: none; transition: var(--transition); background: #fff;
  cursor: pointer; font-family: inherit; color: var(--dark);
}
.sort-select:focus { border-color: var(--primary); }

/* ── Financing Section ──────────────────────────────────── */
.financing-section {
  background: #fff; padding: 4.5rem 0; border-top: 1px solid var(--gray-border);
}
.financing-banks {
  display: flex; align-items: center; justify-content: center;
  gap: 3rem; flex-wrap: wrap; margin-top: 2.5rem;
}
.bank-logo {
  display: flex; align-items: center; justify-content: center;
  height: 44px; opacity: .75; transition: var(--transition); filter: grayscale(.3);
}
.bank-logo:hover { opacity: 1; filter: none; }
.bank-logo-text {
  font-size: 1.5rem; font-weight: 900; letter-spacing: -1px;
}

/* ── Financing Form ─────────────────────────────────────── */
.financing-layout {
  display: grid; grid-template-columns: 1fr 1fr; gap: 3.5rem;
  margin-top: 3rem; align-items: start;
}
.financing-left h3 {
  font-size: 1.25rem; font-weight: 700; color: var(--dark);
  margin-bottom: .5rem;
}
.financing-left p { font-size: .9rem; margin-bottom: 1.75rem; }
.financing-feature {
  display: flex; align-items: flex-start; gap: .85rem; margin-bottom: 1.1rem;
}
.financing-feature-icon {
  width: 38px; height: 38px; border-radius: 10px;
  background: var(--primary-pale); display: flex; align-items: center;
  justify-content: center; flex-shrink: 0;
}
.financing-feature-icon svg { width: 18px; height: 18px; color: var(--primary); }
.financing-feature-text strong { display: block; font-size: .88rem; font-weight: 700; color: var(--dark); margin-bottom: .1rem; }
.financing-feature-text span   { font-size: .82rem; color: var(--gray); }
.financing-form-card {
  background: #fff; border-radius: var(--radius-lg); padding: 2rem;
  box-shadow: var(--shadow); border: 1px solid var(--gray-border);
}
.financing-form-card h3 {
  font-size: 1.1rem; font-weight: 700; color: var(--primary);
  margin-bottom: 1.5rem; padding-bottom: .85rem;
  border-bottom: 2px solid var(--primary-pale);
  display: flex; align-items: center; gap: .55rem;
}
.financing-form-card h3 svg { width: 18px; height: 18px; flex-shrink: 0; }
@media (max-width: 900px) {
  .financing-layout { grid-template-columns: 1fr; gap: 2rem; }
}

/* ── Bank Selector ──────────────────────────────────────── */
.bank-selector {
  display: flex; flex-wrap: wrap; gap: .65rem;
}
.bank-option {
  cursor: pointer; display: block;
}
.bank-option input[type="radio"] {
  position: absolute; opacity: 0; width: 0; height: 0;
}
.bank-option-inner {
  display: flex; align-items: center; justify-content: center;
  padding: .55rem 1.1rem; border: 2px solid var(--gray-border);
  border-radius: var(--radius-sm); background: #fff;
  transition: var(--transition); min-width: 90px; text-align: center;
}
.bank-option:hover .bank-option-inner {
  border-color: var(--primary-light);
  background: var(--primary-pale);
}
.bank-option input:checked + .bank-option-inner {
  border-color: var(--primary);
  background: var(--primary-pale);
  box-shadow: 0 0 0 3px rgba(27,58,107,.12);
}
.bank-option-name { font-size: .95rem; letter-spacing: -.3px; }

/* ── Contact / Footer ───────────────────────────────────── */
.contact-section {
  background: var(--darker); padding: 4rem 0 0;
  overflow: hidden; /* evita desbordamiento horizontal */
}
.contact-header {
  text-align: center; padding-bottom: 3rem; padding-left: 1.5rem; padding-right: 1.5rem;
}
.contact-header h2 {
  color: #fff; font-size: 1.5rem; font-weight: 900; letter-spacing: 3px;
  text-transform: uppercase; margin-bottom: 0;
}
.contact-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 0;
}
.contact-map { height: 280px; overflow: hidden; background: #1a2a3a; }
.contact-map iframe { width: 100%; height: 100%; border: 0; filter: grayscale(.4) brightness(.85); }
.contact-info {
  padding: 2.5rem 3rem; background: var(--darkest);
}
.contact-info-title {
  font-size: 1rem; font-weight: 700; color: #fff;
  margin-bottom: 1.5rem; letter-spacing: 1px; text-transform: uppercase;
}
.contact-item {
  display: flex; align-items: flex-start; gap: .85rem;
  margin-bottom: 1.25rem;
}
.contact-item svg { color: rgba(255,255,255,.5); flex-shrink: 0; margin-top: 2px; width: 18px; height: 18px; }
.contact-item-label { font-size: .75rem; font-weight: 700; color: rgba(255,255,255,.4); text-transform: uppercase; letter-spacing: .5px; }
.contact-item-value { font-size: .9rem; color: rgba(255,255,255,.8); margin-top: .1rem; line-height: 1.5; word-break: break-word; }
.contact-social { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 1.75rem; }
.social-btn {
  display: flex; align-items: center; gap: .5rem;
  color: rgba(255,255,255,.6); font-size: .82rem; font-weight: 500;
  transition: var(--transition); word-break: break-all;
}
.social-btn:hover { color: #fff; }
.social-btn svg { width: 16px; height: 16px; flex-shrink: 0; }
.footer-bar {
  background: var(--darkest); padding: 1.25rem 0;
  border-top: 1px solid rgba(255,255,255,.06);
  overflow: hidden;
}
.footer-bar-inner {
  display: flex; align-items: center; justify-content: space-between;
  max-width: 1240px; margin: 0 auto; padding: 0 1.5rem;
  font-size: .78rem; color: rgba(255,255,255,.35);
  flex-wrap: wrap; gap: .5rem;
}
.footer-bar-inner a { transition: color .2s; }
.footer-bar-inner a:hover { color: rgba(255,255,255,.7); }

/* ── WhatsApp Floating Button ───────────────────────────── */
.whatsapp-float {
  position: fixed; bottom: 1.75rem; right: 1.75rem; z-index: 9990;
  width: 56px; height: 56px; border-radius: 50%;
  background: #25d366; color: #fff;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 20px rgba(37,211,102,.5);
  transition: var(--transition); text-decoration: none;
}
.whatsapp-float:hover {
  background: #1ebe5d; transform: scale(1.1);
  box-shadow: 0 6px 28px rgba(37,211,102,.65);
}
.whatsapp-float svg { width: 28px; height: 28px; }

/* ── Why Us Section ─────────────────────────────────────── */
.why-grid {
  display: flex; flex-wrap: wrap; gap: 1.25rem; justify-content: center;
}
.why-card {
  flex: 1 1 210px; max-width: 270px;
  background: #fff; border-radius: var(--radius-lg); padding: 1.75rem;
  box-shadow: var(--shadow-sm); border: 1px solid var(--gray-border);
  transition: var(--transition); text-align: center;
}
.why-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.why-icon {
  width: 56px; height: 56px; border-radius: 14px;
  background: var(--primary-pale); display: flex; align-items: center;
  justify-content: center; margin: 0 auto 1.1rem;
}
.why-icon svg { width: 28px; height: 28px; color: var(--primary); }
.why-card h3 { font-size: 1rem; color: var(--dark); margin-bottom: .4rem; }
.why-card p  { font-size: .85rem; }

/* ── Stats ──────────────────────────────────────────────── */
.stats-section { background: var(--primary); padding: 3.5rem 0; }
.stats-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 2rem; text-align: center;
}
.stat-card .number { font-size: 2.75rem; font-weight: 900; color: #fff; line-height: 1; margin-bottom: .4rem; }
.stat-card .label  { color: rgba(255,255,255,.7); font-size: .95rem; font-weight: 500; }

/* ── Car Detail Page ────────────────────────────────────── */
.page-header {
  background: var(--primary);
  padding: 2rem 0; border-bottom: 1px solid rgba(255,255,255,.1);
}
.page-header .breadcrumb {
  display: flex; align-items: center; gap: .5rem;
  font-size: .8rem; color: rgba(255,255,255,.5); margin-bottom: .4rem;
}
.page-header .breadcrumb a:hover { color: rgba(255,255,255,.9); }
.page-header .breadcrumb span { color: rgba(255,255,255,.3); }
.page-header h1 { color: #fff; font-size: 1.65rem; }
.detail-layout {
  display: grid;
  grid-template-columns: 1fr 380px;
  grid-template-areas: "gallery sidebar" "content sidebar";
  gap: 2.5rem;
  padding: 2.5rem 0 5rem;
  align-items: start;
}
.detail-gallery-col { grid-area: gallery; min-width: 0; }
.detail-sidebar-col { grid-area: sidebar; }
.detail-content-col { grid-area: content; display: flex; flex-direction: column; gap: 1.5rem; }
.gallery-main {
  border-radius: var(--radius-lg); overflow: hidden;
  background: #f3f4f6; position: relative; width: 100%; padding-bottom: 62.5%;
}
.gallery-main img,
.gallery-main iframe,
.gallery-main .gallery-placeholder {
  position: absolute; top: 0; left: 0; width: 100%; height: 100%;
}
.gallery-main img { object-fit: cover; }
.gallery-main iframe { border: 0; }
.gallery-main .gallery-placeholder {
  display: flex; align-items: center; justify-content: center;
  flex-direction: column; gap: 1rem; color: var(--gray-light);
}
.gallery-main .gallery-placeholder svg { width: 80px; height: 80px; opacity: .3; }
.gallery-carousel { display: flex; align-items: center; gap: .4rem; margin-top: .75rem; }
.gallery-thumbs {
  flex: 1; min-width: 0; display: flex; gap: .75rem; overflow-x: auto; flex-wrap: nowrap;
  scroll-behavior: smooth; -webkit-overflow-scrolling: touch; scrollbar-width: none;
}
.gallery-thumbs::-webkit-scrollbar { display: none; }
.carousel-btn {
  flex-shrink: 0; width: 30px; height: 30px; background: var(--primary); color: #fff;
  border-radius: 50%; font-size: 1.2rem; line-height: 1; display: flex;
  align-items: center; justify-content: center; cursor: pointer;
  transition: var(--transition); border: none; opacity: .85; user-select: none;
}
.carousel-btn:hover { background: var(--primary-dark); opacity: 1; }
.gallery-thumb {
  flex-shrink: 0; width: 80px; height: 60px; border-radius: var(--radius-sm); overflow: hidden;
  cursor: pointer; border: 2.5px solid transparent; transition: var(--transition);
  background: #e5e7eb;
}
.gallery-thumb img { width: 100%; height: 100%; object-fit: cover; }
.gallery-thumb.active { border-color: var(--primary); }
.gallery-thumb:hover { border-color: var(--primary-light); }
.detail-card {
  background: #fff; border-radius: var(--radius-lg); padding: 1.75rem;
  box-shadow: var(--shadow); border: 1px solid var(--gray-border);
  align-self: start; position: sticky; top: 84px;
}
.detail-eyebrow { font-size: .78rem; color: var(--gray); font-weight: 600; margin-bottom: .2rem; }
.detail-title   { font-size: 1.65rem; font-weight: 800; color: var(--primary); line-height: 1.2; }
.detail-price   { font-size: 2rem; font-weight: 900; color: var(--price-dark); margin: 1rem 0; }
.detail-price span { font-size: .85rem; font-weight: 400; color: var(--gray); }
.specs-grid     { display: grid; grid-template-columns: 1fr 1fr; gap: .65rem; margin: 1.1rem 0; }
.spec-item      { background: var(--light); border-radius: var(--radius-sm); padding: .7rem; display: flex; flex-direction: column; gap: .15rem; }
.spec-label     { font-size: .7rem; font-weight: 700; color: var(--gray); text-transform: uppercase; letter-spacing: .5px; }
.spec-value     { font-size: .9rem; font-weight: 600; color: var(--dark); }
.detail-actions { display: flex; flex-direction: column; gap: .65rem; margin-top: 1.25rem; }
.detail-description h3 { font-size: 1.1rem; color: var(--dark); margin-bottom: .65rem; }
.detail-description p  { font-size: .92rem; line-height: 1.8; }
.features-tags  { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 1rem; }
.feature-tag {
  background: var(--primary-pale); color: var(--primary);
  padding: .3rem .85rem; border-radius: 50px; font-size: .8rem; font-weight: 600;
  border: 1px solid rgba(27,58,107,.15);
}
.contact-card {
  background: #fff; border-radius: var(--radius-lg); padding: 1.75rem;
  box-shadow: var(--shadow-sm); border: 1px solid var(--gray-border); margin-top: 1.5rem;
}
.contact-card h3 { font-size: 1.1rem; color: var(--dark); margin-bottom: 1.1rem; }

/* ── Forms ──────────────────────────────────────────────── */
.form-group   { margin-bottom: 1.1rem; }
.form-label   { display: block; font-size: .875rem; font-weight: 600; color: var(--dark); margin-bottom: .4rem; }
.form-control {
  width: 100%; padding: .75rem 1rem; border: 1.5px solid var(--gray-border);
  border-radius: var(--radius-sm); font-size: .9rem; outline: none;
  transition: var(--transition); background: #fff; color: var(--dark); font-family: inherit;
}
.form-control:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(27,58,107,.1); }
.form-control::placeholder { color: var(--gray-light); }
textarea.form-control { min-height: 110px; resize: vertical; }
select.form-control   { cursor: pointer; }
.form-row  { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.form-error{ font-size: .8rem; color: var(--danger); margin-top: .3rem; }
.form-hint { font-size: .8rem; color: var(--gray); margin-top: .3rem; }

/* ── Admin Layout ───────────────────────────────────────── */
.admin-wrap { display: grid; grid-template-columns: 260px 1fr; min-height: 100vh; background: #f1f5f9; }
.admin-sidebar {
  background: var(--primary); display: flex; flex-direction: column;
  padding: 0; position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.sidebar-logo {
  padding: 1.5rem 1.25rem; border-bottom: 1px solid rgba(255,255,255,.1);
  display: flex; align-items: center; gap: .75rem;
}
.sidebar-logo-icon {
  width: 34px; height: 34px; border-radius: 50%;
  background: rgba(255,255,255,.15); display: flex; align-items: center; justify-content: center;
}
.sidebar-logo-icon svg { width: 18px; height: 18px; color: #fff; }
.sidebar-logo span { font-size: 1rem; font-weight: 800; color: #fff; line-height: 1.2; }
.sidebar-logo span small { display: block; font-size: .65rem; font-weight: 400; color: rgba(255,255,255,.5); }
.sidebar-nav { padding: 1.25rem .75rem; flex: 1; }
.sidebar-nav-label {
  font-size: .68rem; font-weight: 700; color: rgba(255,255,255,.35);
  text-transform: uppercase; letter-spacing: 1.5px; padding: 0 .75rem;
  margin-bottom: .4rem; margin-top: .9rem;
}
.sidebar-link {
  display: flex; align-items: center; gap: .75rem; padding: .7rem 1rem;
  border-radius: var(--radius-sm); color: rgba(255,255,255,.7);
  font-size: .88rem; font-weight: 500; margin-bottom: .1rem; transition: var(--transition);
}
.sidebar-link svg  { width: 17px; height: 17px; flex-shrink: 0; }
.sidebar-link:hover{ background: rgba(255,255,255,.1); color: #fff; }
.sidebar-link.active { background: rgba(255,255,255,.18); color: #fff; }
.sidebar-link.danger { color: rgba(255,130,130,.8); }
.sidebar-link.danger:hover { background: rgba(239,68,68,.2); color: #fca5a5; }
.sidebar-bottom { padding: .75rem; border-top: 1px solid rgba(255,255,255,.1); }
.admin-main    { padding: 2rem; overflow-x: hidden; }
.admin-header  { margin-bottom: 2rem; }
.admin-header h1 { font-size: 1.5rem; color: var(--dark); font-weight: 800; }
.admin-header p  { color: var(--gray); font-size: .88rem; margin-top: .15rem; }
.admin-stats-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.25rem; margin-bottom: 2rem; }
.admin-stat-card {
  background: #fff; border-radius: var(--radius); padding: 1.5rem;
  box-shadow: var(--shadow-sm); border: 1px solid var(--gray-border);
  display: flex; align-items: center; gap: 1.1rem;
}
.admin-stat-icon {
  width: 50px; height: 50px; border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.admin-stat-icon svg { width: 24px; height: 24px; }
.admin-stat-icon.teal  { background: var(--primary-pale); color: var(--primary); }
.admin-stat-icon.green { background: #dcfce7; color: #16a34a; }
.admin-stat-icon.red   { background: #fee2e2; color: #dc2626; }
.admin-stat-info .num  { font-size: 1.65rem; font-weight: 800; color: var(--dark); line-height: 1; }
.admin-stat-info .lbl  { font-size: .78rem; color: var(--gray); margin-top: .2rem; }
.admin-card {
  background: #fff; border-radius: var(--radius); box-shadow: var(--shadow-sm);
  border: 1px solid var(--gray-border); overflow: hidden;
}
.admin-card-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1.1rem 1.5rem; border-bottom: 1px solid var(--gray-border);
}
.admin-card-header h2 { font-size: .95rem; font-weight: 700; color: var(--dark); }
.admin-table { width: 100%; border-collapse: collapse; }
.admin-table th {
  text-align: left; font-size: .72rem; font-weight: 700; color: var(--gray);
  text-transform: uppercase; letter-spacing: .5px; padding: .7rem 1.5rem;
  background: #f8fafc; border-bottom: 1px solid var(--gray-border);
}
.admin-table td { padding: .9rem 1.5rem; border-bottom: 1px solid var(--gray-border); vertical-align: middle; }
.admin-table tr:last-child td { border-bottom: none; }
.admin-table tr:hover td { background: #f8fafc; }
.car-table-img { width: 64px; height: 48px; border-radius: var(--radius-sm); object-fit: cover; background: var(--light); }
.car-table-img-placeholder {
  width: 64px; height: 48px; border-radius: var(--radius-sm);
  background: linear-gradient(135deg, #e5e7eb, #d1d5db);
  display: flex; align-items: center; justify-content: center;
}
.car-table-img-placeholder svg { width: 22px; height: 22px; color: var(--gray-light); }
.action-btns { display: flex; gap: .5rem; }
.action-btn {
  width: 34px; height: 34px; border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center; transition: var(--transition);
}
.action-btn svg { width: 15px; height: 15px; }
.action-btn.edit   { background: #eff6ff; color: #3b82f6; }
.action-btn.edit:hover  { background: #3b82f6; color: #fff; }
.action-btn.delete { background: #fef2f2; color: var(--danger); }
.action-btn.delete:hover { background: var(--danger); color: #fff; }
.toggle-switch { position: relative; display: inline-block; width: 44px; height: 24px; }
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
  position: absolute; cursor: pointer; inset: 0; background: #d1d5db;
  border-radius: 24px; transition: .3s;
}
.toggle-slider:before {
  content: ''; position: absolute; height: 18px; width: 18px;
  left: 3px; bottom: 3px; background: #fff; border-radius: 50%; transition: .3s;
}
.toggle-switch input:checked + .toggle-slider { background: var(--primary); }
.toggle-switch input:checked + .toggle-slider:before { transform: translateX(20px); }

/* ── Image Upload ───────────────────────────────────────── */
.upload-area {
  border: 2px dashed var(--gray-border); border-radius: var(--radius);
  padding: 2rem; text-align: center; cursor: pointer; transition: var(--transition);
  background: var(--light); position: relative;
}
.upload-area:hover, .upload-area.drag-over { border-color: var(--primary); background: var(--primary-pale); }
.upload-area input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; }
.upload-icon { color: var(--primary); margin-bottom: .75rem; }
.upload-icon svg { width: 42px; height: 42px; }
.upload-area p { font-size: .9rem; color: var(--gray); }
.upload-area strong { color: var(--primary); }
.image-previews {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: .75rem; margin-top: 1rem;
}
.image-preview-item {
  position: relative; border-radius: var(--radius-sm); overflow: hidden;
  aspect-ratio: 4/3; background: var(--light);
}
.image-preview-item img { width: 100%; height: 100%; object-fit: cover; }
.image-preview-remove {
  position: absolute; top: .3rem; right: .3rem; width: 22px; height: 22px;
  background: rgba(0,0,0,.6); color: #fff; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; font-size: .8rem; transition: var(--transition);
}
.image-preview-remove:hover { background: var(--danger); }

/* ── Tags Input ─────────────────────────────────────────── */
.tags-input-wrap {
  display: flex; flex-wrap: wrap; gap: .5rem; padding: .6rem;
  border: 1.5px solid var(--gray-border); border-radius: var(--radius-sm);
  background: #fff; cursor: text; transition: var(--transition);
  min-height: 48px; align-items: center;
}
.tags-input-wrap:focus-within { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(27,58,107,.1); }
.tag-item {
  display: flex; align-items: center; gap: .35rem;
  background: var(--primary-pale); color: var(--primary);
  padding: .3rem .75rem; border-radius: 50px; font-size: .8rem; font-weight: 600;
}
.tag-remove { cursor: pointer; opacity: .7; line-height: 1; font-size: 1rem; }
.tag-remove:hover { opacity: 1; }
.tag-input { flex: 1; border: none; outline: none; font-size: .875rem; min-width: 120px; background: transparent; font-family: inherit; }

/* ── Modal ──────────────────────────────────────────────── */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(0,0,0,.55);
  backdrop-filter: blur(4px); z-index: 9998;
  display: flex; align-items: center; justify-content: center; padding: 1rem;
  opacity: 0; pointer-events: none; transition: opacity .2s;
}
.modal-backdrop.show { opacity: 1; pointer-events: all; }
.modal {
  background: #fff; border-radius: var(--radius-xl); padding: 2rem;
  max-width: 440px; width: 100%; box-shadow: var(--shadow-xl);
  transform: scale(.95); transition: transform .2s;
}
.modal-backdrop.show .modal { transform: scale(1); }
.modal-icon {
  width: 60px; height: 60px; border-radius: 50%;
  background: #fee2e2; color: var(--danger);
  display: flex; align-items: center; justify-content: center; margin: 0 auto 1.1rem;
}
.modal-icon svg { width: 28px; height: 28px; }
.modal h3 { font-size: 1.2rem; text-align: center; margin-bottom: .5rem; }
.modal p  { text-align: center; font-size: .88rem; margin-bottom: 1.5rem; }
.modal-actions { display: flex; gap: .75rem; }
.modal-actions .btn { flex: 1; }

/* ── Login Page ─────────────────────────────────────────── */
.login-page {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 60%, #1a4080 100%);
  padding: 1rem;
}
.login-card {
  background: #fff; border-radius: var(--radius-xl); padding: 2.5rem;
  width: 100%; max-width: 420px; box-shadow: var(--shadow-xl);
}
.login-logo { text-align: center; margin-bottom: 2rem; }
.login-logo h1 { font-size: 1.4rem; color: var(--dark); margin-top: .5rem; }
.login-logo p  { font-size: .85rem; }
.alert { padding: .9rem 1.1rem; border-radius: var(--radius-sm); font-size: .875rem; font-weight: 500; margin-bottom: 1.25rem; display: flex; align-items: center; gap: .6rem; }
.alert-error   { background: #fef2f2; border: 1px solid #fecaca; color: #991b1b; }
.alert-success { background: #f0fdf4; border: 1px solid #bbf7d0; color: #166534; }
.alert svg { width: 17px; height: 17px; flex-shrink: 0; }

/* ── Admin Form Page ────────────────────────────────────── */
.admin-form-grid { display: grid; grid-template-columns: 1fr 380px; gap: 1.5rem; align-items: start; }
.form-section {
  background: #fff; border-radius: var(--radius); padding: 1.5rem;
  box-shadow: var(--shadow-sm); border: 1px solid var(--gray-border); margin-bottom: 1.5rem;
}
.form-section-title {
  font-size: .9rem; font-weight: 700; color: var(--dark); margin-bottom: 1.1rem;
  padding-bottom: .7rem; border-bottom: 1px solid var(--gray-border);
  display: flex; align-items: center; gap: .5rem;
}
.form-section-title svg { width: 17px; height: 17px; color: var(--primary); }

/* ── Loading / Skeletons ────────────────────────────────── */
.skeleton {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%; animation: shimmer 1.4s infinite; border-radius: var(--radius-sm);
}
@keyframes shimmer { 0% { background-position: -200% 0; } 100% { background-position: 200% 0; } }
.skeleton-card { border-radius: var(--radius-lg); height: 350px; }
.spinner {
  width: 38px; height: 38px; border-radius: 50%;
  border: 3px solid rgba(27,58,107,.15); border-top-color: var(--primary);
  animation: spin .7s linear infinite; margin: 2.5rem auto;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading-msg { text-align: center; color: var(--gray); font-size: .88rem; margin-top: .75rem; }
.empty-state { text-align: center; padding: 4.5rem 2rem; color: var(--gray); }
.empty-state svg { width: 70px; height: 70px; opacity: .25; margin: 0 auto 1.25rem; display: block; }
.empty-state h3 { font-size: 1.1rem; color: var(--dark); margin-bottom: .4rem; }
.empty-state p  { font-size: .88rem; }

/* ── Notification Toast ─────────────────────────────────── */
.toast {
  position: fixed; bottom: 5.5rem; right: 1.5rem; z-index: 9999;
  background: var(--dark); color: #fff; padding: .9rem 1.4rem;
  border-radius: var(--radius); box-shadow: var(--shadow-xl);
  display: flex; align-items: center; gap: .65rem; font-size: .875rem;
  transform: translateY(100px); opacity: 0; transition: all .3s;
  max-width: 340px; border-left: 4px solid var(--primary);
}
.toast.show { transform: translateY(0); opacity: 1; }
.toast.error   { border-color: var(--danger); }
.toast.success { border-color: var(--success); }
.toast svg { width: 18px; height: 18px; flex-shrink: 0; }

/* ── Pagination (catalog page) ──────────────────────────── */
.pagination {
  display: flex; align-items: center; justify-content: center; gap: .5rem; margin-top: 2.5rem;
}
.page-btn {
  width: 38px; height: 38px; border-radius: var(--radius-sm); font-size: .88rem;
  font-weight: 600; background: #fff; border: 1.5px solid var(--gray-border);
  color: var(--gray); transition: var(--transition); font-family: inherit; cursor: pointer;
}
.page-btn:hover { border-color: var(--primary); color: var(--primary); }
.page-btn.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.page-btn:disabled { opacity: .4; cursor: default; }

/* ── Similar Cars ───────────────────────────────────────── */
#similar-section { background: #fff; padding: 3rem 0; }

/* ── Responsive ─────────────────────────────────────────── */
@media (max-width: 1100px) {
  .cars-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 1024px) {
  .detail-layout {
    grid-template-columns: 1fr;
    grid-template-areas: "gallery" "sidebar" "content";
  }
  .detail-card     { position: static; }
  .admin-form-grid { grid-template-columns: 1fr; }
  .contact-grid    { grid-template-columns: 1fr; }
  .contact-map     { height: 220px; }
  .contact-info    { padding: 2rem 1.5rem; }
}
@media (max-width: 900px) {
  .cars-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ── 768px – Tablet / Mobile ─────────────────────────────── */
@media (max-width: 768px) {
  /* Navbar */
  .navbar-inner { padding: 0 1rem; }
  .navbar-brand { font-size: .9rem; }
  .navbar-brand span { display: none; }
  .navbar-links {
    display: none; position: absolute; top: 68px; left: 0; right: 0;
    flex-direction: column; background: #fff; padding: 1rem;
    border-bottom: 1px solid var(--gray-border); gap: .2rem;
    box-shadow: 0 8px 20px rgba(0,0,0,.1); z-index: 999;
  }
  .navbar-links.open  { display: flex; }
  .navbar-toggle      { display: flex; }
  .navbar-logo-badge  { width: 36px; height: 36px; flex-shrink: 0; }
  .navbar-logo-badge svg { width: 18px; height: 18px; }

  /* Hero */
  .hero-chat { min-height: 92dvh; }
  .hero-chat-inner { padding: 2.5rem 1.25rem 2rem; gap: 1.5rem; }
  .hero-title  { font-size: 3rem; letter-spacing: -1px; }
  .hero-subtitle { font-size: 1rem; }
  .chat-main-text { font-size: 1.4rem; }
  .chat-suggestions { gap: .5rem; }
  .chat-chip { padding: .5rem .85rem; font-size: .8rem; }

  /* Cards grid */
  .cars-grid { grid-template-columns: repeat(2, 1fr); gap: 1rem; }

  /* Car card compact */
  .car-card-header { padding: .65rem .75rem .4rem; }
  .car-card-brand  { font-size: .8rem; }
  .car-card-meta   { font-size: .7rem; }
  .car-card-sucursal { font-size: .68rem; }
  .car-card-image  { height: 155px; }
  .car-card-body   { padding: .6rem .75rem; gap: .5rem; }
  .car-card-motor  { font-size: .68rem; }
  .car-card-colors { font-size: .65rem; }
  .spec-chip       { padding: .18rem .5rem; font-size: .68rem; }
  .spec-chip svg   { width: 10px; height: 10px; }
  .car-price-btn   { padding: .65rem; font-size: .82rem; }

  /* Sections */
  .section         { padding: 3.5rem 0; }
  .stats-grid      { grid-template-columns: 1fr; gap: 1rem; }
  .why-card        { max-width: calc(50% - .625rem); flex: 1 1 calc(50% - .625rem); }

  /* Admin */
  .admin-wrap      { grid-template-columns: 1fr; }
  .admin-sidebar   { height: auto; position: static; }
  .admin-stats-grid { grid-template-columns: 1fr 1fr; gap: 1rem; }
  .form-row        { grid-template-columns: 1fr; }

  /* Financing */
  .financing-banks { gap: 2rem 2.5rem; flex-wrap: wrap; justify-content: center; }

  /* Filters */
  .catalog-filters-bar {
    flex-direction: column; align-items: stretch; gap: .65rem;
  }
  .filter-search-wrap { min-width: unset; }
  .filter-select-wrap { width: 100%; }
  .filter-select      { width: 100%; min-width: unset; }
  .filter-clear-btn   { width: 100%; text-align: center; }

  /* Contact footer */
  .contact-section    { padding: 3rem 0 0; }
  .contact-header     { padding-bottom: 2rem; }
  .contact-header h2  { font-size: 1.1rem; letter-spacing: 1.5px; }
  .contact-grid       { grid-template-columns: 1fr; }
  .contact-map        { height: 240px; }
  .contact-info       { padding: 1.75rem 1.25rem; }
  .contact-item-value { font-size: .85rem; }
  .social-btn         { font-size: .78rem; }

  /* Footer bar */
  .footer-bar-inner   { flex-direction: column; gap: .65rem; text-align: center; }
}

/* ── 600px – Small mobile ─────────────────────────────────── */
@media (max-width: 600px) {
  /* Hero */
  .hero-chat       { min-height: 95dvh; }
  .hero-chat-inner { padding: 2rem 1rem 1.75rem; gap: 1.25rem; }
  .hero-title      { font-size: 2.5rem; }
  .hero-subtitle   { font-size: .88rem; }
  .chat-main-text  { font-size: 1.3rem; }
  .chat-suggestions { display: none; } /* hide chips on very small screens for space */
  .chat-hint       { font-size: .72rem; }

  /* Cards – 1 column to avoid clipping */
  .cars-grid { grid-template-columns: 1fr; gap: .85rem; }

  /* Card layout horizontal on 1-col view */
  .car-card { flex-direction: row; max-height: 148px; overflow: hidden; }
  .car-card-image { width: 130px; min-width: 130px; height: 100%; flex-shrink: 0; border-radius: 0; }
  .car-card-image img { border-radius: 0; }
  .car-card-header { padding: .65rem .7rem .3rem; }
  .car-card-body   { padding: .4rem .7rem .4rem; flex: 1; min-width: 0; overflow: hidden; }
  .car-card-footer { margin-top: auto; }
  .car-card-colors { display: none; }
  .car-price-btn   { border-radius: 0 0 var(--radius-lg) 0; padding: .55rem .7rem; font-size: .78rem; }
  /* Condition badge repositioned for horizontal card */
  .car-condition-badge  { top: .4rem; left: .4rem; }
  .car-available-badge  { top: .4rem; right: .4rem; }

  /* Why grid */
  .why-card { max-width: 100%; flex: 1 1 100%; }

  /* Admin stats */
  .admin-stats-grid { grid-template-columns: 1fr; }

  /* Financing */
  .financing-banks { gap: 1.5rem 2rem; }
  .bank-logo-text  { font-size: 1.2rem; }

  /* Contact footer */
  .contact-section    { padding: 2.5rem 0 0; }
  .contact-header     { padding-bottom: 1.5rem; }
  .contact-header h2  { font-size: 1rem; letter-spacing: 1px; }
  .contact-map        { height: 200px; }
  .contact-info       { padding: 1.5rem 1rem; }
  .contact-info-title { font-size: .88rem; margin-bottom: 1rem; }
  .contact-item       { gap: .65rem; margin-bottom: 1rem; }
  .contact-item svg   { width: 16px; height: 16px; }
  .contact-item-value { font-size: .82rem; }
  .contact-social     { flex-direction: column; gap: .65rem; margin-top: 1.25rem; }
  .social-btn         { font-size: .8rem; }

  /* Footer bar */
  .footer-bar         { padding: 1rem 0; }
  .footer-bar-inner   { flex-direction: column; gap: .5rem; text-align: center; padding: 0 1rem; font-size: .72rem; }
  .footer-bar-inner > div { display: flex; gap: .75rem; justify-content: center; }
}

/* ── 480px – XS mobile ────────────────────────────────────── */
@media (max-width: 480px) {
  .modal { padding: 1.5rem; }
  .hero-title { font-size: 2.2rem; }
  .navbar-brand { font-size: .82rem; }

  /* Card back to full column stacked (not horizontal) to keep details readable */
  .car-card { flex-direction: column; max-height: none; }
  .car-card-image { width: 100%; height: 160px; min-width: unset; border-radius: 0; }
  .car-card-colors { display: flex; }
  .car-price-btn  { border-radius: 0 0 var(--radius-lg) var(--radius-lg); }

  /* Compact hero */
  .hero-chat-inner { padding: 1.75rem .85rem 1.5rem; gap: 1rem; }
  .chat-main-text  { font-size: 1.2rem; }
  .hero-subtitle   { display: none; }
  .chat-form-wrap  { width: 100%; }

  /* Load more */
  .btn-load-more { padding: .75rem 2rem; font-size: .88rem; }

  /* Contact footer XS */
  .contact-section    { padding: 2rem 0 0; }
  .contact-header h2  { font-size: .9rem; letter-spacing: .5px; }
  .contact-map        { height: 180px; }
  .contact-info       { padding: 1.25rem .85rem; }
  .footer-bar-inner   { padding: 0 .85rem; font-size: .7rem; }
}
