/* ==========================================================================
   MARINO MOTORS - ESTILOS CENTRALES (PREMIUM, DEPORTIVO Y ADAPTATIVO)
   ========================================================================== */

/* 1. IMPORTACIÓN DE FUENTES DE GOOGLE FONTS */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Outfit:wght@400;500;600;700;800&display=swap');

/* 2. VARIABLES DEL SISTEMA DE DISEÑO (CSS CUSTOM PROPERTIES) */
:root {
  /* Paleta de Colores Deportiva */
  --primary: #eb1003;
  --primary-hover: #c40c02;
  --success: #25d366;
  --success-hover: #1ebd5b;
  
  /* Fondos Premium */
  --bg-main: #0a0b0d;
  --bg-panel: #14161a;
  --bg-panel-hover: #1e2127;
  --bg-navbar: rgba(10, 11, 13, 0.75);
  
  /* Textos y Contrastes */
  --text-white: #ffffff;
  --text-gray: #9ca3af;
  --text-muted: #6b7280;
  
  /* Tipografía */
  --font-title: 'Outfit', sans-serif;
  --font-body: 'Inter', sans-serif;
  
  /* Transiciones y Sombras */
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.7);
  --border-radius: 12px;
  --border-color: rgba(255, 255, 255, 0.08);
}

/* 3. RESET DE ESTILOS Y ELEMENTOS BÁSICOS */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  scroll-behavior: smooth;
}

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

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

button, input, select {
  font-family: inherit;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-title);
  font-weight: 700;
  letter-spacing: -0.02em;
}

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

/* 4. COMPONENTES Y UTILIDADES DE DISEÑO */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

.section-padding {
  padding: 80px 0;
}

@media (max-width: 768px) {
  .section-padding {
    padding: 60px 0;
  }
}

.section-title {
  text-align: center;
  font-size: 2.5rem;
  margin-bottom: 12px;
  position: relative;
  text-transform: uppercase;
}

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

.section-subtitle {
  text-align: center;
  color: var(--text-gray);
  max-width: 600px;
  margin: 0 auto 50px auto;
  font-size: 1.1rem;
}

/* Botones Premium */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 28px;
  border-radius: var(--border-radius);
  font-family: var(--font-title);
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  transition: var(--transition);
  border: none;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.btn-primary {
  background-color: var(--primary);
  color: var(--text-white);
  box-shadow: 0 4px 15px rgba(235, 16, 3, 0.3);
}

.btn-primary:hover {
  background-color: var(--primary-hover);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(235, 16, 3, 0.5);
}

.btn-success {
  background-color: var(--success);
  color: var(--text-white);
  box-shadow: 0 4px 15px rgba(37, 211, 102, 0.2);
}

.btn-success:hover {
  background-color: var(--success-hover);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(37, 211, 102, 0.4);
}

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

.btn-outline:hover {
  background-color: rgba(255, 255, 255, 0.05);
  border-color: var(--text-white);
  transform: translateY(-2px);
}

/* Badges y Tags */
.badge {
  display: inline-block;
  padding: 5px 12px;
  border-radius: 50px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background-color: var(--primary);
  color: var(--text-white);
}

/* ==========================================================================
   5. CABECERA (NAVBAR FLOTANTE GLASSMORPHISM)
   ========================================================================== */
.header-nav {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
  background-color: var(--bg-navbar);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-color);
  transition: var(--transition);
}

.header-nav.scrolled {
  padding: 10px 0;
  background-color: rgba(10, 11, 13, 0.95);
  box-shadow: var(--shadow-lg);
}

.nav-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 80px;
  transition: var(--transition);
}

.header-nav.scrolled .nav-container {
  height: 65px;
}

/* Logo Estilo Deportivo */
.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.5rem;
  font-family: var(--font-title);
  font-weight: 800;
  color: var(--text-white);
  cursor: pointer;
}

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

.logo-icon {
  width: 32px;
  height: 32px;
  background-color: var(--primary);
  border-radius: 6px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-style: italic;
  color: var(--text-white);
  transform: skewX(-12deg);
}

/* Dirección en Header (Ocultable en móvil) */
.header-address {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  color: var(--text-gray);
  background-color: rgba(255, 255, 255, 0.05);
  padding: 6px 14px;
  border-radius: 50px;
  border: 1px solid var(--border-color);
}

.header-address i {
  color: var(--primary);
}

/* Acciones de Contacto */
.nav-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

