/* ==========================================================================
   APEX MOTORS - PALETA: BLANCO DE FONDO, TOQUES ROJO Y NEGRO
   DISEÑO 100% RESPONSIVO PARA ESCRITORIO, IPADS, TABLETS Y MÓVILES
   ========================================================================== */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800;900&family=Montserrat:wght@400;500;600;700;800;900&display=swap');

:root {
  --bg-main: #ffffff;
  --bg-secondary: #f8fafc;
  --bg-card: #ffffff;
  --bg-subtle: #f1f5f9;
  --bg-dark: #0a0a0c;
  --bg-dark-card: #131417;
  
  --red-primary: #e60023;
  --red-hover: #c4001d;
  --red-dark: #990017;
  --red-light: #fee2e2;
  --red-glow: rgba(230, 0, 35, 0.22);
  
  --black-deep: #09090b;
  --black-surface: #121316;
  --text-dark: #0f172a;
  --text-muted: #64748b;
  --text-light: #94a3b8;
  --text-white: #ffffff;
  
  --border-light: #e2e8f0;
  --border-subtle: #cbd5e1;
  --border-dark: #27272a;
  
  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 6px 24px rgba(0, 0, 0, 0.07);
  --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.12);
  --shadow-red: 0 8px 25px rgba(230, 0, 35, 0.25);
  --shadow-card-hover: 0 18px 38px rgba(15, 23, 42, 0.12);

  --font-main: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-heading: 'Montserrat', sans-serif;
  
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-full: 9999px;
  
  --transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
  overflow-x: hidden;
  width: 100%;
}

body {
  font-family: var(--font-main);
  background-color: var(--bg-main);
  color: var(--text-dark);
  line-height: 1.6;
  overflow-x: hidden;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  text-decoration: none;
  color: inherit;
  transition: var(--transition);
}

button, input, select, textarea {
  font-family: inherit;
  font-size: 1rem;
}

.container {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* ==========================================================================
   BADGES Y BOTONES
   ========================================================================== */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.8rem;
  border-radius: var(--radius-full);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.badge-red {
  background: var(--red-light);
  color: var(--red-primary);
  border: 1px solid rgba(230, 0, 35, 0.2);
}

.badge-black {
  background: var(--black-deep);
  color: var(--text-white);
}

.badge-eco {
  background: #dcfce7;
  color: #15803d;
  font-weight: 800;
}

.badge-cero {
  background: #e0f2fe;
  color: #0369a1;
  font-weight: 800;
}

.badge-c {
  background: #fef3c7;
  color: #b45309;
  font-weight: 800;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.8rem 1.6rem;
  min-height: 46px;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  border: none;
  transition: var(--transition);
  touch-action: manipulation;
}

.btn-primary {
  background: linear-gradient(135deg, var(--red-primary), var(--red-dark));
  color: var(--text-white);
  box-shadow: var(--shadow-red);
}

.btn-primary:hover, .btn-primary:active {
  transform: translateY(-2px);
  box-shadow: 0 10px 28px rgba(230, 0, 35, 0.38);
}

.btn-secondary {
  background: var(--black-deep);
  color: var(--text-white);
}

.btn-secondary:hover, .btn-secondary:active {
  background: #27272a;
  transform: translateY(-2px);
}

.btn-outline {
  background: transparent;
  border: 2px solid var(--border-light);
  color: var(--text-dark);
}

.btn-outline:hover, .btn-outline:active {
  border-color: var(--black-deep);
  background: var(--bg-subtle);
}

.btn-outline-red {
  background: transparent;
  border: 1.5px solid var(--red-primary);
  color: var(--red-primary);
}

.btn-outline-red:hover, .btn-outline-red:active {
  background: var(--red-primary);
  color: var(--text-white);
}

.btn-sm {
  padding: 0.5rem 1rem;
  min-height: 40px;
  font-size: 0.88rem;
  border-radius: var(--radius-sm);
}

/* ==========================================================================
   ENCABEZADOS DE SECCIÓN
   ========================================================================== */

.section-header {
  text-align: center;
  max-width: 700px;
  margin: 0 auto 3rem auto;
}

.section-tag {
  color: var(--red-primary);
  font-weight: 800;
  text-transform: uppercase;
  font-size: 0.85rem;
  letter-spacing: 0.12em;
  margin-bottom: 0.5rem;
  display: block;
}

.section-title {
  font-family: var(--font-heading);
  font-size: clamp(1.8rem, 4vw, 2.4rem);
  font-weight: 800;
  color: var(--black-deep);
  line-height: 1.2;
  margin-bottom: 0.75rem;
  letter-spacing: -0.02em;
}

.section-title span {
  color: var(--red-primary);
}

.section-desc {
  color: var(--text-muted);
  font-size: clamp(0.95rem, 2vw, 1.05rem);
}

/* ==========================================================================
   TOP BAR & HEADER NAVBAR
   ========================================================================== */

.top-bar {
  background: var(--black-deep);
  color: var(--text-light);
  font-size: 0.82rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.top-bar .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.top-bar-info, .top-bar-social {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.top-bar-info span {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.top-bar-info i, .top-bar-social a {
  color: var(--red-primary);
}

.top-bar-social a:hover {
  color: #ffffff;
}

.navbar {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-light);
  transition: var(--transition);
}

.navbar.scrolled {
  box-shadow: var(--shadow-md);
}

.nav-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 75px;
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--font-heading);
  font-size: clamp(1.3rem, 3vw, 1.6rem);
  font-weight: 900;
  letter-spacing: -0.03em;
  color: var(--black-deep);
}

.brand-logo .logo-icon {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, var(--black-deep) 0%, #1e293b 100%);
  border: 2px solid var(--red-primary);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--red-primary);
  font-size: 1.25rem;
  box-shadow: 0 4px 10px rgba(230, 0, 35, 0.2);
}

.brand-logo span span {
  color: var(--red-primary);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  list-style: none;
}

.nav-link {
  font-weight: 600;
  color: var(--text-dark);
  font-size: 0.95rem;
  position: relative;
  padding: 0.5rem 0;
}

.nav-link:hover, .nav-link.active {
  color: var(--red-primary);
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0%;
  height: 2px;
  background: var(--red-primary);
  transition: var(--transition);
}

.nav-link:hover::after, .nav-link.active::after {
  width: 100%;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.currency-toggle-btn {
  position: relative;
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  background: var(--bg-subtle);
  border: 1px solid var(--border-light);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--black-deep);
  cursor: pointer;
  transition: var(--transition);
  user-select: none;
  padding: 0;
}

.currency-toggle-btn:hover, .currency-toggle-btn:active {
  background: var(--red-light);
  color: var(--red-primary);
  border-color: rgba(230, 0, 35, 0.3);
}

.currency-toggle-symbol {
  font-size: 1.05rem;
  font-weight: 900;
  line-height: 1;
  color: inherit;
  transition: transform 0.2s ease;
}

.currency-toggle-btn:hover .currency-toggle-symbol {
  transform: scale(1.15);
}

.currency-toggle-code {
  font-size: 0.52rem;
  font-weight: 800;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  line-height: 1;
  margin-top: 2px;
  text-transform: uppercase;
}

.currency-toggle-btn:hover .currency-toggle-code {
  color: var(--red-primary);
}

