/* Recherche Typesense du site (page de résultats) : feuille du prototype backoffice
   (product_search/style.css, prototype supprimé) préfixée par #cc-search pour ne pas toucher au reste du site.
   Charte de la maquette Figma « Search Abtesty » : Montserrat, encre #002342, gris #b1bdc5, fond #f5f5f5. */

#cc-search,
#cc-search * {
    box-sizing: border-box;
}

#cc-search {
    margin: 0;
    background: var(--papier);
    color: var(--encre);
    font: 400 14px/25px var(--sans);
}

#cc-search {
    --encre: #002342;
    --encre-70: rgba(0, 35, 66, 0.7);
    --gris: #b1bdc5;
    --gris-clair: #c7ced3;
    --fond: #f5f5f5;
    --papier: #fffffff5;
    --bouton: #002039;
    --promo: #81020c;
    --sans: 'Montserrat', 'Segoe UI', Helvetica, Arial, sans-serif;
    --side: 221px;
    --pad-x: 47px;
}

#cc-search a {
    color: inherit;
    text-decoration: none;
}

#cc-search button {
    font: inherit;
    color: inherit;
    background: none;
    border: 0;
    padding: 0;
    cursor: pointer;
}

/* le CSS du site met les titres en Lora noir, display:flex et pleine largeur : on reprend la charte de la maquette */
#cc-search h2 {
    display: block;
    width: auto;
    margin: 0;
    font-family: var(--sans);
    font-size: 16px;
    font-weight: 600;
    line-height: 25px;
    letter-spacing: -0.02em;
    text-transform: uppercase;
    color: var(--encre);
}

#cc-search :focus-visible {
    outline: 2px solid var(--encre);
    outline-offset: 2px;
}

#cc-search .sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

#cc-search .upper, #cc-search .block-title, #cc-search .side-title, #cc-search .popular, #cc-search .options, #cc-search .btn, #cc-search .filters-fab {
    text-transform: uppercase;
}

#cc-search .panel {
    max-width: 1410px;
    margin: 15px auto 40px;
    padding: 28px var(--pad-x) 48px;
    background: var(--fond);
}

/* Mode overlay : plein écran au-dessus du site, ouvert par la loupe du header */
#cc-search[data-mode='overlay'] {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 100000;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

#cc-search[data-mode='overlay'].is-open {
    display: block;
}

body.cc-search-open {
    overflow: hidden;
}

#cc-search .overlay-head {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 10px;
}

#cc-search .overlay-close {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

#cc-search .overlay-close img {
    width: 14px;
    height: 14px;
}

#cc-search .overlay-close:hover {
    text-decoration: underline;
    text-underline-offset: 3px;
}

#cc-search .searchbar {
    position: relative;
    display: flex;
    align-items: center;
    gap: 16px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--gris);
}

#cc-search .searchbar-input {
    flex: 1;
    min-width: 0;
    border: 0;
    background: none;
    padding: 0;
    font: 300 34px/40px var(--sans);
    text-transform: uppercase;
    color: var(--encre);
    -webkit-appearance: none;
    appearance: none;
}

#cc-search .searchbar-input::placeholder {
    color: var(--gris);
    opacity: 1;
}

#cc-search .searchbar-input:focus {
    outline: none;
}

#cc-search .searchbar-input::-webkit-search-cancel-button, #cc-search .searchbar-input::-webkit-search-decoration {
    -webkit-appearance: none;
}

#cc-search .searchbar-close {
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
}

#cc-search .searchbar-close img {
    width: 38px;
    height: 38px;
}

#cc-search .autocomplete {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 20;
    margin: 0;
    padding: 6px 0;
    list-style: none;
    background: #fff;
    border: 1px solid var(--gris);
    border-top: 0;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.08);
}

#cc-search .autocomplete li {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 6px 14px;
    font: 400 14px/18px var(--sans);
    color: var(--encre);
    cursor: pointer;
}

#cc-search .autocomplete li.is-active {
    background: #f3f3f3;
}

#cc-search .autocomplete img, #cc-search .autocomplete-noimg {
    width: 36px;
    height: 44px;
    object-fit: cover;
    background: #f0f0f0;
    flex: none;
}

#cc-search .autocomplete mark {
    background: none;
    color: inherit;
    font-weight: 600;
}

