/* -- hero -- */
.title-hero-prod { 
    letter-spacing: .2px;
    font-family: 'Montserrat-Bold';
}
.hero-paragraph-prod {
    font-size: .9rem;
    font-family: 'Inter-Regular';
}
.bg-hero-icon-prod { 
    background: radial-gradient(circle,rgba(255, 255, 255, 0.20) 60%, rgba(255, 255, 255, 0.1) 100%, rgba(255, 255, 255, 0.9) 100%);
}
.prod-svg { 
    color: #91a0bc;
}
.text-label { 
    font-family: 'Inter-Regular';
    font-size: .9rem;
    max-width: 5rem;
}
/* -- hero -- */

/* -- products catalog -- */
.products-catalog {
    --products-blue: #0027a0;
    --products-blue-dark: #001d79;
    --products-ink: #3f4866;
    --products-muted: #747c94;
    --products-line: #d8ddef;
    --products-surface: #f7f7fc;
    position: relative;
    background: #fff;
    color: var(--products-ink);
    /* keeps the catalog start clear of the fixed header when scrolled into view */
    scroll-margin-top: 80px;
}

.products-catalog-shell {
    width: min(100% - 40px, 1240px);
    margin: 0 auto;
    padding: 46px 0 90px;
}

/* mobile: holds the featured card above filters and sort (empty on desktop) */
.products-featured-slot:empty {
    display: none;
}

.products-featured-slot {
    margin-bottom: 24px;
}

.products-toolbar {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
    min-height: 42px;
    margin-bottom: 30px;
}

.products-toolbar-filters,
.products-active-filters {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.products-filter-toggle,
.products-filter-chip {
    min-height: 38px;
    border: 0;
    border-radius: 8px;
    background: var(--products-blue);
    color: #fff;
    font-family: 'Inter-Medium';
    font-size: .82rem;
    line-height: 1;
}

.products-filter-toggle {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 0 18px;
    cursor: pointer;
}

.products-filter-toggle svg {
    width: 16px;
    height: 16px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.7;
    stroke-linejoin: round;
}

.products-filter-chip {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 0 12px 0 16px;
}

.products-filter-chip button {
    display: grid;
    place-items: center;
    width: 19px;
    height: 19px;
    border: 0;
    border-radius: 50%;
    background: rgba(255,255,255,.9);
    color: var(--products-blue);
    cursor: pointer;
    font-size: 14px;
    font-weight: 700;
    line-height: 1;
}

.products-sort-wrap {
    position: relative;
    flex: 0 0 auto;
}

.products-sort-wrap::after {
    content: '';
    position: absolute;
    right: 16px;
    top: 50%;
    width: 8px;
    height: 8px;
    border-right: 2px solid #59617b;
    border-bottom: 2px solid #59617b;
    transform: translateY(-68%) rotate(45deg);
    pointer-events: none;
}

.products-sort {
    width: 242px;
    height: 38px;
    appearance: none;
    border: 1px solid #cdd3e7;
    border-radius: 7px;
    background: #fff;
    color: #59617b;
    padding: 0 42px 0 17px;
    font-family: 'Inter-Medium';
    font-size: .8rem;
    cursor: pointer;
}

.products-sort:focus-visible,
.products-filter-toggle:focus-visible,
.products-filter-chip button:focus-visible,
.products-filter-option input:focus-visible + span,
.product-card-cta:focus-visible {
    outline: 3px solid rgba(0, 115, 255, .35);
    outline-offset: 3px;
}

.products-catalog-body {
    display: grid;
    grid-template-columns: 245px minmax(0, 1fr);
    gap: 34px;
    align-items: start;
}

.products-filters-panel {
    position: sticky;
    top: 104px;
}

.products-filters-mobile-head,
.products-filter-backdrop {
    display: none;
}

.products-filter-group {
    margin: 0 0 40px;
    padding: 0;
    border: 0;
}

.products-level-filters .products-filter-group:last-child {
    margin-bottom: 0;
}

.products-filter-group legend {
    margin-bottom: 18px;
    color: var(--products-blue);
    font-family: 'Montserrat-Bold';
    font-size: 1.05rem;
}

.products-filter-options {
    display: grid;
    gap: 15px;
}

/* -- sub-level accordion -- */
.products-filter-accordion {
    margin-bottom: 0;
    border-bottom: 1px solid var(--products-line);
}

.products-filter-accordion legend {
    float: left;
    width: 100%;
    margin-bottom: 0;
}

.products-filter-accordion legend + * {
    clear: both;
}

.products-filter-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    width: 100%;
    padding: 16px 0;
    border: 0;
    background: none;
    color: var(--products-blue);
    font: inherit;
    text-align: left;
    cursor: pointer;
}

