/* ------------------------- Listado de artículos (ficha de marca / ficha de familia) ------------------------- */

.listado_productos_familia {
    background-color: #f7f7f8;
}

.productos_grid {
    display: grid;
    gap: 16px;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
}

.producto_tarjeta {
    display: flex;
    flex-direction: column;
    background: #fff;
    border: 1px solid transparent;
    border-radius: 10px;
    transition: border-color .2s ease-in-out, box-shadow .2s ease-in-out, transform .2s ease-in-out;
}

.producto_tarjeta:hover,
.producto_tarjeta:focus-within {
    border-color: #e5e5e5;
    box-shadow: 0 10px 24px rgba(0, 0, 0, .08);
    transform: translateY(-2px);
}

.producto_imagen {
    position: relative;
    aspect-ratio: 1 / 1;
    background-color: #eef1f4;
    border-radius: 10px 10px 0 0;
    overflow: hidden;
}

.producto_imagen img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    /*padding: 1rem;*/
}

.producto_badge {
    position: absolute;
    top: .6rem;
    left: .6rem;
    font-size: .7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .04em;
    padding: .2rem .55rem;
    border-radius: 50px;
    line-height: 1.6;
}

.badge_en_stock {
    background-color: rgba(74, 94, 58, .1);
    color: green;
}

.badge_stock_bajo {
    background-color: rgba(255, 193, 7, .15);
    color: #b8860b;
}

.badge_sin_stock {
    background-color: rgba(220, 53, 69, .1);
    color: #dc3545;
}

.producto_datos {
    display: flex;
    flex-direction: column;
    flex: 1;
    padding: 1rem 1.1rem 1.1rem;
}

.producto_nombre {
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.35;
    margin: 0 0 .3rem;
    color: #222;
}

.producto_intro {
    font-size: .85rem;
    line-height: 1.4;
    color: #666;
    margin-bottom: .6rem;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.producto_precio {
    margin-top: auto;
    padding-top: .6rem;
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: .4rem;
}

.precio_actual {
    font-size: 1.2rem;
    font-weight: 600;
    color: #222;
}

.precio_actual.precio_dto {
    color: #2098d1;
}

.precio_anterior {
    text-decoration: line-through;
    color: #94a3b8;
    font-size: .9rem;
    font-weight: 400;
}

.precio_dto_porcentaje {
    font-size: .72rem;
    font-weight: 700;
    color: #dc3545;
    background-color: rgba(220, 53, 69, .1);
    padding: .1rem .4rem;
    border-radius: 4px;
}

.producto_iva {
    flex-basis: 100%;
    font-size: .72rem;
    color: #888;
}

.producto_acciones {
    display: flex;
    align-items: center;
    gap: .6rem;
    margin-top: .9rem;
}

.btn_ver_ficha {
    flex: 1;
    text-align: center;
    padding: .5rem .9rem;
    border-radius: 8px;
    background-color: #2098d1;
    color: #fff;
    font-weight: 600;
    font-size: .9rem;
    text-decoration: none;
    transition: background-color .2s ease-in-out;
}

.btn_ver_ficha:hover,
.btn_ver_ficha:focus {
    background-color: #17789f;
    color: #fff;
}

.btn_add_carrito {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(32, 152, 209, .1);
    color: #2098d1;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    transition: background-color .2s ease-in-out;
}

.btn_add_carrito:hover,
.btn_add_carrito:focus {
    background: rgba(32, 152, 209, .2);
}

@media (max-width: 575px) {
    .productos_grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
        gap: 12px;
    }

    .producto_datos {
        padding: .8rem .9rem .9rem;
    }
}

/* ------------------------- Panel de filtros ------------------------- */

.panel_filtros_catalogo {
    margin-bottom: 1.5rem;
}

.form_filtros_catalogo {
    display: flex;
    flex-direction: column;
    gap: .8rem;
}

.fila_buscador_filtros {
    display: flex;
    gap: .8rem;
    align-items: center;
}

.buscador_catalogo {
    flex: 1;
    position: relative;
    max-width: 420px;
}

.buscador_catalogo i {
    position: absolute;
    top: 50%;
    left: .9rem;
    transform: translateY(-50%);
    color: #999;
    font-size: .85rem;
}

.buscador_catalogo input {
    width: 100%;
    padding: .55rem .9rem .55rem 2.2rem;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: .9rem;
    background: #fff;
}

.buscador_catalogo input:focus {
    outline: none;
    border-color: #2098d1;
    box-shadow: 0 0 0 3px rgba(32, 152, 209, .15);
}

