/* ══════════════════════════════════════════
   AELP Drive v3.1.0 — Sélecteur point de livraison drive
   Améliorations : barre de recherche, badge compteur,
   sticky selection, meilleur responsive, animations.
   ══════════════════════════════════════════ */

.aelp-pickup-row th {
    padding: 0 !important;
    vertical-align: top;
}

#aelp-pickup-wrap {
    --rose:  #C4708A;
    --vert:  #6B9A5A;
    --vert-dark: #4E7540;
    --cream: #FAF7F2;
    --ink:   #2A1F1A;
    --ink-mid: #6B5548;
    --ink-light: #A89080;
    --rule:  #E5D9C8;
    font-family: inherit;
    margin: .5rem 0 1rem;
    border: 1.5px solid var(--rule);
    border-radius: 12px;
    overflow: hidden;
    background: var(--cream);
    transition: border-color .2s;
}

#aelp-pickup-label {
    padding: .75rem 1rem .6rem;
    font-size: .9rem;
    border-bottom: 1px solid var(--rule);
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: .4rem;
}

/* Badge compteur de points */
.aelp-point-badge {
    font-size: .68rem;
    font-weight: 600;
    color: var(--vert);
    background: #f0f6f1;
    padding: .2rem .55rem;
    border-radius: 20px;
    white-space: nowrap;
}

/* ── Barre de recherche ── */
#aelp-search-bar {
    padding: .5rem .75rem;
    background: #fff;
    border-bottom: 1px solid var(--rule);
}
#aelp-search-input {
    width: 100%;
    padding: .5rem .75rem;
    border: 1.5px solid var(--rule);
    border-radius: 8px;
    font-size: .82rem;
    font-family: inherit;
    background: var(--cream);
    color: var(--ink);
    outline: none;
    transition: border-color .15s, box-shadow .15s;
    box-sizing: border-box;
}
#aelp-search-input:focus {
    border-color: var(--vert);
    box-shadow: 0 0 0 3px rgba(107, 154, 90, .12);
}
#aelp-search-input::placeholder {
    color: var(--ink-light);
}

/* No results */
.aelp-pu-no-results {
    padding: 1.2rem 1rem;
    text-align: center;
    font-size: .82rem;
    color: var(--ink-light);
    font-style: italic;
}

/* ── Mini-map ── */
#aelp-pickup-map {
    height: 300px;
    width: 100%;
    background: #f0ebe3;
    display: block;
    border-bottom: 1px solid var(--rule);
}

/* ── Point list ── */
#aelp-pickup-list {
    max-height: 280px;
    overflow-y: auto;
    overscroll-behavior: contain;
}
#aelp-pickup-list::-webkit-scrollbar { width: 4px; }
#aelp-pickup-list::-webkit-scrollbar-thumb { background: var(--rule); border-radius: 2px; }

.aelp-pu-group-label {
    display: flex;
    align-items: center;
    gap: .4rem;
    padding: .55rem 1rem .3rem;
    font-size: .65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .07em;
    color: var(--ink-light);
    background: #f5f0ea;
    border-bottom: 1px solid var(--rule);
    position: sticky;
    top: 0;
    z-index: 2;
}
.aelp-pu-group-label .gdot {
    width: 8px; height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}
.aelp-pu-group-count {
    margin-left: auto;
    font-size: .6rem;
    font-weight: 600;
    background: #e8e0d5;
    color: var(--ink-mid);
    padding: .1rem .4rem;
    border-radius: 10px;
    min-width: 18px;
    text-align: center;
}

.aelp-pu-item {
    display: flex;
    align-items: flex-start;
    gap: .7rem;
    padding: .75rem 1rem;
    cursor: pointer;
    border-bottom: 1px solid var(--rule);
    border-left: 3px solid transparent;
    transition: background .15s, border-color .15s, transform .1s;
    -webkit-tap-highlight-color: transparent;
}
.aelp-pu-item:last-child { border-bottom: none; }
.aelp-pu-item:hover { background: rgba(255,255,255,.7); }
.aelp-pu-item:active { transform: scale(.99); }
.aelp-pu-item.selected {
    background: #fff;
    border-left-color: var(--vert);
}

.aelp-pu-num {
    width: 26px; height: 26px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: .7rem; font-weight: 700;
    color: #fff; flex-shrink: 0; margin-top: .1rem;
    transition: transform .15s;
}
.aelp-pu-item.selected .aelp-pu-num {
    transform: scale(1.1);
}

.aelp-pu-info { flex: 1; min-width: 0; }
.aelp-pu-city {
    font-weight: 600;
    font-size: .92rem;
    color: var(--ink);
}
.aelp-pu-date {
    font-size: .78rem;
    color: var(--ink-mid);
    margin-top: .12rem;
}
.aelp-pu-note {
    font-size: .73rem;
    color: var(--ink-light);
    margin-top: .05rem;
}
.aelp-pu-check {
    width: 22px; height: 22px;
    border-radius: 50%;
    border: 2px solid var(--rule);
    flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    font-size: .75rem;
    color: #fff;
    transition: all .18s;
    margin-top: .15rem;
}
.aelp-pu-item.selected .aelp-pu-check {
    background: var(--vert);
    border-color: var(--vert);
    animation: aelp-check-pop .25s ease;
}