.nav-actions .tel-link {
  font-weight: 600;
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  gap: 6px;
}

.nav-actions .tel-link i {
  color: var(--primary);
}

.nav-actions .tel-link:hover {
  color: var(--primary);
}

/* Menú Móvil Hamburguesa */
.menu-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text-white);
  font-size: 1.5rem;
  cursor: pointer;
}

@media (max-width: 992px) {
  .header-address {
    display: none;
  }
}

@media (max-width: 768px) {
  .nav-actions .tel-link {
    display: none;
  }
  .menu-toggle {
    display: block;
  }
}

/* ==========================================================================
   6. SECCIÓN PRINCIPAL (HERO BANNER)
   ========================================================================== */
.hero {
  position: relative;
  min-height: 90vh;
  display: flex;
  align-items: center;
  padding-top: 100px;
  overflow: hidden;
}

.hero-background {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
}

.hero-background img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: brightness(0.45) contrast(1.1);
}

/* Degradado de Oscuridad para Fundir Fondo */
.hero::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 250px;
  background: linear-gradient(transparent, var(--bg-main));
  z-index: 2;
}

.hero-content {
  position: relative;
  z-index: 3;
  max-width: 680px;
  animation: fadeInUp 1s ease;
}

.hero-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background-color: rgba(235, 16, 3, 0.15);
  border: 1px solid rgba(235, 16, 3, 0.3);
  color: #ff5247;
  padding: 8px 18px;
  border-radius: 50px;
  font-family: var(--font-title);
  font-weight: 600;
  font-size: 0.9rem;
  text-transform: uppercase;
  margin-bottom: 24px;
}

.hero-tag i {
  animation: pulse 2s infinite;
}

.hero h1 {
  font-size: 3.8rem;
  line-height: 1.1;
  margin-bottom: 20px;
  text-transform: uppercase;
}

.hero h1 span {
  color: var(--primary);
  display: block;
}

.hero p {
  font-size: 1.2rem;
  color: var(--text-gray);
  margin-bottom: 35px;
  font-weight: 300;
}

.hero-ctas {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 40px;
}

/* Trust Badges en Hero */
.hero-trust {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 24px;
}

.trust-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  color: var(--text-gray);
}

.trust-item i {
  color: var(--primary);
  font-size: 1rem;
}

@media (max-width: 768px) {
  .hero {
    min-height: 80vh;
    padding-top: 80px;
  }
  .hero h1 {
    font-size: 2.5rem;
  }
  .hero p {
    font-size: 1rem;
  }
  .hero-trust {
    gap: 12px;
  }
}

/* ==========================================================================
   7. BARRA DE ESTADÍSTICAS Y CONFIANZA (STATS)
   ========================================================================== */
.stats-bar {
  background-color: var(--bg-panel);
  border-top: 1px solid var(--border-color);
  border-bottom: 1px solid var(--border-color);
  padding: 30px 0;
  position: relative;
  z-index: 4;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 30px;
  text-align: center;
}

.stat-item h3 {
  font-size: 2.8rem;
  color: var(--primary);
  line-height: 1;
  margin-bottom: 5px;
}

.stat-item p {
  color: var(--text-gray);
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

@media (max-width: 768px) {
  .stats-grid {
    grid-template-columns: 1fr;
    gap: 24px;
  }
  .stat-item h3 {
    font-size: 2.2rem;
  }
}

/* ==========================================================================
   8. GRILLA DE VEHÍCULOS DESTACADOS
   ========================================================================== */
.catalog-section {
  position: relative;
  z-index: 4;
}

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

/* Tarjetas de Auto Estilo Premium */
.car-card {
  background-color: var(--bg-panel);
  border-radius: var(--border-radius);
  border: 1px solid var(--border-color);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  position: relative;
  transition: var(--transition);
}

.car-card:hover {
  transform: translateY(-8px);
  border-color: rgba(235, 16, 3, 0.3);
  box-shadow: var(--shadow-lg);
}

/* Contenedor de Imagen */
.car-img-container {
  height: 200px;
  position: relative;
  overflow: hidden;
}

.car-img-container img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: var(--transition);
}

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

