/**
 * Styles du template « Nouvelle Map v2 FR » (template-new-new-map.php).
 * Anciennement inline dans le template, extrait pour mise en cache,
 * versioning et lisibilité.
 */

:root {
    --map-accent: #ef7e15;
    --map-accent-soft: #fd8741;
    --map-accent-tint: rgba(239, 126, 21, 0.08);
    --map-ink: #1e201d;
    --map-ink-soft: #5b5e58;
    --map-line: #e8e4dc;
    --map-bg: #faf7f1;
    --map-card: #ffffff;
    --map-radius: 6px;
    --map-shadow: 0 18px 40px -22px rgba(30, 32, 29, 0.28);
    --map-shadow-soft: 0 8px 20px -14px rgba(30, 32, 29, 0.25);
}

body.page-template-template-new-new-map, body.page-template-template-new-new-map-en { background: var(--map-bg); }

#content.content-map {
    position: relative;
    margin: 0;
    padding: 0;
    max-width: none;
    width: 100%;
}

.page-template-template-new-new-map #wrapper,
.page-template-template-new-new-map-en #wrapper { max-width: none; padding: 0; margin-top: 0; }
.page-template-template-new-new-map #container,
.page-template-template-new-new-map-en #container { max-width: none; padding: 0; margin-top: 0; }
.page-template-template-new-new-map .site-footer,
.page-template-template-new-new-map-en .site-footer { margin: 0; }

/* ---------- Stage : map à gauche + panneau latéral à droite ---------- */
.map-stage {
    display: flex;
    width: 100%;
    align-items: stretch;
}

.map-modal {
    flex: 0 0 420px;
    width: 420px;
    position: relative;
}
.map-modal__panel {
    height: 100%;
    width: 100%;
    max-height: calc(100vh - 80px);
    overflow-y: auto;
    background: var(--map-card);
    box-shadow: -20px 0 50px -22px rgba(30, 32, 29, 0.35);
    position: sticky;
    top: 0;
}

/* À l'intérieur du panneau : toolbar en colonne unique */
.map-modal .map-hero { padding: 28px 28px 18px; text-align: left; }
.map-modal .map-hero__inner { max-width: none; }
.map-modal .map-toolbar {
    grid-template-columns: 1fr;
    max-width: none;
    margin: 0;
    padding: 0 28px 28px;
    background: transparent;
    box-shadow: none;
    gap: 22px;
}
.map-modal .map-toolbar__section--search {
    border-left: 0;
    border-top: 1px solid var(--map-line);
    padding: 18px 0 0;
}

/* ---------- Hero ---------- */
.map-hero {
    padding: 56px 24px 28px;
    text-align: center;
}
.map-hero__inner {
    max-width: 760px;
    margin: 0 auto;
}
.map-hero__eyebrow {
    display: inline-block;
    font-size: 12px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--map-accent);
    background: var(--map-accent-tint);
    padding: 6px 14px;
    border-radius: 999px;
    font-weight: 600;
    margin-bottom: 18px;
}
.map-hero__title {
    font-size: clamp(20px, 2.6vw, 28px);
    line-height: 1.15;
    color: var(--map-ink);
    margin: 0 0 12px;
    font-weight: 700;
    letter-spacing: -0.01em;
}
.map-hero__lead {
    font-size: 16px;
    line-height: 1.55;
    color: var(--map-ink-soft);
    margin: 0;
}

/* ---------- Toolbar (filters + search) ---------- */
.map-toolbar {
    max-width: 1180px;
    margin: 0 auto 28px;
    padding: 22px 22px 18px;
    background: var(--map-card);
    border-radius: var(--map-radius);
    box-shadow: var(--map-shadow);
    display: grid;
    grid-template-columns: 1fr 360px;
    gap: 28px;
    align-items: start;
}
.map-toolbar__label {
    font-size: 11px;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--map-ink-soft);
    font-weight: 600;
    margin-bottom: 10px;
}
.map-toolbar__section--search { border-left: 1px solid var(--map-line); padding-left: 28px; }

