/**
 * CrecyPlage - Composant intelligent (barre carte).
 *
 * Barre overlay posee en haut de #crecy-map : recherche unifiee
 * (activites + commerces + hameaux) + pastille "ouvert maintenant".
 * Rendu verre depoli (glassmorphism medium), decalee a gauche pour
 * laisser respirer les commandes zoom +/- de Leaflet.
 */

.crecy-ci {
    position: absolute;
    top: 12px;
    left: 52px;   /* laisse passer le +/- de Leaflet (haut-gauche) */
    right: 12px;
    z-index: 1000;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    padding: 3px;
    background: rgba(253, 251, 247, 0.55);
    -webkit-backdrop-filter: blur(10px) saturate(120%);
    backdrop-filter: blur(10px) saturate(120%);
    border: 1px solid rgba(255, 255, 255, 0.55);
    border-radius: 14px;
    box-shadow: 0 3px 14px rgba(20, 40, 60, 0.12);
    font-size: 14px;
}

/* ---- Zone de recherche ---- */
.crecy-ci__search {
    position: relative;
    flex: 1 1 220px;
    min-width: 190px;
}

.crecy-ci__field {
    display: flex;
    align-items: center;
    gap: 8px;
    height: 40px;
    padding: 0 12px;
    background: rgba(255, 255, 255, 0.58);
    border: 1px solid rgba(228, 222, 210, 0.8);
    border-radius: 10px;
}

.crecy-ci__field:focus-within {
    background: #fff;
    border-color: #1E5A7B;
    box-shadow: 0 0 0 3px rgba(30, 90, 123, 0.12);
}

.crecy-ci__icon {
    flex: 0 0 auto;
    width: 18px;
    height: 18px;
    color: #1E5A7B;
}

.crecy-ci__input {
    flex: 1 1 auto;
    min-width: 0;
    border: 0;
    outline: 0;
    background: transparent;
    font: inherit;
    font-size: 14px;
    color: #22303B;
}

.crecy-ci__input::placeholder {
    color: #7C7768;
}

.crecy-ci__clear {
    flex: 0 0 auto;
    border: 0;
    background: transparent;
    color: #8A8578;
    cursor: pointer;
    padding: 4px;
    line-height: 0;
    display: none;
}

.crecy-ci__clear.is-visible {
    display: inline-flex;
}

/* ---- Dropdown resultats ---- */
.crecy-ci__results {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    max-height: 320px;
    overflow-y: auto;
    background: rgba(255, 255, 255, 0.80);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(228, 222, 210, 0.9);
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(20, 40, 60, 0.16);
    padding: 4px;
    display: none;
}

.crecy-ci__results.is-open {
    display: block;
}

.crecy-ci__item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 10px;
    border-radius: 8px;
    cursor: pointer;
}

.crecy-ci__item:hover,
.crecy-ci__item.is-active {
    background: #F3F6FA;
}

.crecy-ci__dot {
    flex: 0 0 auto;
    width: 9px;
    height: 9px;
    border-radius: 50%;
}

.crecy-ci__label {
    flex: 1 1 auto;
    color: #22303B;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.crecy-ci__type {
    flex: 0 0 auto;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: #8A8578;
}

.crecy-ci__empty {
    padding: 14px 12px;
    color: #8A8578;
    text-align: center;
}

/* ---- Pastille "ouvert maintenant" ---- */
.crecy-ci__open {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    height: 40px;
    padding: 0 13px;
    border: 1px solid rgba(240, 201, 187, 0.9);
    border-radius: 10px;
    background: rgba(250, 236, 231, 0.85);
    color: #993C1D;
    font-size: 13px;
    cursor: pointer;
    white-space: nowrap;
}

.crecy-ci__open[aria-pressed="true"] {
    background: #993C1D;
    border-color: #993C1D;
    color: #fff;
}

.crecy-ci__open-led {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #1D9E75;
}

.crecy-ci__open-count {
    padding: 1px 7px;
    border-radius: 8px;
    background: #fff;
    border: 1px solid rgba(240, 201, 187, 0.9);
    color: #993C1D;
    font-size: 12px;
}

.crecy-ci__open[aria-pressed="true"] .crecy-ci__open-count {
    background: rgba(255, 255, 255, 0.18);
    border-color: transparent;
    color: #fff;
}

/* ---- Mobile ---- */
@media (max-width: 640px) {
    .crecy-ci {
        top: 8px;
        left: 46px;   /* +/- Leaflet present aussi sur mobile */
        right: 8px;
    }
    .crecy-ci__search {
        flex-basis: 100%;
    }
    .crecy-ci__open {
        flex: 1 1 auto;
        justify-content: center;
    }
}