@keyframes aelp-check-pop {
    0% { transform: scale(0.5); }
    50% { transform: scale(1.15); }
    100% { transform: scale(1); }
}

/* ── Selected summary (sticky bottom) ── */
#aelp-pickup-selected {
    padding: .65rem 1rem;
    font-size: .82rem;
    color: var(--vert);
    font-weight: 500;
    min-height: 2.4rem;
    border-top: 1px solid var(--rule);
    background: #f0f6f1;
    display: none;
    position: sticky;
    bottom: 0;
    z-index: 3;
    line-height: 1.5;
}
#aelp-pickup-selected.show { display: flex; align-items: center; flex-wrap: wrap; gap: .3rem; }

.aelp-sel-check {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px; height: 20px;
    border-radius: 50%;
    background: var(--vert);
    color: #fff;
    font-size: .7rem;
    font-weight: 700;
    flex-shrink: 0;
}

.aelp-sel-hint {
    color: var(--ink-light);
    font-weight: 400;
    font-style: italic;
    font-size: .8rem;
}

.aelp-sel-change {
    margin-left: auto;
    padding: .2rem .6rem;
    font-size: .72rem;
    font-weight: 600;
    color: var(--vert);
    background: transparent;
    border: 1.5px solid var(--vert);
    border-radius: 6px;
    cursor: pointer;
    font-family: inherit;
    transition: all .13s;
    white-space: nowrap;
}
.aelp-sel-change:hover {
    background: var(--vert);
    color: #fff;
}

/* ── Leaflet popup for checkout ── */
#aelp-pickup-map .leaflet-popup-content-wrapper {
    border-radius: 10px;
    padding: 0;
    overflow: hidden;
    border: 1px solid var(--rule);
    box-shadow: 0 6px 24px rgba(42,31,26,.14);
    min-width: 200px;
}
#aelp-pickup-map .leaflet-popup-tip-container { display: none; }
#aelp-pickup-map .leaflet-popup-content { margin: 0 !important; }
#aelp-pickup-map .leaflet-popup-close-button {
    color: var(--ink-light) !important;
    top: 8px !important; right: 10px !important;
    font-size: 16px !important;
}

.aelp-pu-popup { padding: .8rem 1rem; }
.aelp-pu-popup-tour {
    font-size: .62rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    margin-bottom: .3rem;
}
.aelp-pu-popup-city {
    font-weight: 600; font-size: 1rem;
    margin-bottom: .4rem; color: var(--ink);
    line-height: 1.2;
}
.aelp-pu-popup-date { font-size: .78rem; color: var(--ink-mid); margin-bottom: .15rem; }
.aelp-pu-popup-note { font-size: .73rem; color: var(--ink-light); margin-bottom: .15rem; }
.aelp-pu-popup-btn {
    display: block; width: 100%; padding: .45rem .6rem;
    background: var(--vert); color: #fff; border: none;
    border-radius: 7px; font-size: .8rem; font-weight: 600;
    cursor: pointer; font-family: inherit; text-align: center;
    transition: background .13s, transform .1s;
    margin-top: .5rem;
}
.aelp-pu-popup-btn:hover { background: var(--vert-dark); }
.aelp-pu-popup-btn:active { transform: scale(.97); }
.aelp-pu-popup-btn.selected { background: var(--ink); cursor: default; }

/* ── Marker ── */
.aelp-mk {
    display: flex; align-items: center; justify-content: center;
    width: 28px; height: 28px;
    border-radius: 50% 50% 50% 3px;
    transform: rotate(-45deg);
    border: 2px solid rgba(255,255,255,.9);
    box-shadow: 0 2px 8px rgba(0,0,0,.22);
    cursor: pointer;
    transition: transform .2s, box-shadow .2s;
}
.aelp-mk span {
    transform: rotate(45deg);
    color: #fff; font-weight: 700; font-size: .62rem;
    font-family: sans-serif;
}
.aelp-mk.sel {
    box-shadow: 0 0 0 3px rgba(255,255,255,.9), 0 4px 12px rgba(0,0,0,.22);
    transform: rotate(-45deg) scale(1.2);
}

/* ── Error state ── */
.aelp-pickup-error #aelp-pickup-wrap {
    border-color: #e2401c;
}

/* ── Drive hint ── */
.aelp-pickup-hint {
    display: block;
    font-size: .78rem;
    color: #6B9A5A;
    font-weight: 500;
    margin-top: .2rem;
    padding-left: 1.6rem;
}

/* ══════════════════════════════════════════
   RESPONSIVE
   ══════════════════════════════════════════ */
@media (max-width: 600px) {
    #aelp-pickup-map {
        height: 220px;
    }
    #aelp-pickup-list {
        max-height: 240px;
    }
    #aelp-pickup-label {
        font-size: .82rem;
        padding: .6rem .8rem .5rem;
    }
    .aelp-pu-popup-city {
        font-size: .9rem;
    }
    .aelp-pu-item {
        padding: .65rem .8rem;
        gap: .55rem;
    }
    #aelp-search-bar {
        padding: .4rem .6rem;
    }
    #aelp-search-input {
        padding: .45rem .6rem;
        font-size: .8rem;
    }
    .aelp-sel-change {
        font-size: .68rem;
    }
}

/* ── Animation d'entrée ── */
#aelp-pickup-wrap {
    animation: aelp-slide-in .3s ease-out;
}
@keyframes aelp-slide-in {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}