#cc-search .lang select {
    padding: 4px 22px 4px 8px;
    border: 1px solid var(--gris);
    background: var(--papier)
        url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'><path d='M1 1l4 4 4-4' fill='none' stroke='%23002342' stroke-width='1.2'/></svg>")
        no-repeat right 8px center;
    font: 500 12px/16px var(--sans);
    color: var(--encre);
    -webkit-appearance: none;
    appearance: none;
}

#cc-search .row-chips {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 10px;
    min-height: 27px;
    margin-top: 9px;
}

#cc-search .row-chips-label {
    white-space: nowrap;
}

#cc-search .chips {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

#cc-search .chip {
    display: inline-flex;
    align-items: center;
    height: 27px;
    padding: 0 10px;
    border-radius: 15px;
    background: var(--papier);
    white-space: nowrap;
}

#cc-search .chip:hover {
    box-shadow: inset 0 0 0 1px var(--gris);
}

#cc-search .chip-history {
    padding-right: 8px;
    gap: 8px;
}

#cc-search .chip-remove {
    display: grid;
    place-items: center;
    width: 10px;
    height: 10px;
}

#cc-search .chip-remove img {
    width: 10px;
    height: 10px;
}

#cc-search .link-small {
    font-size: 12px;
    text-decoration: underline;
    text-underline-offset: 2px;
}

#cc-search .body {
    display: grid;
    grid-template-columns: var(--side) minmax(0, 1fr);
    gap: 32px;
    margin-top: 35px;
}

#cc-search .side-title {
    line-height: 20px;
    margin-bottom: 13px;
}

#cc-search .popular {
    list-style: none;
    margin: 0;
    padding: 0;
    font-size: 13px;
    letter-spacing: -0.02em;
}

/* le CSS du site centre les boutons et annule text-transform (normalize) : on reprend la main */
#cc-search .popular button {
    display: block;
    width: 100%;
    text-align: left;
    text-transform: inherit;
    line-height: 25px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

#cc-search .popular button:hover {
    text-decoration: underline;
    text-underline-offset: 3px;
}

#cc-search .filters-head {
    display: none;
}

/* desktop : le pied du panneau mobile ne garde que « Effacer les filtres », placé en tête de la colonne des facettes */
#cc-search .filters-wrap {
    display: flex;
    flex-direction: column;
}

#cc-search .filters-foot {
    order: -1;
    display: flex;
    justify-content: flex-end;
    line-height: 25px;
    margin-bottom: 8px;
}

#cc-search .filters-foot .btn {
    display: none;
}

#cc-search .facet {
    margin-bottom: 20px;
}

#cc-search .facet summary {
    list-style: none;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 0 6px;
    border-bottom: 1px solid var(--gris);
    font-size: 16px;
    font-weight: 600;
    line-height: 20px;
    letter-spacing: -0.02em;
    text-transform: uppercase;
}

#cc-search .facet summary::-webkit-details-marker {
    display: none;
}

#cc-search .chevron {
    width: 10px;
    height: 21px;
    transform: rotate(-90deg); 
    transition: transform 0.15s;
}

#cc-search .facet[open] .chevron {
    transform: rotate(90deg);
}

#cc-search .options {
    list-style: none;
    margin: 7px 0 0;
    padding: 0;
    font-size: 13px;
    letter-spacing: -0.02em;
}

#cc-search .options.is-columns {
    columns: 2;
    column-gap: 16px;
}

#cc-search .options.is-columns li {
    break-inside: avoid;
}

#cc-search .option {
    display: flex;
    align-items: center;
    gap: 9px;
    line-height: 25px;
}

#cc-search .check {
    flex: none;
    width: 13px;
    height: 13px;
    border: 1px solid var(--gris);
    border-radius: 2px;
    background: var(--papier);
    display: grid;
    place-items: center;
}

#cc-search .option.is-refined .check {
    border-color: var(--encre);
}

#cc-search .option.is-refined .check::after {
    content: '';
    width: 7px;
    height: 7px;
    border-radius: 1px;
    background: var(--encre);
}

#cc-search .option-label {
    flex: 1;
    min-width: 0;
}

#cc-search .option-count {
    font-size: 11px;
    color: var(--gris);
    font-variant-numeric: tabular-nums;
}

#cc-search .swatch {
    flex: none;
    width: 13px;
    height: 13px;
    border-radius: 50%;
    border: 1px solid var(--gris);
}

#cc-search .show-more {
    margin-top: 4px;
    font-size: 12px;
    color: var(--encre-70);
    text-decoration: underline;
    text-underline-offset: 3px;
}