.products-filter-heading-text {
    display: grid;
    gap: 4px;
    min-width: 0;
}

/* the chosen option, shown while the group is collapsed */
.products-filter-heading-summary {
    overflow: hidden;
    color: var(--products-muted);
    font-family: 'Inter-Medium';
    font-size: .78rem;
    text-overflow: ellipsis;
    white-space: nowrap;
    transition: opacity .25s ease;
}

.products-filter-heading-summary:empty,
.products-filter-accordion:not(.is-collapsed) .products-filter-heading-summary {
    display: none;
}

.products-filter-heading-chevron {
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #f0f2fb;
    transition: transform .35s cubic-bezier(.45, 0, .15, 1), background .2s ease;
}

.products-filter-heading-chevron svg {
    width: 14px;
    height: 14px;
}

.products-filter-heading:hover .products-filter-heading-chevron {
    background: #e2e6f7;
}

.products-filter-accordion.is-collapsed .products-filter-heading-chevron {
    transform: rotate(-90deg);
}

.products-filter-heading:focus-visible {
    outline: 3px solid rgba(0, 115, 255, .35);
    outline-offset: 3px;
    border-radius: 6px;
}

.products-filter-collapse {
    display: grid;
    grid-template-rows: 1fr;
    transition: grid-template-rows .35s cubic-bezier(.45, 0, .15, 1);
}

.products-filter-collapse-inner {
    min-height: 0;
    overflow: hidden;
    padding-bottom: 18px;
    transition: padding-bottom .35s cubic-bezier(.45, 0, .15, 1), visibility 0s;
}

.products-filter-accordion.is-collapsed .products-filter-collapse {
    grid-template-rows: 0fr;
}

/* hidden options stay out of the tab order once the group is closed */
.products-filter-accordion.is-collapsed .products-filter-collapse-inner {
    padding-bottom: 0;
    visibility: hidden;
    transition: padding-bottom .35s cubic-bezier(.45, 0, .15, 1), visibility 0s linear .35s;
}
/* -- sub-level accordion -- */

.products-filter-option {
    position: relative;
    display: flex;
    align-items: center;
    gap: 11px;
    width: fit-content;
    color: #59617b;
    cursor: pointer;
    font-family: 'Inter-Medium';
    font-size: .8rem;
}

.products-filter-option input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.products-filter-control {
    position: relative;
    flex: 0 0 auto;
    width: 17px;
    height: 17px;
    border: 1.5px solid #b8c0d9;
    border-radius: 50%;
    background: #fff;
    transition: border-color .2s ease, background .2s ease;
}

.products-filter-option input:checked + .products-filter-control {
    border-color: var(--products-blue);
    background: var(--products-blue);
    box-shadow: inset 0 0 0 3px #fff;
}

.products-filter-option:hover {
    color: var(--products-blue);
}

.products-filter-empty {
    color: var(--products-muted);
    font-size: .78rem;
    line-height: 1.5;
}

.products-results {
    min-width: 0;
}

.products-status {
    min-height: 0;
    color: var(--products-muted);
    font-size: .86rem;
}

.products-status:empty {
    display: none;
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 24px;
    /* durations match GRID_FADE_MS / GRID_RESIZE_MS in products.js */
    transition: opacity .2s ease, height .55s cubic-bezier(.45, 0, .15, 1);
}

/* current cards fade out before the new results come in */
.products-grid.is-leaving {
    opacity: 0;
}

.products-item-enter {
    animation: products-item-in .5s cubic-bezier(.22, 1, .36, 1) backwards;
}

/* filter groups that appear after choosing an option */
.products-filter-enter {
    animation: products-item-in .4s ease backwards;
}

