:root{
    --gap: 20px;
    --radius: 16px;
    --border: #eceef3;
    --text: #111;
    --muted: #6b7280;
    --bg: #fff;
    --shadow-sm: 0 1px 2px rgba(0,0,0,.04);
    --shadow-md: 0 8px 18px rgba(0,0,0,.10);
    --primary: var(--primary-yellow, #ffe799);
    --focus: rgba(255,214,77,.45);
}

body {
    background: var(--main-background);
}

.page-search .main-container {
    max-width: none;
}

.page-search .search-layout {
    margin: 0 auto;
}

.search-page-wrapper {
    max-width: 1800px;
    margin: 0 auto;
    padding: 0 24px;
}

/* Fil d'Ariane */
.search-breadcrumb {
    display: flex;
    justify-content: flex-start;
    width: 100%;
    margin-bottom: 24px;
    overflow: hidden;
    /* Décalage pour aligner avec la grille (compense la sidebar + gap) */
    padding-left: 296px;
    box-sizing: border-box;
}
.search-breadcrumb a {
    color: inherit;
    text-decoration: none;
}
.search-breadcrumb a:hover {
    text-decoration: underline;
}

.page-search .product-grid {
    max-width: 1400px;
    margin-inline: auto;
    justify-content: flex-start;
}

.search-layout{
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: 380px 1fr;
    gap: 32px;
    align-items: start;
}

.search-layout--no-sidebar {
    grid-template-columns: 280px 1fr;
    gap: 16px;
}
.search-layout--no-sidebar .search-filters {
    width: 280px;
}

@media (max-width: 1200px){
    .search-layout{
        grid-template-columns: 320px 1fr;
        gap: 24px;
    }
}

@media (max-width: 900px){
    .search-page-wrapper {
        padding: 24px 16px;
    }

    .search-page-title-container {
        font-size: 32px;
        margin-bottom: 24px;
        gap: 12px;
        padding-left: 0;
    }

    .search-breadcrumb {
        padding-left: 0;
    }

    .search-layout{
        grid-template-columns: 1fr
    }
}

.search-filters{
    position: sticky;
    top: 100px;
    align-self: start;
    max-height: calc(100vh - 120px);
}

@media (max-width: 900px){
    .search-filters{
        position: static;
        max-height: none;
    }
}

.filters-form{
    display: flex;
    flex-direction: column;
    gap: 16px;
    height: 100%;
    max-height: inherit;
}

.filter-box{
    padding: 24px 20px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg);
    box-shadow: var(--shadow-sm);
}

.filter-title{
    display: block;
    font-size: 20px;
    font-weight: 800;
    margin-bottom: 16px;
    color: #111;
}

.facet-list{ display: grid; gap: 4px; }

.facet-item{
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 0;
}

.facet-input{
    width: 16px;
    height: 16px;
}

.facet-label{
    color: var(--text);
    font-weight: 600;
    font-size: 14px;
    line-height: 1.4;
}

.facet-count{ color: var(--muted); }

