@import "./fonts.css";

:root {
    --tp-blue: #396097;
    --tp-gray: #ECEFF4;
    /* gris claro del panel */
    --gap: 20px;
    --radius: 6px;
    --min-card: 320px;
    /* MÁS GRANDES en desktop */
    --img-aspect: 4/3;
    /* alto cómodo para la pieza */
}

/* Contenedor principal con espacio arriba */
.site-content {
    width: 100%;
    margin: 0 auto;
    box-sizing: border-box;
    padding-inline: clamp(10px, 3vw, 28px);
    margin-top: clamp(180px, 2.5vw, 30px);
}

/* margen extra en móviles para no chocar con el menú fijo */
@media (max-width: 640px) {
    .site-content {
        margin-top: clamp(90px, 14vw, 140px);
    }
}

/* Filtros */
.filter-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: .6rem;
    align-items: center;
    justify-content: center;
    width: 100%;
    margin: 0 0 1.4rem;
    padding: .25rem 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
}

.filter-buttons-hero {
    flex-wrap: wrap;
    justify-content: flex-start;
    margin: 0;
    padding: 0;
    overflow: visible;
}

.filter-button {
    background: #fff;
    color: var(--tp-blue);
    border: 1px solid #d9dde3;
    border-radius: 999px;
    padding: .55rem .9rem;
    font-weight: 700;
    font-size: clamp(12px, 2.4vw, 14px);
    white-space: nowrap;
    transition: .2s;
}

.filter-button:hover {
    background: #f2f6ff;
    border-color: #b9c6ff;
}

.filter-button.active {
    background: var(--tp-blue);
    color: #fff;
    border-color: var(--tp-blue);
}

.filter-buttons-hero .filter-button {
    background: rgba(255, 255, 255, .12);
    color: #fff;
    border-color: rgba(255, 255, 255, .18);
    backdrop-filter: blur(4px);
}

.filter-buttons-hero .filter-button:hover {
    background: rgba(255, 255, 255, .2);
    border-color: rgba(255, 255, 255, .28);
}

.filter-buttons-hero .filter-button.active {
    background: #fff;
    color: #173d70;
    border-color: rgba(255, 255, 255, .82);
    box-shadow: 0 10px 20px rgba(15, 33, 58, .18);
}

.products-guide {
    position: relative;
    display: grid;
    grid-template-columns: auto minmax(0, 1.15fr) minmax(260px, .85fr);
    align-items: center;
    gap: clamp(12px, 2vw, 24px);
    margin-bottom: 1.4rem;
    padding: clamp(16px, 2.6vw, 28px);
    border-radius: 24px;
    overflow: hidden;
    background:
        linear-gradient(135deg, rgba(20, 56, 107, .97), rgba(57, 96, 151, .92)),
        radial-gradient(circle at top right, rgba(255, 255, 255, .18), transparent 45%);
    box-shadow: 0 18px 40px rgba(18, 42, 76, .2);
    color: #fff;
}

.products-guide::after {
    content: "";
    position: absolute;
    inset: 0;
    background:
        linear-gradient(115deg, transparent 0 38%, rgba(255, 255, 255, .08) 48%, transparent 58%),
        repeating-linear-gradient(90deg, transparent 0 24px, rgba(255, 255, 255, .04) 24px 25px);
    pointer-events: none;
}

.products-guide>* {
    position: relative;
    z-index: 1;
}

.products-guide-badge {
    display: grid;
    place-items: center;
    width: clamp(58px, 6vw, 76px);
    height: clamp(58px, 6vw, 76px);
    border-radius: 20px;
    background: rgba(255, 255, 255, .14);
    border: 1px solid rgba(255, 255, 255, .2);
    backdrop-filter: blur(4px);
    animation: guideFloat 2.2s ease-in-out infinite;
}

.products-guide-badge .material-symbols-rounded {
    font-size: clamp(30px, 3vw, 40px);
}

.products-guide-copy {
    display: grid;
    gap: .35rem;
}

.products-guide-eyebrow {
    margin: 0;
    font-size: .82rem;
    font-weight: 800;
    letter-spacing: .12em;
    text-transform: uppercase;
    opacity: .8;
}

.products-guide-title {
    margin: 0;
    font-family: 'Ghino', sans-serif;
    font-size: clamp(1.15rem, 2vw, 2rem);
    line-height: 1.05;
}

.products-guide-text {
    margin: 0;
    max-width: 56ch;
    font-size: clamp(.92rem, 1.35vw, 1.05rem);
    line-height: 1.45;
    opacity: .9;
}

.products-guide-panel {
    display: grid;
    gap: .8rem;
    padding: clamp(14px, 2vw, 18px);
    border-radius: 20px;
    background: rgba(255, 255, 255, .08);
    border: 1px solid rgba(255, 255, 255, .16);
    backdrop-filter: blur(4px);
}

.products-guide-panel-title {
    margin: 0;
    font-size: .82rem;
    font-weight: 800;
    letter-spacing: .1em;
    text-transform: uppercase;
    opacity: .82;
}

/* Grilla */
.products-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(var(--min-card), 1fr));
    gap: var(--gap);
    align-items: stretch;
}