.cat-filters {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0;
    transition: 0.3s all ease;
}
/* Bascule Restaurants / Voyages */
.kind-switch {
    display: inline-flex;
    gap: 4px;
    padding: 4px;
    background: #f5f1e8;
    border-radius: 999px;
}
.kind-switch__btn {
    border: 0;
    background: transparent;
    padding: 8px 18px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.02em;
    color: var(--map-ink-soft);
    cursor: pointer;
    transition: background 0.18s ease, color 0.18s ease;
}
.kind-switch__btn:hover { color: var(--map-ink); }
.kind-switch__btn.is-active {
    background: var(--map-accent);
    color: #fff;
}

.cat-filter {
    padding: 8px 16px;
    border: 1px solid var(--map-line);
    border-radius: 999px;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.02em;
    color: var(--map-ink);
    background: #fff;
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
}
.cat-filter:hover {
    border-color: var(--map-accent);
    color: var(--map-accent);
    transform: translateY(-1px);
}
.cat-filter.selected {
    border-color: var(--map-accent);
    background: var(--map-accent);
    color: #fff;
    box-shadow: 0 6px 14px -8px rgba(239, 126, 21, 0.6);
}

/* ---------- Search ---------- */
.search-location { margin: 0; }
.search-location .input {
    position: relative;
    display: flex;
    align-items: center;
    background: var(--map-bg);
    border: 1px solid var(--map-line);
    border-radius: 999px;
    padding: 4px 4px 4px 44px;
    transition: all 0.2s ease;
}
.search-location .input:focus-within {
    border-color: var(--map-accent);
    background: #fff;
    box-shadow: 0 0 0 4px var(--map-accent-tint);
}
.search-location .search-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    width: 16px;
    height: 16px;
    transform: translateY(-50%);
    fill: var(--map-ink-soft);
    pointer-events: none;
}
.search-location input#search-location {
    flex: 1;
    border: 0;
    outline: 0;
    background: transparent;
    font-size: 15px;
    padding: 10px 8px;
    color: var(--map-ink);
    width: 100%;
}
.search-location input#search-location::placeholder { color: #9a9a92; }
.search-location .validate {
    border: 0;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--map-accent);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
}
.search-location .validate:hover { background: var(--map-accent-soft); transform: scale(1.05); }
.search-location .validate svg { width: 14px; height: 14px; fill: #fff; }
.error-search-location {
    min-height: 18px;
    margin-top: 8px;
    font-size: 13px;
    color: #c0392b;
}

/* ---------- Map (à gauche du panneau, sous le header) ---------- */
#map {
    flex: 1 1 auto;
    width: auto;
    max-width: none;
    height: calc(100vh - 80px);
    min-height: 480px;
    margin: 0;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    overflow: hidden;
}

