/* ═══════════════════════════════════════════════════════════════
   OREFICE AUTOMOTORES - Estilos Principales
   Paleta: Azul principal #1565C0, Azul oscuro #0D47A1, Blanco #FFFFFF
   ═══════════════════════════════════════════════════════════════ */

:root {
  --azul-principal: #1565C0;
  --azul-oscuro: #0D47A1;
  --azul-claro: #1976D2;
  --azul-hover: #1E88E5;
  --azul-bg: #E3F2FD;
  --blanco: #FFFFFF;
  --gris-claro: #F5F7FA;
  --gris-medio: #E0E0E0;
  --gris-texto: #546E7A;
  --negro: #1A1A2E;
  --verde-wa: #25D366;
  --verde-wa-hover: #128C7E;
  --sombra: 0 4px 20px rgba(21, 101, 192, 0.15);
  --sombra-hover: 0 8px 30px rgba(21, 101, 192, 0.3);
  --radio: 12px;
  --radio-sm: 8px;
  --transicion: all 0.3s ease;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: var(--gris-claro);
  color: var(--negro);
  line-height: 1.6;
  overflow-x: hidden;
}

/* ─── NAVBAR ─────────────────────────────────────────────────── */
.navbar {
  background: var(--azul-oscuro);
  padding: 0.8rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 2px 15px rgba(0,0,0,0.3);
}

.navbar-brand {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  text-decoration: none;
}

.navbar-logo {
  height: 45px;
  width: auto;
}

.navbar-title {
  color: var(--blanco);
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  line-height: 1.2;
}

.navbar-title span {
  display: block;
  font-size: 0.7rem;
  font-weight: 400;
  opacity: 0.8;
  letter-spacing: 2px;
  text-transform: uppercase;
}

.navbar-phone {
  color: var(--blanco);
  text-decoration: none;
  font-size: 0.85rem;
  opacity: 0.9;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  transition: var(--transicion);
}

.navbar-phone:hover { opacity: 1; }

/* ─── HERO ───────────────────────────────────────────────────── */
.hero {
  background: linear-gradient(135deg, var(--azul-oscuro) 0%, var(--azul-principal) 60%, var(--azul-hover) 100%);
  padding: 3.5rem 1.5rem 4rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(255,255,255,0.05) 0%, transparent 60%);
  animation: pulse-bg 6s ease-in-out infinite;
}

@keyframes pulse-bg {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.1); }
}

.hero-badge {
  display: inline-block;
  background: rgba(255,255,255,0.15);
  color: var(--blanco);
  padding: 0.3rem 1rem;
  border-radius: 50px;
  font-size: 0.8rem;
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-bottom: 1rem;
  border: 1px solid rgba(255,255,255,0.3);
}

.hero h1 {
  color: var(--blanco);
  font-size: clamp(1.8rem, 5vw, 3rem);
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 0.8rem;
  text-shadow: 0 2px 10px rgba(0,0,0,0.2);
}

.hero h1 span {
  color: #90CAF9;
}

.hero p {
  color: rgba(255,255,255,0.9);
  font-size: clamp(1rem, 3vw, 1.3rem);
  margin-bottom: 2rem;
  font-weight: 500;
}

.hero-stats {
  display: flex;
  justify-content: center;
  gap: 2rem;
  flex-wrap: wrap;
}

.hero-stat {
  color: var(--blanco);
  text-align: center;
}

.hero-stat strong {
  display: block;
  font-size: 1.8rem;
  font-weight: 800;
  color: #90CAF9;
}

.hero-stat span {
  font-size: 0.8rem;
  opacity: 0.8;
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* ─── SECCIÓN FILTROS ────────────────────────────────────────── */
.filtros-section {
  background: var(--blanco);
  margin: -1.5rem 1rem 1.5rem;
  border-radius: var(--radio);
  padding: 1.5rem;
  box-shadow: var(--sombra);
  position: relative;
  z-index: 10;
}

.filtros-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--azul-oscuro);
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.filtros-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.8rem;
}

