/* =============== MODAL ================= */

/* =============== LIGHTBOX (ZOOM) =============== */
.lightbox {
  display: none; /* Oculto por defecto */
  position: fixed;
  z-index: 2000; /* Encima de todo, incluso del modal */
  padding-top: 50px;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(0, 0, 0, 0.9); /* Fondo negro casi opaco */
  align-items: center;
  justify-content: center;
}

.lightbox.active {
  display: flex; /* Mostrar flex para centrar */
}

.lightbox-content {
  margin: auto;
  display: block;
  width: 80%;
  max-width: 1200px;
  max-height: 90vh; /* Para que no se salga en vertical */
  object-fit: contain;
  animation: zoomIn 0.3s; /* Animación de entrada */
}

@keyframes zoomIn {
  from {transform:scale(0)} 
  to {transform:scale(1)}
}

.lightbox-close {
  position: absolute;
  top: 20px;
  right: 35px;
  color: #f1f1f1;
  font-size: 40px;
  font-weight: bold;
  transition: 0.3s;
  cursor: pointer;
  z-index: 2001;
}

.lightbox-close:hover,
.lightbox-close:focus {
  color: var(--verde-color);
  text-decoration: none;
  cursor: pointer;
}

/* Responsive Lightbox */
@media only screen and (max-width: 700px){
  .lightbox-content {
    width: 95%;
  }
  .lightbox-close {
    top: 10px;
    right: 20px;
    font-size: 30px;
  }
}


.modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.8);
  align-items: center;
  justify-content: center;
  padding: 1rem;
  z-index: 1000;
}

.modal.active { display: flex; }

.modal-content {
  position: relative; /* muy importante para que el botón se posicione dentro */
  background: #1a1a1f;
  border-radius: 12px;
  padding: 2rem;
  max-width: 900px;
  width: 100%;
  box-sizing: border-box;
}

.modal-body {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
}


/* Animación cuando el modal se abre */
.modal.active .modal-content {
  transform: scale(1);
  opacity: 1;
}







.btn-cerrar {
  position: absolute;
  top: 15px;
  right: 20px;
  font-size: 1.8rem;
  font-weight: bold;
  color: #fff;
  cursor: pointer;
  background: rgba(0, 0, 0, 0.7);
  border: none;
  z-index: 1001;
  transition: color 0.2s ease-in-out, background 0.2s ease-in-out;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}



.btn-cerrar:hover {
  color: var(--verde-color);
  background: rgba(0, 0, 0, 0.9);
}

.modal-thumbnails img.active {
  border-color: var(--verde-color);
}

/* INFORMACIÓN */
.modal-info {
  flex: 1;
  min-width: 250px;
}

.modal-info h2 {
  margin-top: 0;
  font-size: 1.5rem;
}

.modal-info p { margin: 0.5rem 0; }

.btn-action {
  background: var(--verde-color);
  border: none;
  padding: 0.7rem 1.5rem;
  margin-right: 0.5rem;
  border-radius: 8px;
  cursor: pointer;
  font-weight: bold;
}

.modal-img-container {
  position: relative;   /* necesario para el badge */
  width: 100%;
  max-width: 414px;     /* tamaño fijo */
  height: 414px;        /* alto uniforme */
  margin: 0 auto 1rem;  /* centrado y espacio debajo */
  border-radius: 8px;
  overflow: hidden;     /* recorta lo que sobresalga */
  display: flex;
  align-items: center;
  justify-content: center;   /* fondo de seguridad (oscuro gamer) */
}

.modal-img-container img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;  /* mantiene proporción sin deformar */
}

.modal-specs {
  margin-top: 1rem;
  text-align: left;
}

.modal-specs h3 {
  font-size: 1rem;
  margin-bottom: 0.5rem;
  color: var(--verde-color); /* dorado gamer */
}

.modal-specs table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.modal-specs td {
  padding: 6px 8px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}

.spec-key {
  font-weight: 600;
  color: #aaa;
  width: 40%;
}

.spec-value {
  color: #fff;
}

/* Responsive */
@media (max-width: 768px) {
  .modal-body { flex-direction: column; }
  .modal-thumbnails { justify-content: center; }
}




/* Contenedor general del modal */
.modal-content {
  position: relative;
  background: #1a1a1f;
  border-radius: 12px;
  padding: 1.5rem;
  max-width: 900px;
  width: 95%;
  display: flex;
  flex-direction: row;
  gap: 2rem;
  box-sizing: border-box;
  overflow: hidden;
}

/* ==== Columna de imágenes ==== */
/* === CONTENEDOR DE IMÁGENES === */
.modal-images {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;  /* centra el contenido */
  gap: 1rem;
}

