/* Estilos para la página de productos */

.filtros-container {
    background-color: #f8f9fa;
    border-radius: 8px;
    padding: 20px;
    margin: 20px auto;
    max-width: 1200px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.filtros-titulo {
    font-size: 1.2rem;
    margin-bottom: 15px;
    color: #333;
    border-bottom: 1px solid #ddd;
    padding-bottom: 10px;
}

.filtros-form {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    align-items: flex-end;
}

.filtro-grupo {
    flex: 1 1 200px;
    margin-bottom: 10px;
}

.filtro-grupo label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: #555;
}

.filtro-select,
.filtro-input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.3s;
}

.filtro-select:focus,
.filtro-input:focus {
    border-color: #4a90e2;
    outline: none;
    box-shadow: 0 0 0 2px rgba(74, 144, 226, 0.2);
}

.filtro-btn {
    background-color: #4a90e2;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 8px 16px;
    cursor: pointer;
    font-weight: 500;
    transition: background-color 0.3s;
}

.filtro-btn:hover {
    background-color: #3a7bc8;
}

.filtro-btn-reset {
    background-color: #6c757d;
}

.filtro-btn-reset:hover {
    background-color: #5a6268;
}

/* Estilos para la lista de productos */
.contenedor-productos {
    max-width: 1400px; /* Reducido para evitar overflow en pantallas muy anchas */
    margin: 0 auto;
    padding: 20px 20px; /* Reducido padding horizontal */
    background-color: #fafafa;
}

.titulo-productos {
    text-align: center;
    margin-bottom: 30px;
    color: #333;
    font-size: 2rem;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

#contenedor {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-start;
    gap: 20px;
    max-width: 100%;
}

#contenedor > * {
    flex: 0 0 250px;
    margin: 0;
}

.producto-destacado {
    border: 1px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.3s, box-shadow 0.3s;
    background-color: white;
    position: relative;
}

/* Estilos para productos sin stock */
.producto-destacado.out-of-stock {
    background-color: #f5f5f5 !important;
    border-color: #ddd;
    opacity: 0.8;
}

.producto-destacado.out-of-stock .producto-imagen-container img {
    filter: grayscale(50%);
}

.producto-destacado.out-of-stock .titulo-producto {
    color: #666;
}

.producto-destacado.out-of-stock .precio-original,
.producto-destacado.out-of-stock .precio-descuento {
    color: #999;
}

.producto-destacado:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.producto-imagen-container {
    position: relative;
    width: 100%;
    min-height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.producto-imagen-container img {
    max-width: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
}

.producto-info {
    padding: 15px;
}

.titulo-producto {
    margin: 0 0 10px 0;
    font-size: 1rem;
    color: #333;
    font-weight: 600;
    line-height: 1.4;
}

.producto p.precio {
    margin: 0 0 15px 0;
    color: black;
    font-weight: bold;
    font-size: 1.1rem;
}

/* Estilos para precios con descuento */
.precio-container {
    margin-bottom: 16px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    position: relative;
    z-index: 2;
    text-align: center;
}

.precio-original {
    font-size: 1em;
    color: #999;
    text-decoration: line-through;
    font-weight: 500;
    text-decoration-thickness: 2px;
    text-decoration-color: #999;
}

.precio-descuento {
    font-size: 1.4em;
    color: black;
    font-weight: 700;
}

.precio-regular {
    font-size: 1.4em;
    color: black;
    font-weight: 700;
}

.agregar {
    width: 100%;
    padding: 10px;
    background-color: #4a90e2 !important;
    color: white !important;
    border: none;
    cursor: pointer;
    transition: background-color 0.3s;
}

.sin-stock {
    width: 100%;
    padding: 10px;
    background-color: #adb5bd !important;
    color: #495057 !important;
    border: none;
    cursor: not-allowed;
    transition: background-color 0.3s;
    font-weight: 500;
}

.descuento-badge {
    background: #232c85;
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: bold;
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 10;
}

.producto button {
    width: 100%;
    padding: 10px;
    background-color: #4a90e2;
    color: white;
    border: none;
    cursor: pointer;
    transition: background-color 0.3s;
    position: relative;
    z-index: 2;
}

.producto button:hover {
    background-color: #3a7bc8;
}

.producto button.btn-success {
    background-color: #4caf50 !important;
    color: white !important;
    border-color: #4caf50 !important;
}

.producto button.btn-success i {
    background-color: white;
    color: #4caf50;
    border-radius: 50%;
    padding: 2px;
    width: 16px;
    height: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.no-productos {
    grid-column: 1 / -1;
    text-align: center;
    padding: 50px;
    color: #777;
    font-size: 1.2rem;
}

.mensaje {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background-color: #4caf50;
    color: white;
    padding: 10px 20px;
    border-radius: 4px;
    display: none;
    z-index: 1000;
    animation: fadeIn 0.3s, fadeOut 0.3s 2.7s;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeOut {
    from { opacity: 1; transform: translateY(0); }
    to { opacity: 0; transform: translateY(20px); }
}

/* Paginación */
.paginacion {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 30px;
    gap: 15px;
}

.paginacion button {
    padding: 8px 16px;
    background-color: #232c85;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
    margin: 3px;
}

.paginacion button:hover {
    background-color: #1a2163;
    transform: translateY(-2px);
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.paginacion button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background-color: #6c757d;
    transform: none;
    box-shadow: none;
}

.pagina-info {
    font-size: 14px;
    color: #555;
    font-weight: 500;
}

/* Responsive */
@media (max-width: 768px) {
    .filtros-form {
        flex-direction: column;
    }

    .filtro-grupo {
        flex: 1 1 100%;
    }

    #contenedor {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    }

    .paginacion {
        flex-wrap: nowrap;
        gap: 5px;
        justify-content: center;
    }

    .paginacion button {
        padding: 8px 6px;
        font-size: 12px;
        min-width: 35px;
    }

    .pagina-info {
        order: -1;
        width: 100%;
        text-align: center;
        margin-bottom: 10px;
    }
}

@media (max-width: 480px) {
    #contenedor {
        grid-template-columns: 1fr;
    }

    .filtros-container {
        padding: 15px;
    }

    .paginacion {
        gap: 8px;
    }

    .paginacion button {
        padding: 12px;
        font-size: 16px;
        min-width: 45px;
    }

    .pagina-info {
        order: -1;
        margin-bottom: 10px;
    }
}
