/* Comparacion de productos*/

.comparativa {
  padding: 40px;
  background-color: #ab556a;
  text-align: center;
}

.comparativa table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 20px;
  margin-bottom: 20px;
}

.comparativa th,
.comparativa td {
  padding: 10px;
  border: 1px solid #424B5D;
  text-align: center;
}

.comparativa th {
  background-color: #030f27;
  color: #ffffff;
}

.comparativa td {
  background-color: #424B5D;
  color: #ffffff;
}

.comparativa tbody tr:hover {
  border: #ffffff 1.5px solid;
  transition: background-color 0.3s ease;
}

.comparativa tbody td:hover {
  color: #ab556a;
  transition: background-color 0.3s ease;
}



/*-----------------------------------------------------------------*/





/* Creacion de producto */

.crearProducto {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 74vh;
  background-color: #ab556a;
  padding: 2rem;
}

#crearProducto {
  padding: 2rem;
  border-radius: 12px;
  box-shadow: 0px 4px 8px rgba(0,0,0,0.2);
  width: 80%;
  max-width: 900px;
  display: flex;
  flex-direction: column;
  gap: 1.8rem;
}

#crearProducto h1 {
  text-align: center;
}

.form-layout {
  display: flex;
  gap: 2rem;
}


#preview-img-producto {
  width: 100%;
  max-height: 280px;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid #ccc;
}




/*-----------------------------------------------------------------*/



/* Editar Producto */

.editar * {
  margin: 5px;
}

.editar label {
  width: 25%;
}

.editar input {
  width: 65%;
}

.editar textarea {
  width: 100%;
  height: 85px;
}

.editar select {
  display: block;
  width: 65%;
}



/*-----------------------------------------------------------------*/




/* Filtros */


.filtros {
  background-color: #ab556a;
  width: 100%;
  display: flex;
  justify-content: center;
  gap: 15%;
}

.filtro-productos {
  background-color: #ab556a;
  text-align: center;
}

.filtro-productos input {
  padding: 10px;
  width: 100%;
  max-width: 400px;
  border: 2px solid #ccc;
  border-radius: 9999px;
  font-size: 16px;
  justify-self: center;
}

.select-filtro {
  background-color: #ab556a;
  text-align: center;
}

.select-filtro select {
  padding: 10px;
  width: 100%;
  max-width: 400px;
  border: 2px solid #ccc;
  border-radius: 9999px;
  font-size: 16px;
  justify-self: end;
}


/*-----------------------------------------------------------------*/



/* Estilos modal */


.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  padding-top: 80px;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(0,0,0,0.6);
}

.modal-content {
  background-color: #fff;
  margin: auto;
  padding: 20px;
  border-radius: 12px;
  width: 40%;
  box-shadow: 0px 4px 15px rgba(0,0,0,0.3);
  animation: slideDown 0.3s ease-out;
}

.close {
  color: #aaa;
  float: right;
  font-size: 28px;
  font-weight: bold;
  cursor: pointer;
}

.close:hover {
  color: #000;
}



/* Opciones */


.opciones {
  background-color: #030f27;
  padding: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.opciones a {
  display: inline-block; /* Evita que ocupe todo el ancho */
  width: auto; /* Se ajusta al texto */
  max-width: 200px; /* (Opcional) límite de ancho */
}



/*-----------------------------------------------------------------*/



/* Despliegue de Productos */

#div4, .productos {
  min-height: auto;
  height: auto;
  overflow: visible;
}

.productos {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 250px));
  justify-content: center;
  gap: 20px;
  padding: 30px;
}

.productos article {
  background: #ffffff;
  padding: 15px;
  border-radius: 8px;
  text-align: center;
  transition: background-color 0.3s ease, transform 0.3s ease;
  display: none;
}

.productos article.active {
  display: block; /* mantiene el layout */
}

.productos article:hover {
  background-color: #f9f9f9;
  transform: scale(1.02);
}

.productos article img {
  width: 100%;
  max-width: 250px;
  height: auto;
  display: block;
  margin: 0 auto;
  border-radius: 8px;
}

.productos > article > div {
  align-self: flex-end;
}



/*-----------------------------------------------------------------*/





/* Despliegue de Categorias */
.categorias {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  justify-content: center;
  gap: 15px;
  align-items: start;
}

.categorias article {
  background: #ffffff;
  color: #030f27;
  padding: 15px;
  border-radius: 8px;
  border: #d42233 2px solid;
  text-align: center;
  transition: background-color 0.3s ease, transform 0.3s ease;
  width: 150px;
  height: 270px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.categorias article:hover {
  background-color: #f9f9f9;
  transform: scale(1.02);
}

.categorias article img {
  width: 100%;
  max-width: 250px;
  height: auto;
  display: block;
  margin: 0 auto;
  border-radius: 8px;
}




/*-----------------------------------------------------------------*/





/* Despliegue de un Producto */


.producto {
  display: flex;
  align-items: center;
  gap: 2rem;
  padding: 2rem;
}

.producto img {
  max-width: 450px;
  border: #030f27 2px solid;
  height: auto;
  object-fit: cover;
}

.producto > div {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  padding: 5px;
  border: #030f27 2px solid;
  background-color: #424B5D;
}

.producto h1 {
  margin: 0 0 1rem;
}

.producto p {
  margin: 0;
  line-height: 1.5;
}

.info-extra {
  display: flex;
  gap: 2rem; /* espacio entre precio y categorías */
  align-items: flex-start; /* alinear arriba */
}

.precio-box,
.categorias-box {
  flex: 1; /* que ocupen espacio proporcional */
}

.precio-box h2,
.categorias-box h2 {
  margin-bottom: 0.5rem;
}

.submenu-productos-fijo li {
  margin: 10px;
}

/* imagenes de producto */

.galeria-imagenes {
  margin-top: 15px;
  width: 100%;
  background: none;
  text-align: left;
}

.galeria-imagenes h3 {
  font-size: 1.1rem;
  color: #fff;
  margin-bottom: 8px;
}

.imagenes-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-start;
}

.imagenes-grid img {
  width: 100px;
  height: 100px;
  border: 1px solid #888;
  margin-bottom: 4px;
  opacity: 0;
  animation: fadeIn 0.5s ease forwards;
}

.imagenes-grid img:hover {
  transform: scale(1.05);
  border-color: #007bff;
  box-shadow: 0 0 10px rgba(0, 123, 255, 0.4);
}


/*-----------------------------------------------------------------*/


/* --- Ajuste para pantallas pequeñas --- */
@media (max-width: 1000px) {
  .categorias {
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 10px;
    row-gap: 5px; 
    padding: 10px;
  }

  .categorias article {
    width: 100%;
    height: auto;            /* 🔹 Ya no fuerza un alto fijo */
    padding: 10px;
  }

  .categorias article img {
    max-width: 100px;        /* 🔹 Imagen más pequeña */
    height: auto;
  }

  .categorias article h3 {
    font-size: 14px;         /* 🔹 Texto más compacto */
  }

  .categorias .boton-azul {
    font-size: 13px;
    padding: 6px 10px;
  }

  .imagenes-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr); /* 2 columnas iguales */
    gap: 10px;
    justify-items: center;
  }

  .imagenes-grid img {
    width: 100px;
    height: 100px;
  }
}


/* 📱 Ajuste extra para pantallas muy pequeñas */
@media (max-width: 480px) {
  .imagenes-grid {
    grid-template-columns: 1fr; /* una columna */
  }

  .imagenes-grid img {
    width: 90px;
    height: 90px;
  }
}


@keyframes slideDown {
  from { transform: translateY(-50px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

/* ✨ Animación de aparición suave */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}