/* Badges sobre la imagen */
.car-tag {
  position: absolute;
  top: 15px;
  left: 15px;
  z-index: 5;
  background-color: var(--primary);
  color: var(--text-white);
  font-size: 0.7rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Detalles Técnicos */
.car-body {
  padding: 20px;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.car-title-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 12px;
}

.car-title {
  font-size: 1.25rem;
  font-weight: 600;
  line-height: 1.2;
}

.car-year {
  font-size: 0.85rem;
  background-color: rgba(255, 255, 255, 0.05);
  color: var(--text-gray);
  padding: 2px 8px;
  border-radius: 4px;
  border: 1px solid var(--border-color);
}

.car-specs {
  display: flex;
  gap: 16px;
  margin-bottom: 20px;
  font-size: 0.85rem;
  color: var(--text-gray);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  padding-bottom: 14px;
}

.spec-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

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

.car-price-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: auto;
  margin-bottom: 20px;
}

.price-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-transform: uppercase;
}

.car-price {
  font-family: var(--font-title);
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--text-white);
}

.car-price span {
  font-size: 1rem;
  color: var(--primary);
  margin-right: 2px;
}

.car-card .btn-success {
  width: 100%;
}

/* ==========================================================================
   ★ ESTADO VENDIDO (DRAMÁTICO Y COMERCIAL) ★
   ========================================================================== */
.car-card.sold {
  opacity: 0.65;
}

.car-card.sold::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(10, 11, 13, 0.15);
  z-index: 6;
  pointer-events: none;
}

/* Badge de Vendido diagonal superior o centrado */
.car-card.sold .car-tag {
  background-color: #6b7280; /* Cambiar tag superior a gris */
}

.sold-overlay-badge {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) rotate(-12deg);
  background-color: var(--primary);
  color: var(--text-white);
  font-family: var(--font-title);
  font-weight: 900;
  font-size: 1.6rem;
  padding: 10px 30px;
  border-radius: 4px;
  border: 3px solid var(--text-white);
  box-shadow: var(--shadow-lg);
  letter-spacing: 0.1em;
  z-index: 7;
  text-transform: uppercase;
  pointer-events: none;
}

/* Deshabilitar botón de WhatsApp para vendidos */
.car-card.sold .btn-success {
  background-color: #374151;
  color: var(--text-gray);
  box-shadow: none;
  cursor: not-allowed;
  pointer-events: none;
}

/* ==========================================================================
   9. SECCIÓN PLAN CANJE (TOMAMOS TU USADO)
   ========================================================================== */
.exchange-section {
  background-color: var(--bg-panel);
  border-top: 1px solid var(--border-color);
  border-bottom: 1px solid var(--border-color);
  position: relative;
  overflow: hidden;
}

.exchange-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 50px;
  align-items: center;
}

.exchange-content h2 {
  font-size: 2.5rem;
  margin-bottom: 16px;
  text-transform: uppercase;
}

.exchange-content h2 span {
  color: var(--primary);
}

.exchange-content > p {
  color: var(--text-gray);
  margin-bottom: 40px;
  font-size: 1.1rem;
}

/* Pasos de Cotización */
.steps-container {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.step-card {
  display: flex;
  gap: 20px;
  background-color: var(--bg-main);
  padding: 20px;
  border-radius: var(--border-radius);
  border: 1px solid var(--border-color);
  transition: var(--transition);
}

.step-card:hover {
  border-color: rgba(255, 255, 255, 0.15);
  transform: translateX(5px);
}

.step-icon {
  width: 50px;
  height: 50px;
  border-radius: 10px;
  background-color: rgba(235, 16, 3, 0.1);
  border: 1px solid rgba(235, 16, 3, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  color: var(--primary);
  flex-shrink: 0;
}

.step-text h4 {
  font-size: 1.1rem;
  margin-bottom: 4px;
}

.step-text p {
  font-size: 0.9rem;
  color: var(--text-gray);
}

/* Tarjeta Destacada de Llamada a la Acción */
.exchange-cta-box {
  background-color: var(--bg-main);
  border: 2px solid var(--primary);
  border-radius: var(--border-radius);
  padding: 40px;
  text-align: center;
  position: relative;
  box-shadow: var(--shadow-lg);
}

.exchange-cta-box::before {
  content: 'PLAN CANJE';
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  background-color: var(--primary);
  color: var(--text-white);
  font-family: var(--font-title);
  font-weight: 800;
  font-size: 0.75rem;
  padding: 4px 16px;
  border-radius: 50px;
  letter-spacing: 0.05em;
}

.exchange-cta-box h3 {
  font-size: 1.8rem;
  margin-bottom: 12px;
  text-transform: uppercase;
}

.exchange-cta-box p {
  color: var(--text-gray);
  font-size: 0.95rem;
  margin-bottom: 28px;
}

.exchange-cta-box .btn {
  width: 100%;
}

@media (max-width: 992px) {
  .exchange-grid {
    grid-template-columns: 1fr;
    gap: 40px;
  }
}

/* ==========================================================================
   10. PIE DE PÁGINA (FOOTER CON MAPA Y DATOS)
   ========================================================================== */
.footer {
  background-color: #050608;
  border-top: 1px solid var(--border-color);
  padding: 70px 0 30px 0;
  font-size: 0.95rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 40px;
  margin-bottom: 50px;
}

.footer-info h3 {
  font-size: 1.5rem;
  margin-bottom: 16px;
}

.footer-info h3 span {
  color: var(--primary);
}

.footer-info p {
  color: var(--text-gray);
  margin-bottom: 20px;
  font-size: 0.9rem;
}

/* Íconos Sociales */
.social-links {
  display: flex;
  gap: 12px;
}

.social-btn {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  background-color: var(--bg-panel);
  border: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-white);
  font-size: 1.1rem;
}

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

.footer-title {
  font-size: 1.1rem;
  text-transform: uppercase;
  margin-bottom: 20px;
  color: var(--text-white);
  font-family: var(--font-title);
  position: relative;
  padding-bottom: 8px;
}

.footer-title::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 40px;
  height: 2px;
  background-color: var(--primary);
}