.currency-dropdown-container {
  position: relative;
  display: inline-block;
}

.currency-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: #ffffff;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.15), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
  min-width: 175px;
  padding: 0.4rem;
  display: none;
  flex-direction: column;
  gap: 0.25rem;
  z-index: 1001;
  transform-origin: top right;
  animation: dropdownFade 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.currency-menu.show {
  display: flex;
}

@keyframes dropdownFade {
  from {
    opacity: 0;
    transform: scale(0.95) translateY(-5px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.currency-option {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  padding: 0.55rem 0.75rem;
  border: none;
  background: transparent;
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--black-deep);
  cursor: pointer;
  transition: var(--transition);
  text-align: left;
}

.currency-option:hover {
  background: var(--bg-subtle);
  color: var(--red-primary);
}

.curr-opt-symbol {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
  font-weight: 900;
  border-radius: var(--radius-xs);
  background: var(--bg-subtle);
  color: var(--black-deep);
  flex-shrink: 0;
}

.currency-option:hover .curr-opt-symbol {
  background: var(--red-light);
  color: var(--red-primary);
}

.curr-opt-name {
  flex: 1;
  font-size: 0.85rem;
}

.curr-opt-check {
  font-size: 0.8rem;
  color: var(--red-primary);
  opacity: 0;
  transition: opacity 0.2s ease;
}

.currency-option.active {
  background: rgba(230, 0, 35, 0.06);
  color: var(--red-primary);
}

.currency-option.active .curr-opt-symbol {
  background: var(--red-primary);
  color: #ffffff;
}

.currency-option.active .curr-opt-check {
  opacity: 1;
}

.fav-btn {
  position: relative;
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  background: var(--bg-subtle);
  border: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--black-deep);
  cursor: pointer;
  transition: var(--transition);
  font-size: 1.1rem;
}

.fav-btn:hover, .fav-btn:active {
  background: var(--red-light);
  color: var(--red-primary);
  border-color: rgba(230, 0, 35, 0.3);
}

.fav-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  background: var(--red-primary);
  color: white;
  font-size: 0.7rem;
  font-weight: 800;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid white;
}

.mobile-toggle {
  display: none;
  background: var(--bg-subtle);
  border: 1px solid var(--border-light);
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  font-size: 1.3rem;
  color: var(--black-deep);
  cursor: pointer;
  align-items: center;
  justify-content: center;
}

.mobile-toggle:hover {
  background: var(--red-light);
  color: var(--red-primary);
}

/* Fondo oscuro cuando el menú tablet/móvil está abierto */
.mobile-nav-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(10, 10, 12, 0.6);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 998;
  display: none;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.mobile-nav-overlay.active {
  display: block;
  opacity: 1;
}

/* ==========================================================================
   HERO SECTION
   ========================================================================== */

.hero {
  position: relative;
  padding: clamp(3rem, 6vw, 4.5rem) 0 clamp(2.5rem, 5vw, 4rem);
  background: radial-gradient(circle at 85% 30%, rgba(230, 0, 35, 0.06) 0%, transparent 60%),
              linear-gradient(180deg, var(--bg-secondary) 0%, var(--bg-main) 100%);
  overflow: hidden;
  border-bottom: 1px solid var(--border-light);
}

.hero::before {
  content: '';
  position: absolute;
  top: -80px;
  right: -80px;
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(230, 0, 35, 0.08) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  align-items: center;
  gap: 3rem;
}

.hero-content {
  z-index: 2;
}

.hero-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.4rem 1.1rem;
  background: var(--bg-main);
  border: 1px solid var(--border-light);
  border-left: 3px solid var(--red-primary);
  border-radius: var(--radius-full);
  font-size: clamp(0.78rem, 1.8vw, 0.85rem);
  font-weight: 700;
  color: var(--black-deep);
  margin-bottom: 1.25rem;
  box-shadow: var(--shadow-sm);
}

.hero-pill i {
  color: var(--red-primary);
}

.hero-title {
  font-family: var(--font-heading);
  font-size: clamp(2.2rem, 5vw, 3.4rem);
  font-weight: 900;
  line-height: 1.15;
  color: var(--black-deep);
  margin-bottom: 1.25rem;
  letter-spacing: -0.03em;
}

.hero-title .accent-red {
  color: var(--red-primary);
  position: relative;
  display: inline-block;
}

.hero-title .accent-red::after {
  content: '';
  position: absolute;
  bottom: 4px;
  left: 0;
  width: 100%;
  height: 8px;
  background: rgba(230, 0, 35, 0.15);
  z-index: -1;
  border-radius: 4px;
}

.hero-subtitle {
  font-size: clamp(1rem, 2.2vw, 1.15rem);
  color: var(--text-muted);
  margin-bottom: 2rem;
  max-width: 540px;
  line-height: 1.6;
}

.hero-cta-group {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 2.5rem;
}

.hero-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border-light);
}

.hero-stat-number {
  font-family: var(--font-heading);
  font-size: clamp(1.5rem, 3vw, 1.8rem);
  font-weight: 900;
  color: var(--black-deep);
}

.hero-stat-number span {
  color: var(--red-primary);
}

.hero-stat-label {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 700;
  text-transform: uppercase;
}

.hero-image-wrapper {
  position: relative;
  z-index: 1;
}

.hero-car-card {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--black-deep);
  border: 1px solid var(--border-dark);
  box-shadow: var(--shadow-lg);
  transition: transform 0.4s ease, box-shadow 0.4s ease, border-color 0.4s ease;
  cursor: pointer;
}

.hero-car-card:hover {
  transform: translateY(-5px);
  border-color: rgba(230, 0, 35, 0.45);
  box-shadow: 0 20px 45px rgba(230, 0, 35, 0.18), var(--shadow-lg);
}

.hero-view-details-tag {
  font-size: 0.72rem;
  font-weight: 700;
  color: #ffffff;
  background: var(--red-primary);
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  transition: background 0.2s ease, transform 0.2s ease;
  box-shadow: 0 2px 8px rgba(230, 0, 35, 0.4);
}

.hero-car-card:hover .hero-view-details-tag {
  background: var(--red-hover);
  transform: scale(1.05);
}

.hero-car-img {
  width: 100%;
  height: clamp(280px, 35vw, 380px);
  object-fit: cover;
  object-position: center center;
  transition: transform 0.6s ease;
}

.hero-car-card:hover .hero-car-img {
  transform: scale(1.04);
}

