/* ═══════════════════════════════════════════════
   Agence Locator — Frontend Styles
   ═══════════════════════════════════════════════ */

:root {
    --al-primary:     #e30613;
    --al-primary-dk:  #b8000f;
    --al-secondary:   #1a1a2e;
    --al-accent:      #f5a623;
    --al-text:        #222;
    --al-muted:       #777;
    --al-border:      #e5e5e5;
    --al-bg:          #f7f8fa;
    --al-white:       #fff;
    --al-shadow:      0 4px 24px rgba(0,0,0,.10);
    --al-shadow-md:   0 2px 12px rgba(0,0,0,.07);
    --al-radius:      12px;
    --al-radius-sm:   8px;
    --al-transition:  .22s cubic-bezier(.4,0,.2,1);
    --al-sidebar-w:   360px;
}

/* ── Wrapper ── */
.al-wrapper {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-size: 14px;
    color: var(--al-text);
    background: var(--al-bg);
    border-radius: var(--al-radius);
    overflow: hidden;
    box-shadow: var(--al-shadow);
}

/* ── Header / Recherche ── */
.al-header {
    background: var(--al-white);
    border-bottom: 1px solid var(--al-border);
    padding: 16px 20px;
}

.al-search-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #f0f0f3;
    border-radius: 50px;
    padding: 10px 16px;
    transition: box-shadow var(--al-transition);
}

.al-search-bar:focus-within {
    box-shadow: 0 0 0 3px rgba(227,6,19,.18);
    background: var(--al-white);
}

.al-search-icon { display: flex; align-items: center; color: var(--al-muted); }
.al-search-icon svg { width: 18px; height: 18px; }

.al-search-input {
    flex: 1;
    border: none;
    background: transparent;
    font-size: 14px;
    outline: none;
    color: var(--al-text);
}
.al-search-input::placeholder { color: var(--al-muted); }

.al-geolocate-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
    background: var(--al-primary);
    color: var(--al-white);
    border: none;
    border-radius: 50px;
    padding: 7px 14px;
    font-size: 13px;
    cursor: pointer;
    transition: background var(--al-transition);
}
.al-geolocate-btn:hover { background: var(--al-primary-dk); }
.al-geolocate-btn svg { width: 15px; height: 15px; }

/* Filtres */
.al-filters {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 12px;
    flex-wrap: wrap;
}

.al-filter-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.al-filter-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--al-muted);
    text-transform: uppercase;
    letter-spacing: .05em;
}

.al-filter-select {
    border: 1px solid var(--al-border);
    border-radius: 8px;
    padding: 7px 12px;
    font-size: 13px;
    color: var(--al-text);
    background: var(--al-white);
    cursor: pointer;
    outline: none;
    transition: border-color var(--al-transition);
}
.al-filter-select:focus { border-color: var(--al-primary); }

.al-reset-btn {
    background: transparent;
    border: 1px solid var(--al-border);
    border-radius: 8px;
    padding: 7px 14px;
    font-size: 13px;
    color: var(--al-muted);
    cursor: pointer;
    transition: all var(--al-transition);
    margin-left: auto;
}
.al-reset-btn:hover { border-color: var(--al-primary); color: var(--al-primary); }

/* ── Corps ── */
.al-body {
    display: flex;
    height: 600px;
}

/* ── Sidebar ── */
.al-sidebar {
    width: var(--al-sidebar-w);
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    background: var(--al-white);
    border-right: 1px solid var(--al-border);
    overflow: hidden;
}

.al-results-count {
    padding: 12px 16px 8px;
    font-size: 12px;
    font-weight: 600;
    color: var(--al-muted);
    text-transform: uppercase;
    letter-spacing: .05em;
    border-bottom: 1px solid var(--al-border);
}

.al-list {
    flex: 1;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--al-border) transparent;
}
.al-list::-webkit-scrollbar { width: 4px; }
.al-list::-webkit-scrollbar-thumb { background: var(--al-border); border-radius: 2px; }