.btn_toggle_filtros {
    display: none;
    align-items: center;
    gap: .4rem;
    padding: .55rem 1.1rem;
    border: none;
    border-radius: 8px;
    background-color: var(--color-marca, #012A5E);
    color: #fff;
    font-weight: 600;
    font-size: .9rem;
    cursor: pointer;
    flex-shrink: 0;
    transition: filter 200ms ease-in-out;
}

.js .btn_toggle_filtros {
    display: inline-flex;
}

.btn_toggle_filtros:hover,
.btn_toggle_filtros[aria-expanded="true"] {
    filter: brightness(.9);
}

.contador_filtros_activos {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.3rem;
    height: 1.3rem;
    padding: 0 .3rem;
    border-radius: 50px;
    background: rgba(0, 0, 0, .25);
    color: inherit;
    font-size: .72rem;
    font-weight: 700;
}

.fila_chips_filtros {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .5rem;
}

.chip_filtro {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    padding: .3rem .4rem .3rem .7rem;
    border-radius: 50px;
    background: rgba(32, 152, 209, .1);
    color: #17789f;
    font-size: .8rem;
    font-weight: 500;
}

.quitar_chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.1rem;
    height: 1.1rem;
    border: none;
    border-radius: 50%;
    background: rgba(23, 120, 159, .15);
    color: inherit;
    font-size: .85rem;
    line-height: 1;
    cursor: pointer;
}

.quitar_chip:hover {
    background: rgba(23, 120, 159, .3);
}

.borrar_todos_filtros {
    font-size: .8rem;
    font-weight: 600;
    color: #888;
    text-decoration: underline;
}

.borrar_todos_filtros:hover {
    color: #dc3545;
}

.filtros_grid {
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    padding: 1rem;
    background: #fff;
    border: 1px solid #eee;
    border-radius: 10px;
}

.js .filtros_grid {
    display: none;
}

.js .filtros_grid.abierto {
    display: grid;
}

.filtro {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: .3rem;
}

.filtro_label {
    font-size: .78rem;
    font-weight: 600;
    color: #666;
}

.filtro_btn {
    display: none;
    align-items: center;
    justify-content: space-between;
    padding: .5rem .8rem;
    border: 1px solid #ddd;
    border-radius: 8px;
    background: #fff;
    font-size: .85rem;
    color: #222;
    cursor: pointer;
    text-align: left;
}

.js .filtro_btn {
    display: flex;
}

.filtro_btn::after {
    content: '';
    flex-shrink: 0;
    margin-left: .5rem;
    width: 0;
    height: 0;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 5px solid #999;
    transition: transform .15s ease-in-out;
}

.filtro_btn[aria-expanded="true"]::after {
    transform: rotate(180deg);
}

.filtro_btn[aria-expanded="true"] {
    border-color: #2098d1;
}

.filtro_select {
    width: 100%;
    padding: .5rem;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: .85rem;
    background: #fff;
}

.js .filtro_select {
    display: none;
}

.filtro_panel {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    z-index: 20;
    max-height: 260px;
    overflow-y: auto;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-shadow: 0 10px 24px rgba(0, 0, 0, .12);
    padding: .4rem;
}

.filtro_panel label.opcion_filtro {
    display: flex;
    align-items: center;
    gap: .5rem;
    padding: .4rem .5rem;
    border-radius: 6px;
    font-size: .85rem;
    cursor: pointer;
}

.filtro_panel label.opcion_filtro:hover {
    background: #f2f6f8;
}

.filtro_panel label.opcion_filtro.deshabilitada {
    color: #bbb;
    cursor: not-allowed;
}

.filtro_panel .contador_opcion {
    margin-left: auto;
    color: #999;
    font-size: .78rem;
}

.filtro_panel .pie_filtro_panel {
    display: flex;
    justify-content: flex-end;
    padding: .4rem .5rem 0;
    margin-top: .3rem;
    border-top: 1px solid #eee;
}

.filtro_panel .btn_hecho_filtro {
    border: none;
    background: none;
    color: #2098d1;
    font-weight: 600;
    font-size: .8rem;
    cursor: pointer;
    padding: .3rem .5rem;
}

.btn_aplicar_filtros {
    align-self: flex-start;
    padding: .55rem 1.4rem;
    border: none;
    border-radius: 8px;
    background-color: #2098d1;
    color: #fff;
    font-weight: 600;
    font-size: .9rem;
    cursor: pointer;
}

.js .btn_aplicar_filtros {
    display: none;
}

.sin_resultados_catalogo {
    padding: 2.5rem 1rem;
    text-align: center;
    color: #888;
}

@media (max-width: 767px) {
    .js .filtros_grid.abierto {
        position: fixed;
        inset: 0;
        z-index: 1050;
        display: flex;
        flex-direction: column;
        grid-template-columns: none;
        border-radius: 0;
        overflow-y: auto;
        padding-bottom: 5rem;
    }
}