.hero-badge-floating {
  position: absolute;
  top: 1.25rem;
  left: 1.25rem;
  background: rgba(10, 10, 12, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  padding: 0.5rem 1rem;
  border-radius: var(--radius-full);
  color: white;
  font-size: 0.8rem;
  font-weight: 700;
  border: 1px solid rgba(230, 0, 35, 0.4);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.hero-badge-floating i {
  color: var(--red-primary);
}

.hero-car-info {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 1.5rem;
  background: linear-gradient(0deg, rgba(10, 10, 12, 0.95) 0%, rgba(10, 10, 12, 0.7) 70%, transparent 100%);
  color: white;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 1rem;
}

.hero-car-info h4 {
  font-size: clamp(1.05rem, 2vw, 1.25rem);
  font-weight: 800;
  margin-bottom: 0.25rem;
}

.hero-car-info p {
  font-size: 0.85rem;
  color: var(--text-light);
}

.hero-car-info .price-tag {
  font-family: var(--font-heading);
  font-size: clamp(1.25rem, 2.5vw, 1.5rem);
  font-weight: 900;
  color: var(--red-primary);
  white-space: nowrap;
}

/* ==========================================================================
   BARRA DE BÚSQUEDA RÁPIDA
   ========================================================================== */

.quick-search-box {
  background: var(--bg-main);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: clamp(1.25rem, 3vw, 1.75rem);
  box-shadow: var(--shadow-lg);
  margin-top: -2.5rem;
  position: relative;
  z-index: 10;
}

.quick-search-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr) auto;
  gap: 1.25rem;
  align-items: flex-end;
}

.input-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.input-group label {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--black-deep);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.input-group label i {
  color: var(--red-primary);
}

.input-group select, .input-group input, .input-group textarea {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  min-width: 0;
  height: 48px;
  padding: 0 1rem;
  border-radius: var(--radius-md);
  border: 1.5px solid var(--border-light);
  background: var(--bg-secondary);
  color: var(--text-dark);
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 600;
  outline: none;
  transition: var(--transition);
  -webkit-appearance: none;
  appearance: none;
}

.input-group textarea {
  height: auto;
  min-height: 110px;
  padding: 0.85rem 1rem;
  line-height: 1.5;
  resize: vertical;
}

.input-group select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2364748b'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  background-size: 1.2rem;
  padding-right: 2.5rem;
}

.input-group select:focus, .input-group input:focus, .input-group textarea:focus {
  border-color: var(--red-primary);
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(230, 0, 35, 0.12);
}

.form-grid-2col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1rem;
  width: 100%;
  box-sizing: border-box;
}

.form-grid-2col > * {
  min-width: 0;
}

@media (max-width: 768px) {
  .form-grid-2col {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
}

/* ==========================================================================
   SECCIÓN CATÁLOGO & FILTROS
   ========================================================================== */

.catalog-section {
  padding: clamp(3rem, 6vw, 5rem) 0;
  background: var(--bg-secondary);
}

.filter-toggle-tablet-container {
  display: none;
  margin-bottom: 1.25rem;
}

.btn-filter-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 1.25rem;
  background: var(--bg-main);
  border: 1.5px solid var(--border-light);
  border-radius: var(--radius-md);
  font-weight: 700;
  color: var(--black-deep);
  cursor: pointer;
  box-shadow: var(--shadow-sm);
}

.btn-filter-toggle span {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-filter-toggle i {
  color: var(--red-primary);
}

.catalog-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 2rem;
}

.filter-sidebar {
  background: var(--bg-main);
  padding: 1.75rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-sm);
  height: fit-content;
  position: sticky;
  top: 95px;
  transition: var(--transition);
}

.filter-sidebar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border-light);
}

.filter-sidebar-header h3 {
  font-size: 1.15rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.filter-sidebar-header h3 i {
  color: var(--red-primary);
}

.btn-reset-filters {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
}

.btn-reset-filters:hover {
  color: var(--red-primary);
  text-decoration: underline;
}

.filter-group {
  margin-bottom: 1.5rem;
}

.filter-group-title {
  font-size: 0.85rem;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--black-deep);
  margin-bottom: 0.75rem;
  display: flex;
  justify-content: space-between;
}

.filter-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.filter-pill-btn {
  padding: 0.5rem 0.85rem;
  min-height: 38px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-dark);
  cursor: pointer;
  transition: var(--transition);
  touch-action: manipulation;
}

.filter-pill-btn:hover {
  border-color: var(--black-deep);
}

.filter-pill-btn.active {
  background: var(--black-deep);
  color: white;
  border-color: var(--black-deep);
}

.range-slider-container {
  padding: 0.5rem 0;
}

.range-slider {
  width: 100%;
  accent-color: var(--red-primary);
  cursor: pointer;
  height: 8px;
  border-radius: 4px;
}

.range-values {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-dark);
  margin-top: 0.4rem;
}

.catalog-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.results-count {
  font-size: 1rem;
  color: var(--text-muted);
}

.results-count strong {
  color: var(--black-deep);
  font-weight: 800;
}

.catalog-sort {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.catalog-sort label {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-muted);
  white-space: nowrap;
}

.catalog-sort select {
  padding: 0.5rem 2.2rem 0.5rem 1rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-light);
  background: white;
  font-size: 0.88rem;
  font-weight: 600;
  outline: none;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2364748b'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  background-size: 1rem;
}

.cars-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
  gap: 1.75rem;
}

.car-card {
  background: var(--bg-main);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-light);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  position: relative;
}

.car-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-card-hover);
  border-color: rgba(230, 0, 35, 0.35);
}

.car-card-img-wrapper {
  position: relative;
  height: 220px;
  overflow: hidden;
  background: var(--black-deep);
}

.car-card-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
  transition: transform 0.5s ease;
}

.car-card:hover .car-card-img {
  transform: scale(1.06);
}

.card-tag {
  position: absolute;
  top: 1rem;
  left: 1rem;
  z-index: 2;
}

.card-eco-tag {
  position: absolute;
  top: 1rem;
  right: 3.75rem;
  z-index: 2;
}

.card-fav-btn {
  position: absolute;
  top: 0.85rem;
  right: 0.85rem;
  z-index: 2;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--black-deep);
  cursor: pointer;
  transition: var(--transition);
  font-size: 1rem;
}

.card-fav-btn:hover, .card-fav-btn:active {
  background: white;
  color: var(--red-primary);
  transform: scale(1.1);
}

.card-fav-btn.active {
  background: var(--red-primary);
  color: white;
}

.car-card-body {
  padding: 1.4rem;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.car-card-brand {
  font-size: 0.8rem;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--red-primary);
  letter-spacing: 0.05em;
}

.car-card-title {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--black-deep);
  margin-top: 0.2rem;
  margin-bottom: 0.85rem;
  line-height: 1.3;
}

.car-specs-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.6rem;
  padding: 0.85rem 0;
  margin-bottom: 1rem;
  border-top: 1px solid var(--border-light);
  border-bottom: 1px solid var(--border-light);
}

.spec-item {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.spec-item i {
  font-size: 0.85rem;
  color: var(--red-primary);
}

.spec-label {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
  font-weight: 600;
}

.spec-value {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--black-deep);
}

.car-card-pricing {
  margin-top: auto;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  padding-bottom: 1rem;
}

.price-container {
  display: flex;
  flex-direction: column;
}

.original-price {
  font-size: 0.85rem;
  color: var(--text-muted);
  text-decoration: line-through;
  font-weight: 600;
}

.main-price {
  font-family: var(--font-heading);
  font-size: 1.6rem;
  font-weight: 900;
  color: var(--black-deep);
  line-height: 1;
}

.finance-estimate {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 600;
  text-align: right;
}

.finance-estimate span {
  color: var(--red-primary);
  font-weight: 800;
}

.car-card-actions {
  display: flex;
}

.car-card-actions .btn-view-details {
  width: 100%;
  justify-content: center;
}

.no-results {
  grid-column: 1 / -1;
  text-align: center;
  padding: 4rem 1rem;
  background: white;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-light);
}

