/**
 * Barre de filtres du catalogue des châteaux :
 *  - barre collante (sticky) une fois le hero passé,
 *  - bascule de vue + recherche,
 *  - tiroir « Tous les filtres » glissant depuis la droite.
 * Reprend le style « pills » du thème (gris arrondi).
 */

/* Barre collante -------------------------------------------------------- */
/* NB : le thème pose `overflow-x: hidden` sur le body, ce qui casse
   `position: sticky`. On passe donc en `position: fixed` piloté au
   défilement (classe .is-fixed ajoutée par FilterCastle.js une fois le
   hero dépassé), avec un « spacer » pour éviter le saut de contenu. */
.page-template-chateaux .search-chateaux,
.page-template-chateaux .type-section-space-200.search-chateaux {
    background: #fff;
    transition: box-shadow 0.2s ease;
    /* Remplace le height: 8rem du master.css (trop haut). */
    height: auto !important;
    min-height: 0;
    padding-top: 8px;
    padding-bottom: 8px;
    top: auto;
}

.page-template-chateaux .search-chateaux.is-fixed {
    position: fixed;
    left: 0;
    right: 0;
    z-index: 40;
    padding-top: 8px;
    padding-bottom: 8px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.08);
}

.page-template-chateaux .chateaux-bar-spacer {
    height: 0;
}

.page-template-chateaux .chateaux-filter-bar {
    position: relative;
}

.page-template-chateaux .chateaux-filter-bar .filtre-section {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.page-template-chateaux .view-tabs {
    display: flex;
    gap: 6px;
}

/* Pills ----------------------------------------------------------------- */
.page-template-chateaux .filter-pill {
    all: unset;
    box-sizing: border-box;
    font-family: var(--font-first, inherit);
    background-color: #F5F5F5;
    border-radius: 30px;
    cursor: pointer;
    font-size: 13px;
    line-height: 1;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 14px;
    color: #1F2749;
    transition: background-color 0.2s ease, color 0.2s ease;
    white-space: nowrap;
}

.page-template-chateaux .filter-pill:hover {
    background-color: #e7e8ee;
}

.page-template-chateaux .filter-pill.is-active {
    background-color: #1F2749;
    color: #fff;
}

.page-template-chateaux .search-form {
    flex: 1 1 240px;
    min-width: 200px;
    margin: 0;
}

.page-template-chateaux .search-input {
    box-sizing: border-box;
    width: 100%;
    height: 34px;
    border: none;
    border-radius: 30px;
    background-color: #F5F5F5;
    padding: 0 16px;
    font-family: var(--font-first, inherit);
    font-size: 13px;
    color: #1F2749;
    outline: none;
}

.page-template-chateaux .search-input::placeholder {
    color: rgba(31, 39, 73, 0.5);
}

.page-template-chateaux .all-filters {
    margin-left: auto;
}

/* Voile ----------------------------------------------------------------- */
.page-template-chateaux .filters-overlay {
    position: fixed;
    inset: 0;
    z-index: 100000;
    background: rgba(31, 39, 73, 0.35);
    opacity: 0;
    transition: opacity 0.25s ease;
}

.page-template-chateaux .filters-overlay.is-open {
    opacity: 1;
}

.page-template-chateaux .filters-overlay[hidden] {
    display: none;
}

/* Tiroir de filtres ----------------------------------------------------- */
.page-template-chateaux .filters-drawer {
    position: fixed;
    top: 0;
    right: 0;
    z-index: 100001;
    height: 100vh;
    height: 100dvh;
    width: min(440px, 92vw);
    background: #fff;
    box-shadow: -12px 0 40px rgba(0, 0, 0, 0.15);
    transform: translateX(100%);
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
}

.page-template-chateaux .filters-drawer.is-open {
    transform: translateX(0);
}

.page-template-chateaux .filters-drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 24px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    flex-shrink: 0;
}

.page-template-chateaux .filter-group-title {
    font-size: 13px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #1F2749;
    font-weight: 600;
    margin: 0;
}

.page-template-chateaux .filters-close {
    all: unset;
    cursor: pointer;
    font-size: 26px;
    line-height: 1;
    color: #1F2749;
    padding: 0 4px;
}

.page-template-chateaux .filters-drawer-body {
    flex: 1 1 auto;
    overflow-y: auto;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 28px;
}

.page-template-chateaux .facet-title {
    font-weight: 600;
    color: #1F2749;
    margin: 0 0 12px;
    font-size: 15px;
}

.page-template-chateaux .filter-facet ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.page-template-chateaux .facet-letters {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.page-template-chateaux .facet-option {
    all: unset;
    box-sizing: border-box;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    width: 100%;
    padding: 9px 12px;
    border-radius: 8px;
    font-size: 14px;
    color: #1F2749;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.page-template-chateaux .filter-facet > ul > li + li .facet-option {
    border-top: 1px solid rgba(0, 0, 0, 0.06);
    border-radius: 0;
}

.page-template-chateaux .facet-letters .facet-option {
    width: auto;
    min-width: 46px;
    justify-content: center;
    border-radius: 30px;
    border: none;
    background-color: #F5F5F5;
}

.page-template-chateaux .facet-option:hover {
    background-color: #eef0f6;
}

.page-template-chateaux .facet-option.is-active {
    background-color: #1F2749;
    color: #fff;
}

.page-template-chateaux .facet-option span {
    font-size: 12px;
    opacity: 0.55;
}

.page-template-chateaux .facet-option.is-active span {
    opacity: 0.85;
}

.page-template-chateaux .filters-drawer-footer {
    padding: 20px 24px;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
}

.page-template-chateaux .filters-drawer-footer .facet-reset {
    display: block;
    width: 100%;
    text-align: center;
    cursor: pointer;
}

/* Surbrillance de la facette ciblée à l'ouverture. */
.page-template-chateaux .filter-facet.is-target .facet-title {
    color: #b18b46;
}

.page-template-chateaux .chateaux-no-result {
    padding-top: 40px;
    padding-bottom: 40px;
    text-align: center;
}

/* Blocage du scroll de la page quand le tiroir est ouvert. */
body.chateaux-drawer-open {
    overflow: hidden;
}