/* Horarios y Enlaces */
.footer-hours-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
  color: var(--text-gray);
}

.footer-hours-list li {
  display: flex;
  flex-direction: column;
}

.footer-hours-list li span.day {
  color: var(--text-white);
  font-weight: 600;
  font-size: 0.85rem;
  text-transform: uppercase;
}

.footer-contact-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 16px;
  color: var(--text-gray);
}

.footer-contact-list li {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.footer-contact-list li i {
  color: var(--primary);
  font-size: 1.1rem;
  margin-top: 3px;
  flex-shrink: 0;
}

.footer-contact-list a:hover {
  color: var(--text-white);
}

/* Derechos de autor */
.footer-bottom {
  border-top: 1px solid var(--border-color);
  padding-top: 30px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  color: var(--text-muted);
  font-size: 0.85rem;
}

@media (max-width: 992px) {
  .footer-grid {
    grid-template-columns: 1fr;
    gap: 35px;
  }
}

/* Ocultar enlace a admin pero mantener doble-clic */
.hidden-admin-trigger {
  cursor: default;
  user-select: none;
}

/* ==========================================================================
   11. DISEÑO ESPECÍFICO DEL PANEL DE CONTROL (ADMIN.HTML)
   ========================================================================== */
.admin-body {
  background-color: #07080a;
  padding-top: 40px;
}

.admin-header {
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 24px;
  margin-bottom: 40px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 20px;
}

.admin-title-area {
  display: flex;
  align-items: center;
  gap: 15px;
}

.admin-badge {
  background-color: rgba(235, 16, 3, 0.1);
  color: var(--primary);
  border: 1px solid rgba(235, 16, 3, 0.2);
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
}

/* Grilla de Métricas Rápidas */
.metrics-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-bottom: 40px;
}

.metric-card {
  background-color: var(--bg-panel);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 20px;
}

.metric-card-icon {
  width: 50px;
  height: 50px;
  border-radius: 10px;
  background-color: rgba(255, 255, 255, 0.03);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  color: var(--primary);
}

.metric-card-icon.blue {
  color: #3b82f6;
}

.metric-card-icon.green {
  color: var(--success);
}

.metric-card-info h4 {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-bottom: 4px;
}

.metric-card-info p {
  font-size: 1.8rem;
  font-weight: 800;
  line-height: 1;
}

@media (max-width: 992px) {
  .metrics-row {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 576px) {
  .metrics-row {
    grid-template-columns: 1fr;
  }
}

/* Grilla de Secciones Admin */
.admin-grid {
  display: grid;
  grid-template-columns: 1fr 1.3fr;
  gap: 40px;
  align-items: start;
}

@media (max-width: 992px) {
  .admin-grid {
    grid-template-columns: 1fr;
  }
}

/* Tarjeta General de Admin Panel */
.admin-card {
  background-color: var(--bg-panel);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  padding: 30px;
  margin-bottom: 30px;
}

.admin-card h3 {
  font-size: 1.3rem;
  margin-bottom: 24px;
  text-transform: uppercase;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* Estilos de Formulario Admin */
.form-group {
  margin-bottom: 20px;
}

.form-row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.form-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--text-gray);
}