.no-results i {
  font-size: 3rem;
  color: var(--red-primary);
  margin-bottom: 1rem;
}

.no-results h3 {
  font-size: 1.4rem;
  font-weight: 800;
  margin-bottom: 0.5rem;
}

/* ==========================================================================
   CALCULADORA DE FINANCIACIÓN
   ========================================================================== */

.finance-section {
  padding: clamp(3rem, 6vw, 5rem) 0;
  background: var(--bg-main);
  border-top: 1px solid var(--border-light);
  border-bottom: 1px solid var(--border-light);
}

.finance-card {
  background: var(--black-deep);
  color: white;
  border-radius: var(--radius-lg);
  padding: clamp(1.75rem, 4vw, 3rem);
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: clamp(2rem, 4vw, 3rem);
  border: 1px solid var(--border-dark);
  box-shadow: var(--shadow-lg);
  position: relative;
  overflow: hidden;
}

.finance-card::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 350px;
  height: 350px;
  background: radial-gradient(circle, rgba(230, 0, 35, 0.22) 0%, transparent 70%);
  pointer-events: none;
}

.finance-sliders {
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
}

.slider-block {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.slider-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 700;
  font-size: 0.95rem;
}

.slider-header span:last-child {
  color: var(--red-primary);
  font-size: 1.15rem;
  font-weight: 800;
  font-family: var(--font-heading);
}

.slider-block input[type="range"] {
  width: 100%;
  height: 8px;
  border-radius: 4px;
  background: #27272a;
  outline: none;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
}

.slider-block input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--red-primary);
  cursor: pointer;
  box-shadow: 0 0 10px rgba(230, 0, 35, 0.5);
  border: 2px solid white;
}

.slider-block input[type="range"]::-moz-range-thumb {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--red-primary);
  cursor: pointer;
  box-shadow: 0 0 10px rgba(230, 0, 35, 0.5);
  border: 2px solid white;
}

.finance-summary-box {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-md);
  padding: clamp(1.5rem, 3vw, 2.2rem);
  display: flex;
  flex-direction: column;
  justify-content: center;
  text-align: center;
}

.monthly-fee-label {
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-light);
  margin-bottom: 0.5rem;
  font-weight: 700;
}

.monthly-fee-amount {
  font-family: var(--font-heading);
  font-size: clamp(2.5rem, 6vw, 3.4rem);
  font-weight: 900;
  color: var(--red-primary);
  line-height: 1;
  margin-bottom: 1.25rem;
}

.finance-terms {
  font-size: 0.8rem;
  color: var(--text-light);
  margin-bottom: 1.5rem;
  line-height: 1.4;
}

/* ==========================================================================
   TASADOR DE COCHES
   ========================================================================== */

.sell-car-section {
  padding: clamp(3rem, 6vw, 5rem) 0;
  background: var(--bg-secondary);
}

.sell-car-card {
  background: white;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-light);
  padding: clamp(1.75rem, 4vw, 3rem);
  box-shadow: var(--shadow-md);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(2rem, 4vw, 3rem);
  align-items: center;
}

.sell-info-list {
  list-style: none;
  margin: 1.5rem 0 2rem 0;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.sell-info-list li {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-weight: 600;
  color: var(--text-dark);
}

.sell-info-list i {
  color: var(--red-primary);
  background: var(--red-light);
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  flex-shrink: 0;
}

.appraisal-form {
  background: var(--bg-secondary);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: clamp(1.25rem, 3vw, 2rem);
}

.appraisal-form h4 {
  font-size: 1.25rem;
  font-weight: 800;
  margin-bottom: 1.25rem;
  color: var(--black-deep);
}

.appraisal-form .form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.appraisal-result {
  margin-top: 1rem;
  padding: 1rem;
  background: #ffffff;
  border: 1.5px dashed var(--red-primary);
  border-radius: var(--radius-md);
  text-align: center;
  display: none;
}

.appraisal-result.show {
  display: block;
}

.appraisal-result .valuation-price {
  font-family: var(--font-heading);
  font-size: clamp(1.4rem, 3vw, 1.8rem);
  font-weight: 900;
  color: var(--red-primary);
}

/* ==========================================================================
   VENTAJAS
   ========================================================================== */

.features-section {
  padding: clamp(3rem, 6vw, 5rem) 0;
  background: var(--bg-main);
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.75rem;
}

.feature-box {
  background: var(--bg-secondary);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: clamp(1.5rem, 3vw, 2rem) 1.5rem;
  text-align: center;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.feature-box::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: var(--red-primary);
  transform: scaleX(0);
  transition: transform 0.3s ease;
}

.feature-box:hover {
  transform: translateY(-6px);
  background: white;
  border-color: rgba(230, 0, 35, 0.3);
  box-shadow: var(--shadow-card-hover);
}

.feature-box:hover::before {
  transform: scaleX(1);
}

.feature-icon-wrapper {
  width: 60px;
  height: 60px;
  border-radius: var(--radius-md);
  background: var(--black-deep);
  color: var(--red-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  margin: 0 auto 1.25rem auto;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.feature-box h4 {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--black-deep);
  margin-bottom: 0.5rem;
}

.feature-box p {
  font-size: 0.9rem;
  color: var(--text-muted);
}

/* ==========================================================================
   TESTIMONIOS
   ========================================================================== */

.testimonials-section {
  padding: clamp(3rem, 6vw, 5rem) 0;
  background: var(--black-deep);
  color: white;
}

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

.testimonial-card {
  background: var(--bg-dark-card);
  border: 1px solid var(--border-dark);
  border-radius: var(--radius-lg);
  padding: clamp(1.5rem, 3vw, 2rem);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.stars {
  color: #f59e0b;
  font-size: 0.95rem;
  margin-bottom: 1rem;
}

.testimonial-text {
  font-size: 0.95rem;
  color: var(--text-light);
  line-height: 1.6;
  margin-bottom: 1.5rem;
  font-style: italic;
}

.client-info {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.client-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 2px solid var(--red-primary);
  background: #27272a;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  color: white;
}

.client-name {
  font-weight: 800;
  font-size: 0.95rem;
  color: white;
}

.client-car {
  font-size: 0.78rem;
  color: var(--red-primary);
}

/* ==========================================================================
   CONTACTO Y MAPA
   ========================================================================== */

.contact-section {
  padding: clamp(3rem, 6vw, 5rem) 0;
  background: var(--bg-main);
}

.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: clamp(2rem, 4vw, 3rem);
}

.contact-info-panel {
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
}

.contact-method {
  display: flex;
  align-items: flex-start;
  gap: 1.2rem;
}

.contact-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  background: var(--black-deep);
  color: var(--red-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  flex-shrink: 0;
}

.contact-method h4 {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--black-deep);
  margin-bottom: 0.2rem;
}

.contact-method p {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.contact-form-box {
  background: var(--bg-secondary);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: clamp(1.25rem, 4vw, 2.5rem);
  box-shadow: var(--shadow-sm);
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.contact-form-box form {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

/* ==========================================================================
   FOOTER
   ========================================================================== */

.footer {
  background: var(--black-deep);
  color: var(--text-light);
  padding: clamp(2.5rem, 5vw, 4rem) 0 2rem 0;
  border-top: 3px solid var(--red-primary);
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1.2fr;
  gap: clamp(1.5rem, 3vw, 3rem);
  margin-bottom: 3rem;
}

.footer-brand p {
  font-size: 0.9rem;
  margin: 1rem 0 1.5rem 0;
  line-height: 1.6;
}

.footer-socials {
  display: flex;
  gap: 0.75rem;
}

.social-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #18181b;
  border: 1px solid var(--border-dark);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.social-btn:hover {
  background: var(--red-primary);
  border-color: var(--red-primary);
  transform: translateY(-3px);
}

.footer-col h4 {
  font-size: 1.1rem;
  font-weight: 800;
  color: white;
  margin-bottom: 1.25rem;
  position: relative;
  padding-bottom: 0.5rem;
}

.footer-col h4::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 30px;
  height: 2px;
  background: var(--red-primary);
}

.footer-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}

.footer-links a {
  font-size: 0.9rem;
  color: var(--text-light);
}

.footer-links a:hover {
  color: var(--red-primary);
  padding-left: 5px;
}

.footer-bottom {
  padding-top: 2rem;
  border-top: 1px solid var(--border-dark);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
}

.footer-legal-links {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--text-muted);
}

.footer-legal-links a {
  color: #94a3b8;
  text-decoration: none;
  font-weight: 500;
  transition: var(--transition);
  cursor: pointer;
}

.footer-legal-links a:hover {
  color: var(--red-primary);
  text-decoration: underline;
}

/* ==========================================================================
   MODALES
   ========================================================================== */

.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(10, 10, 12, 0.78);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 2000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.modal-overlay.active {
  display: flex;
  opacity: 1;
}

.modal-card {
  background: var(--bg-main);
  border-radius: var(--radius-lg);
  max-width: 900px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
  border: 1px solid var(--border-light);
  transform: scale(0.95);
  transition: transform 0.3s ease;
  -webkit-overflow-scrolling: touch;
}

.modal-overlay.active .modal-card {
  transform: scale(1);
}

.legal-modal-card {
  background: var(--bg-main);
  border-radius: var(--radius-lg);
  max-width: 680px;
  width: 92%;
  max-height: 85vh;
  overflow-y: auto;
  position: relative;
  transform: scale(0.92);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  padding: 2.5rem 2rem 2rem 2rem;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.35);
  border: 1px solid var(--border-light);
  -webkit-overflow-scrolling: touch;
}

