/* MapPoints Frontend – matches the dark blue design */
.mappoints-frontend {
    --mp-bg: #0d1e35;
    --mp-bg2: #091629;
    --mp-blue: #2a5fa0;
    --mp-blue-light: #4a9eff;
    --mp-accent: #00c9ff;
    --mp-white: #ffffff;
    --mp-gray: #8faabb;
    --mp-pin: #e8f4ff;
    --mp-pin-hover: #00c9ff;
    --mp-card-bg: rgba(255,255,255,0.06);
    --mp-border: rgba(74,158,255,0.25);
    --mp-font: 'Segoe UI', system-ui, -apple-system, sans-serif;

    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 0; /* behind content */
    pointer-events: none; /* let clicks pass through */

    display: flex;
    align-items: center; /* Centered vertically as requested */
    padding-top: 0;
    justify-content: center; /* Centered horizontally */
    overflow: hidden;
    font-family: var(--mp-font);
    box-sizing: border-box;
}

.mappoints-frontend::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at 70% 50%, rgba(42,95,160,0.15) 0%, transparent 70%);
    pointer-events: none;
}

/* Light theme override */
.mappoints-theme-light {
    --mp-bg: #f0f5ff;
    --mp-bg2: #e8eef8;
    --mp-white: #1a2a40;
    --mp-gray: #4a6080;
    --mp-card-bg: rgba(0,0,0,0.06);
    --mp-border: rgba(30,90,180,0.2);
    --mp-pin: #1a3a6c;
}

/* LEFT PANEL */
.mappoints-content-left {
    flex: 0 0 380px;
    min-width: 0;
    z-index: 1;
}

.mappoints-badge {
    display: inline-flex;
    align-items: center;
    background: rgba(74,158,255,0.12);
    border: 1px solid rgba(74,158,255,0.3);
    color: var(--mp-blue-light);
    border-radius: 20px;
    padding: 4px 14px;
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0.3px;
    margin-bottom: 18px;
}

.mappoints-heading {
    font-size: clamp(24px, 3vw, 38px);
    font-weight: 800;
    color: var(--mp-white);
    line-height: 1.15;
    margin: 0 0 16px 0;
    letter-spacing: -0.5px;
}

.mappoints-description {
    color: var(--mp-gray);
    font-size: 14px;
    line-height: 1.6;
    margin: 0 0 28px 0;
    max-width: 340px;
}

/* Info panel */
.mappoints-info-panel {
    background: var(--mp-card-bg);
    border: 1px solid var(--mp-border);
    border-radius: 10px;
    padding: 16px 20px;
    margin-bottom: 24px;
    min-height: 90px;
    transition: all 0.3s;
}

.mappoints-info-location {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 10px;
}

.mappoints-pin-icon {
    width: 20px;
    height: 20px;
    color: var(--mp-accent);
    flex-shrink: 0;
    margin-top: 2px;
}

.mappoints-info-city {
    font-size: 16px;
    font-weight: 700;
    color: var(--mp-white);
    line-height: 1.2;
}
.mappoints-info-dept {
    font-size: 12px;
    color: var(--mp-gray);
    margin-top: 2px;
}

.mappoints-info-divider {
    height: 1px;
    background: var(--mp-border);
    margin: 10px 0;
}

.mappoints-info-details {
    font-size: 13px;
    line-height: 1.7;
}
.mappoints-info-name { color: var(--mp-white); font-weight: 600; }
.mappoints-info-phone { color: var(--mp-gray); }
.mappoints-info-phone::before { content: '+ '; }
.mappoints-info-email { color: var(--mp-gray); }
.mappoints-info-empty { color: var(--mp-gray); font-size: 13px; text-align: center; padding: 8px 0; }

/* CTA */
.mappoints-cta-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: transparent;
    border: 1px solid rgba(255,255,255,0.25);
    color: var(--mp-white);
    border-radius: 6px;
    padding: 10px 20px;
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s;
    cursor: pointer;
}
.mappoints-cta-btn:hover {
    background: rgba(255,255,255,0.08);
    border-color: var(--mp-accent);
    color: var(--mp-white);
    text-decoration: none;
}
.mappoints-cta-btn svg {
    width: 16px;
    height: 16px;
    transition: transform 0.2s;
}
.mappoints-cta-btn:hover svg { transform: translateX(4px); }

/* MAP AREA */
.mappoints-map-area {
    width: 65%; /* Map occupies 65% of background width on the right, overlapping slightly under text */
    max-width: 900px;
    margin-left: 20%; /* Shift map to the right of the text */
    margin-right: 0;
    flex-shrink: 0;
    z-index: 1;
}

