/* =============================================================
   MAP RESTAURANTS — Feuille de style
   Chemin : /assets/css/map-restaurants.css
   ============================================================= */

/* ─────────────────────────────────────────
   CONTENEUR CARTE
───────────────────────────────────────── */
.map-container {
    position: relative;
    width: 100vw;
    max-width: 100%;
    margin: 0;
    height: 600px;
    overflow: hidden;
}

#map_restaurants {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    border-radius: 0;
    box-shadow: none;
    overflow: hidden;

    -webkit-mask-image: radial-gradient(ellipse at center, black 50%, transparent 100%);
    mask-image:         radial-gradient(ellipse at center, black 50%, transparent 100%);
}

/* Supprime le masque sur mobile */
@media (max-width: 768px) {
    #map_restaurants {
        -webkit-mask-image: none !important;
        mask-image: none !important;
        height: calc(100vh - 140px);
    }

    .map-container {
        height: calc(100vh - 140px);
    }
}

/* ─────────────────────────────────────────
   PANNEAU DROIT
───────────────────────────────────────── */
.right-panel {
    position: absolute;
    top: 18px;
    right: 24px;
    bottom: 18px;
    width: 420px;
    z-index: 6;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

@media (max-width: 768px) {
    .right-panel {
        position: absolute;
        top: 12px;
        left: 0;
        right: 0;
        bottom: auto;
        width: auto;
        z-index: 80;
    }
}

/* ─────────────────────────────────────────
   FILTRES
───────────────────────────────────────── */
#filter-container {
    position: relative;
    z-index: 20;
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    padding: 4px 20px 4px 0;
    max-width: 1300px;
    flex-wrap: wrap;
    margin: 0;
}

.filters-desktop {
    flex-shrink: 0;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    flex-wrap: wrap;
    width: 100%;
    padding: 0 20px;
    border-radius: 12px;
}

/* Boutons dropdown */
#filter-container .dropdown-toggle {
    background: var(--background-nav-color);
    backdrop-filter: blur(6px);
    border: 1px solid rgba(0, 0, 0, 0.15);
    border-radius: 10px;
    padding: 5px;
    font-weight: 600;
    font-size: smaller;
    color: var(--text-color);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.12);
    transition: all 0.25s ease;
}

#filter-container .dropdown-toggle:hover,
#filter-container .dropdown-toggle:focus {
    background: var(--background-nav-contrasted);
    border-color: var(--primary-color);
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.18);
    transform: translateY(-1px);
}

#filter-container .dropdown.show .dropdown-toggle {
    border-color: var(--background-nav-contrasted);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.22);
}

/* Menu dropdown */
#filter-container .dropdown-menu {
    margin-top: 8px;
    border-radius: 12px;
    border: none;
    padding: 6px;
    min-width: 220px;
    background: var(--background-nav-color);
    backdrop-filter: blur(8px);
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.25);
    z-index: 80;
    max-height: min(60vh, 420px);
    overflow-y: auto;
}

/* Scrollbar fine */
#filter-container .dropdown-menu::-webkit-scrollbar       { width: 6px; }
#filter-container .dropdown-menu::-webkit-scrollbar-track { background: transparent; }
#filter-container .dropdown-menu::-webkit-scrollbar-thumb {
    background-color: rgba(0, 0, 0, 0.25);
    border-radius: 4px;
}
#filter-container .dropdown-menu::-webkit-scrollbar-thumb:hover {
    background-color: rgba(0, 0, 0, 0.45);
}
#filter-container .dropdown-menu {
    scrollbar-width: thin;
    scrollbar-color: rgba(0, 0, 0, 0.35) transparent;
}

/* Items */
#filter-container .dropdown-item {
    border-radius: 8px;
    padding: 10px;
    font-weight: 500;
    color: var(--text-color);
    transition: background 0.2s ease, color 0.2s ease;
}

#filter-container .dropdown-item:hover {
    background: var(--background-nav-contrasted);
    color: var(--text-color);
}

/* Ajustements mobile dropdown */
@media (max-width: 768px) {
    #filter-container {
        z-index: 80;
    }

    #filter-container .dropdown-menu {
        z-index: 80;
        max-height: 45vh;
    }

    #filter-container .dropdown-toggle {
        font-weight: 400;
        font-size: smaller;
        padding: 5px;
    }

    .filters-desktop {
        justify-content: center;
    }
}

/* ─────────────────────────────────────────
   LISTE RESTAURANTS (desktop)
───────────────────────────────────────── */
.restaurant-list {
    position: relative;
    flex: 1;
    display: flex;
    flex-direction: column;
    z-index: 5;
    width: 100%;
    height: calc(120px * 4 + 18px);
    max-height: calc(100% - 48px - 12px);
    overflow-y: auto;
    padding: 6px 20px;
    gap: 6px;
    scroll-snap-type: y mandatory;
    scrollbar-width: none;
}