.modal-overlay.active .legal-modal-card {
  transform: scale(1);
}

.legal-header {
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 2px solid var(--border-light);
}

.legal-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: rgba(230, 0, 35, 0.1);
  color: var(--red-primary);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 0.3rem 0.75rem;
  border-radius: 999px;
  margin-bottom: 0.75rem;
}

.legal-title {
  font-size: 1.5rem;
  font-weight: 900;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin: 0;
}

.legal-body {
  font-size: 0.95rem;
  line-height: 1.7;
  color: var(--text-muted);
}

.legal-body h4 {
  color: var(--text-main);
  font-size: 1.05rem;
  font-weight: 800;
  margin-top: 1.25rem;
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.legal-body p {
  margin-bottom: 0.85rem;
}

.legal-body ul {
  padding-left: 1.25rem;
  margin-bottom: 1rem;
}

.legal-body li {
  margin-bottom: 0.5rem;
}

.legal-body strong {
  color: var(--text-main);
}

.legal-satire-box {
  background: #fff5f5;
  border: 1px dashed var(--red-primary);
  border-radius: var(--radius-md);
  padding: 1.15rem;
  margin-top: 1.5rem;
  display: flex;
  gap: 0.85rem;
  align-items: flex-start;
}

.legal-satire-box i {
  font-size: 1.4rem;
  color: var(--red-primary);
  flex-shrink: 0;
  margin-top: 0.15rem;
}

.legal-satire-box p {
  margin: 0;
  font-size: 0.88rem;
  color: #7f1d1d;
  font-weight: 500;
  line-height: 1.5;
}

.legal-footer-action {
  margin-top: 1.75rem;
  display: flex;
  justify-content: flex-end;
}

.modal-close-btn {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.65);
  color: white;
  border: none;
  font-size: 1.3rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 20;
  transition: var(--transition);
}

.modal-close-btn:hover {
  background: var(--red-primary);
  color: white;
}

.modal-gallery-main {
  width: 100%;
  height: clamp(240px, 40vw, 380px);
  background: var(--black-deep);
}

.modal-gallery-main img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
}

.modal-thumbs {
  display: flex;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-light);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.modal-thumb-img {
  width: 75px;
  height: 50px;
  object-fit: cover;
  object-position: center center;
  border-radius: var(--radius-sm);
  cursor: pointer;
  border: 2px solid transparent;
  transition: var(--transition);
  flex-shrink: 0;
}

.modal-thumb-img.active, .modal-thumb-img:hover {
  border-color: var(--red-primary);
}

.modal-body {
  padding: clamp(1.25rem, 3vw, 2rem);
}

.modal-header-info {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.modal-specs-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  background: var(--bg-secondary);
  padding: 1.25rem;
  border-radius: var(--radius-md);
  margin-bottom: 1.5rem;
  border: 1px solid var(--border-light);
}

.modal-equipment-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.6rem;
  margin-bottom: 1.5rem;
}

.modal-equipment-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.88rem;
  color: var(--text-dark);
}

.modal-equipment-item i {
  color: var(--red-primary);
}

.modal-actions-bar {
  display: flex;
  gap: 1rem;
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border-light);
  flex-wrap: wrap;
}

/* ==========================================================================
   MODAL SOLICITAR PRUEBA / CALENDARIO Y CITAS LOCALES
   ========================================================================== */

.testdrive-modal-card {
  background: var(--bg-main);
  border-radius: var(--radius-lg);
  max-width: 960px;
  width: 95%;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  transform: scale(0.95);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  padding: 2.2rem 2rem 2rem 2rem;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.45);
  border: 1px solid var(--border-light);
  -webkit-overflow-scrolling: touch;
}

.modal-overlay.active .testdrive-modal-card {
  transform: scale(1);
}

.td-header {
  margin-bottom: 1.25rem;
  padding-bottom: 1rem;
  padding-right: 3.2rem;
  border-bottom: 1px solid var(--border-light);
}

.td-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  background: rgba(230, 0, 35, 0.08);
  color: var(--red-primary);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 0.3rem 0.75rem;
  border-radius: 999px;
  margin-bottom: 0.5rem;
}

.td-title {
  font-size: 1.55rem;
  font-weight: 900;
  color: var(--text-main);
  margin: 0 0 0.35rem 0;
}

.td-subtitle {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin: 0;
  line-height: 1.5;
}

.td-nav-tabs {
  display: flex;
  gap: 0.5rem;
  margin-top: 1rem;
  background: var(--bg-secondary);
  padding: 0.3rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-light);
}

.td-tab-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.65rem 1rem;
  border: none;
  background: transparent;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-muted);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s;
}

.td-tab-btn.active {
  background: #ffffff;
  color: var(--text-main);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.td-tab-badge {
  background: var(--red-primary);
  color: #ffffff;
  font-size: 0.72rem;
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
  font-weight: 800;
}

.td-layout-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 1.75rem;
  margin-top: 1.25rem;
}

