/* ==========================================================================
   Product list page
   Loaded after main.css via @stack('style'), so it overrides at equal
   specificity. Values are kept in step with product_details.css so the
   listing header and the detail header read as the same design.
   ========================================================================== */

/* --------------------------------------------------------------------------
   Page header - breadcrumb / title / description
   -------------------------------------------------------------------------- */

.product-list__header {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-bottom: 28px;
}

.product-list__crumbs {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    font-size: .875rem;
    line-height: 1.4;
    color: hsl(var(--text-mute));
}

.product-list__crumbs a {
    color: hsl(var(--text-mute));
    text-decoration: none;
    transition: color .2s;
}

.product-list__crumbs a:hover,
.product-list__crumbs a:focus {
    color: hsl(var(--base));
}

.product-list__crumbs__sep {
    color: hsl(var(--border-color));
}

.product-list__crumbs__current {
    color: hsl(var(--heading-color));
    font-weight: 500;
}

/* the theme's bare h1 is 3.75rem; match the product title instead so the
   listing heading never outweighs the products it lists */
.product-list__title {
    margin-bottom: 0;
    font-size: 2.5rem;
    font-weight: 700;
    line-height: 1.15;
    letter-spacing: -.02em;
}

@media screen and (max-width: 1199px) {
    .product-list__title {
        font-size: 2rem;
    }
}

@media screen and (max-width: 991px) {
    .product-list__title {
        font-size: 1.5rem;
    }
}

.product-list__desc {
    margin-bottom: 0;
    max-width: 640px;
    font-size: 1rem;
    line-height: 1.7;
    color: hsl(var(--text-mute));
}

/* --------------------------------------------------------------------------
   Category chips
   Surfaces product_categories.icon, which had no frontend representation.
   -------------------------------------------------------------------------- */

.product-list__chips {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 24px;
    padding: 0;
    list-style: none;
}

.product-list__chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 16px;
    border-radius: 12px;
    border: 1px solid hsl(var(--border-color));
    background-color: hsl(var(--white));
    color: hsl(var(--heading-color));
    font-family: var(--heading-font);
    font-size: .9375rem;
    font-weight: 600;
    line-height: 1.2;
    text-decoration: none;
    transition: .2s ease-in-out;
}

.product-list__chip:hover,
.product-list__chip:focus-visible {
    border-color: hsl(var(--base));
    color: hsl(var(--base));
}

.product-list__chip i {
    font-size: 1.125rem;
    line-height: 1;
    color: hsl(var(--base));
    transition: color .2s ease-in-out;
}

.product-list__chip__count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    padding: 2px 6px;
    border-radius: 6px;
    background-color: hsl(var(--border-color-three));
    color: hsl(var(--text-mute));
    font-size: .75rem;
    font-weight: 600;
    line-height: 1.4;
    transition: .2s ease-in-out;
}

.product-list__chip.is-active {
    border-color: hsl(var(--base));
    background-color: hsl(var(--base));
    color: hsl(var(--white));
}

.product-list__chip.is-active i,
.product-list__chip.is-active .product-list__chip__count {
    color: hsl(var(--white));
}

.product-list__chip.is-active .product-list__chip__count {
    background-color: hsl(var(--white) / .22);
}

@media screen and (max-width: 575px) {
    .product-list__chip {
        padding: 8px 12px;
        font-size: .875rem;
    }
}

/* --------------------------------------------------------------------------
   Result summary + active filters
   -------------------------------------------------------------------------- */

.product-list__summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 24px;
}

.product-list__count {
    margin-bottom: 0;
    font-size: .9375rem;
    color: hsl(var(--text-mute));
}

.product-list__count strong {
    color: hsl(var(--heading-color));
    font-weight: 700;
}

.product-list__applied {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.product-list__applied__chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 5px 10px;
    border-radius: 8px;
    background-color: hsl(var(--base) / .1);
    color: hsl(var(--base));
    font-size: .8125rem;
    font-weight: 600;
    line-height: 1.4;
    text-decoration: none;
}

.product-list__applied__chip:hover,
.product-list__applied__chip:focus-visible {
    background-color: hsl(var(--base) / .18);
    color: hsl(var(--base));
}

.product-list__applied__chip i {
    font-size: .75rem;
}

.product-list__clear {
    font-size: .875rem;
    font-weight: 600;
    color: hsl(var(--text-mute));
    text-decoration: underline;
    text-underline-offset: 3px;
    transition: color .2s;
}

.product-list__clear:hover,
.product-list__clear:focus-visible {
    color: hsl(var(--base));
}

/* --------------------------------------------------------------------------
   Sort dropdown (select2)
   The dropdown is appended to <body>, so it can't be scoped by ancestor - but
   this stylesheet only loads on the product list page, so these overrides
   can't leak elsewhere.
   -------------------------------------------------------------------------- */

/* main.css:1034 puts 10px on the open container and main.css:12577 another 8px
   on the dropdown, leaving the options list floating 18px below the control */
.select2-container--open:has(.select2-dropdown--below) {
    margin-top: 0;
}

.select2-dropdown--below {
    margin-top: 4px !important;
}

/* --------------------------------------------------------------------------
   Filter bar - full width and stacked on small screens
   -------------------------------------------------------------------------- */

@media screen and (max-width: 767px) {
    .product-page .filter-header {
        flex-wrap: wrap;
        gap: 12px;
    }

    .product-page .filter-header__left {
        max-width: 100%;
        width: 100%;
    }

    .product-page .filter-header__right {
        width: 100%;
        justify-content: stretch;
    }

    /* main.css:8229 caps this at 380px, which leaves it short of the search box */
    .product-page .filter-header__right-select {
        max-width: 100%;
        min-width: 0;
        width: 100%;
    }

    /* select2 writes a computed pixel width inline at init and never recomputes */
    .product-page .filter-header__right-select .select2-container {
        width: 100% !important;
    }
}

/* --------------------------------------------------------------------------
   Empty state (was an inline <style> block in the Blade)
   -------------------------------------------------------------------------- */

.empty-message {
    max-width: 150px;
}