.form-control {
  width: 100%;
  background-color: var(--bg-main);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  padding: 12px 16px;
  color: var(--text-white);
  font-size: 0.95rem;
  transition: var(--transition);
}

.form-control:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(235, 16, 3, 0.1);
}

/* Selector Visual de Imágenes */
.image-selector-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 12px;
}

.image-option {
  border: 2px solid transparent;
  border-radius: 6px;
  overflow: hidden;
  cursor: pointer;
  position: relative;
  height: 60px;
  transition: var(--transition);
}

.image-option img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.image-option.selected {
  border-color: var(--primary);
}

.image-option::after {
  content: '✓';
  position: absolute;
  top: 3px;
  right: 3px;
  background-color: var(--primary);
  color: var(--text-white);
  font-size: 0.6rem;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: var(--transition);
}

.image-option.selected::after {
  opacity: 1;
}

.image-option span {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  background-color: rgba(0, 0, 0, 0.7);
  color: var(--text-white);
  font-size: 0.6rem;
  text-align: center;
  padding: 2px 0;
  font-weight: 600;
  text-transform: uppercase;
}

.admin-card button[type="submit"] {
  width: 100%;
  margin-top: 10px;
}

/* Listado de Stock en Admin */
.admin-stock-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.admin-stock-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background-color: var(--bg-main);
  border: 1px solid var(--border-color);
  padding: 16px;
  border-radius: var(--border-radius);
  gap: 16px;
}

.admin-stock-item.sold {
  border-left: 4px solid var(--primary);
  opacity: 0.75;
}

.admin-stock-info {
  display: flex;
  align-items: center;
  gap: 16px;
}

.admin-stock-thumb {
  width: 60px;
  height: 45px;
  border-radius: 4px;
  object-fit: cover;
  background-color: var(--bg-panel);
}

.admin-stock-details h4 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 2px;
}

.admin-stock-details p {
  font-size: 0.8rem;
  color: var(--text-gray);
}

.admin-stock-details .status-badge {
  display: inline-block;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 4px;
  text-transform: uppercase;
  margin-left: 6px;
}

.status-badge.disponible {
  background-color: rgba(37, 211, 102, 0.15);
  color: var(--success);
}

.status-badge.vendido {
  background-color: rgba(235, 16, 3, 0.15);
  color: var(--primary);
}

.admin-stock-actions {
  display: flex;
  gap: 8px;
}

.btn-icon {
  width: 36px;
  height: 36px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border-color);
  background-color: var(--bg-panel);
  color: var(--text-white);
  cursor: pointer;
  transition: var(--transition);
}

.btn-icon:hover {
  background-color: rgba(255, 255, 255, 0.05);
}

.btn-icon.btn-sold-toggle:hover {
  background-color: rgba(37, 211, 102, 0.1);
  color: var(--success);
  border-color: var(--success);
}

.btn-icon.btn-sold-toggle.is-sold:hover {
  background-color: rgba(235, 16, 3, 0.1);
  color: var(--primary);
  border-color: var(--primary);
}

.btn-icon.btn-delete:hover {
  background-color: rgba(235, 16, 3, 0.15);
  color: var(--primary);
  border-color: var(--primary);
}

@media (max-width: 576px) {
  .admin-stock-item {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }
  .admin-stock-actions {
    justify-content: flex-end;
  }
}

/* ==========================================================================
   12. ANIMACIONES GENERALES
   ========================================================================== */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes pulse {
  0% {
    opacity: 0.6;
    transform: scale(1);
  }
  50% {
    opacity: 1;
    transform: scale(1.1);
  }
  100% {
    opacity: 0.6;
    transform: scale(1);
  }
}