.td-section-label {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.85rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-main);
  margin-bottom: 0.6rem;
}

.td-vehicle-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.85rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  margin-bottom: 1.25rem;
}

.td-vehicle-thumb {
  width: 76px;
  height: 52px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  background: #000;
  flex-shrink: 0;
}

.td-vehicle-info {
  flex: 1;
  min-width: 0;
}

.td-vehicle-title {
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--text-main);
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.td-vehicle-price {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--red-primary);
  margin-top: 0.15rem;
}

.td-select-vehicle {
  width: 100%;
  padding: 0.75rem 0.9rem;
  border-radius: var(--radius-md);
  border: 1.5px solid var(--border-light);
  background: #ffffff;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 1.25rem;
  outline: none;
  transition: border-color 0.2s;
}

.td-select-vehicle:focus {
  border-color: var(--red-primary);
}

/* Calendario */
.td-calendar-box {
  background: #ffffff;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 1.1rem;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.03);
}

.td-cal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.9rem;
}

.td-cal-month-title {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--text-main);
  text-transform: capitalize;
}

.td-cal-nav-btn {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid var(--border-light);
  background: #ffffff;
  color: var(--text-main);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
}

.td-cal-nav-btn:hover:not(:disabled) {
  background: var(--bg-secondary);
  border-color: var(--text-main);
}

.td-cal-nav-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
  pointer-events: none;
}

.td-cal-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  text-align: center;
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--text-muted);
  margin-bottom: 0.4rem;
  text-transform: uppercase;
}

.td-cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}

.td-day-cell {
  aspect-ratio: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  border: 1.5px solid transparent;
  background: transparent;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-main);
  cursor: pointer;
  transition: all 0.18s ease;
  position: relative;
  padding: 2px;
}

.td-day-cell:hover:not(.disabled) {
  background: rgba(230, 0, 35, 0.08);
  border-color: var(--red-primary);
}

.td-day-cell.selected {
  background: var(--red-primary) !important;
  color: #ffffff !important;
  border-color: var(--red-primary) !important;
  box-shadow: 0 4px 12px rgba(230, 0, 35, 0.35);
}

.td-day-cell.today:not(.selected) {
  border-color: var(--red-primary);
  color: var(--red-primary);
  font-weight: 800;
  background: #fff5f5;
}

.td-day-cell .today-badge {
  font-size: 0.52rem;
  line-height: 1;
  font-weight: 800;
  letter-spacing: -0.2px;
  margin-top: 1px;
}

.td-day-cell.disabled.past {
  color: #cbd5e1;
  background: #f8fafc;
  cursor: not-allowed;
  pointer-events: none;
  opacity: 0.45;
}

.td-day-cell.disabled.sunday {
  color: #94a3b8;
  background: #f1f5f9;
  cursor: not-allowed;
  pointer-events: none;
  font-size: 0.78rem;
  opacity: 0.65;
}

.td-day-cell.disabled.sunday span {
  font-size: 0.5rem;
  display: block;
  color: #ef4444;
  font-weight: 800;
  text-transform: uppercase;
}

.td-day-cell.empty {
  pointer-events: none;
  background: transparent;
}

.td-cal-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
  font-size: 0.74rem;
  color: var(--text-muted);
  margin-top: 0.75rem;
  padding-top: 0.65rem;
  border-top: 1px solid var(--border-light);
}

.td-legend-item {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.td-legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}

/* Horarios y Franjas */
.td-slots-box {
  margin-top: 1.25rem;
}

.td-slots-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.td-hours-badge {
  font-size: 0.75rem;
  font-weight: 700;
  color: #15803d;
  background: #dcfce7;
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

.td-hours-badge.closed {
  color: #b91c1c;
  background: #fee2e2;
}

.td-slots-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(76px, 1fr));
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.td-slot-btn {
  padding: 0.65rem 0.25rem;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border-light);
  background: #ffffff;
  color: var(--text-main);
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  text-align: center;
}

.td-slot-btn:hover:not(:disabled) {
  border-color: var(--red-primary);
  color: var(--red-primary);
  background: #fff5f5;
}

.td-slot-btn.selected {
  background: var(--red-primary);
  border-color: var(--red-primary);
  color: #ffffff;
  box-shadow: 0 4px 10px rgba(230, 0, 35, 0.3);
}

.td-slot-btn:disabled, .td-slot-btn.disabled {
  background: #f8fafc;
  border-color: #e2e8f0;
  color: #94a3b8;
  cursor: not-allowed;
  opacity: 0.55;
}

.td-slot-btn.booked {
  background: #fee2e2;
  border-color: #fecaca;
  color: #ef4444;
  cursor: not-allowed;
  text-decoration: line-through;
  opacity: 0.65;
}

.td-sunday-banner {
  padding: 1rem;
  border-radius: var(--radius-md);
  background: #fff1f2;
  border: 1px dashed #f43f5e;
  color: #9f1239;
  font-size: 0.88rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.td-no-slots-banner {
  padding: 0.85rem;
  border-radius: var(--radius-md);
  background: #fefce8;
  border: 1px dashed #f59e0b;
  color: #854d0e;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

/* Formulario */
.td-form-box {
  background: var(--bg-secondary);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 1.4rem;
  display: flex;
  flex-direction: column;
}

.td-form-title {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--text-main);
  margin: 0 0 1rem 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.td-storage-notice {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  font-size: 0.78rem;
  line-height: 1.4;
  color: #0369a1;
  background: #e0f2fe;
  padding: 0.65rem 0.85rem;
  border-radius: var(--radius-sm);
  border: 1px solid #bae6fd;
  margin-bottom: 1.1rem;
}

.td-storage-notice i {
  color: #0284c7;
  margin-top: 0.1rem;
  flex-shrink: 0;
}

.td-summary-preview {
  background: #ffffff;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 0.85rem;
  margin-bottom: 1.1rem;
  font-size: 0.85rem;
}

.td-summary-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.35rem;
}

.td-summary-row:last-child {
  margin-bottom: 0;
}

.td-summary-label {
  color: var(--text-muted);
  font-weight: 600;
}

.td-summary-val {
  font-weight: 800;
  color: var(--text-main);
  text-align: right;
}

.td-checkbox-group {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 1.25rem;
  cursor: pointer;
  line-height: 1.4;
}

.td-checkbox-group input {
  margin-top: 0.15rem;
  cursor: pointer;
  accent-color: var(--red-primary);
  flex-shrink: 0;
}

/* Voucher / Confirmación */
.td-voucher-wrap {
  text-align: center;
  padding: 1rem 0;
}

.td-voucher-icon {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: #dcfce7;
  color: #16a34a;
  font-size: 2.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1.25rem auto;
  box-shadow: 0 10px 25px rgba(22, 163, 74, 0.2);
}

.td-voucher-card {
  background: #ffffff;
  border: 2px dashed var(--border-light);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  max-width: 540px;
  margin: 1.5rem auto;
  text-align: left;
  box-shadow: 0 15px 30px rgba(0, 0, 0, 0.04);
}

.td-voucher-code {
  display: inline-block;
  background: var(--black-deep);
  color: #ffffff;
  font-family: monospace;
  font-size: 1.15rem;
  font-weight: 800;
  padding: 0.35rem 0.9rem;
  border-radius: 6px;
  letter-spacing: 1.5px;
  margin-bottom: 1.25rem;
}

.td-voucher-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
  margin-top: 1.5rem;
}