@media (max-width: 768px) {
    .restaurant-list {
        display: none;
    }
}

/* ─────────────────────────────────────────
   CARTE RESTAURANT
───────────────────────────────────────── */
.restaurant-item {
    display: flex;
    gap: 16px;
    overflow: hidden;
    background: var(--background-nav-color);
    cursor: pointer;
    transition: box-shadow 0.2s ease, transform 0.2s ease;
    height: 120px;
    min-height: 120px;
    max-height: 120px;
    scroll-snap-align: start;
    scroll-snap-stop: always;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.12);
    box-sizing: border-box;
    padding: 10px;
    align-items: center;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 8px;
}

.restaurant-item:hover,
.restaurant-item.active {
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.1);
    background-color: var(--background-nav-contrasted);
}

.restaurant-card-inner {
    display: flex;
    gap: 12px;
    align-items: center;
}

/* Image */
.restaurant-image {
    width: 150px;
    aspect-ratio: 3 / 2;
    flex-shrink: 0;
    overflow: hidden;
}

.restaurant-image img,
.restaurant-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 8px;
    display: block;
}

/* Détails texte */
.restaurant-details {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.restaurant-details a {
    font-size: smaller;
    font-weight: 600;
    color: var(--text-color);
    text-decoration: none;
    margin-bottom: 5px;
}

.restaurant-details a:hover { text-decoration: underline; }

.restaurant-title {
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.25;
    color: var(--text-color);
    text-decoration: none;
}

.restaurant-rating {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--primary-color);
}

.restaurant-rating-row {
    display: flex;
    align-items: center;
    gap: 6px;
}

.rating-value {
    font-size: 0.75rem !important;
    font-weight: 600;
    color: var(--text-color);
    margin-left: 0 !important;
}

.stars {
    display: flex;
    gap: 2px;
}

.stars i {
    font-size: 0.8rem;
    color: #fbbc04; /* Google star yellow */
}

.restaurant-location {
    font-size: 0.75rem;
    color: var(--text-color);
    opacity: 0.8;
}

.restaurant-tags {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.restaurant-tags span {
    font-size: 0.65rem !important;
    background: rgba(0, 0, 0, 0.06);
    padding: 2px 8px;
    border-radius: 12px;
}

/* ─────────────────────────────────────────
   CARTE MOBILE
───────────────────────────────────────── */
#mobile-restaurant-card {
    display: none;
    position: absolute;
    bottom: 20px;
    left: 0;
    right: 0;
    margin: auto;
    width: calc(100% - 24px);
    z-index: 80;
    opacity: 0.9;
    background: var(--background-nav-color);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    padding: 10px;
    gap: 12px;
    align-items: center;
    color: var(--text-color);
}

#mobile-restaurant-card img {
    width: 150px;
    height: auto !important;
    aspect-ratio: 3 / 2;
    object-fit: cover;
}

#mobile-restaurant-card a {
    font-weight: bold;
    font-size: 1rem;
    color: var(--text-color);
    text-decoration: none;
}

#mobile-restaurant-card .card-details { flex: 1; }

#mobile-restaurant-card .mobile-card-tags span {
    font-size: 0.65rem !important;
    background: #f1f1f1;
    padding: 2px 8px;
    border-radius: 12px;
    color: #242424;
}

#mobile-card-close {
    font-size: 1.5rem;
    font-weight: bold;
    cursor: pointer;
    padding: 0 12px;
    user-select: none;
}

@media (max-width: 768px) {
    #mobile-restaurant-card {
        display: flex;
        color: black;
    }
}

/* ─────────────────────────────────────────
   MARQUEURS LEAFLET
───────────────────────────────────────── */
.leaflet-marker-icon .cluster-image {
    position: relative;
    overflow: visible;
}

/* Marqueur rond */
.leaflet-marker-icon .restaurant-marker {
    position: relative;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    border: 3px solid #ffffff;
    transition: border-color 0.2s ease, transform 0.2s ease;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.35);
}

.leaflet-marker-icon .restaurant-marker img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

/* Badge nombre (cluster) */
.leaflet-marker-icon .restaurant-count {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.45);
    color: #fff;
    font-weight: 700;
    font-size: 15px;
    border-radius: 50%;
    pointer-events: none;
}

/* Tag cœur */
.marker-heart-tag {
    position: absolute;
    bottom: -6px;
    left: 6px;
    transform: translateX(-50%);
    width: 20px;
    height: 20px;
    background: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    color: #c21c1c;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
    z-index: 10;
}

/* Tag prix */
.marker-price-tag {
    position: absolute;
    bottom: -6px;
    right: 6px;
    transform: translateX(50%);
    width: 20px;
    height: 20px;
    background: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    color: #c2ac1c;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
    z-index: 10;
}

.restaurant-marker.active {
    border-color: #2e8b57;
    transform: scale(1.08);
}