/* css/productos-page.css - Estilos específicos para la página de Productos */

/* Encabezado y Barra de Búsqueda */
.encabezado-productos {
    text-align: center;
    margin-bottom: 30px;
    padding-bottom: 25px;
    border-bottom: 1px solid #EAEAEA;
}

.encabezado-productos h1 {
    font-size: 2.6em;
    color: #0A2463;
    margin-bottom: 8px;
}

.encabezado-productos p {
    font-size: 1.1em;
    color: #555555;
    max-width: 700px;
    margin: 0 auto;
    line-height: 1.6;
}

.barra-busqueda-filtros {
    display: flex;
    justify-content: center;
    align-items: center;
    /* Alinear verticalmente */
    gap: 15px;
    /* Espacio entre buscador y botón */
    padding: 20px;
    background-color: #FFFFFF;
    border-radius: 10px;
    margin-bottom: 30px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.06);
}

.campo-busqueda {
    display: flex;
    width: 100%;
    max-width: 600px;
    position: relative;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    /* Sombra suave para efecto flotante */
    border-radius: 50px;
    /* Forma de píldora completa */
    background-color: #FFFFFF;
    transition: box-shadow 0.3s ease;
}

.campo-busqueda:focus-within {
    box-shadow: 0 6px 16px rgba(10, 36, 99, 0.15);
    /* Sombra más pronunciada al enfocar */
}

.campo-busqueda input[type="search"] {
    width: 100%;
    padding: 15px 25px;
    border: 2px solid transparent;
    /* Borde transparente por defecto */
    border-radius: 50px 0 0 50px;
    /* Redondear izquierda */
    font-family: 'Lato', sans-serif;
    font-size: 1.05em;
    outline: none;
    color: #333333;
    background-color: transparent;
}

.campo-busqueda input[type="search"]::placeholder {
    color: #999;
}

.campo-busqueda input[type="search"]:focus {
    border-color: transparent;
    box-shadow: none;
}

/* Estilos botón filtros */
/* Estilos botón buscar */
.btn-buscar-icono {
    background-color: #0A2463;
    border: none;
    padding: 0 25px;
    cursor: pointer;
    border-radius: 0 50px 50px 0;
    /* Redondear derecha a juego */
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s ease;
    color: #FFFFFF;
}

.btn-buscar-icono:hover {
    background-color: #081F54;
}

.btn-toggle-filtros {
    display: flex;
    align-items: center;
    gap: 8px;
    background-color: #FFFFFF;
    border: 1px solid #DDE1E6;
    padding: 12px 20px;
    border-radius: 8px;
    font-family: 'Lato', sans-serif;
    font-weight: 700;
    color: #333;
    cursor: pointer;
    transition: all 0.2s ease;
    height: 100%;
    /* Para igualar altura si fuese contenedor flex */
}

.btn-toggle-filtros:hover,
.btn-toggle-filtros.activo {
    background-color: #0A2463;
    border-color: #0A2463;
    color: #FFFFFF;
}

.btn-toggle-filtros svg {
    width: 20px;
    height: 20px;
}

/* --- Estilos para Filtros Interactivos --- */
.filtros-contenedor {
    margin-bottom: 40px;
    display: none;
    /* Oculto por defecto */
    animation: fadeIn 0.3s ease-out;
}

