/* ============================================
   MODAL DE PRODUCTOS
   ============================================ */

.modal {
  display: none;
  position: fixed;
  z-index: 9999;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.92);
  overflow-y: auto;
  animation: modalFadeIn 0.3s ease;
  padding: 20px;
}

@keyframes modalFadeIn {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.modal-content {
  background: linear-gradient(145deg, #1a1a1a, #222222);
  margin: 20px auto;
  padding: 30px;
  max-width: 1200px;
  width: 95%;
  border-radius: 16px;
  position: relative;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.8);
}

/* Botón cerrar */
.modal-close {
  position: absolute;
  top: 15px;
  right: 25px;
  font-size: 45px;
  font-weight: 300;
  color: #fff;
  background: none;
  border: none;
  cursor: pointer;
  transition: all 0.3s ease;
  z-index: 10;
  line-height: 1;
}

.modal-close:hover {
  color: #ef4444;
  transform: rotate(90deg);
}

/* Grid del modal */
.modal-body {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  margin-top: 10px;
}

/* ============================================
   GALERÍA DE IMÁGENES
   ============================================ */

.modal-gallery {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.modal-main-image {
  width: 100%;
  aspect-ratio: 4/3;
  overflow: hidden;
  border-radius: 12px;
  background: #0a0a0a;
  border: 1px solid rgba(255, 255, 255, 0.05);
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-main-image img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: transform 0.3s ease;
}

.modal-main-image img:hover {
  transform: scale(1.02);
}

.modal-thumbnails {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

.modal-thumbnails img {
  width: 100%;
  aspect-ratio: 1/1;
  object-fit: cover;
  border-radius: 8px;
  cursor: pointer;
  border: 3px solid transparent;
  transition: all 0.3s ease;
  background: #0a0a0a;
}

.modal-thumbnails img:hover {
  border-color: #ef4444;
  transform: scale(1.05);
}

.modal-thumbnails img.active {
  border-color: #ef4444;
  box-shadow: 0 0 20px rgba(239, 68, 68, 0.3);
}

/* ============================================
   DETALLES DEL PRODUCTO
   ============================================ */

.modal-details {
  color: #e5e5e5;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.modal-product-title {
  font-size: 28px;
  font-weight: 800;
  text-transform: uppercase;
  color: #ffffff;
  margin-bottom: 5px;
  letter-spacing: -0.5px;
}

.modal-product-price {
  font-size: 34px;
  font-weight: 700;
  color: #ef4444;
  margin-bottom: 20px;
  letter-spacing: -1px;
}

.modal-product-description {
  font-size: 16px;
  line-height: 1.7;
  color: #d1d5db;
  margin-bottom: 25px;
  padding-bottom: 25px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

/* Especificaciones */
.modal-product-specs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 25px;
  margin-bottom: 30px;
}

.modal-product-specs .spec-item {
  display: flex;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.modal-product-specs .spec-label {
  color: #9ca3af;
  font-weight: 500;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.modal-product-specs .spec-value {
  color: #ffffff;
  font-weight: 600;
  font-size: 15px;
}

/* Botón CTA */
.modal-cta {
  width: 100%;
  padding: 16px;
  background: #ef4444;
  color: white;
  border: none;
  border-radius: 10px;
  font-size: 18px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s ease;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-top: 10px;
}

.modal-cta:hover {
  background: #dc2626;
  transform: translateY(-2px);
  box-shadow: 0 10px 30px rgba(239, 68, 68, 0.3);
}

.modal-cta:active {
  transform: translateY(0);
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 992px) {
  .modal-body {
    grid-template-columns: 1fr;
    gap: 30px;
  }
  
  .modal-content {
    padding: 20px;
    margin: 10px auto;
  }
  
  .modal-product-title {
    font-size: 24px;
  }
  
  .modal-product-price {
    font-size: 28px;
  }
}

@media (max-width: 768px) {
  .modal {
    padding: 10px;
  }
  
  .modal-content {
    padding: 15px;
    border-radius: 12px;
  }
  
  .modal-close {
    top: 10px;
    right: 18px;
    font-size: 35px;
  }
  
  .modal-product-title {
    font-size: 20px;
  }
  
  .modal-product-price {
    font-size: 24px;
  }
  
  .modal-product-specs {
    grid-template-columns: 1fr;
    gap: 5px;
  }
  
  .modal-thumbnails {
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
  }
  
  .modal-cta {
    font-size: 16px;
    padding: 14px;
  }
}

@media (max-width: 480px) {
  .modal-product-description {
    font-size: 14px;
  }
  
  .modal-product-specs .spec-label,
  .modal-product-specs .spec-value {
    font-size: 13px;
  }
}