.halles-map {
    width: 100%;
    box-sizing: border-box;
    padding: clamp(1.25rem, 4vw, 3rem);
    margin-block: 2rem;
    background: #edf2ec;
    color: #243f34;
}
.halles-map h2 { text-align: center; margin: 0 0 1rem; }
.halles-map-filters {
    display: flex;
    flex-wrap: wrap;
    gap: .85rem;
    max-width: 56rem;
    margin-inline: auto;
}
.halles-map-filters label { flex: 1 1 12rem; min-width: 0; font-weight: 600; }
.halles-map-filters :is(input, select) {
    display: block;
    width: 100%;
    box-sizing: border-box;
    margin-top: .25rem;
    min-height: 2.75rem;
    padding: .5rem;
    border: 1px solid #667d70;
    border-radius: .35rem;
    background: white;
    color: #243f34;
}
.halles-map-status { text-align: center; margin: .6rem 0; }
.halles-map-figure { position: relative; width: min(100%, 485px); margin: auto; }
.halles-map-figure > img:first-child { display: block; width: 100%; height: auto; }
.halles-map-pin {
    position: absolute;
    left: var(--x);
    top: var(--y);
    transform: translate(-50%, -50%);
    display: grid;
    place-items: center;
    width: clamp(21px, 4vw, 29px);
    aspect-ratio: 1;
    border: 1px solid #fff;
    border-radius: 50%;
    padding: 0;
    font: 700 .75rem/1 system-ui, sans-serif;
    background: #234738;
    color: white;
    box-shadow: 0 1px 4px #0007;
    cursor: pointer;
}
.halles-map-pin[data-traders=""] { background: #58635f; }
.halles-map-pin:is(.is-selected, :focus-visible, [aria-expanded="true"]) {
    background: #ffdf87;
    color: #172c23;
    transform: translate(-50%, -50%) scale(1.15);
    box-shadow: 0 0 0 2px #263d32;
    z-index: 1;
}
.halles-map-pin[hidden], .halles-map-popup[hidden] { display: none; }
.halles-map-popup {
    position: absolute;
    z-index: 2;
    width: min(15rem, calc(100% - 1rem));
    box-sizing: border-box;
    padding: .85rem 2rem .85rem .85rem;
    border-top: 3px solid #aa792d;
    background: white;
    border-radius: .35rem;
    box-shadow: 0 4px 20px #0004;
    color: #243f34;
    line-height: 1.35;
}
.halles-map-popup p { margin: .3rem 0; }
.halles-map-popup a { color: #254e3b; text-decoration: underline; }
.halles-map-popup img { display: block; width: 2.5rem; height: 2.5rem; object-fit: contain; }
.halles-map-popup article + article { margin-top: .6rem; border-top: 1px solid #ccc; padding-top: .6rem; }
.halles-map-popup [data-map-close] {
    position: absolute;
    top: .35rem;
    right: .35rem;
    border: 0;
    padding: .15rem .35rem;
    background: #edf2ec;
    color: #243f34;
    font-size: 1.2rem;
    cursor: pointer;
}
/* Reprise du liseré et de la plaque des titres de l’accueil. */
body.home .halles-map::before {
    content: "";
    display: block;
    width: min(100%, 64rem);
    aspect-ratio: 1024 / 90;
    margin: 0 auto clamp(.65rem, 1.5vw, 1.1rem);
    background: url("/wp-content/uploads/2026/11/liseret-halles.png") center / contain no-repeat;
}
body.home .halles-map > h2 {
    box-sizing: border-box;
    width: min(100%, 38rem);
    margin: 0 auto clamp(1.5rem, 3vw, 2.5rem);
    padding: clamp(1.15rem, 3vw, 2.15rem) .75rem;
    background: #333 url("/wp-content/uploads/2026/11/Fond-metal-gris-NetB-Halles-Narbonne.jpg") top left / cover no-repeat;
    color: #fff;
    font-family: "Playfair Display", Georgia, serif;
    font-size: clamp(1.7rem, 4.1vw, 3.125rem);
    font-weight: 600;
    line-height: 1.12;
}
@media (min-width: 768px) {
    .halles-map-figure {
        width: min(100%, 900px);
        aspect-ratio: 3305 / 1810;
    }
    .halles-map-figure > img:first-child {
        position: absolute;
        top: 50%;
        left: 50%;
        width: calc(100% * 1810 / 3305);
        max-width: none;
        transform: translate(-50%, -50%) rotate(90deg);
    }
    .halles-map-pin {
        left: calc(100% - var(--y));
        top: var(--x);
    }
}
.halles-map-popup .halles-map-trader-link {
    display: inline-block;
    font-weight: 700;
    text-underline-offset: .15em;
}

.halles-category-filter { position:relative; min-width:0; font-weight:600; }
.hc-filters .halles-category-filter { flex:1 1 14rem; }
.halles-map-filters .halles-category-filter { flex:1 1 12rem; }
.halles-category-filter select[hidden] { display:none; }
.halles-category-picker { position:relative; margin-top:.3rem; }
.halles-category-picker[open] { z-index:5; }
.halles-category-picker summary {
    display:flex; align-items:center; justify-content:space-between; gap:.55rem;
    box-sizing:border-box; min-height:2.75rem; padding:.4rem .6rem;
    border:1px solid #74867a; border-radius:.35rem; background:white; color:#243f34; cursor:pointer; list-style:none;
}
.halles-category-picker summary::-webkit-details-marker { display:none; }
.halles-category-picker summary::after { content:""; width:.5rem; height:.5rem; flex:none; border-right:1px solid; border-bottom:1px solid; transform:translateY(-.12rem) rotate(45deg); }
.halles-category-picker[open] summary::after { transform:translateY(.12rem) rotate(225deg); }
.halles-category-label { display:flex; align-items:center; gap:.55rem; font-weight:500; font-size:.92rem; }
.halles-category-label img { width:1.65rem; height:1.65rem; object-fit:contain; border-radius:.18rem; }
.halles-category-picker .halles-category-options {
    position:absolute; inset-inline:0; max-height:15rem; overflow:auto; overscroll-behavior:contain;
    list-style:none; margin:.2rem 0 0; padding:.2rem; border:1px solid #74867a; border-radius:.35rem;
    background:#fff; box-shadow:0 6px 14px #0003;
}
.halles-category-options button { display:block; width:100%; border:0; padding:.45rem .5rem; text-align:start; color:#243f34; background:#fff; cursor:pointer; }
.halles-category-options button:is([aria-pressed="true"],:hover,:focus-visible) { background:#e9f0e9; }
.halles-category-picker :is(summary,button):focus-visible { outline:2px solid #805b27; outline-offset:-2px; }

.halles-map-layout { padding:1.55rem 1.15rem; }
.halles-map-street { position:absolute; color:#243f34; font-size:clamp(.67rem,2.1vw,.87rem); font-weight:750; line-height:1.1; white-space:nowrap; }
.halles-map-street--north,.halles-map-street--south { left:50%; transform:translateX(-50%); }
.halles-map-street--north { bottom:100%; margin-bottom:.32rem; }
.halles-map-street--south { top:100%; margin-top:.32rem; }
.halles-map-street--west,.halles-map-street--east { top:50%; writing-mode:vertical-rl; transform:translateY(-50%); }
.halles-map-street--west { right:100%; margin-right:.25rem; transform:translateY(-50%) rotate(180deg); }
.halles-map-street--east { left:100%; margin-left:.25rem; }
.halles-map-figure > .halles-map-landmark {
    position:absolute; left:var(--x); top:var(--y); transform:translate(-50%,-50%);
    width:clamp(20px,5.5vw,32px); height:auto; z-index:1;
    border:1px solid white; border-radius:.18rem; background:#0c5693; box-shadow:0 1px 3px #0007;
}
.halles-map-figure > .halles-map-landmark--wc { width:clamp(26px,7vw,42px); }
.halles-map-amenities {
    display:grid; grid-template-columns:repeat(4,minmax(0,1fr));
    gap:.65rem; width:min(100%,33rem); list-style:none; padding:0; margin:.45rem auto 0;
}
.halles-map-amenities li { display:grid; justify-items:center; align-content:start; gap:.35rem; text-align:center; font-size:.84rem; font-weight:650; }
.halles-map-amenities img { display:block; width:clamp(38px,12vw,58px); aspect-ratio:1; object-fit:contain; background:#0c5693; border-radius:.25rem; }
@media(min-width:768px) {
    .halles-map-figure > .halles-map-landmark { left:calc(100% - var(--y)); top:var(--x); }
    .halles-map-street--north,.halles-map-street--south { top:50%; bottom:auto; margin:0; writing-mode:vertical-rl; transform:translateY(-50%); }
    .halles-map-street--north { left:100%; margin-left:.3rem; }
    .halles-map-street--south { left:auto; right:100%; margin-right:.3rem; transform:translateY(-50%) rotate(180deg); }
    .halles-map-street--west,.halles-map-street--east { left:50%; right:auto; margin:0; writing-mode:horizontal-tb; transform:translateX(-50%); }
    .halles-map-street--west { top:auto; bottom:100%; margin-bottom:.32rem; }
    .halles-map-street--east { top:100%; margin-top:.32rem; }
}
@media(max-width:420px) { .halles-map-amenities { grid-template-columns:repeat(2,minmax(0,1fr)); } }

.halles-map-pin.has-category-logo { border-radius:.25rem; background:#fff; padding:2px; }
.halles-map-pin.has-category-logo img { display:block; width:100%; height:100%; object-fit:contain; border-radius:.13rem; }
.halles-map-pin.has-category-logo .halles-map-pin-number {
    position: absolute;
    inset-inline-end: -3px;
    inset-block-end: -3px;
    border: 1px solid white;
    border-radius: 4px;
    padding: 1px 2px;
    background: #234738;
    color: white;
    font-size: .625rem;
}
.halles-map-pin.has-category-logo:is(.is-selected,:focus-visible,[aria-expanded="true"]) { border-color:#aa792d; box-shadow:0 0 0 2px #ffdf87,0 1px 5px #0007; }

.halles-map-pin[data-stall$="bis"] { width: auto; min-width: 2.35rem; aspect-ratio: auto; min-height: 1.5rem; padding-inline: .2rem; font-size: .65rem; }

@media (min-width: 768px) {
    .is-layout-constrained > .halles-map[data-profile="0"] { max-width: none; }
    .halles-map[data-profile="0"] :is(.halles-map-figure,.halles-map-filters) {
        width: min(100%, 100rem);
        max-width: none;
    }
    .halles-map[data-profile="0"] .halles-map-filters { width: min(100% - 2.3rem, 100rem); }
}

.halles-map-aisles { display:none; }
@media (min-width: 768px) {
    .halles-map-aisles { display:block; position:absolute; inset:0; width:100%; height:100%; pointer-events:none; }
    .halles-map-aisles text { fill:#646965; font:600 43px system-ui,sans-serif; }
}