/* Efecto de Carga de Contenido */
.animate-slide-up {
  opacity: 0;
  transform: translateY(20px);
  animation: slideUp 0.6s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes slideUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ==========================================================================
   13. COMPONENTES EXTRA (AUTH OVERLAY & FILE UPLOADS)
   ========================================================================== */
.auth-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: var(--bg-main);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.auth-overlay.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.auth-card {
  width: 90%;
  max-width: 400px;
  background-color: var(--bg-panel);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  padding: 40px;
  text-align: center;
  box-shadow: var(--shadow-lg);
  animation: fadeInUp 0.6s ease;
}

.auth-card .logo-icon {
  margin: 0 auto 16px auto;
  width: 50px;
  height: 50px;
  font-size: 2rem;
}

.auth-card h3 {
  font-size: 1.5rem;
  margin-bottom: 8px;
  text-transform: uppercase;
}

.auth-card p {
  color: var(--text-gray);
  font-size: 0.9rem;
  margin-bottom: 24px;
}

.auth-error-msg {
  color: var(--primary);
  font-size: 0.85rem;
  margin-top: 10px;
  display: none;
  font-weight: 600;
}

/* Controles de Carga de Archivo (WebP converter) */
.custom-file-upload {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border: 2px dashed var(--border-color);
  padding: 24px;
  border-radius: 8px;
  cursor: pointer;
  transition: var(--transition);
  background-color: rgba(255, 255, 255, 0.01);
  text-align: center;
  margin-bottom: 12px;
}

.custom-file-upload:hover {
  border-color: var(--primary);
  background-color: rgba(235, 16, 3, 0.02);
}

.custom-file-upload i {
  font-size: 2rem;
  color: var(--primary);
  margin-bottom: 10px;
}

.custom-file-upload span {
  font-size: 0.85rem;
  color: var(--text-gray);
  font-weight: 500;
}

.custom-file-upload p {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 4px;
}

.custom-file-upload input[type="file"] {
  display: none;
}

.upload-status-area {
  display: none;
  margin-top: 10px;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 600;
  text-align: center;
  width: 100%;
}

.upload-status-area.success {
  background-color: rgba(37, 211, 102, 0.1);
  color: var(--success);
  border: 1px solid rgba(37, 211, 102, 0.2);
}

.upload-status-area.loading {
  background-color: rgba(255, 255, 255, 0.05);
  color: var(--text-gray);
  border: 1px solid var(--border-color);
}

.upload-status-area.warning,
.sync-status.warning {
  background-color: rgba(245, 158, 11, 0.1);
  color: #f59e0b;
  border: 1px solid rgba(245, 158, 11, 0.25);
}

.sync-status {
  display: block;
  width: 100%;
  margin-top: 6px;
  padding: 5px 7px;
  border-radius: 6px;
  border: 1px solid var(--border-color);
  color: var(--text-gray);
  background-color: rgba(255, 255, 255, 0.04);
  font-size: 0.65rem;
  line-height: 1.25;
}

.sync-status.success {
  background-color: rgba(37, 211, 102, 0.1);
  color: var(--success);
  border-color: rgba(37, 211, 102, 0.2);
}

/* ==========================================================================
   14. ELEMENTOS PREMIUM: CARRUSEL DE IMÁGENES, EDICIÓN Y PRECIOS FLEXIBLES
   ========================================================================= */

/* Carrusel de Fotos en Tarjetas */
.carousel-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 34px;
  height: 34px;
  background-color: rgba(10, 11, 13, 0.7);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-white);
  cursor: pointer;
  border: 1px solid var(--border-color);
  z-index: 10;
  opacity: 0;
  transition: var(--transition);
  -webkit-tap-highlight-color: transparent;
}

.car-card:hover .carousel-arrow {
  opacity: 1;
}

.carousel-arrow:hover {
  background-color: var(--primary);
  border-color: var(--primary);
  transform: translateY(-50%) scale(1.05);
}

.carousel-arrow.prev {
  left: 12px;
}

.carousel-arrow.next {
  right: 12px;
}

.carousel-dots {
  position: absolute;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 6px;
  z-index: 10;
}

.carousel-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: rgba(255, 255, 255, 0.4);
  cursor: pointer;
  transition: var(--transition);
  border: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

.carousel-dot.active {
  background-color: var(--primary);
  width: 14px;
  border-radius: 4px;
}

@media (hover: none), (max-width: 768px) {
  .carousel-arrow {
    opacity: 1;
    width: 40px;
    height: 40px;
    background-color: rgba(10, 11, 13, 0.78);
  }

  .carousel-arrow.prev {
    left: 10px;
  }

  .carousel-arrow.next {
    right: 10px;
  }

  .carousel-dots {
    bottom: 10px;
    gap: 8px;
  }

  .carousel-dot {
    width: 8px;
    height: 8px;
  }

  .carousel-dot.active {
    width: 18px;
  }
}