@keyframes products-item-in {
    from {
        opacity: 0;
        transform: translateY(14px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.product-card {
    display: flex;
    min-width: 0;
    min-height: 500px;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid rgba(0, 39, 160, .035);
    border-radius: 16px;
    background: var(--products-surface);
    box-shadow: 0 12px 30px rgba(15, 31, 79, .035);
    transition: transform .25s ease, box-shadow .25s ease;
}

.product-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 18px 40px rgba(15, 31, 79, .1);
}

/* flex (not grid): the image's 100% height resolves against this fixed box in
   every browser, so a large photo is scaled down instead of spilling over the text */
.product-card-media {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 258px;
    padding: 26px;
    overflow: hidden;
    background: #f4f5fc;
}

.product-card-media img {
    display: block;
    width: 100%;
    height: 100%;
    min-width: 0;
    min-height: 0;
    object-fit: contain;
    filter: drop-shadow(0 10px 8px rgba(17, 22, 44, .15));
}

.product-card-image-missing {
    display: flex;
    align-items: center;
    flex-direction: column;
    gap: 12px;
    color: #717791;
    font-size: 14px;
    font-weight: 600;
    text-align: center;
}

.product-card-image-missing-icon {
    display: grid;
    place-items: center;
    width: 78px;
    height: 78px;
    border: 1px solid #c9cde0;
    border-radius: 50%;
    background: #fff;
}

.product-card-image-missing-icon svg {
    width: 42px;
    height: 42px;
    fill: none;
    stroke: #9ba1ba;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 2.5;
}

.product-card-body {
    display: flex;
    flex: 1;
    flex-direction: column;
    padding: 27px 28px 29px;
    background: #fafafa;
}

.product-card-category {
    margin: 0 0 6px;
    color: #7c8398;
    font-family: 'Inter-Regular';
    font-size: .76rem;
    line-height: 1.35;
}

.product-card-title {
    margin: 0;
    color: var(--products-blue);
    font-family: 'Montserrat-Bold';
    font-size: 1.35rem;
    line-height: 1.18;
}

.product-card-description {
    display: -webkit-box;
    margin: 12px 0 22px;
    overflow: hidden;
    color: #59617b;
    font-family: 'Inter-Medium';
    font-size: .76rem;
    line-height: 1.48;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
}

.product-card-code {
    margin: auto 0 16px;
    color: #9298a9;
    font-size: .68rem;
    letter-spacing: .04em;
}

/* layout and hover effect come from Tailwind classes set in products.js */
.product-card-cta {
    color: var(--products-blue);
    font-family: 'Inter-Bold';
    font-size: .83rem;
    text-decoration: none;
}

.products-loading-card {
    min-height: 500px;
    overflow: hidden;
    border-radius: 16px;
    background: #f6f7fb;
}

.products-loading-card::before,
.products-loading-card::after {
    content: '';
    display: block;
    background: linear-gradient(90deg, #eef0f6 25%, #f8f9fc 50%, #eef0f6 75%);
    background-size: 200% 100%;
    animation: products-shimmer 1.25s infinite;
}

.products-loading-card::before {
    height: 258px;
}

.products-loading-card::after {
    width: calc(100% - 56px);
    height: 130px;
    margin: 28px;
    border-radius: 8px;
}

.products-message {
    grid-column: 1 / -1;
    padding: 64px 24px;
    border: 1px solid var(--products-line);
    border-radius: 16px;
    background: #fafbff;
    text-align: center;
}

.products-message h3 {
    margin: 0 0 8px;
    color: var(--products-blue);
    font-family: 'Montserrat-Bold';
    font-size: 1.15rem;
}

.products-message p {
    margin: 0;
    color: var(--products-muted);
    font-size: .85rem;
}

.products-message button {
    margin-top: 18px;
    border: 0;
    border-radius: 8px;
    background: var(--products-blue);
    color: #fff;
    padding: 11px 18px;
    cursor: pointer;
    font-family: 'Inter-Medium';
}

@keyframes products-shimmer {
    to { background-position: -200% 0; }
}

/*desktop: filters hidden by default (4 columns), the toggle adds .products-filters-visible (panel + 3 columns) */
@media(min-width:981px) {
    /* the panel column grows from 0 to 245px instead of popping in */
    .products-catalog-body {
        grid-template-columns: 0px minmax(0, 1fr);
        column-gap: 0px;
        transition: grid-template-columns .75s cubic-bezier(.45, 0, .15, 1), column-gap .75s cubic-bezier(.45, 0, .15, 1);
    }

    .products-filters-panel {
        min-width: 0;
        overflow: hidden;
        opacity: 0;
        visibility: hidden;
        transform: translateX(-10px);
        transition: opacity .45s ease, transform .75s cubic-bezier(.45, 0, .15, 1), visibility 0s linear .75s;
    }

    /* fixed width so the filter text doesn't rewrap while the column grows */
    .products-filters-panel > * {
        width: 245px;
    }

    .products-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
        animation: products-grid-reflow-a .6s ease;
    }

    .products-filters-visible .products-catalog-body {
        grid-template-columns: 245px minmax(0, 1fr);
        column-gap: 34px;
    }

    .products-filters-visible .products-filters-panel {
        opacity: 1;
        visibility: visible;
        transform: translateX(0);
        transition: opacity .6s ease .2s, transform .75s cubic-bezier(.45, 0, .15, 1), visibility 0s;
    }

    /* switching animation name restarts the fade each time the columns change */
    .products-filters-visible .products-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        animation: products-grid-reflow-b .6s ease;
    }
}

@keyframes products-grid-reflow-a {
    from { opacity: .6; }
    to { opacity: 1; }
}

@keyframes products-grid-reflow-b {
    from { opacity: .6; }
    to { opacity: 1; }
}

/* -- products catalog -- */


/*------------------ RESPONSIVE ------------------*/
@media(max-width:980px) {
    /* -- hero -- */
    .title-hero-prod { 
        font-size: 2rem;
        max-width: none;
    }
    .hero-paragraph-prod {
        font-size: 1.2rem;
    }
    .text-label { 
        font-size: 1rem;
        max-width: 5rem;
    }
    /* -- hero -- */

    .products-catalog-shell {
        width: min(100% - 32px, 940px);
        padding: 42px 0 72px;
    }

    .products-filter-toggle {
        display: inline-flex;
    }

    .products-catalog-body {
        grid-template-columns: 1fr;
        gap: 0;
    }

    .products-filter-backdrop {
        position: fixed;
        inset: 0;
        z-index: 59990;
        border: 0;
        background: rgba(4, 12, 38, .45);
        opacity: 0;
        pointer-events: none;
        transition: opacity .25s ease;
    }

    .products-filters-panel {
        position: fixed;
        z-index: 60000;
        inset: 0 auto 0 0;
        display: block;
        width: min(340px, 88vw);
        overflow-y: auto;
        background: #fff;
        padding: 26px 24px;
        transform: translateX(-102%);
        transition: transform .25s ease;
        box-shadow: 18px 0 45px rgba(7, 20, 58, .18);
    }

    .products-filters-open .products-filter-backdrop {
        display: block;
        opacity: 1;
        pointer-events: auto;
    }

    .products-filters-open .products-filters-panel {
        transform: translateX(0);
    }

    .products-filters-mobile-head {
        display: flex;
        align-items: center;
        justify-content: space-between;
        margin-bottom: 32px;
        color: var(--products-blue);
        font-family: 'Montserrat-Bold';
        font-size: 1.1rem;
    }

    .products-filter-close {
        display: grid;
        place-items: center;
        width: 34px;
        height: 34px;
        border: 0;
        border-radius: 50%;
        background: #f0f2fb;
        color: var(--products-blue);
        cursor: pointer;
        font-size: 1.5rem;
    }

    .products-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media(max-width:560px) {
    /* -- hero -- */
    .title-hero-prod { 
        font-size: 2rem;
        max-width: 16rem;
    }
    .hero-paragraph-prod {
        font-size: 1.2rem;
    }
    .text-label { 
        font-size: 1rem;
        max-width: 5rem;
    }
    /* -- hero -- */

    .products-catalog-shell {
        width: min(100% - 28px, 540px);
        padding: 30px 0 58px;
    }

    .products-toolbar {
        display: grid;
        grid-template-columns: 1fr;
        gap: 14px;
        margin-bottom: 22px;
    }

    .products-toolbar-filters {
        align-items: flex-start;
    }

    .products-filter-toggle {
        flex: 0 0 auto;
    }

    .products-active-filters {
        flex: 1 1 170px;
    }

    .products-sort-wrap,
    .products-sort {
        width: 100%;
    }

    .products-grid {
        grid-template-columns: 1fr;
        gap: 18px;
    }

    .product-card {
        min-height: 470px;
    }

    .product-card-media {
        height: 245px;
    }

    .product-card-body {
        padding: 24px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .product-card,
    .product-card-cta > span,
    .products-catalog-body,
    .products-filters-panel,
    .products-filter-backdrop,
    .products-filter-heading-chevron,
    .products-filter-collapse,
    .products-filter-collapse-inner {
        transition: none;
    }

    .products-grid,
    .products-item-enter,
    .products-filter-enter {
        animation: none;
    }

    .products-grid {
        transition: none;
    }

    .products-loading-card::before,
    .products-loading-card::after {
        animation: none;
    }
}
