/* Sección de Modelos */

.brands-carousel-section {
  background: linear-gradient(135deg, #f8fafc 0%, #e0e7ff 100%);
  padding: 60px 0;
  overflow: hidden;
  border-bottom: 1px solid #e2e8f0;
}

.brands-carousel-section .section-title {
  text-align: center;
  font-size: 2rem;
  color: #1e40af;
  margin-bottom: 30px;
  font-family: 'Poppins', sans-serif;
  font-weight: 700;
  letter-spacing: -0.5px;
}

.brands-carousel-wrapper {
  overflow: hidden;
  width: 100%;
}

.brands-carousel-track {
  display: flex;
  width: max-content;
  animation: scrollBrands 40s linear infinite;
}

.brand-item {
  flex: 0 0 auto;
  width: 150px;
  margin: 0 25px;
  transition: transform 0.3s ease;
}

.brand-item:hover {
  transform: scale(1.05);
}

.brand-item img {
  width: 100%;
  height: auto;
  display: block;
  filter: grayscale(20%);
  transition: filter 0.3s ease;
}

.brand-item:hover img {
  filter: grayscale(0%);
}
  
@keyframes scrollBrands {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

.models-section {
  padding: 80px 0;
  margin-top: 70px;
  background: linear-gradient(to bottom, #ffffff 0%, #f9fafb 100%);
  min-height: 100vh;
}

.models-section h1 {
  text-align: center;
  margin-bottom: 40px;
  font-size: 2.5rem;
  color: #1e293b;
  font-weight: 700;
  letter-spacing: -1px;
}

.models-section h2 {
  text-align: center;
  margin-bottom: 40px;
  font-size: 2.5rem;
  color: #1e293b;
  font-weight: 700;
  letter-spacing: -1px;
}

.model-filters {
  display: flex;
  justify-content: center;
  gap: 15px;
  margin-bottom: 40px;
  flex-wrap: wrap;
  padding: 0 20px;
}

.filter-btn {
  padding: 12px 28px;
  background: white;
  border: 2px solid #e2e8f0;
  border-radius: 50px;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.95rem;
  transition: all 0.3s ease;
  color: #475569;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.filter-btn:hover {
  background: #f1f5f9;
  border-color: #cbd5e1;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.filter-btn.active {
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  color: white;
  border-color: #2563eb;
  box-shadow: 0 4px 16px rgba(59, 130, 246, 0.4);
  transform: translateY(-2px);
}

.models-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 35px;
  padding: 20px;
  animation: fadeIn 0.6s ease-in-out;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.model-card {
  background: white;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05), 0 10px 20px rgba(0, 0, 0, 0.08);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  border: 1px solid #f1f5f9;
  position: relative;
}

.model-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, #3b82f6, #8b5cf6, #ec4899);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.model-card:hover::before {
  opacity: 1;
}

.model-card:hover {
  transform: translateY(-8px) scale(1.02);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.12), 0 20px 40px rgba(59, 130, 246, 0.15);
  border-color: #e0e7ff;
}

.model-image-slider {
  position: relative;
  height: 280px;
  overflow: hidden;
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
  display: flex;
  align-items: center;
  justify-content: center;
}

.model-image-slider img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  position: absolute;
  top: 0;
  left: 0;
  opacity: 0;
  transition: opacity 0.5s ease, transform 0.5s ease;
  padding: 15px;
}

.model-image-slider img.active {
  opacity: 1;
  animation: slideInImage 0.5s ease;
}