.filter-box:has(.brand-filter-list){
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.brand-filter-list{
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    display: grid;
    gap: 4px;
}

@media (max-width: 900px){
    .filter-box:has(.brand-filter-list){
        flex: none;
    }
    .brand-filter-list{
        max-height: 300px;
        flex: none;
    }
}

.ui-select,
.filters-form input[type="search"],
.filters-form input[type="text"]{
    width: 100%;
    height: 42px;
    padding: 8px 12px;
    border-radius: 12px;
    border: 1px solid #cfd8dc;
    background: #fff;
    transition: border-color .15s ease, box-shadow .15s ease;
    font: inherit;
}

.ui-select:focus,
.filters-form input:focus{
    outline: none;
    border-color: #9aa9b5;
    box-shadow: 0 0 0 3px rgba(154,169,181,.2);
}

.results-area{
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    width: 100%;
}

.results-header{
    width: 100%;
    margin-bottom: 24px;
}

.results-count{
    display: inline-flex;
    align-items: baseline;
    background: var(--primary);
    gap: 10px;
    color: #111;
    border-radius: 12px;
    font-size: 16px;
    padding: 8px 24px;
    box-shadow: var(--shadow-sm);
}

.results-count strong{
    font-size: 28px;
    font-weight: 800;
    line-height: 1;
}

.product-grid{
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    justify-content: flex-start;
    width: 100%;
}

.product-link{
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 14px;
    text-decoration: none;
    color: var(--text);
}

.product-image{
    display: block;
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: contain;
    background: #f5f6f9;
    border-radius: 12px;
}

.product-image.is-placeholder{ opacity: .9; }

.product-name{
    font-weight: 800;
    font-size: 16px;
    line-height: 1.25;
}

.product-price{
    font-weight: 700;
}

/* ===================== Accessibilité Focus ===================== */
*:focus-visible{
    outline: none;
    box-shadow:
            0 0 0 3px rgba(0,0,0,.08),
            0 0 0 6px var(--focus);
    border-radius: 12px;
}

.facet-tree-list{
    list-style: none;
    margin: 0;
    padding-left: 0;
}

.facet-tree-item{
    position: relative;
    padding: 2px 0;
}

.facet-toggle{
    appearance: none;
    border: none;
    background: none;
    cursor: pointer;
    width: 18px;
    height: 18px;
    margin-right: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.facet-toggle::before{
    content: '▸';
    font-size: 14px;
    line-height: 1;
    transform-origin: center;
    transition: transform .15s ease;
    color: #777;
}
.facet-tree-item.is-open > .facet-toggle::before{
    transform: rotate(90deg);
}

.facet-toggle--spacer{
    display: inline-block;
    width: 18px;
    height: 18px;
    margin-right: 6px;
}

.facet-tree > .facet-tree-list > .facet-tree-item > .facet-checkline .facet-label {
    font-weight: 800;
    font-size: 16px;
}

.facet-checkline {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.facet-children{
    display: none;
    padding-left: 18px;
    margin-top: 4px;
}
.facet-children.is-open{
    display: block;
}

.product-grid{
    display: flex;
    flex-wrap: wrap;
    gap: var(--gap);
    justify-content: center;
    max-width: 1600px;
    margin-inline: auto;
}

.product-card{
    flex: 0 0 260px;
    width: 260px;
    box-sizing: border-box;
    list-style: none;
}

.product-card .highlight-card{
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 4px;

    height: 300px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 10px;
    padding: 10px;

    box-shadow: var(--shadow-sm);
    transition: transform .2s ease, box-shadow .2s ease;
}
.product-card .highlight-card:hover{
    transform: translateY(-3px);
    box-shadow: 0 8px 18px rgba(0,0,0,.10);
}

.product-card .highlight-clickable{
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 100%;
    text-decoration: none;
    color: inherit;
}

.product-card .highlight-imgwrap{
    width: 100%;
    aspect-ratio: 16/10;
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
}
.product-card .highlight-imgwrap img{
    width: 100%;
    height: 100%;
    object-fit: contain;
    image-rendering: auto;
    display: block;
}

.product-card .highlight-label{
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    padding: 6px 10px;
    text-align: center;
}
.product-card .highlight-name{
    font-weight: 800;
    font-size: 16px;
    line-height: 1.25;
    min-height: 2.6em;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.product-card .highlight-price{
    color: #de3d41;
    font-weight: 600;
}

.product-card .highlight-actions{
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    justify-content: flex-start;
    gap: 10px;
    padding: 8px;
    background: #fff;
    border-top: 1px solid #eee;
    border-radius: 8px;
}
.product-card .highlight-actions > .qty,
.product-card .highlight-actions > .add-to-cart{
    flex: 1 1 0;
    min-width: 0;
}

@media (max-width: 1500px){
    .product-card{
        flex: 0 0 240px;
        width: 240px;
    }
}

@media (max-width: 1200px){
    .product-card{
        flex: 0 0 260px;
        width: 260px;
    }
}

@media (max-width: 900px){
    .product-card{
        flex: 0 0 280px;
        width: 280px;
    }

    .search-layout--no-sidebar {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 620px){
    .product-card{
        flex: 0 0 100%;
        width: 100%;
        max-width: 100%;
    }
}