#cc-search .facet-empty {
    display: none;
}

#cc-search .facet:has(.facet-empty) {
    display: none;
}

#cc-search .main {
    min-width: 0;
    grid-column: 2;
}

#cc-search .block-title {
    line-height: 25px;
    margin-bottom: 8px;
}

#cc-search .main > .block + .block {
    margin-top: 32px;
}

#cc-search .sheet {
    background: var(--papier);
    padding: 18px 26px 22px;
}

#cc-search .sheet-empty {
    padding: 30px 40px;
    margin-bottom: 25px;
    text-align: center;
    font-size: 18px;
    line-height: 30px;
}

#cc-search .sheet-empty p {
    margin: 0;
}

#cc-search .link-inline {
    text-decoration: underline;
    text-underline-offset: 3px;
}

#cc-search .results-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

#cc-search .results-count {
    margin-left: 16px;
    font-size: 13px;
    font-weight: 300;
    letter-spacing: -0.02em;
    text-transform: none;
}

#cc-search .results-tools {
    display: flex;
    align-items: center;
    margin-left: auto;
    gap: 24px;
    font-size: 13px;
    letter-spacing: -0.02em;
    text-transform: uppercase;
}

#cc-search .sort .ais-SortBy-select {
    padding: 0 18px 0 0;
    border: 0;
    background: transparent
        url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'><path d='M1 1l4 4 4-4' fill='none' stroke='%23002342' stroke-width='1.2'/></svg>")
        no-repeat right center;
    font: 400 13px/25px var(--sans);
    letter-spacing: -0.02em;
    text-transform: uppercase;
    color: var(--encre);
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
}

#cc-search .grid {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 20px 6px;
}

/* Tuiles rendues par le serveur (DISPLAY_MODE = SMARTY) : grille et tuile du site (product-grid-thin, .product-item de
   cc_gamme_produit.scss), seuls l'espacement et l'état épuisé sont ajustés ici ; squelette le temps du chargement */
#cc-search .server-tiles .product-grid {
    margin-top: 0;
}

/* la tuile doit tenir dans sa colonne : sur les pages de gamme la grille est pleine largeur et le titre tronqué est
   dimensionné en vw ; ici la colonne est plus étroite que l'image native, tout s'aligne sur la largeur de la cellule */
#cc-search .server-tiles .product-grid > .search-tile,
#cc-search .search-tile .product-item,
#cc-search .search-tile .product-item > a,
#cc-search .search-tile .product-thumbnail,
#cc-search .search-tile .text {
    min-width: 0;
    max-width: 100%;
}

#cc-search .search-tile .product-thumbnail img {
    width: 100% !important;
    height: auto;
}

#cc-search .search-tile .title.trunc {
    width: auto;
    max-width: 100%;
}

/* la tuile du site réutilise des noms de classes de l'overlay (h2, .body, .option, .options) : on rend à ces éléments
   les valeurs de la page de gamme (cc_gamme_produit.scss) */
#cc-search .search-tile .text .title {
    margin: 15px 0 0;
    padding-bottom: 10px;
    font: 400 14px/16.953px Montserrat, sans-serif;
    letter-spacing: 0.25px;
    text-transform: none;
    color: #000;
}

#cc-search .search-tile .price-area {
    line-height: 1;
    font-size: 14px;
}

/* pastilles couleur à droite du prix, sur la même ligne (le site pousse .product-detail avec margin-left:auto) */
#cc-search .search-tile .product-detail {
    min-width: 0;
    flex-shrink: 1;
}

#cc-search .search-tile .options,
#cc-search .search-tile .option {
    display: block;
    margin: 0;
    padding: 0;
    font-size: inherit;
    letter-spacing: normal;
    line-height: normal;
}

#cc-search .search-tile .option .body {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    align-items: center;
    gap: 5px;
    margin: 6px 0 0;
    width: auto;
}

#cc-search .search-tile .option .body a {
    display: block;
}

/* barre des tailles au survol : #cc-search a { color: inherit } (sélecteur avec id) écrase les couleurs du site,
   dont le gris des tailles indisponibles */
#cc-search .search-tile .product-size ul a {
    color: #001f37;
    line-height: 18px;
}

#cc-search .search-tile .product-size ul li.disabled a {
    color: lightgrey;
    cursor: not-allowed;
}

#cc-search .server-tiles + .server-tiles .product-grid {
    margin-top: 3rem;
}