@keyframes slideInImage {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.slider-controls {
  position: absolute;
  bottom: 15px;
  left: 0;
  right: 0;
  display: flex;
  justify-content: space-between;
  padding: 0 15px;
  z-index: 10;
}

.slider-controls button {
  background: rgba(30, 41, 59, 0.8);
  backdrop-filter: blur(8px);
  color: white;
  border: none;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.slider-controls button:hover {
  background: rgba(59, 130, 246, 0.95);
  transform: scale(1.1);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
}

.model-info {
  padding: 24px;
  background: white;
}

.model-info h3 {
  font-size: 1.25rem;
  margin-bottom: 8px;
  color: #1e293b;
  font-weight: 700;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  min-height: 2.6rem;
}

.model-specs {
  color: #64748b;
  margin-bottom: 12px;
  font-size: 0.9rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.model-price {
  font-size: 1.75rem;
  font-weight: 800;
  background: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 18px;
  display: inline-block;
}

.model-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.btn-view {
  flex: 1;
  padding: 12px 20px;
  background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
  color: white;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-weight: 600;
  font-size: 0.9rem;
  box-shadow: 0 2px 8px rgba(30, 41, 59, 0.2);
  min-width: 120px;
}

.btn-view:hover {
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
}

.btn-view:active {
  transform: translateY(0);
}

.btn-whatsapp {
  padding: 12px 18px;
  background: linear-gradient(135deg, #25D366 0%, #20BA5A 100%);
  color: white;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.3s ease;
  font-weight: 600;
  font-size: 0.9rem;
  box-shadow: 0 2px 8px rgba(37, 211, 102, 0.3);
  white-space: nowrap;
}

.btn-whatsapp:hover {
  background: linear-gradient(135deg, #20BA5A 0%, #128C7E 100%);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(37, 211, 102, 0.5);
}

.btn-whatsapp:active {
  transform: translateY(0);
}

.btn-whatsapp i {
  font-size: 1.1rem;
}

/* Modal */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(8px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  padding: 20px;
  animation: fadeInOverlay 0.3s ease;
}

@keyframes fadeInOverlay {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.modal-content {
  background: white;
  border-radius: 20px;
  max-width: 900px;
  width: 100%;
  max-height: 90vh;
  overflow: auto;
  position: relative;
  display: flex;
  flex-direction: column;
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.3);
  animation: slideUpModal 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes slideUpModal {
  from {
    opacity: 0;
    transform: translateY(30px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.modal-close {
  position: absolute;
  top: 20px;
  right: 20px;
  background: rgba(30, 41, 59, 0.1);
  border: none;
  font-size: 1.8rem;
  cursor: pointer;
  color: #1e293b;
  z-index: 10;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
}

.modal-close:hover {
  background: rgba(239, 68, 68, 0.15);
  color: #dc2626;
  transform: rotate(90deg);
}

.modal-slider {
  flex: 1;
  padding: 30px;
  display: flex;
  flex-direction: column;
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
}

.modal-main-image {
  width: 100%;
  max-height: 500px;
  object-fit: contain;
  margin-bottom: 20px;
  border-radius: 12px;
  background: white;
  padding: 20px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.modal-thumbnails {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding: 12px 0;
  scrollbar-width: thin;
  scrollbar-color: #cbd5e1 #f1f5f9;
}

.modal-thumbnails::-webkit-scrollbar {
  height: 6px;
}

.modal-thumbnails::-webkit-scrollbar-track {
  background: #f1f5f9;
  border-radius: 10px;
}

.modal-thumbnails::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 10px;
}

.modal-thumbnails::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

.modal-thumbnails img {
  width: 90px;
  height: 70px;
  object-fit: cover;
  cursor: pointer;
  border: 3px solid transparent;
  border-radius: 10px;
  transition: all 0.3s ease;
  background: white;
}

.modal-thumbnails img:hover {
  border-color: #cbd5e1;
  transform: scale(1.05);
}

.modal-thumbnails img.active {
  border-color: #3b82f6;
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
  transform: scale(1.05);
}

.modal-info {
  padding: 30px;
  border-top: 1px solid #e2e8f0;
  background: white;
}
.model-colors {
  font-size: 0.85rem;
  color: #64748b;
  margin-bottom: 10px;
  font-style: italic;
  font-weight: 500;
}

/* Estilos para accesorios - diseño profesional y compacto */
.model-card[data-category="accessories"] {
  max-width: 350px;
  margin: 0 auto;
}

.model-card[data-category="accessories"] .model-image-slider {
  height: 240px;
  background: #ffffff;
}

.model-card[data-category="accessories"] .model-image-slider img {
  padding: 30px;
  object-fit: contain;
}

.model-card[data-category="accessories"] .model-info {
  padding: 20px;
}

.model-card[data-category="accessories"] .model-info h3 {
  font-size: 1.1rem;
  min-height: auto;
  margin-bottom: 8px;
}

.model-card[data-category="accessories"] .model-specs {
  font-size: 0.85rem;
  color: #64748b;
  margin-bottom: 10px;
}

.model-card[data-category="accessories"] .model-price {
  font-size: 1.6rem;
  margin-bottom: 16px;
}

.model-card[data-category="accessories"] .model-actions {
  gap: 8px;
}

.model-card[data-category="accessories"] .btn-add-cart,
.model-card[data-category="accessories"] .btn-view,
.model-card[data-category="accessories"] .btn-whatsapp {
  padding: 10px 16px;
  font-size: 0.85rem;
}

/* Grid más compacto cuando solo hay accesorios visibles */
.models-grid:has(.model-card[data-category="accessories"]:not([style*="display: none"])):not(:has(.model-card[data-category="electric"]:not([style*="display: none"]))) {
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 30px;
  max-width: 1400px;
  margin: 0 auto;
}

/* Loading States */
.model-card.loading {
  pointer-events: none;
  opacity: 0.6;
}

.model-image-slider.loading::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 40px;
  height: 40px;
  margin: -20px 0 0 -20px;
  border: 4px solid #f1f5f9;
  border-top-color: #3b82f6;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Responsive */
@media (max-width: 768px) {
  .models-section {
    padding: 60px 0;
  }

  .models-section h1,
  .models-section h2 {
    font-size: 2rem;
  }

  .models-grid {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 25px;
    padding: 15px;
  }
  
  .model-actions {
    flex-direction: column;
  }

  .btn-view,
  .btn-whatsapp {
    width: 100%;
    justify-content: center;
  }

  .model-image-slider {
    height: 240px;
  }

  .model-info {
    padding: 20px;
  }

  .model-info h3 {
    font-size: 1.15rem;
  }

  .model-price {
    font-size: 1.5rem;
  }

  .modal-content {
    border-radius: 16px;
  }

  .modal-slider {
    padding: 20px;
  }

  .modal-info {
    padding: 20px;
  }
}

@media (max-width: 480px) {
  .models-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .filter-btn {
    padding: 10px 20px;
    font-size: 0.9rem;
  }

  .model-image-slider {
    height: 220px;
  }
}
.model-filters { 
  display: flex; 
  gap: 15px; 
  flex-wrap: wrap; 
  justify-content: center;
  padding: 0 20px;
  margin-bottom: 40px;
}

.filter-group { 
  position: relative; 
}

.filter-btn.active,
.sub-filter-btn.active { 
  outline: 3px solid #3b82f6;
  outline-offset: 2px;
}

.sub-filters { 
  display: flex; 
  gap: 10px; 
  margin-top: 12px; 
  animation: slideDown 0.3s ease;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.sub-filters.oculto { 
  display: none; 
}

.badge-featured {
  font-size: .75rem;
  padding: 3px 10px;
  border-radius: 12px;
  background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
  color: white;
  margin-left: 8px;
  font-weight: 700;
  box-shadow: 0 2px 6px rgba(251, 191, 36, 0.3);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.sub-filter-btn {
  background: white;
  color: #475569;
  border: 2px solid #e2e8f0;
  border-radius: 25px;
  padding: 8px 18px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
}

.sub-filter-btn:hover {
  background: linear-gradient(135deg, #0ea5e9 0%, #0284c7 100%);
  color: white;
  border-color: #0284c7;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(14, 165, 233, 0.3);
}

.sub-filter-btn.active {
  background: linear-gradient(135deg, #06b6d4 0%, #0891b2 100%);
  color: white;
  border-color: #0891b2;
  box-shadow: 0 4px 12px rgba(6, 182, 212, 0.4);
  transform: translateY(-2px);
}
/* Espaciado general dentro del modal */
.modal-info > * + * { 
  margin-top: 12px; 
}

.modal-info h2 {
  margin: 0 0 8px;
  font-size: 1.5rem;
  line-height: 1.3;
  color: #1e293b;
  font-weight: 700;
}

.modal-info .model-price {
  margin: 0 0 12px;
  font-weight: 800;
  font-size: 2rem;
}

/* Botón de WhatsApp del modal */
.modal-info .btn-whatsapp,
.btn-whatsapp.full-width,
.btn-whatsapp-modal {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin: 10px 0 16px;
  padding: 14px 24px;
  border-radius: 12px;
  background: linear-gradient(135deg, #25D366 0%, #20BA5A 100%);
  color: white;
  font-weight: 700;
  font-size: 1rem;
  border: 0;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(37, 211, 102, 0.3);
  width: 100%;
}

.modal-info .btn-whatsapp:hover,
.btn-whatsapp-modal:hover {
  background: linear-gradient(135deg, #20BA5A 0%, #128C7E 100%);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(37, 211, 102, 0.5);
}

.modal-info .btn-whatsapp i,
.btn-whatsapp-modal i { 
  font-size: 1.3rem; 
}

/* Títulos de secciones */
.modal-info h4 {
  margin: 20px 0 12px;
  font-size: 1.15rem;
  font-weight: 700;
  color: #1e293b;
  padding-bottom: 8px;
  border-bottom: 2px solid #e2e8f0;
}

/* Tabla de especificaciones */
.specs-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  table-layout: fixed;
  background: white;
  border: 2px solid #e2e8f0;
  border-radius: 16px;
  overflow: hidden;
  font-size: 0.95rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  margin: 12px 0;
}

.specs-table th,
.specs-table td {
  padding: 14px 18px;
  vertical-align: top;
}

.specs-table th {
  width: 42%;
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
  color: #475569;
  font-weight: 700;
  border-right: 2px solid #e2e8f0;
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.specs-table td {
  color: #1e293b;
  word-wrap: break-word;
  font-weight: 500;
  background: white;
}

/* Divisores entre filas */
.specs-table tr:not(:last-child) th,
.specs-table tr:not(:last-child) td {
  border-bottom: 1px solid #f1f5f9;
}

/* Alternar sutilmente el fondo de las filas de valores */
.specs-table tr:nth-child(even) td { 
  background: #fafbfc; 
}

.specs-table tr:hover td {
  background: #f0f9ff;
  transition: background 0.2s ease;
}

/* Responsive: en pantallas chicas ajustamos proporciones y tamaño */
@media (max-width: 600px) {
  .modal-info h2 { 
    font-size: 1.25rem; 
  }
  
  .modal-info .model-price {
    font-size: 1.75rem;
  }
  
  .specs-table { 
    font-size: 0.85rem; 
  }
  
  .specs-table th { 
    width: 45%; 
    padding: 12px 14px;
  }

  .specs-table td {
    padding: 12px 14px;
  }

  .modal-info .btn-whatsapp,
  .btn-whatsapp-modal {
    padding: 12px 20px;
    font-size: 0.95rem;
  }
}
