/* ARchive title */
#p2p-product-gallery-title {
    display: flex;
    flex-direction: row-reverse;
    align-items: center;
    gap: 1rem;
}

.p2p-archive-title-prefix {
    font-size: 0.75rem;
    font-weight: 400;
    text-transform: uppercase;
}

.p2p-archive-title-main {
    font-size: 2rem;
    font-weight: 700;
}


/* Product gallery toolbar */

.p2p-product-gallery-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.p2p-product-gallery-toolbar h2 {
    margin: 0;
}

.p2p-product-sort {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-left: auto;
}

.p2p-product-sort label {
    white-space: nowrap;
}

.p2p-product-sort-select {
    max-width: 100%;
    padding: 0.5rem 2rem 0.5rem 0.75rem;
}

/* Responsive layout */

/* Below lg: title on its own row, then the Filter button and sorting. */
@media (max-width: 991.98px) {

    .p2p-product-gallery-toolbar {
        flex-wrap: wrap;
    }

    #p2p-product-gallery-title {
        flex-basis: 100%;
    }

}

@media (max-width: 575.98px) {

    .p2p-archive-title-main {
        font-size: 1.5rem;
    }

    .p2p-product-gallery-toolbar {
        gap: 0.75rem;
        margin-bottom: 1rem;
    }

    .p2p-product-sort {
        flex: 1;
        min-width: 0;
    }

    .p2p-product-sort-select {
        flex: 1;
        min-width: 0;
    }

}


/* Load more button */

.p2p-load-more-wrapper {
    display: flex;
    justify-content: center;
    margin: 2rem 0;
}

.p2p-load-more-wrapper[hidden] {
    display: none;
}

.p2p-load-more-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 2rem;
    cursor: pointer;
}

.p2p-load-more-button:disabled {
    opacity: 0.5;
    cursor: wait;
}

/*
 * Scrolling to the product grid (category bar on the front page) stops
 * below the fixed header instead of hiding the heading behind it.
 */
#product-gallery {
    scroll-margin-top: 9rem;
}

/* The heading receives focus after a category change; no focus ring needed. */
[data-p2p-gallery-title]:focus {
    outline: none;
}

@media (max-width: 991.98px) {
    #product-gallery {
        scroll-margin-top: 7rem;
    }
}