@media (min-width: 768px) {
  .filtros-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (min-width: 1024px) {
  .filtros-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

.filtro-grupo {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.filtro-grupo label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--gris-texto);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.filtro-grupo select,
.filtro-grupo input {
  padding: 0.6rem 0.8rem;
  border: 2px solid var(--gris-medio);
  border-radius: var(--radio-sm);
  font-size: 0.9rem;
  color: var(--negro);
  background: var(--gris-claro);
  transition: var(--transicion);
  width: 100%;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%231565C0' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.8rem center;
  padding-right: 2rem;
}

.filtro-grupo input {
  background-image: none;
  padding-right: 0.8rem;
}

.filtro-grupo select:focus,
.filtro-grupo input:focus {
  outline: none;
  border-color: var(--azul-principal);
  background: var(--blanco);
  box-shadow: 0 0 0 3px rgba(21, 101, 192, 0.1);
}

.filtros-precio {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.8rem;
}

.filtros-acciones {
  grid-column: 1 / -1;
  display: flex;
  gap: 0.8rem;
  margin-top: 0.5rem;
}

/* ─── BOTONES ────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.7rem 1.5rem;
  border-radius: var(--radio-sm);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transicion);
  border: none;
  text-decoration: none;
  white-space: nowrap;
}

.btn-primary {
  background: var(--azul-principal);
  color: var(--blanco);
  flex: 1;
}

.btn-primary:hover {
  background: var(--azul-oscuro);
  transform: translateY(-1px);
  box-shadow: var(--sombra-hover);
}

.btn-outline {
  background: transparent;
  color: var(--azul-principal);
  border: 2px solid var(--azul-principal);
}

.btn-outline:hover {
  background: var(--azul-bg);
}

.btn-danger {
  background: #EF5350;
  color: var(--blanco);
}

.btn-danger:hover {
  background: #C62828;
}

.btn-success {
  background: #43A047;
  color: var(--blanco);
}

.btn-success:hover {
  background: #2E7D32;
}

.btn-sm {
  padding: 0.4rem 0.9rem;
  font-size: 0.8rem;
}

/* ─── SECCIÓN AUTOS ──────────────────────────────────────────── */
.autos-section {
  padding: 1rem 1rem 2rem;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.2rem;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.section-title {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--azul-oscuro);
}

.autos-count {
  font-size: 0.85rem;
  color: var(--gris-texto);
  background: var(--azul-bg);
  padding: 0.3rem 0.8rem;
  border-radius: 50px;
}

.autos-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.2rem;
}

@media (min-width: 600px) {
  .autos-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 900px) {
  .autos-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (min-width: 1200px) {
  .autos-grid { grid-template-columns: repeat(4, 1fr); }
}

/* ─── CARD AUTO ──────────────────────────────────────────────── */
.auto-card {
  background: var(--blanco);
  border-radius: var(--radio);
  overflow: hidden;
  box-shadow: var(--sombra);
  transition: var(--transicion);
  display: flex;
  flex-direction: column;
  position: relative;
}

.auto-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--sombra-hover);
}

.auto-card-badge {
  position: absolute;
  top: 0.8rem;
  left: 0.8rem;
  background: var(--azul-principal);
  color: var(--blanco);
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.2rem 0.6rem;
  border-radius: 50px;
  text-transform: uppercase;
  letter-spacing: 1px;
  z-index: 2;
}

.auto-card-img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  background: var(--gris-medio);
  display: block;
}

.auto-card-img-placeholder {
  width: 100%;
  height: 200px;
  background: linear-gradient(135deg, var(--azul-bg), var(--gris-medio));
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--azul-principal);
  font-size: 3rem;
}

.auto-card-body {
  padding: 1rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.auto-card-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--negro);
  margin-bottom: 0.3rem;
}

.auto-card-year {
  font-size: 0.85rem;
  color: var(--gris-texto);
  margin-bottom: 0.8rem;
}

.auto-card-specs {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 0.8rem;
}

.spec-tag {
  background: var(--azul-bg);
  color: var(--azul-oscuro);
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.2rem 0.6rem;
  border-radius: 50px;
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.auto-card-desc {
  font-size: 0.85rem;
  color: var(--gris-texto);
  margin-bottom: 1rem;
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.auto-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 0.8rem;
  border-top: 1px solid var(--gris-medio);
  gap: 0.5rem;
}

.auto-card-price {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--azul-principal);
}

.btn-consultar {
  background: var(--verde-wa);
  color: var(--blanco);
  padding: 0.5rem 1rem;
  border-radius: var(--radio-sm);
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  transition: var(--transicion);
  white-space: nowrap;
}

.btn-consultar:hover {
  background: var(--verde-wa-hover);
  transform: scale(1.03);
}

/* ─── LOADING / EMPTY ────────────────────────────────────────── */
.loading-container {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--gris-texto);
}

