/* Reset básico 
* {
    margin: 0;
    padding: 0;
    font-family: "Roboto", sans-serif;
}
*/
/* Fondo general de la página */
body {
    background-image: url('images/background-image.png');
    background-position: center;
    background-size: cover;
    background-repeat: no-repeat;
    min-height: 100vh;
    margin: 0;
    padding: 0;
    position: relative; /* Necesario para que el pseudo-elemento funcione */
}

body::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: inherit; /* Hereda la misma imagen de fondo */
    background-position: inherit;
    background-size: inherit;
    background-repeat: inherit;
    filter: blur(5px); /* Desenfoque */
    z-index: -1; /* Envía el pseudo-elemento detrás del contenido */
}

.page-title {
    text-align: center; /* Centra el texto horizontalmente */
    margin: 20px 0; /* Espaciado superior e inferior */
    font-size: 2.5rem; /* Tamaño del texto */
    color: #333; /* Color del texto */
    font-weight: bold; /* Negrita para destacar */
}

/* Sección de Productos */
.products-container {
    display: grid;
    grid-template-columns: repeat(4, 1fr); /* Default: 4 columnas */
    gap: 20px;
    padding: 20px;
    max-width: 1200px;
    margin: 0 auto;
    transition: grid-template-columns 0.3s;
}

.product-item {
    background-color: #fff; /* Fondo blanco real */
    border-radius: 10px;
    text-align: center;
    overflow: hidden; /* Asegura que el contenido no se desborde */
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    min-width: 0; /* importante para grids */
}

.product-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 0;
    display: block;
}

.product-item:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 10px rgba(0, 0, 0, 0.2);
}

.image-container {
    background-color: rgba(253, 228, 207, 1);
    width: 100%;             /* Hace que ocupe todo el ancho de la tarjeta */
    aspect-ratio: 3/4;       /* Mantiene proporción vertical (como 300x400) */
    display: flex;
    justify-content: center;
    align-items: center;    
    border-top-left-radius: 10px;
    border-top-right-radius: 10px;
    overflow: hidden;
    margin: 0 auto;
    min-height: 0;           /* Previene errores en mobile */
    min-width: 0;
}

.product-item img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* Ajusta la imagen para que llene el contenedor sin deformarse */
    border-radius: 0; /* Asegúrate de que no tenga bordes redondeados */
}



.info-container {
    background-color: rgba(255, 255, 255, 1); /* Fondo rosa para el texto */
    padding: 15px;
    border-bottom-left-radius: 10px;
    border-bottom-right-radius: 10px;
}

.product-item h3 {
    margin: 10px 0;
    font-size: 18px;
    color: #333;
}

.product-item p {
    margin: 5px 0;
    font-size: 16px;
    color: #333;
    font-weight: bold;
}

.product-item button {
    padding: 10px 15px;
    background-color: #007bff; /* Sin fondo */
    color: #ffffff; /* Color del texto */
    border: 2px solid ; /* Contorno definido */
    border-radius: 5px; /* Bordes redondeados */
    font-size: 14px;
    cursor: pointer;
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
    margin: 5px;
    text-align: center;
}

.product-item button:hover {
    background-color:  #0056b3; /* Fondo negro al pasar el mouse */
    color: #fff; /* Texto blanco al pasar el mouse */
    
}

/* Botón Más detalles */
.more-details {
    display: inline-block;
    padding: 10px 20px;
    background-color: transparent; /* Sin fondo */
    color: black;
    border: 2px solid black; /* Bordes negros */
    border-radius: 5px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
}

.more-details:hover {
    background-color: black; /* Fondo negro al pasar el mouse */
    color: white; /* Texto blanco al pasar el mouse */
}


.products-container.x3 {
    grid-template-columns: repeat(3, 1fr) !important;
}
.products-container.x4 {
    grid-template-columns: repeat(4, 1fr) !important;
}
.products-container.x5 {
    grid-template-columns: repeat(5, 1fr) !important;
}
.products-page-wrapper {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 10px;
}
.products-toolbar {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 12px;
    margin: 20px 0 2px 0;
    padding-right: 0;

    margin-right: 2%;

}

.products-toolbar .view-mode-btn {
    margin-left: 5px;
    padding: 6px 12px;
    border: none;
    border-radius: 4px;
    background: #f0f0f0;
    color: #333;
    font-weight: bold;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
}

.products-toolbar .view-mode-btn.active {
    background: #007bff;
    color: #fff;
}

.toolbar-label {
    font-weight: bold;
    margin-right: 8px;
    color: #222;
}

.view-mode-icons {
    display: flex;
    gap: 6px;
}

.view-mode-icon {
    background: #f0f0f0;
    border: none;
    border-radius: 7px;
    padding: 3px 5px;
    cursor: pointer;
    transition: background 0.18s, box-shadow 0.18s;
    color: #888;
    outline: none;
    position: relative;
}

.view-mode-icon:hover,
.view-mode-icon:focus {
    background: #e0e9ff;
    color: #007bff;
}

.view-mode-icon.active {
    background: #007bff;
    color: #fff;
    box-shadow: 0 2px 8px 0 #007bff44;
}

.view-mode-icon svg {
    display: block;
    margin: 0 auto;
}
.sort-mode-group {
    display: inline-flex;
    gap: 4px;
    margin-right: 24px;
    vertical-align: middle;
}
.sort-mode-btn {
    background: #f0f0f0;
    border: none;
    border-radius: 7px;
    padding: 5px 12px;
    cursor: pointer;
    color: #222;
    font-weight: 500;
    font-size: 1em;
    transition: background 0.18s, color 0.18s;
    outline: none;
}
.sort-mode-btn.active {
    background: #007bff;
    color: #fff;
}
.sort-mode-btn:hover, .sort-mode-btn:focus {
    background: #e0e9ff;
    color: #007bff;
}

@media (max-width: 600px) {
    .products-toolbar {
        margin: 15px 0 0 0;
        justify-content: center;
    }
}
#loading-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(255,255,255,0.95);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.4s;
}
.spinner {
  border: 6px solid #e3e3e3;
  border-top: 6px solid #007bff;
  border-radius: 50%;
  width: 60px; height: 60px;
  animation: spin 1s linear infinite;
}
@keyframes spin {
  0% {transform: rotate(0deg);}
  100% {transform: rotate(360deg);}
}

/* Ocultar SOLO en celulares (max 600px) el cambio de columnas */
@media (max-width: 600px) {
  .view-mode-icons {
    display: none !important;
  }
  /* Extra: forzar 1 columna aunque tenga clase x3/x4/x5 */
  .products-container,
  .products-container.x3,
  .products-container.x4,
  .products-container.x5 {
    grid-template-columns: 1fr !important;
  }
}

/* (Opcional) Grilla flexible para tablets */
@media (min-width: 601px) and (max-width: 900px) {
  .products-container {
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    padding: 18px;
  }
}
