/* ── Discover Our Products ──────────────────────────────────
   Figma: desktop 812:2529, tablet 3112:41372, mobile 2243:1473.
   ─────────────────────────────────────────────────────────── */

.discover-products {
    padding: 60px var(--pad-x) 80px;
}

.discover-products__inner {
    display: flex;
    flex-direction: column;
    max-width: var(--site-max-w);
    margin: 0 auto;
}

.discover-products__head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
}

.discover-products__shop-link {
    display: none;
}

.discover-products__pills {
    display: flex;
    flex-wrap: wrap;
    gap: 12px 16px;
    margin-top: 20px;
}

.discover-products__pills .button {
    flex-shrink: 0;
}

.discover-products__grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 20px 16px;
    margin-top: 25px;
    transition: opacity var(--transition);
}

/* The pills' other sets of cards */
.discover-products__grid[hidden] {
    display: none;
}

/* Tablet only */
.discover-products__more {
    display: none;
}

/* ── Tablet: 2 columns, 6 cards, pills scroll ───────────────── */
@media (max-width: 1024px) {
    .discover-products {
        padding-block: 48px;
    }

    .discover-products__head {
        align-items: center;
    }

    /* One row that scrolls, out to the screen edges */
    .discover-products__pills {
        flex-wrap: nowrap;
        margin: 24px calc(-1 * var(--pad-x)) 0;
        padding-inline: var(--pad-x);
        overflow-x: auto;
        scrollbar-width: none;
    }

    .discover-products__pills::-webkit-scrollbar {
        display: none;
    }

    .discover-products__grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 32px;
        margin-top: 24px;
    }

    .discover-products__grid > :nth-child(n + 7) {
        display: none;
    }

    .discover-products__more {
        display: block;
        align-self: center;
        margin-top: 24px;
        padding-inline: 30px;
        color: var(--color-primary);
        font-weight: 700;
        line-height: 20.8px;
    }

    .discover-products__more:hover,
    .discover-products__more:focus-visible {
        text-decoration: underline;
    }
}

/* ── Mobile: one row of cards that scrolls sideways ─────────── */
@media (max-width: 767px) {
    .discover-products {
        padding-block: 40px;
    }

    .discover-products__head {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .discover-products__shop {
        display: none;
    }

    .discover-products__shop-link {
        display: inline-flex;
    }

    /* Out to the screen edges, so the cards scroll edge to edge */
    .discover-products__grid {
        display: flex;
        gap: 16px;
        margin: 25px calc(-1 * var(--pad-x)) 0;
        padding: 12px var(--pad-x);
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        scroll-padding-inline: var(--pad-x);
        scrollbar-width: none;
    }

    .discover-products__grid::-webkit-scrollbar {
        display: none;
    }

    .discover-products__grid > * {
        flex: 0 0 min(308px, 82vw);
        scroll-snap-align: start;
    }

    .discover-products__grid > :nth-child(n + 7) {
        display: flex;
    }

    .discover-products__more {
        display: none;
    }
}