/* Lista de citas guardadas */
.td-appointments-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: 1.25rem;
}

.td-apt-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  padding: 1.25rem;
  background: #ffffff;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
}

.td-apt-left {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.td-apt-date-badge {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(230, 0, 35, 0.08);
  color: var(--red-primary);
  border-radius: var(--radius-md);
  padding: 0.5rem 0.75rem;
  min-width: 62px;
}

.td-apt-date-day {
  font-size: 1.35rem;
  font-weight: 900;
  line-height: 1;
}

.td-apt-date-month {
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
}

.td-apt-info h4 {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--text-main);
  margin: 0 0 0.25rem 0;
}

.td-apt-meta {
  font-size: 0.85rem;
  color: var(--text-muted);
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
}

.td-apt-meta span {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.td-empty-state {
  text-align: center;
  padding: 3.5rem 1.5rem;
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  border: 1px dashed var(--border-light);
}

.td-empty-state i {
  font-size: 3rem;
  color: #cbd5e1;
  margin-bottom: 1rem;
}

.td-empty-state h4 {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-main);
  margin: 0 0 0.5rem 0;
}

.td-empty-state p {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin: 0 0 1.25rem 0;
}

/* Responsive Base Utilities */
.form-grid-2col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.td-voucher-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.85rem;
}

.tab-text-short {
  display: none;
}

.cal-sunday-tag .tag-short {
  display: none;
}

/* Tablet (<= 820px) */
@media (max-width: 820px) {
  .td-layout-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .testdrive-modal-card {
    padding: 1.75rem 1.35rem;
    max-width: 680px;
  }

  .td-voucher-card {
    padding: 1.25rem;
  }
}

/* Mobile Devices (<= 600px) */
@media (max-width: 600px) {
  .modal-overlay {
    padding: 0.5rem 0.35rem;
    align-items: flex-start;
    overflow-y: auto;
  }

  .testdrive-modal-card {
    width: 100%;
    max-width: 100%;
    margin: auto 0;
    max-height: calc(100dvh - 1rem);
    max-height: calc(100vh - 1rem);
    padding: 1.15rem 0.85rem 1.35rem 0.85rem;
    border-radius: var(--radius-md);
    box-sizing: border-box;
  }

  .modal-close-btn {
    top: 0.65rem;
    right: 0.65rem;
    width: 36px;
    height: 36px;
    font-size: 1.1rem;
  }

  .td-header {
    padding-right: 2.75rem;
    margin-bottom: 0.85rem;
    padding-bottom: 0.75rem;
  }

  .td-badge {
    font-size: 0.68rem;
    padding: 0.2rem 0.6rem;
    margin-bottom: 0.35rem;
  }

  .td-title {
    font-size: 1.22rem;
    line-height: 1.25;
    margin-bottom: 0.25rem;
  }

  .td-subtitle {
    font-size: 0.8rem;
    line-height: 1.35;
  }

  .td-nav-tabs {
    gap: 0.35rem;
    padding: 0.25rem;
    margin-top: 0.75rem;
  }

  .td-tab-btn {
    font-size: 0.78rem;
    padding: 0.55rem 0.4rem;
    gap: 0.35rem;
  }

  .tab-text-full {
    display: none;
  }

  .tab-text-short {
    display: inline;
  }

  .td-layout-grid {
    gap: 1.15rem;
    margin-top: 0.85rem;
  }

  .td-section-label {
    font-size: 0.78rem;
    margin-bottom: 0.45rem;
  }

  .td-select-vehicle {
    padding: 0.65rem 0.75rem;
    font-size: 0.85rem;
    margin-bottom: 1rem;
  }

  /* Calendario Móvil */
  .td-calendar-box {
    padding: 0.75rem 0.45rem;
    border-radius: var(--radius-sm);
  }

  .td-cal-header {
    margin-bottom: 0.6rem;
  }

  .td-cal-month-title {
    font-size: 0.95rem;
  }

  .td-cal-nav-btn {
    width: 32px;
    height: 32px;
  }

  .td-cal-weekdays {
    font-size: 0.68rem;
    margin-bottom: 0.3rem;
  }

  .td-cal-grid {
    gap: 2px;
  }

  .td-day-cell {
    aspect-ratio: auto;
    height: 36px;
    min-height: 36px;
    font-size: 0.82rem;
    padding: 1px;
    border-radius: 6px;
  }

  .td-day-cell .today-badge {
    font-size: 0.48rem;
    letter-spacing: -0.2px;
    line-height: 1;
  }

  .cal-sunday-tag .tag-full {
    display: none;
  }

  .cal-sunday-tag .tag-short {
    display: inline;
    font-size: 0.48rem;
    letter-spacing: -0.2px;
  }

  .td-cal-legend {
    gap: 0.4rem 0.7rem;
    font-size: 0.68rem;
    margin-top: 0.65rem;
    padding-top: 0.5rem;
    justify-content: center;
  }

  /* Franjas Horarias Móvil */
  .td-slots-box {
    margin-top: 1rem;
  }

  .td-slots-header {
    flex-direction: column;
    align-items: stretch;
    gap: 0.4rem;
    margin-bottom: 0.5rem;
  }

  .td-hours-badge {
    width: 100%;
    justify-content: center;
    font-size: 0.72rem;
    padding: 0.3rem 0.5rem;
    text-align: center;
    box-sizing: border-box;
  }

  .td-slots-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 0.4rem;
  }

  .td-slot-btn {
    padding: 0.55rem 0.2rem;
    font-size: 0.82rem;
    border-radius: 6px;
  }

  /* Formulario Móvil */
  .td-form-box {
    padding: 1rem 0.8rem;
  }

  .td-form-title {
    font-size: 1.02rem;
    margin-bottom: 0.75rem;
  }

  .td-storage-notice {
    font-size: 0.74rem;
    padding: 0.55rem 0.7rem;
    margin-bottom: 0.85rem;
  }

  .form-grid-2col {
    grid-template-columns: 1fr;
    gap: 0.85rem;
  }

  .td-checkbox-group {
    font-size: 0.76rem;
    line-height: 1.35;
    margin-bottom: 1rem;
  }

  .td-summary-preview {
    font-size: 0.78rem;
    padding: 0.7rem;
    margin-bottom: 0.85rem;
  }

  /* Voucher Móvil */
  .td-voucher-wrap {
    padding: 0.5rem 0;
  }

  .td-voucher-icon {
    width: 58px;
    height: 58px;
    font-size: 1.75rem;
    margin-bottom: 0.85rem;
  }

  .td-voucher-card {
    padding: 1.1rem 0.85rem;
    margin: 1rem 0;
  }

  .td-voucher-grid {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }

  .td-voucher-code {
    font-size: 0.95rem;
    padding: 0.25rem 0.65rem;
  }

  .td-voucher-actions {
    flex-direction: column;
    gap: 0.5rem;
    width: 100%;
  }

  .td-voucher-actions .btn {
    width: 100%;
    justify-content: center;
  }

  /* Mis Citas Móvil */
  .td-apt-card {
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
    padding: 0.9rem 0.75rem;
  }

  .td-apt-left {
    gap: 0.75rem;
  }

  .td-apt-date-badge {
    min-width: 50px;
    padding: 0.4rem 0.5rem;
  }

  .td-apt-date-day {
    font-size: 1.15rem;
  }

  .td-apt-info h4 {
    font-size: 0.95rem;
  }

  .td-apt-card > div:last-child {
    display: flex;
    gap: 0.5rem;
    width: 100%;
  }

  .td-apt-card > div:last-child .btn {
    flex: 1;
    justify-content: center;
    font-size: 0.8rem;
    padding: 0.55rem 0.4rem;
  }
}