.mappoints-map-wrapper {
    position: relative;
    width: 100%;
    aspect-ratio: 887 / 681; /* Lock aspect ratio to SVG bounds so pins align perfectly */
    margin-top: -35%; /* Shift map upwards */
}

.mappoints-map-wrapper svg {
    width: 100%;
    height: 100%;
    display: block;
}

/* SVG region styles (frontend) */
.mappoints-map-wrapper .mp-region-bg {
    fill: var(--mp-region-bg-color, #0e1e30);
    stroke: #162b42;
    stroke-width: 1;
    opacity: var(--mp-region-bg-opacity, 0.7);
}
.mappoints-map-wrapper .mp-region-dark {
    fill: #08121d;
    stroke: #0f1e2d;
    stroke-width: 1;
    opacity: 0.5;
}
.mappoints-map-wrapper .mp-region-main {
    fill: var(--mp-region-main-color, #2a5fa0);
    stroke: #3a7bc8;
    stroke-width: 0.8;
}
.mappoints-map-wrapper .mp-coast {
    fill: none;
    stroke: #5a8fbb;
    stroke-width: 0.8;
    stroke-dasharray: 3,3;
    opacity: 0.4;
}
.mappoints-map-wrapper .mp-sea-dot {
    fill: #5a8fbb;
    opacity: 0.3;
}
.mappoints-map-wrapper .mp-border {
    stroke: #3a7bc8;
    stroke-width: 0.4;
    opacity: 0.3;
}
.mappoints-map-wrapper #mappoints-click-area { cursor: default; }

/* Frontend pins layer */
.mappoints-frontend-pins {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    pointer-events: none;
}

/* Individual pin */
.mappoints-frontend-pin {
    position: absolute;
    transform: translate(-50%, -50%);
    pointer-events: all;
    cursor: pointer;
    z-index: 5;
}

.mp-pin-dot {
    width: 15px;
    height: 15px;
    background: #00c9ff; /* Solid celeste fill by default */
    border: 2px solid #ffffff; /* White border by default */
    border-radius: 50%;
    position: relative;
    z-index: 2;
    transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease;
    box-sizing: border-box;
}

.mp-pin-pulse {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 8px;
    height: 8px;
    background: rgba(0, 201, 255, 0.35); /* Cyan pulsing ring */
    border-radius: 50%;
    transform: translate(-50%, -50%);
    animation: mp-pulse 2.5s ease-out infinite;
    z-index: 1;
    display: none; /* Hidden by default */
}

@keyframes mp-pulse {
    0%   { transform: translate(-50%, -50%) scale(1); opacity: 0.6; }
    100% { transform: translate(-50%, -50%) scale(2.5); opacity: 0; }
}

.mappoints-frontend-pin:hover .mp-pin-dot,
.mappoints-frontend-pin.active .mp-pin-dot {
    background: #1b304c; /* Solid dark navy on hover/active */
    border-color: #ffffff; /* Keep white border on hover/active */
    transform: scale(1.05);
}

.mappoints-frontend-pin:hover .mp-pin-pulse,
.mappoints-frontend-pin.active .mp-pin-pulse {
    display: block; /* Show pulsing ring on hover/active */
}

/* Frontend tooltip */
.mappoints-frontend-tooltip {
    position: absolute;
    background: rgba(9, 22, 41, 0.95);
    border: 1px solid rgba(0, 201, 255, 0.45);
    border-radius: 8px;
    padding: 6px 12px;
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    pointer-events: none;
    z-index: 50;
    white-space: nowrap;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(8px);
    transform: translate(-50%, -100%) translateY(-10px);
}

.mappoints-frontend-tooltip::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 50%;
    transform: translateX(-50%) rotate(45deg);
    width: 8px;
    height: 8px;
    background: rgba(9, 22, 41, 0.95);
    border-right: 1px solid rgba(0, 201, 255, 0.45);
    border-bottom: 1px solid rgba(0, 201, 255, 0.45);
}

.mp-tooltip-text {
    font-family: var(--mp-font, sans-serif);
    text-align: center;
}

/* Responsive */
@media (max-width: 991px) {
    .mappoints-frontend {
        position: relative !important; /* Flow naturally on mobile */
        inset: auto !important;
        width: 100% !important;
        height: auto !important;
        margin-top: 30px !important;
        justify-content: center;
        display: flex !important;
    }
    .mappoints-map-area {
        width: 100% !important; /* Take full width on mobile background */
        margin-left: 0 !important; /* Reset left margin on mobile */
        opacity: 1 !important; /* Fully visible, not background opacity */
    }
    .mappoints-map-wrapper {
        margin-top: -25% !important; /* Shift map upwards on mobile */
    }
    .info {
        padding: 80px 0px 40px 0 !important; /* Smaller padding on mobile */
    }
    .mp-left-location {
        position: relative !important; /* Flow naturally on mobile to avoid overlapping the button */
        left: auto !important;
        top: auto !important;
        width: 100% !important;
    }
    #info-map-location {
        min-height: auto !important; /* Shrink naturally if empty on mobile */
        margin: 16px 0;
    }
    /* Space between the map (on top) and the "Un réseau implanté..." heading below it */
    .info__col--map {
        padding-bottom: 32px !important;
    }
    /* Center this section's text on mobile (theme targets a stale class) */
    .info__col--content {
        text-align: center !important;
    }
    .info__col--content .info__btn-wrapper {
        justify-content: center !important;
    }
    .info__col--content .mp-left-location,
    .info__col--content .mp-left-header {
        text-align: center !important;
        justify-content: center !important;
    }
    .info__col--content .mp-left-divider {
        margin-left: auto !important;
        margin-right: auto !important;
    }
}

