/* Collection listing page styles. Extracted from Views/CollectionListing/Index.cshtml.
   Shared filter-panel styles live in search.css; this file is page-specific only. */

    .collection-listing-page {
        font-family: "sofia-pro", sans-serif;
    }

    .collection-listing-page .collection-breadcrumb {
        font-size: 0.875rem;
        margin: 24px 0 10px;
        color: #7392b5;
        text-transform: none;
    }

    .collection-listing-page .collection-breadcrumb a {
        color: #7392b5;
        text-decoration: none;
        text-transform: none;
    }

    .collection-listing-page .collection-breadcrumb span {
        margin: 0 4px;
    }

    .collection-listing-page .categoryTitle {
        padding: 0;
    }

    .collection-listing-page .categoryTitle h1 {
        margin: 0 0 20px;
        font-family: "sofia-pro", sans-serif;
        font-size: 2.75rem;
        font-weight: 600;
        line-height: 1.1;
        color: #1a324e;
        text-transform: none;
    }

    .collection-listing-page .collection-mobile-toolbar {
        margin-bottom: 12px;
    }

    .collection-listing-page .collection-shell {
        display: grid;
        grid-template-columns: 220px minmax(0, 1fr);
        gap: 26px;
        align-items: flex-start;
    }

    .collection-listing-page #SidebarSelectedCount {
        font-weight: 400;
    }

    .collection-listing-page .filter-chip.js-clear-all[disabled] {
        display: none;
    }

    .collection-listing-page .productList {
        margin: 0;
        padding-left: 0;
        padding-right: 0;
        background: transparent;
    }

    .collection-listing-page .productList > div {
        padding-left: 0;
        padding-right: 0;
    }

    .collection-listing-page .no-filter-options {
        color: #6c757d;
        font-size: 1rem;
        padding: 8px 0 0;
    }

    .collection-listing-page .productList {
        display: flex;
        flex-wrap: wrap;
        margin-left: -12px;
        margin-right: -12px;
    }

    .collection-listing-page .productList .productBlock {
        width: 25% !important;
        max-width: 25% !important;
        flex: 0 0 25% !important;
        padding: 12px;
        transition: all 0.3s ease;
        position: relative;
        display: flex;
        justify-content: center;
        text-align: center;
        box-sizing: border-box;
    }

    .collection-listing-page .productList .productBlock:hover {
        background: transparent;
    }

    .collection-listing-page .productList .productBlock .icons {
        position: absolute;
        right: 20px;
        top: 16px;
        z-index: 800;
        display: flex;
        align-items: center;
        gap: 4px;
    }

    .collection-listing-page #SelectedFilterChipsDesktop:not(:has(.filter-chip)) {
        display: none;
    }

    /* The bordered box. Carries the card chrome that used to live on the <a>, so the main
       link and the swatch links can both sit inside it as siblings. */
    .collection-listing-page .productList .productBlock .product-card {
        position: relative;
        background: transparent;
        display: flex;
        flex: 1;
        flex-flow: column;
        min-height: 200px;
        padding: 6px 8px 12px;
        border: solid 1px #e7e9ec;
        box-shadow: 0px 0px 6px 0px rgba(0, 0, 0, 0.1);
    }

    .collection-listing-page .productList .productBlock .product-card-main {
        position: relative;
        display: flex;
        flex: 1;
        flex-flow: column;
        color: black;
        text-decoration: none;
    }

    /* 2021.css carries "#category .row.productList .productBlock a", which styles EVERY
       anchor in a product block as though it were the card itself (border, shadow, flex:1).
       It's an ID selector, so it outranks any plain class rule here - both the main link and
       the swatch links have to out-specify it to opt out. Matching the ID keeps these ahead
       of it; dropping the #category prefix silently re-breaks the cards.

       The :hover variant is listed separately and is not redundant: 2021.css also has
       "#category ... .productBlock a:hover { box-shadow: ... }" at (1,4,2), which outranks
       the plain selector below at (1,4,1). Without the :hover form the inner link grows its
       own glow on hover and the card appears to have a second box inside it. */
    #category .row.productList .productBlock a.product-card-main,
    #category .row.productList .productBlock a.product-card-main:hover {
        border: 0;
        box-shadow: none;
        padding-bottom: 0;
    }

    /* That same 2021.css rule also gives every product-block anchor the card's ::before /
       ::after overlay panels - a white ::after at z-index 1. On a 16px swatch that paints
       straight over the color and leaves only the border, so the dots render as donuts.
       The card overlay now belongs solely to .product-card, so switch it off on both
       anchors. */
    #category .row.productList .productBlock a.product-card-main::before,
    #category .row.productList .productBlock a.product-card-main::after,
    #category .row.productList .productBlock a.product-swatch::before,
    #category .row.productList .productBlock a.product-swatch::after {
        display: none;
        content: none;
    }

    .collection-listing-page .productList .productBlock .product-card::before {
        display: block;
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        content: "";
        background: rgba(252, 186, 64, 0.3);
        z-index: 1;
    }

    .collection-listing-page .productList .productBlock .product-card::after {
        display: block;
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        content: "";
        background: #fff;
        z-index: 1;
        transition: all 0.2s ease;
    }

    .collection-listing-page .productList .productBlock .product-card:hover {
        text-decoration: none;
        box-shadow: 0px 0px 12px 0px rgba(0, 0, 0, 0.1);
        border-color: rgba(252, 186, 64, 0.3);
    }

    .collection-listing-page .productList .productBlock .product-card:hover::after {
        top: 3px;
        left: 3px;
        width: calc(100% - 6px);
        height: calc(100% - 6px);
    }

    .collection-listing-page .productList .productBlock .product-card-main img {
        max-width: 145px !important;
        width: auto !important;
        height: auto;
        position: relative;
        z-index: 500;
        margin: 3px auto 10px;
    }

    .collection-listing-page .productList .productBlock .product-card-main > div:first-of-type {
        position: relative;
        z-index: 500;
        font-size: 1rem;
        font-weight: 600;
        color: black;
        margin-bottom: 4px;
    }

    .collection-listing-page .productList .productBlock .product-card-main div {
        text-align: center;
        font-size: 0.875rem;
        position: relative;
        z-index: 500;
    }

    .collection-listing-page .productList .productBlock .product-card-main div:last-child {
        font-size: 1rem;
        font-weight: 600;
        color: #1f1f1f;
    }

    /* Pagination layout â€” button styles handled by .search-pagination in search.css */
    .collection-listing-page .collection-pagination {
        margin-top: 22px;
    }

    @media (max-width: 991px) {
        .collection-listing-page .collection-results-toolbar {
            display: none !important;
        }

        .collection-listing-page .search-toolbar {
            display: none;
        }

        .collection-listing-page .categoryTitle h1 {
            font-size: 2.15rem;
        }

        .collection-listing-page .collection-shell {
            display: block;
            position: relative;
        }

        .collection-listing-page .productList .productBlock {
            width: 33.333333% !important;
            max-width: 33.333333% !important;
            flex: 0 0 33.333333% !important;
            padding: 8px;
        }
    }

    @media (max-width: 767px) {
        .collection-listing-page .categoryTitle h1 {
            font-size: 1.85rem;
        }

        .collection-listing-page .collection-pagination .page-number.mobile-page-hidden {
            display: none;
        }

        .collection-listing-page .productList .productBlock {
            width: 50% !important;
            max-width: 50% !important;
            flex: 0 0 50% !important;
        }

        .collection-listing-page .productList .productBlock .product-card {
            min-height: 180px;
        }
    }

    /* z-index clears the card's ::after hover overlay (z-index 1), same trick the card's
       own text uses. */
    .collection-listing-page .productList .productBlock .product-swatches {
        position: relative;
        z-index: 500;
        display: flex;
        flex-wrap: wrap;
        gap: 6px;
        justify-content: center;
        margin-top: 16px;
    }

    /* #category prefix for the same reason as .product-card-main above - without it the
       swatches inherit the card's flex:1 and stretch into full-width bars. */
    #category .row.productList .productBlock a.product-swatch {
        display: inline-block;
        flex: 0 0 auto;
        width: 16px;
        height: 16px;
        padding: 0;
        border-radius: 50%;
        /* No inset ring here - at 16px a 1px inset eats a quarter of the radius and the
           dots read as donuts rather than solid color. */
        border: 1px solid rgba(0,0,0,0.3);
        /* Explicit none, or the card's outer glow from 2021.css leaks onto each dot. */
        box-shadow: none;
        transition: transform .12s ease, box-shadow .12s ease;
    }

    #category .row.productList .productBlock a.product-swatch:hover,
    #category .row.productList .productBlock a.product-swatch:focus-visible {
        transform: scale(1.18);
        box-shadow: 0 0 0 2px #215ea4;
        outline: none;
    }