/* Teléfonos muy pequeños (<= 380px) */
@media (max-width: 380px) {
  .testdrive-modal-card {
    padding: 1rem 0.65rem;
  }

  .td-slots-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .td-cal-weekdays {
    font-size: 0.62rem;
  }

  .td-day-cell {
    height: 33px;
    min-height: 33px;
    font-size: 0.76rem;
  }

  .td-tab-btn {
    font-size: 0.74rem;
    padding: 0.5rem 0.25rem;
  }
}

/* Overlay Favoritos */
.fav-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 2450;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.fav-overlay.active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

/* Drawer Favoritos */
.fav-drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: 420px;
  max-width: 100vw;
  height: 100vh;
  height: 100dvh;
  background: #ffffff;
  z-index: 2500;
  box-shadow: -10px 0 35px rgba(0, 0, 0, 0.25);
  transform: translateX(100%);
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
}

.fav-drawer.active {
  transform: translateX(0);
}

.fav-drawer-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--black-deep);
  color: white;
  flex-shrink: 0;
}

.fav-drawer-header h3 {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 1.2rem;
  font-weight: 800;
  margin: 0;
}

.fav-close-btn {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  border: none;
  color: white;
  font-size: 1.25rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.fav-close-btn:hover, .fav-close-btn:active {
  background: var(--red-primary);
  transform: scale(1.05);
}

.fav-drawer-body {
  padding: 1.25rem 1.5rem;
  overflow-y: auto;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  -webkit-overflow-scrolling: touch;
}

.fav-item {
  display: grid;
  grid-template-columns: 80px 1fr auto;
  gap: 0.85rem;
  align-items: center;
  padding: 0.75rem;
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-light);
}

.fav-item img {
  width: 80px;
  height: 55px;
  object-fit: cover;
  border-radius: var(--radius-sm);
}

.fav-remove-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.5rem;
}

.fav-remove-btn:hover {
  color: var(--red-primary);
}

/* ==========================================================================
   TOAST NOTIFICACIONES
   ========================================================================== */

.toast-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 3000;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  max-width: calc(100vw - 3rem);
}

.toast {
  background: var(--black-deep);
  color: white;
  padding: 0.9rem 1.4rem;
  border-radius: var(--radius-md);
  border-left: 4px solid var(--red-primary);
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.9rem;
  font-weight: 600;
  animation: slideInRight 0.3s ease;
}

@keyframes slideInRight {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* ==========================================================================
   BREAKPOINTS RESPONSIVOS: TABLETS, IPADS & MÓVILES
   ========================================================================== */

/* 1. TABLETS GRANDES / IPAD PRO (1024px a 1280px) */
@media (max-width: 1280px) {
  .hero-grid {
    grid-template-columns: 1.1fr 0.9fr;
    gap: 2rem;
  }
  .quick-search-grid {
    grid-template-columns: repeat(2, 1fr) repeat(2, 1fr) auto;
  }
  .features-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .footer-grid {
    grid-template-columns: 1.5fr 1fr 1fr 1fr;
    gap: 2rem;
  }
}

/* 2. TABLETS MEDIANAS / IPAD AIR, IPAD 10th GEN (768px a 1024px) */
@media (max-width: 1024px) {
  .nav-links {
    position: fixed;
    top: 0;
    right: -320px;
    width: 300px;
    height: 100vh;
    background: #ffffff;
    flex-direction: column;
    align-items: flex-start;
    padding: 5rem 2rem 2rem;
    box-shadow: -5px 0 25px rgba(0, 0, 0, 0.15);
    z-index: 999;
    transition: right 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    gap: 1.25rem;
  }

  .nav-links.active {
    right: 0;
  }

  .nav-link {
    font-size: 1.1rem;
    width: 100%;
    border-bottom: 1px solid var(--border-light);
    padding-bottom: 0.75rem;
  }

  .mobile-toggle {
    display: flex;
  }

  .nav-cta-btn {
    display: none;
  }

  .hero-grid {
    grid-template-columns: 1fr;
    text-align: center;
    gap: 2.5rem;
  }

  .hero-subtitle {
    margin-left: auto;
    margin-right: auto;
  }

  .hero-cta-group {
    justify-content: center;
  }

  .hero-stats {
    max-width: 520px;
    margin: 0 auto;
  }

  .hero-image-wrapper {
    max-width: 600px;
    margin: 0 auto;
    width: 100%;
  }

  .quick-search-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .quick-search-grid button {
    grid-column: 1 / -1;
    height: 48px;
  }

  .catalog-layout {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .filter-toggle-tablet-container {
    display: block;
  }

  .filter-sidebar {
    position: static;
    display: none;
    margin-bottom: 1.5rem;
  }

  .filter-sidebar.show-tablet {
    display: block;
    animation: fadeIn 0.3s ease;
  }

  @keyframes fadeIn {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
  }

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

  .finance-card {
    grid-template-columns: 1fr;
  }

  .sell-car-card {
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }

  .testimonials-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .testimonial-card:last-child {
    grid-column: 1 / -1;
  }

  .contact-grid {
    grid-template-columns: 1fr;
  }

  .footer-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 2.5rem;
  }

  .modal-specs-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* 3. TABLETS PEQUEÑAS / IPAD MINI (600px a 768px) */
@media (max-width: 768px) {
  .top-bar-info span:not(:first-child) {
    display: none;
  }

  .cars-grid {
    grid-template-columns: 1fr;
  }

  .features-grid {
    grid-template-columns: 1fr;
  }

  .testimonials-grid {
    grid-template-columns: 1fr;
  }

  .testimonial-card:last-child {
    grid-column: auto;
  }

  .footer-grid {
    grid-template-columns: 1fr;
  }

  .footer-bottom {
    flex-direction: column;
    gap: 1rem;
    text-align: center;
  }
}

/* 4. MÓVILES (< 600px) */
@media (max-width: 600px) {
  .top-bar {
    display: none;
  }

  .quick-search-box {
    margin-top: -1.5rem;
  }

  .quick-search-grid {
    grid-template-columns: 1fr;
  }

  .hero-cta-group .btn {
    width: 100%;
  }

  .hero-stats {
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
  }

  .modal-actions-bar .btn {
    width: 100%;
    flex: none;
  }

  .appraisal-form .form-grid {
    grid-template-columns: 1fr;
  }

  .contact-form-box {
    padding: 1.25rem;
  }

  .fav-drawer {
    width: 100vw;
    max-width: 100vw;
  }
}
