/* Карта отелей на /hotels (Leaflet + OSM, этап D) */

.hotels-listing-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem 1rem;
    margin-bottom: 1rem;
}

.hotels-listing-count {
    margin: 0;
    font-size: var(--text-sm);
    color: var(--text-muted);
}

.hotels-listing-view-toggle .btn.active {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
    color: var(--white);
}

.hotels-map-section {
    margin-bottom: 1.5rem;
}

.hotels-map-section__title {
    font-size: 1.125rem;
    font-weight: var(--font-weight-section);
    margin-bottom: 0.5rem;
}

.hotels-map-section__hint {
    font-size: var(--text-sm);
    color: var(--text-muted);
    margin-bottom: 0.75rem;
}

.hotels-map-wrap {
    position: relative;
    border-radius: var(--radius-map);
    overflow: hidden;
    border: 1px solid var(--neutral);
    box-shadow: var(--shadow-sm);
    background: var(--neutral-light, #f0f2f5);
}

.hotels-map-leaflet {
    height: min(420px, 55vh);
    min-height: 280px;
    width: 100%;
    z-index: 1;
}

/* reset.css: img { max-width:100%; height:auto } — иначе щели между тайлами OSM */
.hotels-map-leaflet.leaflet-container img,
.hotels-map-leaflet .leaflet-tile-pane img,
.hotels-map-leaflet .leaflet-marker-icon,
.hotels-map-leaflet .leaflet-marker-shadow,
.hotels-map-leaflet .leaflet-image-layer,
.hotels-map-leaflet .leaflet-tile {
    max-width: none !important;
    max-height: none !important;
}

.hotels-map-leaflet .leaflet-tile-pane img {
    padding: 0;
    border: none;
}

.hotels-map-empty {
    padding: 2rem 1.25rem;
    text-align: center;
    color: var(--text-muted);
    font-size: var(--text-sm);
}

.hotels-listing-cards.is-map-only .hotels-listing-cards-inner {
    display: none;
}

.hotels-listing-cards.is-list-only .hotels-map-section {
    display: none;
}

@media (min-width: 992px) {
    .hotels-listing-view-toggle {
        display: none;
    }

    .hotels-listing-cards.is-map-only .hotels-listing-cards-inner,
    .hotels-listing-cards.is-list-only .hotels-map-section {
        display: block;
    }
}

@media (max-width: 991.98px) {
    .hotels-map-leaflet {
        height: min(70vh, 480px);
    }
}

.hotel-card-map-highlight > .hotel-card-horizontal,
.hotel-card-map-highlight > .hotel-card {
    outline: 3px solid var(--primary-dark);
    outline-offset: 2px;
    border-radius: var(--card-radius);
}

/* Leaflet: подсказка при наведении */
.hotels-map-leaflet .leaflet-tooltip.hotels-map-tooltip {
    padding: 0;
    border: none;
    background: transparent;
    box-shadow: none;
}

.hotels-map-leaflet .leaflet-tooltip-top.hotels-map-tooltip::before,
.hotels-map-leaflet .leaflet-tooltip-bottom.hotels-map-tooltip::before {
    border-top-color: var(--white);
    border-bottom-color: var(--white);
}

.hotels-map-tooltip-inner {
    display: flex;
    align-items: flex-start;
    gap: 0.625rem;
    max-width: 260px;
    padding: 0.5rem 0.625rem;
    background: var(--white);
    border: 1px solid var(--neutral);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
}

.hotels-map-tooltip-thumb {
    flex-shrink: 0;
    width: 72px;
    height: 54px;
    object-fit: cover;
    border-radius: var(--radius-sm);
}

.hotels-map-tooltip-body {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    min-width: 0;
}

.hotels-map-tooltip-title {
    font-weight: var(--font-weight-section, 600);
    font-size: var(--text-sm);
    line-height: 1.3;
    color: var(--dark);
}

.hotels-map-tooltip-meta {
    font-size: 0.75rem;
    line-height: 1.35;
    color: var(--text-muted, var(--gray));
}

.hotels-map-rating {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--dark);
}

.hotels-map-rating .fa-star {
    color: #f0ad4e;
    font-size: 0.7rem;
}

/* Leaflet: попап по клику */
.hotels-map-leaflet .leaflet-popup.hotels-map-popup-wrap .leaflet-popup-content-wrapper {
    border-radius: var(--radius-md);
    border: 1px solid var(--neutral);
    box-shadow: var(--shadow-md);
}

.hotels-map-leaflet .leaflet-popup.hotels-map-popup-wrap .leaflet-popup-content {
    margin: 0.75rem 0.875rem;
    line-height: var(--line-height-body);
}

.hotels-map-leaflet .leaflet-popup.hotels-map-popup-wrap .leaflet-popup-tip {
    border-top-color: var(--white);
    box-shadow: var(--shadow-sm);
}

.hotels-map-popup .hotels-map-popup-thumb {
    display: block;
    width: 100%;
    max-width: 200px;
    height: auto;
    border-radius: var(--radius-sm);
    margin-bottom: 0.5rem;
}

.hotels-map-popup-title {
    font-weight: var(--font-weight-section, 600);
    font-size: 0.95rem;
    margin: 0 0 0.35rem;
    color: var(--dark);
}

.hotels-map-popup-meta {
    font-size: var(--text-sm);
    color: var(--text-muted, var(--gray));
    margin: 0 0 0.35rem;
}

.hotels-map-popup-rating-wrap {
    margin: 0 0 0.5rem;
}

.hotels-map-popup .btn {
    font-size: 0.85rem;
}

@media (hover: none) {
    .hotels-map-leaflet .leaflet-tooltip.hotels-map-tooltip {
        display: none;
    }
}