#cc-search .search-tile.is-soldout .product-thumbnail {
    opacity: 0.55; /* sur le conteneur : l'image de survol garde son opacity:0 */
}

#cc-search .search-tile.is-soldout .text {
    color: var(--gris, #8a8a8a);
}

#cc-search .tile-skeleton {
    aspect-ratio: 3 / 4;
    background: var(--fond);
    animation: cc-pulse 1.2s ease-in-out infinite;
}

@keyframes cc-pulse {
    50% {
        opacity: 0.45;
    }
}

#cc-search .product-media {
    display: block;
    position: relative;
    aspect-ratio: 3 / 4;
    overflow: hidden;
    background: var(--fond);
}

#cc-search .product-media img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

#cc-search .product-alt {
    opacity: 0;
    transition: opacity 0.25s;
}

#cc-search .product-media:hover .product-alt, #cc-search .product-media:focus-visible .product-alt {
    opacity: 1;
}

#cc-search .product-sizes {
    list-style: none;
    margin: 0;
    padding: 0 6px;
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 2px 10px;
    background: rgba(255, 255, 255, 0.85);
    font-size: 10px;
    line-height: 22px;
    opacity: 0;
    transition: opacity 0.2s;
}

#cc-search .product-media:hover .product-sizes, #cc-search .product-media:focus-visible .product-sizes {
    opacity: 1;
}

#cc-search .product-title {
    margin: 7px 0 0;
    font: 400 11px/16px var(--sans);
    text-transform: none;
    letter-spacing: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

#cc-search .product-title mark, #cc-search .ais-Highlight-highlighted {
    background: none;
    color: inherit;
    font-weight: 600;
}

#cc-search .product-foot {
    margin: 4px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    font-size: 11px;
    line-height: 16px;
}

#cc-search .product-price {
    display: flex;
    gap: 6px;
    align-items: baseline;
    font-weight: 600;
}

#cc-search .product-price.is-promo .price {
    color: var(--promo);
}

#cc-search .price-before {
    color: var(--gris);
    font-weight: 400;
}

#cc-search .product-colors {
    display: flex;
    align-items: center;
    gap: 3px;
}

#cc-search .dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    border: 1px solid var(--gris-clair);
}

#cc-search .dot-more {
    font-size: 9px;
    color: var(--gris);
    margin-left: 1px;
}

#cc-search .sold-out {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 3px 0;
    text-align: center;
    background: rgba(255, 255, 255, 0.85);
    font-size: 10px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

#cc-search .product.is-soldout .product-media img {
    opacity: 0.55;
}

#cc-search .product.is-soldout .product-title, #cc-search .product.is-soldout .product-foot {
    color: var(--gris);
}

/* le .btn du site est en display:flex; width:100% : largeur au contenu ici */
#cc-search .btn {
    display: inline-flex;
    width: auto;
    align-items: center;
    justify-content: center;
    padding: 0 12px;
    height: 36px;
    background: var(--encre);
    color: var(--papier);
    font-size: 14px;
    font-weight: 600;
    letter-spacing: -0.02em;
}

#cc-search .btn-more {
    height: 44px;
    min-width: 227px;
    padding: 0 30px;
    background: var(--bouton);
    font-size: 16px;
    font-weight: 400;
}

#cc-search .more {
    margin: 30px 0 0;
    text-align: center;
}

#cc-search .link-clear {
    font-size: 14px;
    font-weight: 500;
    letter-spacing: -0.02em;
    white-space: nowrap;
    color: var(--gris);
    text-decoration: underline;
    text-underline-offset: 2px;
}

#cc-search .link-clear:disabled {
    opacity: 0.5;
    cursor: default;
}

#cc-search .filters-fab {
    display: none;
}

#cc-search .articles {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 20px 12px;
}

#cc-search .article-card {
    display: block;
    color: inherit;
    text-decoration: none;
}

#cc-search .article-media {
    display: block;
    aspect-ratio: 16 / 10;
    background: var(--fond, #f5f5f5);
    overflow: hidden;
}

#cc-search .article-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

#cc-search .article-title {
    display: block;
    margin: 8px 0 0;
    font: 600 12px/16px var(--sans);
}

#cc-search .article-title mark {
    background: none;
    color: inherit;
    text-decoration: underline;
}

#cc-search .article-chapeau {
    display: -webkit-box;
    margin-top: 4px;
    font: 400 11px/15px var(--sans);
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

