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


.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: none;
  border: none;
  z-index: 10;
  transition: color 0.2s ease-in-out;
}



.btn-cerrar:hover {
  color: var(--verde-color); /* color gamer cuando pasas el mouse */
}

.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 {
  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: 100%;
  max-width: 350px;       /* tamaño máximo fijo */
  height: 220px;          /* 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;
}

.modal-thumbnails img {
  width: 100px;
  height: 80px;
  object-fit: contain;     /* miniaturas proporcionadas */
  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 #ffcc00;
  transform: scale(1.05);
}
/* ==== 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);
}




@media screen and (max-width: 440px) {
    

 .modal-content {
    max-width: 95%;
    padding: 1rem;
    border-radius: 12px;
  }

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

  /* Imagen principal */

 .modal-img-container {
  width: 100%;
  height: 140px;    /* fondo de seguridad (oscuro gamer) */
}
  .modal-images img {
    width: 300px;
    height: 300px;
    max-width: 100%;
    max-height: 200px;
    border-radius: 8px;
    object-fit: contain;
  }

  /* Miniaturas centradas */
  .modal-thumbnails {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.5rem;
  }

  .modal-thumbnails img {
    width: 80px;
    height: 55px;
    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.5rem;
    top: 10px;
    right: 12px;
  }

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

}