/* ---------- Loader ---------- */
.lds-ring {
    display: inline-block;
    position: absolute;
    width: 80px;
    height: 80px;
    top: 280px;
    left: 50%;
    margin-left: -40px;
    z-index: 50;
}
.lds-ring div {
    box-sizing: border-box;
    display: block;
    position: absolute;
    width: 64px;
    height: 64px;
    margin: 8px;
    border: 6px solid var(--map-accent);
    border-radius: 50%;
    animation: lds-ring 1.2s cubic-bezier(0.5, 0, 0.5, 1) infinite;
    border-color: var(--map-accent) transparent transparent transparent;
}
.lds-ring div:nth-child(1) { animation-delay: -0.45s; }
.lds-ring div:nth-child(2) { animation-delay: -0.3s; }
.lds-ring div:nth-child(3) { animation-delay: -0.15s; }
@keyframes lds-ring {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ---------- Banner ---------- */
.bandeau-guide {
    max-width: 1180px;
    margin: 36px auto 0;
    width: calc(100% - 44px);
    border-radius: var(--map-radius);
    overflow: hidden;
    box-shadow: var(--map-shadow-soft);
    transition: transform 0.4s ease, box-shadow 0.4s ease;
}
.bandeau-guide:hover {
    transform: translateY(-3px);
    box-shadow: var(--map-shadow);
}
.bandeau-guide img {
    display: block;
    width: 100%;
    height: auto;
}

/* ---------- Info window ---------- */
.gm-style .gm-style-iw-c {
    border-radius: 6px !important;
    padding: 0 !important;
    box-shadow: 0 16px 40px -18px rgba(30, 32, 29, 0.35) !important;
}
.gm-style .gm-style-iw-d { overflow: hidden !important; padding: 0 !important; }
#info-bulle-title {
    font-size: 18px;
    margin: 0 0 4px;
    line-height: 1.2;
    font-weight: 700;
}
#info-bulle-title a { color: var(--map-ink); text-decoration: none; }
#info-bulle-title a:hover { color: var(--map-accent); }
#info-bulle-adresse {
    font-size: 13px;
    color: var(--map-ink-soft);
    margin: 0 0 10px;
    font-weight: 400;
}
#info-bulle-goto a {
    display: inline-block;
    font-size: 12px;
    color: var(--map-accent);
    text-decoration: none;
    font-weight: 600;
    letter-spacing: 0.02em;
}
#info-bulle-goto a:hover { text-decoration: underline; }
#info-bulle-header, #info-bulle-thumbnail {
    width: 44%;
    padding-left: 14px;
    display: inline-block;
    vertical-align: middle;
}
#info-bulle-horaire {
    font-size: 12px;
    color: var(--map-ink-soft);
    margin-top: 6px;
    line-height: 1.4;
}
#info-bulle-content {
    padding: 12px 14px 0;
    font-size: 13px;
    line-height: 1.5;
    color: var(--map-ink);
}
#info-bulle-link {
    padding: 10px 14px 14px;
    border-top: 1px solid var(--map-line);
    margin-top: 10px;
}
#info-bulle-link a {
    display: inline-block;
    background: var(--map-accent);
    color: #fff !important;
    padding: 8px 14px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    text-decoration: none;
    letter-spacing: 0.02em;
    transition: background 0.2s ease;
}
#info-bulle-link a:hover { background: var(--map-accent-soft); }

/* reCAPTCHA badge masqué sur ce template */
.page-template-template-new-new-map .grecaptcha-badge,
.page-template-template-new-new-map-en .grecaptcha-badge { display: none !important; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
    .map-toolbar {
        grid-template-columns: 1fr;
        gap: 18px;
        padding: 18px;
        width: calc(100% - 32px);
    }
    .map-toolbar__section--search {
        border-left: 0;
        border-top: 1px solid var(--map-line);
        padding-left: 0;
        padding-top: 18px;
    }
    .map-stage {
        flex-direction: column;
    }
    #map {
        width: 100%;
        height: 60vh;
        flex: 0 0 auto;
    }
    .map-modal {
        flex: 0 0 auto;
        width: 100%;
    }
    .map-modal__panel {
        position: relative;
        max-height: none;
        box-shadow: none;
        border-bottom: 1px solid var(--map-line);
    }
}
@media (max-width: 769px) {
    .map-hero { padding: 36px 18px 18px; }
    #map {
        height: 60vh;
        min-height: 360px;
        width: 100%;
        border-radius: 0;
    }
    .bandeau-guide { width: calc(100% - 24px); border-radius: 6px; }
    #info-bulle-header, #info-bulle-thumbnail {
        width: 100%;
        margin-top: 10px;
    }
    .page-template-template-new-new-map .flags,
    .page-template-template-new-new-map-en .flags,
    .page-template-template-new-new-map #logo,
    .page-template-template-new-new-map-en #logo,
    .page-template-template-new-new-map .banner-top,
    .page-template-template-new-new-map-en .banner-top { display: none; }
    .page-template-template-new-new-map #content,
    .page-template-template-new-new-map-en #content { margin-top: 0; margin-bottom: 40px; }
}