/* Mobile: map is display-only — no rollover, no tooltips, no popups */
@media (max-width: 767px) {
    /* Block all pin interactions so hover/click handlers never fire */
    .mappoints-frontend-pin {
        pointer-events: none !important;
        cursor: default !important;
    }
    /* Never show the hover/active visual states */
    .mappoints-frontend-pin:hover .mp-pin-dot,
    .mappoints-frontend-pin.active .mp-pin-dot {
        background: #00c9ff;
        border-color: #ffffff;
        transform: none;
    }
    .mappoints-frontend-pin:hover .mp-pin-pulse,
    .mappoints-frontend-pin.active .mp-pin-pulse {
        display: none !important;
    }
    /* Hide the tooltip entirely */
    .mappoints-frontend-tooltip {
        display: none !important;
    }
}

/* Custom info padding for theme section */
.info {
    padding: 150px 0px 50px 0 !important;
}

/* Left info panel styles matching the mock */
#info-map-location {
    transition: opacity 0.3s ease, transform 0.3s ease;
    margin: 24px 0;
    min-height: 150px !important; /* Minimum height locked to 150px */
    position: relative !important;  /* Relative container for absolute child */
}

#info-map-location.is-hidden {
    display: block !important;     /* Override theme's display: none; */
    opacity: 0 !important;
    transform: translateY(10px) !important;
    pointer-events: none !important;
    visibility: hidden !important; /* Hide visually but keep layout height */
}

.mp-left-location {
    position: absolute !important;  /* Absolute positioning to prevent Y expansion */
    left: 0 !important;
    top: 0 !important;
    width: 100% !important;
    color: #ffffff !important;
    font-family: 'Inter', sans-serif !important;
    text-align: left;
}

.mp-left-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
}

.mp-left-icon {
    width: 25px;
    height: 30px;
    flex-shrink: 0;
}

.mp-left-title-group {
    display: flex;
    flex-direction: column;
}

.mp-left-city {
    font-size: 25px !important;
    font-weight: 700;
    color: #ffffff !important;
    line-height: 1.1;
}

.mp-left-dept {
    font-size: 14px !important;
    color: #ffffff !important;
    font-weight: 500;
}

.mp-left-divider {
    height: 1px;
    background: linear-gradient(90deg, var(--mp-accent, #00c9ff) 0%, rgba(0,201,255,0.1) 100%);
    margin: 12px 0;
    width: 60%;
}

.mp-left-details {
    font-size: 14px !important;
    line-height: 1.6;
    color: #ffffff !important;
}

.mp-left-name-spec {
    color: #ffffff !important;
    margin-bottom: 4px;
}

.mp-left-name-spec strong {
    font-weight: 600;
}

.mp-left-phone {
    color: #ffffff !important;
    margin-bottom: 2px;
}

.mp-left-email a {
    color: #ffffff !important;
    text-decoration: none;
    transition: color 0.2s;
}

.mp-left-email a:hover {
    color: var(--mp-accent, #00c9ff);
    text-decoration: underline !important;
}

/* Prevent default theme underlines in the left location block */
.location,
#info-map-location,
.mp-left-location,
.mp-left-location * {
    text-decoration: none !important;
}