#cc-search .autocomplete-group {
    padding: 6px 10px 2px;
    font: 600 10px/14px var(--sans);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--gris);
    cursor: default;
}

#cc-search .autocomplete li.is-article img, #cc-search .autocomplete li.is-article .autocomplete-noimg {
    width: 44px;
    height: 28px;
    object-fit: cover;
}

@media (max-width: 860px) {
    #cc-search .articles {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    #cc-search {
        --pad-x: 15px;
    }

    #cc-search .panel {
        margin: 0;
        padding: 14px var(--pad-x) 40px;
    }

    #cc-search .searchbar {
        gap: 12px;
        padding-bottom: 12px;
    }

    #cc-search .searchbar-input {
        font: 500 15px/20px var(--sans);
    }

    #cc-search .searchbar-close, #cc-search .searchbar-close img {
        width: 24px;
        height: 24px;
    }

    #cc-search .row-chips {
        flex-wrap: nowrap;
        overflow-x: auto;
        scrollbar-width: none;
        margin-top: 9px;
    }

    #cc-search .row-chips::-webkit-scrollbar {
        display: none;
    }

    #cc-search .chips {
        flex-wrap: nowrap;
    }

    #cc-search .body {
        grid-template-columns: 1fr;
        gap: 20px;
        margin-top: 20px;
    }

    #cc-search .body.is-home .side {
        padding: 0 2px;
    }

    #cc-search .main {
        grid-column: auto;
    }

    #cc-search .side-title {
        font-size: 14px;
    }

    #cc-search .sheet {
        padding: 16px 12px 24px;
    }

    #cc-search .grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 28px 14px;
    }

    #cc-search .overlay-head {
        margin-bottom: 4px;
    }

    #cc-search .results-head {
        align-items: flex-start;
        flex-direction: column;
        gap: 10px;
        margin-bottom: 12px;
    }

    #cc-search .results-head .block-title {
        display: block;
        margin-bottom: 0;
    }

    #cc-search .results-count {
        display: block;
        margin: 2px 0 0;
        font-weight: 400;
    }

    #cc-search .product-title {
        margin-top: 9px;
        font-size: 12px;
        line-height: 17px;
    }

    #cc-search .product-foot {
        margin-top: 6px;
        font-size: 12px;
    }

    #cc-search .more {
        margin-top: 24px;
    }

    #cc-search .product-sizes {
        display: none;
    }

    #cc-search .filters-wrap {
        position: fixed;
        inset: 0;
        z-index: 20;
        display: none;
        flex-direction: column;
        padding: 14px 14px 32px;
        background: var(--fond);
        overflow: hidden;
    }

    #cc-search .filters-wrap.is-open {
        display: flex;
    }

    #cc-search .filters-head {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 7px 15px;
        background: var(--papier);
        border-radius: 10px 10px 0 0;
        font-size: 13px;
        letter-spacing: -0.02em;
    }

    #cc-search .filters-close, #cc-search .filters-close img {
        width: 24px;
        height: 24px;
    }

    #cc-search .filters {
        flex: 1;
        min-height: 0;
        overflow-y: auto;
        padding: 20px 15px 10px;
        background: var(--papier);
    }

    #cc-search .filters-foot {
        order: 0;
        display: flex;
        justify-content: space-between;
        align-items: center;
        gap: 12px;
        margin: 0;
        padding: 28px 15px 0;
        background: var(--papier);
        border-top: 1px solid var(--gris);
        border-radius: 0 0 10px 10px;
    }

    #cc-search .filters-foot .btn {
        display: inline-flex;
        flex: none;
        padding: 0 12px;
        font-size: 13px;
        white-space: nowrap;
    }

    #cc-search .filters-fab {
        position: fixed;
        left: 50%;
        bottom: 24px;
        transform: translateX(-50%);
        z-index: 15;
        display: inline-flex;
        align-items: center;
        gap: 2px;
        height: 36px;
        padding: 0 14px 0 12px;
        border-radius: 16px;
        background: var(--encre);
        color: var(--papier);
        font-size: 14px;
        font-weight: 600;
        letter-spacing: -0.02em;
        box-shadow: 0 4px 12px rgba(0, 35, 66, 0.25);
    }

    #cc-search .filters-fab img {
        width: 25px;
        height: 25px;
    }
}

@media (prefers-reduced-motion: reduce) {
    #cc-search .chevron, #cc-search .product-alt, #cc-search .product-sizes {
        transition: none;
    }
}