/* Imagen principal */
.modal-main-img {
  width: 350px;           /* ancho fijo */
  height: 280px;          /* altura fija para uniformidad */
  object-fit: contain;    /* mantiene proporción sin deformar */
  background: #111;       /* fondo neutro en caso de imágenes pequeñas */
  border-radius: 8px;
  display: block;
  margin: 0 auto;         /* centra horizontal */
}

/* Thumbnails */
.modal-thumbnails {
  display: flex;
  justify-content: center;
  gap: 0.6rem;
  flex-wrap: wrap;
  max-width: 350px;
}

/* Swiper para miniaturas cuando hay más de 3 */
.modal-thumbnails.swiper {
  overflow: visible;
  max-width: 350px;
  padding: 0.8rem 0;
}

.modal-thumbnails.swiper .swiper-wrapper {
  display: flex;
}

.modal-thumbnails.swiper .swiper-slide {
  width: auto;
  flex-shrink: 0;
}

.modal-thumbnails img {
  width: 100px;
  height: 80px;
  flex-shrink: 0;
  object-fit: contain;
  border-radius: 6px;
  cursor: pointer;
  border: 2px solid transparent;
  transition: border 0.2s ease-in-out, transform 0.2s ease-in-out;
}

.modal-thumbnails img.active {
  border: 2px solid var(--verde-color);
  transform: scale(1.05);
}

.modal-thumbnails img:hover {
  transform: scale(1.08);
}

/* ==== Columna de info ==== */
.modal-info {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.modal-info h2 {
  margin-bottom: 0.8rem;
}

.modal-info h3{
  color: var(--verde-color);
}

/* ==== Especificaciones con scroll ==== */
.modal-specs {
  flex: 1;
  max-height: 320px; /* altura fija */
  overflow-y: auto;
  margin-bottom: 1.5rem;
  padding-right: 0.5rem;
}




/* scroll estilizado */
.modal-specs::-webkit-scrollbar {
  width: 6px;
}
.modal-specs::-webkit-scrollbar-thumb {
  background: #444;
  border-radius: 4px;
}

/* tabla */
.modal-specs table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.modal-specs td {
  padding: 6px 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.spec-key {
  font-weight: 600;
  color: #aaa;
  width: 40%;
}

.spec-value {
  color: #fff;
}

/* ==== Botón de acción ==== */
.btn-action {
  margin-top: auto; /* empuja el botón al final */
  padding: 0.8rem 1rem;
  border-radius: 8px;
  background: linear-gradient(90deg, #ffcc00, #ffaa00);
  color: #000;
  font-weight: bold;
  cursor: pointer;
  border: none;
  transition: transform 0.2s ease-in-out;
}

.btn-action:hover {
  transform: scale(1.05);
}

/* COLORES */
.modal-colors {
  display: flex;
  gap: 10px;
  margin: 1rem 0;
  align-items: center;
}

.color-btn {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform 0.2s, border-color 0.2s;
  position: relative;
}

.color-btn:hover {
  transform: scale(1.1);
}

.color-btn.active {
  border-color: var(--verde-color);
  transform: scale(1.1);
  box-shadow: 0 0 8px rgba(166, 255, 0, 0.4);
}

/* Tooltip para el nombre del color */
.color-btn::after {
  content: attr(data-color);
  position: absolute;
  bottom: 120%;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.8);
  color: #fff;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 12px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}

.color-btn:hover::after {
  opacity: 1;
}


@media screen and (max-width: 440px) {
    
  .modal-content {
    max-width: 95%;
    padding: 1rem;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
  }

  .modal-body {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 1rem;
    width: 100%;
  }

  .modal-images {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
  }

  /* Imagen principal */
  .modal-img-container {
    width: 100%;
    height: 250px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #111;
    border-radius: 8px;
  }
  
  .modal-main-img {
    width: 100%;
    height: 250px;
    object-fit: contain;
    border-radius: 8px;
  }

  /* Miniaturas en móvil con Swiper */
  .modal-thumbnails,
  .modal-thumbnails.swiper {
    max-width: 100%;
    padding: 0.5rem 0;
    overflow: visible;
  }

  .modal-thumbnails img {
    width: 80px;
    height: 55px;
    flex-shrink: 0;
    border-radius: 6px;
    object-fit: cover;
  }

 

  /* Información */
  .modal-info h2 {
    font-size: 1.2rem;
    margin-bottom: 0.3rem;
  }

  .modal-info p {
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
  }

 
 .modal-specs {
  max-height:160px;
}
  

  /* ❌ de cerrar */
  .btn-cerrar {
    font-size: 1.3rem;
    top: 8px;
    right: 8px;
    width: 35px;
    height: 35px;
  }

  .modal-images img {
    object-fit: contain;
    margin: 0 auto; /* centra horizontalmente */
    display: block;
  }

}