/* ── Carte agence ── */
.al-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    cursor: pointer;
    border-bottom: 1px solid var(--al-border);
    transition: background var(--al-transition);
    position: relative;
}
.al-card:hover { background: #fef5f5; }
.al-card--active { background: #fef5f5; border-left: 3px solid var(--al-primary); }

.al-card-icon {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    background: var(--al-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--al-white);
}
.al-card-icon svg { width: 18px; height: 18px; }

.al-card-body { flex: 1; min-width: 0; }

.al-card-title {
    font-size: 14px;
    font-weight: 700;
    margin: 0 0 3px;
    color: var(--al-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.al-card-address,
.al-card-phone,
.al-card-hours,
.al-card-services {
    font-size: 12px;
    color: var(--al-muted);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.al-card-phone svg,
.al-card-hours svg { width: 12px; height: 12px; flex-shrink: 0; }

.al-card-arrow { color: var(--al-border); }
.al-card-arrow svg { width: 16px; height: 16px; }
.al-card:hover .al-card-arrow { color: var(--al-primary); }

/* ── Map Container ── */
.al-map-container {
    flex: 1;
    position: relative;
    background: #eee;
}

#al-map {
    width: 100%;
    height: 100%;
}

/* ── No API Key ── */
.al-no-api-key {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    gap: 12px;
    color: var(--al-muted);
    text-align: center;
    padding: 24px;
}
.al-no-api-key svg { width: 48px; height: 48px; opacity: .4; }

/* ── Panneau détail ── */
.al-detail-panel {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--al-white);
    border-radius: var(--al-radius) var(--al-radius) 0 0;
    box-shadow: 0 -4px 24px rgba(0,0,0,.15);
    max-height: 75%;
    overflow-y: auto;
    transform: translateY(100%);
    transition: transform var(--al-transition);
    z-index: 10;
}
.al-detail-panel--open {
    transform: translateY(0);
}

.al-detail-close {
    position: absolute;
    top: 12px;
    right: 12px;
    background: var(--al-bg);
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 1;
    color: var(--al-muted);
    transition: all var(--al-transition);
}
.al-detail-close:hover { background: var(--al-primary); color: var(--al-white); }
.al-detail-close svg { width: 16px; height: 16px; }

.al-detail-header {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 20px 20px 14px;
    border-bottom: 1px solid var(--al-border);
}
.al-detail-img {
    width: 64px;
    height: 64px;
    border-radius: var(--al-radius-sm);
    object-fit: cover;
}
.al-detail-title {
    font-size: 17px;
    font-weight: 700;
    margin: 0 0 6px;
}
.al-detail-badge {
    background: #fff0f0;
    color: var(--al-primary);
    font-size: 11px;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 50px;
    text-transform: uppercase;
    letter-spacing: .05em;
}

.al-detail-body { padding: 14px 20px 20px; }

.al-detail-row {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 10px;
    font-size: 13px;
    color: var(--al-text);
}
.al-detail-row svg { width: 16px; height: 16px; flex-shrink: 0; color: var(--al-primary); margin-top: 1px; }
.al-detail-row a { color: var(--al-primary); text-decoration: none; }
.al-detail-row a:hover { text-decoration: underline; }

.al-detail-services { margin-top: 14px; }
.al-detail-services h4 { font-size: 12px; text-transform: uppercase; color: var(--al-muted); letter-spacing: .05em; margin: 0 0 8px; }

.al-services-grid { display: flex; flex-wrap: wrap; gap: 6px; }
.al-service-tag {
    background: var(--al-bg);
    border: 1px solid var(--al-border);
    border-radius: 50px;
    padding: 4px 12px;
    font-size: 12px;
    color: var(--al-text);
}

.al-itinerary-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--al-primary);
    color: var(--al-white) !important;
    text-decoration: none !important;
    padding: 11px 20px;
    border-radius: 50px;
    font-size: 14px;
    font-weight: 600;
    margin-top: 16px;
    transition: background var(--al-transition);
}
.al-itinerary-btn:hover { background: var(--al-primary-dk); }
.al-itinerary-btn svg { width: 18px; height: 18px; }

/* ── InfoWindow Google Maps ── */
.al-infowindow { font-family: inherit; font-size: 13px; max-width: 200px; }
.al-infowindow strong { display: block; margin-bottom: 4px; }

/* ── États ── */
.al-loading {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 24px;
    color: var(--al-muted);
    justify-content: center;
}

.al-spinner {
    width: 18px; height: 18px;
    border: 2px solid var(--al-border);
    border-top-color: var(--al-primary);
    border-radius: 50%;
    animation: al-spin .7s linear infinite;
    flex-shrink: 0;
}
@keyframes al-spin { to { transform: rotate(360deg); } }

.al-empty, .al-error {
    padding: 24px;
    text-align: center;
    color: var(--al-muted);
    font-size: 13px;
}
.al-error { color: var(--al-primary); }

/* ── Boutons utilitaires ── */
.al-btn-primary {
    display: inline-flex;
    align-items: center;
    padding: 10px 20px;
    background: var(--al-primary);
    color: var(--al-white);
    text-decoration: none;
    border-radius: 50px;
    font-size: 14px;
    font-weight: 600;
    transition: background var(--al-transition);
}
.al-btn-primary:hover { background: var(--al-primary-dk); }

/* ── Inline Search widget ── */
.al-inline-search { width: 100%; }
.al-search-form {
    display: flex;
    border: 1px solid var(--al-border);
    border-radius: 50px;
    overflow: hidden;
}
.al-search-form .al-search-input {
    flex: 1;
    border: none;
    padding: 12px 18px;
    font-size: 15px;
    outline: none;
}
.al-search-form .al-search-btn {
    background: var(--al-primary);
    border: none;
    padding: 0 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    color: var(--al-white);
    transition: background var(--al-transition);
}
.al-search-form .al-search-btn:hover { background: var(--al-primary-dk); }
.al-search-form .al-search-btn svg { width: 20px; height: 20px; }

/* ── Responsive ── */
@media (max-width: 768px) {
    .al-body { flex-direction: column; height: auto; }

    .al-sidebar {
        width: 100%;
        max-height: 300px;
        border-right: none;
        border-bottom: 1px solid var(--al-border);
    }

    .al-map-container { min-height: 320px; }

    .al-filters { flex-direction: column; align-items: flex-start; }
    .al-reset-btn { margin-left: 0; }

    .al-geolocate-btn span { display: none; }
}

@media (max-width: 480px) {
    .al-header { padding: 12px; }
    .al-geolocate-btn { padding: 7px 10px; }
}