.spinner {
  width: 48px;
  height: 48px;
  border: 4px solid var(--gris-medio);
  border-top-color: var(--azul-principal);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 1rem;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--gris-texto);
}

.empty-state .icon {
  font-size: 4rem;
  margin-bottom: 1rem;
  opacity: 0.4;
}

/* ─── RESEÑAS ────────────────────────────────────────────────── */
.resenas-section {
  background: var(--azul-oscuro);
  padding: 3rem 1rem;
  overflow: hidden;
}

.resenas-section .section-title {
  color: var(--blanco);
  text-align: center;
  margin-bottom: 0.5rem;
}

.resenas-subtitle {
  text-align: center;
  color: rgba(255,255,255,0.7);
  font-size: 0.9rem;
  margin-bottom: 2rem;
}

.stars {
  color: #FFC107;
  font-size: 1rem;
  letter-spacing: 2px;
}

.resenas-track-wrapper {
  overflow: hidden;
  position: relative;
}

.resenas-track-wrapper::before,
.resenas-track-wrapper::after {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  width: 80px;
  z-index: 2;
}

.resenas-track-wrapper::before {
  left: 0;
  background: linear-gradient(to right, var(--azul-oscuro), transparent);
}

.resenas-track-wrapper::after {
  right: 0;
  background: linear-gradient(to left, var(--azul-oscuro), transparent);
}

.resenas-track {
  display: flex;
  gap: 1.2rem;
  animation: scroll-resenas 40s linear infinite;
  width: max-content;
}

.resenas-track:hover {
  animation-play-state: paused;
}

@keyframes scroll-resenas {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

.resena-card {
  background: rgba(255,255,255,0.1);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: var(--radio);
  padding: 1.2rem;
  width: 280px;
  flex-shrink: 0;
}

.resena-header {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  margin-bottom: 0.8rem;
}

.resena-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--azul-principal);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--blanco);
  font-weight: 700;
  font-size: 1rem;
  flex-shrink: 0;
}

.resena-nombre {
  color: var(--blanco);
  font-weight: 600;
  font-size: 0.9rem;
}

.resena-texto {
  color: rgba(255,255,255,0.85);
  font-size: 0.85rem;
  line-height: 1.5;
  font-style: italic;
}

/* ─── FOOTER ─────────────────────────────────────────────────── */
.footer {
  background: var(--negro);
  color: rgba(255,255,255,0.8);
  padding: 2.5rem 1.5rem 1.5rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  margin-bottom: 2rem;
}

@media (min-width: 768px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

.footer-brand h3 {
  color: var(--blanco);
  font-size: 1.2rem;
  margin-bottom: 0.5rem;
}

.footer-brand p {
  font-size: 0.85rem;
  line-height: 1.7;
}

.footer-info h4 {
  color: var(--blanco);
  margin-bottom: 0.8rem;
  font-size: 1rem;
}

.footer-info p {
  font-size: 0.85rem;
  margin-bottom: 0.4rem;
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
}

.footer-map {
  border-radius: var(--radio);
  overflow: hidden;
  margin-top: 1rem;
}

.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.1);
  padding-top: 1.2rem;
  text-align: center;
  font-size: 0.8rem;
  opacity: 0.6;
}

/* ─── WHATSAPP FLOTANTE ──────────────────────────────────────── */
.whatsapp-float {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 9999;
  background: var(--verde-wa);
  color: var(--blanco);
  width: 60px;
  height: 60px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  text-decoration: none;
  box-shadow: 0 4px 20px rgba(37, 211, 102, 0.5);
  transition: var(--transicion);
  animation: wa-pulse 2s ease-in-out infinite;
}

.whatsapp-float:hover {
  background: var(--verde-wa-hover);
  transform: scale(1.1);
  animation: none;
}

@keyframes wa-pulse {
  0%, 100% { box-shadow: 0 4px 20px rgba(37, 211, 102, 0.5); }
  50% { box-shadow: 0 4px 30px rgba(37, 211, 102, 0.8), 0 0 0 8px rgba(37, 211, 102, 0.15); }
}

