/* ===== Filtros ===== */
.filtros {
    display: flex;
    flex-wrap: wrap;
    gap: 12px 28px;
    padding: 48px 40px 32px 40px;
}

.filtro-boton {
    background: none;
    border: none;
    border-bottom: 1px solid transparent;
    padding: 10px 0;
    color: var(--brown);
    font-size: 14px;
    font-weight: 400;
    letter-spacing: 0.04em;
    cursor: pointer;
    transition: border-color 0.2s ease, font-weight 0.2s ease;
}

.filtro-boton[hidden] {
    display: none;
}

.filtro-boton small {
    margin-left: 6px;
    font-size: 0.7em;
    opacity: 0.6;
    text-transform: none;
}

.filtro-boton:hover,
.filtro-boton.activo {
    border-bottom-color: var(--brown);
}

.filtro-boton.activo {
    font-weight: 600;
}

/* ===== Grilla de productos ===== */
.productos {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 48px 32px;
    padding: 0 40px 96px 40px;
}

.tarjeta {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.tarjeta img {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    background-color: #f1ebe4;
}

/* foto que aparece al apoyar el cursor */
.tarjeta-foto {
    position: relative;
    overflow: hidden;
}

/* zoom suave al apoyar el cursor (la foto principal y la de hover juntas) */
.tarjeta-foto img {
    transition: transform 0.9s cubic-bezier(0.2, 0.6, 0.2, 1);
}

@media (hover: hover) {
    .tarjeta-foto:hover img {
        transform: scale(1.04);
    }
}

.tarjeta-foto .foto-hover {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    opacity: 0;
    transition: opacity 0.4s ease, transform 0.9s cubic-bezier(0.2, 0.6, 0.2, 1);
}

.tarjeta-foto:hover .foto-hover {
    opacity: 1;
}

/* cuadrado que ocupa el lugar de una foto que todavía no está cargada */
.tarjeta-pendiente {
    display: flex;
    align-items: center;
    justify-content: center;
    aspect-ratio: 1 / 1;
    border: 1px dashed rgba(111, 84, 57, 0.4);
    background-color: #f1ebe4;
    color: var(--brown);
    font-size: 14px;
    letter-spacing: 0.04em;
}

.categoria {
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 1.4px;
    text-transform: uppercase;
    color: var(--mostaza);
}

.tarjeta h2 {
    font-size: 30px;
    font-weight: 300;
    line-height: 1.2;
}

/* aclaración chiquita al lado del nombre (ej. "imitación mármol") */
.tarjeta h2 small {
    font-family: "Poppins", sans-serif;
    font-size: 13px;
    font-weight: 400;
    letter-spacing: 0.02em;
    color: var(--mostaza);
    white-space: nowrap;
}

/* la foto es un enlace a la ficha */
.foto-link {
    display: block;
}

/* botón "Ver más", grande */
.boton-ver {
    margin-top: auto;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 52px;
    margin-top: 4px;
    border: 0;
    border-bottom: 1px solid var(--brown);
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    /* el color sube desde abajo al pasar el mouse, igual que el botón del formulario */
    background-image: linear-gradient(var(--brown), var(--brown));
    background-repeat: no-repeat;
    background-position: bottom;
    background-size: 100% 0;
    transition: background-size 0.3s ease, color 0.3s ease;
}

.boton-ver:hover {
    background-size: 100% 100%;
    color: var(--soft-white);
}

/* ===== Tablet ===== */
@media (max-width: 1199.98px) {
    .productos {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ===== Celular ===== */
@media (max-width: 809.98px) {
    .filtros {
        padding: 16px 24px 24px 24px;
        gap: 8px 20px;
    }

    .productos {
        grid-template-columns: 1fr;
        padding: 0 24px 64px 24px;
        gap: 40px;
    }
}

/* tarjeta que no coincide con el filtro */
.tarjeta.oculta {
    display: none;
}

/* al cambiar de filtro la grilla se desvanece un instante */
.productos {
    transition: opacity 0.25s ease;
}

.productos.filtrando {
    opacity: 0;
}

/* ===== Filtro como panel lateral (solo celular) ===== */
.filtro-barra,
.filtro-abrir,
.filtros-fondo,
.filtros-cabecera {
    display: none;
}

@media (max-width: 809.98px) {
    .filtro-barra {
        display: flex;
        align-items: stretch;
        gap: 8px;
        margin: 32px 24px 28px;
    }

    /* la cruz para sacar el filtro sin abrir el panel */
    .filtro-quitar {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 48px;
        border: 1px solid rgba(111, 84, 57, 0.4);
        background: none;
        color: var(--brown);
        cursor: pointer;
    }

    .filtro-quitar[hidden] {
        display: none;
    }

    /* la cruz aparece con un fundido suave */
    .filtro-quitar:not([hidden]) {
        animation: cruz-aparece 0.35s ease;
    }

    @keyframes cruz-aparece {
        from {
            opacity: 0;
        }
    }

    .filtro-abrir {
        display: flex;
        align-items: center;
        gap: 10px;
        min-height: 48px;
        margin: 0;
        padding: 12px 18px;
        border: 1px solid rgba(111, 84, 57, 0.4);
        background: none;
        color: var(--brown);
        font-size: 13px;
        font-weight: 600;
        letter-spacing: 0.14em;
        text-transform: uppercase;
        cursor: pointer;
    }

    .filtro-actual {
        font-weight: 400;
        color: var(--mostaza);
    }

    .filtros-fondo {
        display: block;
        position: fixed;
        inset: 0;
        z-index: 60;
        background-color: rgba(55, 35, 19, 0.45);
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.35s ease, visibility 0.35s;
    }

    .filtros-fondo.abierto {
        opacity: 1;
        visibility: visible;
    }

    .filtros {
        position: fixed;
        top: 0;
        right: 0;
        bottom: 0;
        z-index: 70;
        display: flex;
        flex-direction: column;
        flex-wrap: nowrap;
        gap: 0;
        width: min(86vw, 340px);
        padding: 0 28px 32px;
        overflow-y: auto;
        background-color: var(--soft-white);
        box-shadow: -12px 0 32px rgba(55, 35, 19, 0.18);
        transform: translateX(100%);
        visibility: hidden;
        transition: transform 0.4s cubic-bezier(0.2, 0.6, 0.2, 1), visibility 0.4s;
    }

    .filtros.abierto {
        transform: none;
        visibility: visible;
    }

    .filtros-cabecera {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 14px 0 8px 0;
        border-bottom: 1px solid var(--brown);
        font-size: 12px;
        font-weight: 600;
        letter-spacing: 0.2em;
        text-transform: uppercase;
    }

    .filtros-cerrar {
        width: 44px;
        height: 44px;
        margin-right: -12px;
        border: 0;
        background: none;
        display: flex;
        align-items: center;
        justify-content: center;
        color: var(--brown);
        cursor: pointer;
    }

    .filtro-boton {
        padding: 18px 0;
        border-bottom: 1px solid rgba(111, 84, 57, 0.2);
        font-size: 18px;
        font-weight: 300;
        text-align: left;
    }

    .filtro-boton.activo {
        border-bottom-color: var(--brown);
        font-weight: 600;
    }
}
