/*
 * GD Product Category widget — section layout and responsive grid.
 * Depends on gd-colors.css for --gd-* custom properties.
 */

.gd-product-category__section {
    padding-bottom: 3rem;
    margin-bottom: 3rem;
    position: relative;
    scroll-margin-top: var(--gd-scroll-offset, 2rem);
}

/* Full-bleed background: stretches to full viewport width while content stays in place */
.gd-product-category__section::before {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100vw;
    background: linear-gradient(to bottom, var(--gd-white, #ffffff) 0%, var(--gd-grey-light, #EAECE9) 100%);
    z-index: -1;
}

/*
 * Last section: the background stays on the sand-gray color below the section as well,
 * instead of falling back to white in the gap that separates sections.
 * The pseudo-element is extended over the section's bottom margin (3rem), and the
 * gradient reaches sand-gray right where the section content ends.
 */
.gd-product-category__section:last-of-type::before {
    bottom: -3rem;
    background: linear-gradient(
        to bottom,
        var(--gd-white, #ffffff) 0%,
        var(--gd-grey-light, #EAECE9) calc(100% - 3rem),
        var(--gd-grey-light, #EAECE9) 100%
    );
}
/* Section head: GD h3 title + optional crosslink, side by side */
.gd-product-category__section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.gd-product-category__subcat-desc {
    max-width: 800px;
    margin-bottom: 2rem;
    color: var(--gd-dark-blueish-grey, #3B4F5B);
}

.gd-product-category__grid {
    display: grid;
    gap: 1.5rem;
    row-gap: 2.5rem;
    padding: 0;
    margin: 0;
    list-style: none;
}

@media ( max-width: 1024px ) {
    .gd-product-category__grid {
        row-gap: 2.5rem;
    }
}

@media ( max-width: 768px ) {
    .gd-product-category__grid {
        row-gap: 1.5rem;
    }
}


.gd-product-category__grid--cols-2 { grid-template-columns: repeat(2, 1fr); }
.gd-product-category__grid--cols-3 { grid-template-columns: repeat(3, 1fr); }
.gd-product-category__grid--cols-4 { grid-template-columns: repeat(4, 1fr); }

@media ( max-width: 1024px ) {
    .gd-product-category__grid--cols-4 {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media ( max-width: 768px ) {
    .gd-product-category__grid--cols-3,
    .gd-product-category__grid--cols-4 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media ( max-width: 480px ) {
    .gd-product-category__grid--cols-2,
    .gd-product-category__grid--cols-3,
    .gd-product-category__grid--cols-4 {
        grid-template-columns: 1fr;
    }
}
