/**
 * 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 (Google) : chrome neutralisé pour laisser la
   carte .ib-card aller à ras bord (photo pleine largeur, pas de bandeau
   blanc, largeur non plafonnée). ---------- */
.gm-style .gm-style-iw-c {
    border-radius: 10px !important;
    padding: 0 !important;
    max-width: none !important;
    box-shadow: 0 16px 40px -18px rgba(30, 32, 29, 0.35) !important;
    overflow: hidden !important;
}
/* auto (défaut Google) plutôt que hidden : si la carte manque de hauteur,
   le contenu défile au lieu d'être rogné. */
.gm-style .gm-style-iw-d {
    overflow: auto !important;
    padding: 0 !important;
    max-width: none !important;
}
/* Bandeau/rangée du bouton de fermeture : ne réserve plus d'espace blanc
   au-dessus de la photo. */
.gm-style .gm-style-iw-ch { padding-top: 0 !important; }
.gm-style .gm-style-iw-chr {
    position: absolute !important;
    top: 4px;
    right: 4px;
    z-index: 3;
    height: 0 !important;
}
/* Bouton « fermer » visible par-dessus la photo, X centré dans le rond. */
.gm-style .gm-style-iw-chr .gm-ui-hover-effect {
    background: rgba(255, 255, 255, 0.92) !important;
    border-radius: 50% !important;
    width: 30px !important;
    height: 30px !important;
    min-width: 30px !important;
    opacity: 1 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0 !important;
    box-shadow: 0 2px 6px -2px rgba(0, 0, 0, 0.4);
}
.gm-style .gm-style-iw-chr .gm-ui-hover-effect > span {
    margin: 0 !important;
    width: 15px !important;
    height: 15px !important;
}
/* Masque le petit ergot/tail blanc résiduel. */
.gm-style .gm-style-iw-tc::after { background: #fff !important; }
/* ---------- Infobulle : carte lieu (resto / voyage) ---------- */
.ib-card {
    width: 460px;
    max-width: 88vw;
    color: var(--map-ink);
    background: #fff;
    overflow: hidden;
}
/* Média : photo + barre nom/bouton par-dessus le bas de la photo */
.ib-media { position: relative; }
.ib-photo {
    height: 190px;
    background-size: cover;
    background-position: center;
    background-color: #b8b8b8;
}
.ib-photo--empty {
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #f1ede5, #e6e0d4);
}
.ib-photo--empty span {
    font-family: var(--font-display, inherit);
    font-size: 58px;
    font-weight: 800;
    color: rgba(0, 0, 0, 0.18);
    letter-spacing: 0.05em;
}
.ib-bar {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    background: rgba(0, 0, 0, 0.35);
    padding: 12px 16px;
}
.ib-name {
    margin: 0;
    font-size: 21px;
    font-weight: 800;
    line-height: 1.1;
    min-width: 0;
}
.ib-name a {
    color: #fff;
    text-decoration: none;
    overflow-wrap: anywhere;
}
.ib-name a:hover { color: var(--map-accent); }

/* Boutons pilule orange (goto + article) */
.ib-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--map-accent);
    color: #fff !important;
    padding: 9px 16px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.01em;
    text-decoration: none;
    white-space: nowrap;
    flex: 0 0 auto;
    transition: background 0.2s ease;
}
.ib-btn:hover { background: var(--map-accent-soft); }
.ib-btn__dot {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #fff;
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.ib-btn__dot svg {
    width: 11px;
    height: 11px;
    display: block;
    fill: var(--map-accent);
}

/* Adresse centrée sous la barre */
.ib-addr {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 16px 4px;
    font-size: 13px;
    font-weight: 700;
    color: var(--map-ink);
    text-align: center;
}
.ib-addr__pin {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
}
.ib-addr__pin svg {
    width: 15px;
    height: 15px;
    display: block;
    fill: var(--map-accent);
}

/* Corps : colonne horaires (gauche) + description (droite) */
.ib-body {
    display: flex;
    gap: 18px;
    align-items: flex-start;
    padding: 10px 18px 4px;
}
.ib-body--single { display: block; }
.ib-aside {
    flex: 0 0 36%;
    max-width: 36%;
}
.ib-status {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 10px;
}
.ib-status__dot {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    flex: 0 0 auto;
}
.ib-status--open   { color: #3aa03a; }
.ib-status--open   .ib-status__dot { background: #3aa03a; }
.ib-status--warn   { color: #c77b00; }
.ib-status--warn   .ib-status__dot { background: #c77b00; }
.ib-status--closed { color: #cc3333; }
.ib-status--closed .ib-status__dot { background: #cc3333; }
.ib-hours__list {
    list-style: none;
    margin: 0;
    padding: 0;
}
.ib-hours__list li,
.ib-hours__raw,
.ib-hours__today {
    font-size: 12px;
    font-style: italic;
    color: var(--map-ink-soft);
    line-height: 1.6;
}
.ib-hours__today { font-weight: 600; font-style: normal; }
.ib-desc {
    flex: 1 1 auto;
    min-width: 0;
    font-size: 13px;
    line-height: 1.55;
    color: var(--map-ink);
}
.ib-desc p { margin: 0; }
.ib-desc img { max-width: 50%; }

/* Pied : bouton « article » aligné à droite */
.ib-foot {
    display: flex;
    justify-content: flex-end;
    padding: 10px 18px 16px;
}

/* 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; }
    /* Infobulle en mobile : colonne unique (horaires au-dessus de la desc). */
    .ib-card { width: 300px; max-width: 82vw; }
    .ib-photo { height: 150px; }
    .ib-name { font-size: 18px; }
    .ib-bar { padding: 10px 12px; gap: 8px; }
    .ib-btn { padding: 8px 12px; font-size: 12px; }
    .ib-body { flex-direction: column; gap: 10px; }
    .ib-aside { flex-basis: auto; max-width: 100%; }
    .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; }
}