/* ─── MODAL ──────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  opacity: 0;
  visibility: hidden;
  transition: var(--transicion);
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal {
  background: var(--blanco);
  border-radius: var(--radio);
  max-width: 600px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  transform: scale(0.9);
  transition: var(--transicion);
}

.modal-overlay.active .modal {
  transform: scale(1);
}

.modal-header {
  padding: 1.2rem 1.5rem;
  border-bottom: 1px solid var(--gris-medio);
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  background: var(--blanco);
  z-index: 1;
}

.modal-header h3 {
  font-size: 1.1rem;
  color: var(--azul-oscuro);
}

.modal-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--gris-texto);
  line-height: 1;
  padding: 0.2rem;
}

.modal-body {
  padding: 1.5rem;
}

/* ─── GALERÍA MODAL CON NAVEGACIÓN ─────────────────────────── */
.modal-galeria-wrapper {
  position: relative;
  margin-bottom: 0.8rem;
  border-radius: var(--radio);
  overflow: hidden;
  background: var(--gris-claro);
  user-select: none;
}

.modal-img-main {
  width: 100%;
  height: auto;
  max-height: 380px;
  object-fit: contain;
  background: var(--gris-claro);
  border-radius: var(--radio);
  display: block;
}

/* Botones prev/next */
.modal-nav-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0,0,0,0.45);
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
  z-index: 10;
  padding: 0;
}

.modal-nav-btn:hover {
  background: rgba(0,0,0,0.7);
}

.modal-nav-prev {
  left: 8px;
}

.modal-nav-next {
  right: 8px;
}

/* Contador de fotos */
.modal-foto-counter {
  position: absolute;
  bottom: 8px;
  right: 10px;
  background: rgba(0,0,0,0.55);
  color: #fff;
  font-size: 0.75rem;
  padding: 2px 8px;
  border-radius: 20px;
  pointer-events: none;
}

/* Galería de miniaturas */
.modal-img-gallery {
  display: flex;
  gap: 0.4rem;
  margin-bottom: 1rem;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: thin;
}

.modal-img-gallery::-webkit-scrollbar {
  height: 4px;
}

.modal-img-gallery::-webkit-scrollbar-thumb {
  background: var(--gris-medio);
  border-radius: 4px;
}

.modal-thumb {
  flex: 0 0 80px;
  width: 80px;
  height: 60px;
  object-fit: cover;
  background: var(--gris-claro);
  border-radius: var(--radio-sm);
  cursor: pointer;
  border: 2px solid transparent;
  transition: border-color 0.2s, opacity 0.2s;
  opacity: 0.7;
}

.modal-thumb:hover {
  opacity: 1;
}

.modal-thumb.active {
  border-color: var(--azul-principal);
  opacity: 1;
}

.modal-specs-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.8rem;
  margin-bottom: 1rem;
}

.modal-spec {
  background: var(--gris-claro);
  padding: 0.8rem;
  border-radius: var(--radio-sm);
}

.modal-spec label {
  font-size: 0.72rem;
  color: var(--gris-texto);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  display: block;
  margin-bottom: 0.2rem;
}

.modal-spec strong {
  font-size: 1rem;
  color: var(--negro);
}

.modal-price {
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--azul-principal);
  margin-bottom: 1rem;
}

/* ─── TOAST NOTIFICACIONES ───────────────────────────────────── */
.toast-container {
  position: fixed;
  bottom: 5rem;
  right: 1rem;
  z-index: 99999;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.toast {
  background: var(--negro);
  color: var(--blanco);
  padding: 0.8rem 1.2rem;
  border-radius: var(--radio-sm);
  font-size: 0.9rem;
  box-shadow: var(--sombra);
  animation: toast-in 0.3s ease;
  max-width: 300px;
}

.toast.success { border-left: 4px solid #43A047; }
.toast.error { border-left: 4px solid #EF5350; }

@keyframes toast-in {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* ─── RESPONSIVE EXTRAS ──────────────────────────────────────── */
@media (max-width: 480px) {
  .filtros-section { margin: -1rem 0.5rem 1rem; padding: 1rem; }
  .autos-section { padding: 0.5rem 0.5rem 2rem; }
  .hero { padding: 2.5rem 1rem 3rem; }
  .hero-stats { gap: 1.2rem; }
}

/* ─── PAGINACIÓN ─────────────────────────────────────────────── */
.pagination {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 2rem;
  flex-wrap: wrap;
}

.page-btn {
  width: 38px;
  height: 38px;
  border-radius: var(--radio-sm);
  border: 2px solid var(--gris-medio);
  background: var(--blanco);
  color: var(--azul-principal);
  font-weight: 600;
  cursor: pointer;
  transition: var(--transicion);
  display: flex;
  align-items: center;
  justify-content: center;
}

.page-btn:hover,
.page-btn.active {
  background: var(--azul-principal);
  color: var(--blanco);
  border-color: var(--azul-principal);
}