/* Precio CONSULTAR */
.car-price.consultar {
  font-family: var(--font-title);
  color: #ff5247;
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

/* Vista previa de múltiples fotos en panel admin */
.admin-upload-preview-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-top: 12px;
}

.admin-preview-img-box {
  position: relative;
  height: 60px;
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid var(--border-color);
}

.admin-preview-img-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.admin-preview-img-box .remove-preview-img {
  position: absolute;
  top: 3px;
  right: 3px;
  background-color: rgba(235, 16, 3, 0.9);
  color: var(--text-white);
  width: 16px;
  height: 16px;
  border-radius: 50%;
  font-size: 0.65rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-weight: 700;
  transition: var(--transition);
  border: 0;
  padding: 0;
  line-height: 1;
}

.admin-preview-img-box .remove-preview-img:hover {
  background-color: #ff5247;
  transform: scale(1.1);
}

/* Botón Cancelar Edición */
.btn-cancel-edit {
  background-color: #374151;
  color: var(--text-white);
  margin-top: 10px;
}

.btn-cancel-edit:hover {
  background-color: #4b5563;
  transform: translateY(-2px);
}

.edit-badge {
  background-color: rgba(235, 16, 3, 0.1);
  color: var(--primary);
  border: 1px solid rgba(235, 16, 3, 0.2);
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
  margin-left: 8px;
}

/* ==========================================================================
   15. ESTILOS DE FILTRADO Y COMPATIBILIDAD RESPONSIVA DE WHATSAPP MÓVIL
   ========================================================================== */

/* Barra de Filtros del Catálogo Público */
.catalog-filter-bar {
  background-color: var(--bg-panel);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  padding: 16px 24px;
  margin-bottom: 40px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  flex-wrap: wrap;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}

.catalog-filter-bar label {
  font-family: var(--font-title);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-gray);
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0;
}

.catalog-filter-bar label i {
  color: var(--primary);
}

.catalog-filter-bar select {
  background-color: var(--bg-main);
  color: var(--text-white);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  padding: 10px 16px;
  font-size: 0.9rem;
  font-weight: 500;
  outline: none;
  cursor: pointer;
  transition: var(--transition);
  min-width: 220px;
  height: auto;
}

.catalog-filter-bar select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(235, 16, 3, 0.15);
}

/* Botón de WhatsApp de Cabecera Responsivo */
.header-wa-btn {
  padding: 10px 20px;
  font-size: 0.85rem;
  transition: var(--transition);
}

.header-wa-btn span {
  display: inline-block;
}

@media (max-width: 768px) {
  .catalog-filter-bar {
    justify-content: space-between;
    padding: 12px 16px;
    margin-bottom: 30px;
  }
  
  .catalog-filter-bar select {
    flex-grow: 1;
    min-width: 150px;
  }
}

@media (max-width: 480px) {
  .header-wa-btn {
    padding: 8px 12px;
  }
  
  .header-wa-btn span {
    display: none;
  }
}

/* Animación del Spinner de Carga */
@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* ==========================================================================
   LIGHTBOX (MODAL DE FOTOS)
   ========================================================================== */
.lightbox-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(10, 11, 13, 0.95);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.lightbox-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.lightbox-content {
  position: relative;
  max-width: 90%;
  max-height: 90vh;
  display: flex;
  justify-content: center;
  align-items: center;
}

.lightbox-img {
  max-width: 100%;
  max-height: 85vh;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border-color);
}

.lightbox-close {
  position: absolute;
  top: -40px;
  right: -20px;
  background: none;
  border: none;
  color: var(--text-gray);
  font-size: 2rem;
  cursor: pointer;
  transition: var(--transition);
}

.lightbox-close:hover {
  color: var(--primary);
  transform: scale(1.1);
}

.lightbox-controls {
  position: absolute;
  top: 50%;
  left: -50px;
  right: -50px;
  display: flex;
  justify-content: space-between;
  transform: translateY(-50%);
  pointer-events: none;
}

.lightbox-btn {
  background: rgba(10, 11, 13, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: white;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  cursor: pointer;
  pointer-events: auto;
  transition: var(--transition);
  backdrop-filter: blur(4px);
}

.lightbox-btn:hover {
  background: var(--primary);
  border-color: var(--primary);
  transform: scale(1.1);
}

@media (max-width: 768px) {
  .lightbox-controls {
    left: 10px;
    right: 10px;
  }
  .lightbox-close {
    right: 0;
    top: -45px;
  }
}