.filtros-contenedor.visible {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.barra-filtros,
.barra-filtros-secundarios {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    margin-bottom: 15px;
}

.filtro-pill {
    font-family: 'Lato', sans-serif;
    font-weight: 700;
    font-size: 0.9em;
    padding: 8px 18px;
    border-radius: 20px;
    border: 2px solid #DDE1E6;
    background-color: #FFFFFF;
    color: #555;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
}

.filtro-pill:hover {
    background-color: #E9ECEF;
    border-color: #0A2463;
    color: #0A2463;
}

.filtro-pill.activo {
    background-color: #0A2463;
    border-color: #0A2463;
    color: #FFFFFF;
    box-shadow: 0 4px 10px rgba(10, 36, 99, 0.2);
}

.barra-filtros-secundarios {
    border-top: 1px solid #EAEAEA;
    padding-top: 15px;
}

.barra-filtros-secundarios .filtro-pill {
    background-color: transparent;
    border-color: #B0BEC5;
    color: #37474F;
}

.barra-filtros-secundarios .filtro-pill:hover {
    background-color: #ECEFF1;
    border-color: #FFC107;
}

.barra-filtros-secundarios .filtro-pill.activo {
    background-color: #FFC107;
    border-color: #FFC107;
    color: #0A2463;
    box-shadow: 0 4px 10px rgba(255, 193, 7, 0.2);
}

/* --- Cuadrícula de Productos (Ahora ocupa todo el ancho) --- */
.productos-contenido-principal {
    width: 100%;
}

.cuadricula-productos {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 25px;
    margin-bottom: 40px;
}

.tarjeta-producto {
    background-color: #FFFFFF;
    border-radius: 10px;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.tarjeta-producto:hover {
    transform: translateY(-6px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.12);
}

.enlace-tarjeta-producto {
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.imagen-producto {
    width: 100%;
    padding-top: 100%;
    position: relative;
    background-color: #f0f0f0;
    overflow: hidden;
}

.imagen-producto img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.tarjeta-producto:hover .imagen-producto img {
    transform: scale(1.07);
}

.info-producto {
    padding: 15px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.info-producto h3 {
    font-family: 'Oswald', sans-serif;
    font-size: 1.15em;
    color: #0A2463;
    margin-bottom: 10px;
    font-weight: 700;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    min-height: 2.6em;
    flex-grow: 1;
}

.tarjeta-producto .btn-anadir-carrito {
    width: calc(100% - 30px);
    margin: 0 auto 15px auto;
    padding: 9px 12px;
    font-size: 0.85em;
}

/* --- Estilos para la Paginación --- */
.paginacion-productos {
    margin: 40px 0 20px 0;
    text-align: center;
}

.paginacion-productos ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: inline-flex;
    align-items: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.07);
    border-radius: 8px;
    overflow: hidden;
}

.paginacion-productos ul li {
    margin: 0;
}

.paginacion-productos .enlace-paginacion {
    display: inline-block;
    padding: 10px 15px;
    font-family: 'Lato', sans-serif;
    font-weight: 700;
    color: #0A2463;
    text-decoration: none;
    border-left: 1px solid #E0E0E0;
    background-color: #FFFFFF;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.paginacion-productos ul li:first-child .enlace-paginacion {
    border-left: none;
}

.paginacion-productos .enlace-paginacion:hover {
    background-color: #f0f0f0;
    color: #071c4a;
}

.paginacion-productos .enlace-paginacion.pagina-actual {
    background-color: #0A2463;
    color: #FFFFFF;
    font-weight: 700;
    cursor: default;
}

.paginacion-productos .enlace-paginacion.pagina-actual:hover {
    background-color: #0A2463;
    color: #FFFFFF;
}

.paginacion-productos .enlace-paginacion.disabled {
    color: #cccccc;
    cursor: not-allowed;
    background-color: #f8f9fa;
}

.paginacion-productos .enlace-paginacion.disabled:hover {
    color: #cccccc;
    background-color: #f8f9fa;
}

/* --- Media Queries --- */
@media (max-width: 768px) {
    .cuadricula-productos {
        grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
        gap: 15px;
    }

    .info-producto h3 {
        font-size: 1.1em;
        min-height: 2.4em;
    }
}

@media (max-width: 480px) {
    .cuadricula-productos {
        grid-template-columns: repeat(2, 1fr);
        /* Dos columnas en móvil */
    }

    .info-producto h3 {
        font-size: 1.05em;
    }

    .paginacion-productos .enlace-paginacion {
        padding: 8px 10px;
        font-size: 0.9em;
    }
}

/* --- NUEVO: Estilos para los botones de acción en la tarjeta --- */

.acciones-tarjeta-producto {
    display: flex;
    gap: 10px;
    /* Espacio entre los botones */
    padding: 0 15px 15px 15px;
    /* Padding inferior y a los lados */
}

.btn-accion-tarjeta {
    flex: 1;
    /* Hace que ambos botones ocupen el mismo espacio */
    padding: 10px 5px;
    /* Ajusta el padding para que quepan bien */
    font-size: 0.9em;
    text-align: center;
    margin: 0;
    /* Resetea el margen individual del .btn global */
}

/* Ajustamos el botón secundario (Detalles) para que se vea bien */
.acciones-tarjeta-producto .btn-secondary {
    background-color: #f0f2f5;
    /* Un fondo sutil */
    border-color: #dadddf;
    color: #333;
}

.acciones-tarjeta-producto .btn-secondary:hover {
    background-color: #e4e6e9;
    border-color: #caced1;
    color: #0A2463;
}