/* Tarjeta: panel completo (sin contenedor blanco) */
.product-card {
    position: relative;
    display: block;
    cursor: pointer;
    text-decoration: none;
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--tp-gray);
    /* gris por defecto */
    border: 1px solid #e3e8ef;
    box-shadow: 0 12px 28px rgba(0, 0, 0, .12);
    transition: transform .2s ease, box-shadow .2s ease;
    isolation: isolate;
}

.product-card:nth-child(odd) {
    background: var(--tp-blue);
}

/* alterna azul/gris */
.product-card::before {
    content: "";
    position: absolute;
    inset: 0;
    border: 2px solid transparent;
    border-radius: inherit;
    transition: border-color .25s ease, box-shadow .25s ease;
    pointer-events: none;
    z-index: 2;
}

.product-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 18px 38px rgba(0, 0, 0, .18);
}

.product-card:hover::before,
.product-card:focus-visible::before,
.product-card.is-guided::before {
    border-color: rgba(255, 255, 255, .72);
    box-shadow: inset 0 0 0 1px rgba(19, 48, 91, .12);
}

.product-card:focus-visible {
    outline: none;
    transform: translateY(-3px);
    box-shadow: 0 18px 38px rgba(0, 0, 0, .18);
}

/* Título arriba */
.product-name {
    padding: 14px 74px;
    text-align: center;
    text-transform: uppercase;
    font-family: 'Ghino', sans-serif;
    font-weight: 800;
    letter-spacing: .4px;
    line-height: 1.1;
    font-size: clamp(16px, 2.2vw, 22px);
    color: #fff;
    /* panel azul => blanco */
}

.product-card:nth-child(even) .product-name {
    color: var(--tp-blue);
}

/* panel gris => azul */

/* Imagen sin marco blanco (ocupa el panel) */
.card-image {
    width: 100%;
    aspect-ratio: var(--img-aspect);
    background-position: center;
    background-repeat: no-repeat;
    background-size: contain;
    /* no recorta la pieza */
    margin: 0;
    /* <<< sin márgenes = sin “caja” blanca */
    border-radius: 0;
    box-shadow: none;
    /* el fondo ahora es el del panel (azul o gris) */
    background-color: transparent;
}

.product-cta {
    position: absolute;
    right: 18px;
    bottom: 18px;
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    padding: .65rem .9rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, .92);
    color: #173d70;
    font-size: .92rem;
    font-weight: 800;
    box-shadow: 0 12px 24px rgba(0, 0, 0, .18);
    opacity: 0;
    transform: translateY(12px);
    transition: opacity .25s ease, transform .25s ease;
    pointer-events: none;
    z-index: 3;
}

.product-cta .material-symbols-rounded {
    font-size: 1.15rem;
}

.product-card:hover .product-cta,
.product-card:focus-visible .product-cta,
.product-card.is-guided .product-cta {
    opacity: 1;
    transform: translateY(0);
}

.product-card.is-guided {
    animation: guidedPulse 1.7s ease-in-out 3;
}

/* Accesibilidad al ocultar por filtro */
.product-card.is-hidden {
    display: none;
    pointer-events: none;
}

@keyframes guideFloat {
    0%,
    100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-6px);
    }
}

@keyframes guidedPulse {
    0%,
    100% {
        transform: translateY(0);
        box-shadow: 0 12px 28px rgba(0, 0, 0, .12);
    }
    50% {
        transform: translateY(-6px);
        box-shadow: 0 22px 42px rgba(17, 41, 75, .22);
    }
}

/* Responsive fino (siempre grande, pero adaptado) */
@media (min-width: 1600px) {
    .products-container {
        grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
    }
}

@media (max-width: 1200px) {
    :root {
        --min-card: 300px;
    }
}

@media (max-width: 992px) {
    :root {
        --min-card: 260px;
    }
}

@media (max-width: 768px) {
    :root {
        --min-card: 220px;
    }

    .products-guide {
        grid-template-columns: 1fr;
        text-align: left;
    }

    .products-guide-panel {
        width: 100%;
    }

    .card-image {
        aspect-ratio: 1/1;
    }

    /* cuadrados en pantallas pequeñas */
}

@media (max-width: 520px) {
    :root {
        --min-card: 100%;
    }

    .products-container {
        gap: 16px;
    }

    .product-name {
        padding: 12px 14px;
        font-size: clamp(15px, 5vw, 19px);
    }

    .products-guide {
        padding: 16px;
        border-radius: 20px;
    }

    .products-guide-panel {
        gap: .7rem;
        padding: 14px;
    }

    .product-cta {
        right: 12px;
        bottom: 12px;
        padding: .55rem .8rem;
        font-size: .85rem;
    }
}
@media(max-width: 576px){
    .filter-buttons {
        justify-content: flex-start;
        flex-wrap: nowrap;
        margin-bottom: 1rem;
        padding-inline: .15rem;
    }

    .filter-buttons-hero {
        flex-wrap: wrap;
        margin-bottom: 0;
        padding-inline: 0;
    }

    .products-guide {
        margin-top: .5rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .products-guide-badge,
    .product-card.is-guided {
        animation: none;
    }

    .product-card,
    .product-cta,
    .product-card::before {
        transition: none;
    }
}
