/* ========================================
   CARTE CLIENTS - STYLES DÉDIÉS (Inspiré de IMX)
   ======================================== */

:root {
    --keyence-red: #E60012;
    --keyence-dark: #1a1a1a;
    --keyence-gray: #666666;
    --white: #ffffff;
    --light-gray: #f5f5f5;
    --border-light: #e0e0e0;
    --shadow-md: 0 4px 12px rgba(0,0,0,0.1);
    --transition: all 0.3s ease;
}

/* Empêche le scroll global pour une expérience app-like */
body.map-mode {
    overflow: hidden;
}

/* ========================================
   TIROIR DU HAUT (SLIDING DRAWER)
   ======================================== */
.top-drawer {
    position: fixed;
    /* Ajustement pour le header du projet WM (approx 72px) */
    top: 72px; 
    left: 0;
    width: 100%;
    z-index: 900; /* En dessous du header (z-index 1000) */
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    
    /* Cache le tiroir vers le haut */
    transform: translateY(-100%); 
    transition: transform 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    
    box-shadow: 0 5px 30px rgba(0,0,0,0.3);
    /* Important: overflow visible pour voir la languette qui dépasse en bas */
    overflow: visible; 
    display: flex;
    flex-direction: column;
}

/* Conteneur interne pour le scroll */
.drawer-content-scroll {
    max-height: calc(90vh - 80px);
    overflow-y: auto;
    width: 100%;
}

/* Le tiroir s'ouvre au survol ou s'il a le focus (interaction clavier/input) */
.top-drawer:hover, .top-drawer:focus-within {
    transform: translateY(0);
}

/* La languette visible quand le tiroir est fermé */
.drawer-handle {
    position: absolute;
    bottom: -32px;
    left: 50%;
    transform: translateX(-50%);
    background: white;
    color: var(--keyence-red);
    padding: 6px 24px;
    border-radius: 0 0 12px 12px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.15);
    font-weight: 700;
    cursor: pointer;
    font-size: 13px;
    z-index: 10000;
    border-bottom: 3px solid var(--keyence-red);
    white-space: nowrap;
}

.drawer-handle:hover {
    background: #fff0f0;
}

/* Optimisation de l'espace dans le tiroir */
.top-drawer .imx-presentation {
    padding: 15px 0 !important;
    background: none !important;
}
.top-drawer .imx-title {
    font-size: 24px !important;
    margin-bottom: 5px !important;
}
.top-drawer .hero-description {
    font-size: 14px !important;
    margin-bottom: 5px !important;
}
.top-drawer .filters-section {
    padding: 10px 0 20px 0 !important;
    background: none !important;
}
.top-drawer .filter-group {
    margin-bottom: 15px;
}

/* Carte Plein Écran */
.map-section {
    height: 100vh;
    width: 100vw;
    position: absolute;
    top: 0;
    left: 0;
    padding: 0 !important;
    margin: 0 !important;
    z-index: 1;
}

.container-full {
    height: 100%;
    width: 100%;
    max-width: 100%;
    padding: 0;
    position: relative;
}

.map-container {
    height: 100% !important;
    width: 100%;
    border-radius: 0 !important;
    box-shadow: none !important;
    background: #e0e0e0;
}

/* Descendre les contrôles Leaflet pour ne pas être cachés par la languette */
.leaflet-top {
    top: 40px; 
}

/* Effet de flou sur la carte quand le menu est ouvert pour focus utilisateur */
.top-drawer:hover ~ .map-section, 
.top-drawer:focus-within ~ .map-section {
    filter: blur(2px) brightness(0.9);
    transition: filter 0.3s ease;
}

/* LEGEND & OTHERS */
.map-legend {
    position: absolute;
    bottom: 30px;
    right: 30px;
    background: white;
    padding: 15px 20px;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    z-index: 400;
}

.map-legend h4 {
    margin: 0 0 12px 0;
    font-size: 14px;
    font-weight: 600;
    color: #1a1a1a;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
    font-size: 14px;
}

.legend-marker {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    display: inline-block;
}

.legend-marker.blue { background: #007bff; }
.legend-marker.red { background: #dc3545; }
.legend-marker.green { background: #28a745; }
.legend-marker.orange { background: #fd7e14; }

/* FILTERS COMMON */
.filter-buttons-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.filter-btn {
    padding: 12px 24px;
    border: 2px solid #e0e0e0;
    background: white;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    color: #1a1a1a;
}

.filter-btn:hover {
    border-color: var(--keyence-red);
    background: rgba(230, 0, 18, 0.05);
}

.filter-btn.active {
    background: var(--keyence-red);
    color: white;
    border-color: var(--keyence-red);
}

.filter-select-wrapper {
    position: relative;
    max-width: 400px;
    margin-bottom: 12px;
}

.filter-select {
    width: 100%;
    padding: 12px 16px;
    font-size: 16px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    background: white;
    cursor: pointer;
    transition: all 0.3s ease;
    color: #1a1a1a;
}

.search-suggestions {
    position: absolute;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    width: 100%;
    max-height: 220px;
    overflow: auto;
    z-index: 500;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    display: none;
}

.search-suggestion-item {
    padding: 10px 12px;
    cursor: pointer;
    font-size: 14px;
}

.search-suggestion-item:hover {
    background: rgba(230,0,18,0.06);
}

/* Switch Slider */
.switch {
    position: relative;
    display: inline-block;
    width: 52px;
    height: 28px;
    margin-right: 0;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #ccc;
    transition: 0.2s;
    border-radius: 34px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 22px;
    width: 22px;
    left: 3px;
    bottom: 3px;
    background: white;
    transition: 0.2s;
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

.switch input:checked + .slider {
    background: var(--keyence-red);
}

.switch input:checked + .slider:before {
    transform: translateX(24px);
}

.results-counter {
    margin-top: 20px;
    padding: 16px 20px;
    background: rgba(230, 0, 18, 0.08);
    border-left: 4px solid var(--keyence-red);
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    color: #1a1a1a;
}

.results-counter span {
    font-size: 20px;
    font-weight: 700;
    color: var(--keyence-red);
}

/* Cluster custom styles */
.custom-cluster {
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 700;
    box-shadow: 0 4px 12px rgba(0,0,0,0.25);
}

.custom-cluster-count {
    font-size: 14px;
    padding: 6px;
}

/* Loading Message */
#mapLoadingMessage {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 10;
    background: white;
    padding: 20px 40px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

/* Inline styles moved from carte-clients.html */
.logo-compact {
    display: none;
}

.imx-presentation {
    padding: 80px 0;
    background: linear-gradient(135deg, rgba(230, 0, 18, 0.08) 0%, rgba(230, 0, 18, 0.04) 100%);
}

.imx-header {
    text-align: center;
}

.imx-title {
    font-size: 64px;
    margin-bottom: 20px;
}

.hero-description {
    font-size: 20px;
    color: var(--keyence-gray);
    max-width: 800px;
    margin: 0 auto;
}

.search-suggestions {
    position: absolute;
    background: #fff;
    border: 1px solid var(--border-light);
    border-radius: 8px;
    width: 100%;
    max-height: 220px;
    overflow: auto;
    z-index: 500;
    box-shadow: var(--shadow-md);
}

.search-suggestion-item {
    padding: 10px 12px;
    cursor: pointer;
    font-size: 14px;
}

.search-suggestion-item:hover {
    background: rgba(230,0,18,0.06);
}