/* Map Styles - Production Ready */
.map-page {
    margin: 0;
    padding: 0;
    overflow: hidden;
    font-family: var(--font-heading, "DM Sans", ui-sans-serif, system-ui, sans-serif);
}

/* ===== Slim map header bar ===== */
.map-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 20px;
    background: #fff;
    border-bottom: 1px solid var(--border, rgba(0,0,0,.12));
    height: 52px;
    z-index: 1100;
    position: relative;
}
.map-topbar__brand {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    color: #000;
    font-weight: 800;
    font-size: 15px;
}
.map-topbar__logo {
    height: 28px;
    width: auto;
    object-fit: contain;
}
.map-topbar__name { font-weight: 800; }
.map-topbar__title {
    font-size: 15px;
    font-weight: 700;
    color: var(--accent, #0d9488);
    letter-spacing: -0.01em;
}
.map-topbar__actions {
    display: flex;
    align-items: center;
    gap: 16px;
}
.map-topbar__link {
    font-size: 14px;
    font-weight: 600;
    color: var(--muted, #1f2937);
    text-decoration: none;
    transition: color .15s ease;
}
.map-topbar__link:hover { color: var(--accent, #0d9488); }
@media (max-width: 640px) {
    .map-topbar__title { display: none; }
    .map-topbar__link { font-size: 13px; }
}

.map-container {
    position: relative;
    height: calc(100vh - 52px);
    width: 100%;
}

#restaurantMap {
    height: 100%;
    width: 100%;
    z-index: 1;
}

.map-controls-overlay {
    position: absolute;
    top: 20px;
    left: 20px;
    right: 20px;
    z-index: 1000;
    pointer-events: none;
}

.map-controls-overlay > * {
    pointer-events: auto;
}

/* Search Box */
.search-container {
    background: white;
    border-radius: 12px;
    padding: 1rem;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    max-width: 600px;
    margin: 0 auto;
}

.input-group {
    display: flex;
    gap: 0.5rem;
}

#mapSearchInput {
    flex: 1;
    padding: 0.75rem 1rem;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

#mapSearchInput:focus {
    outline: none;
    border-color: var(--accent, #0d9488);
    box-shadow: 0 0 0 3px var(--accent-dim, rgba(13,148,136,.15));
}

#searchButton {
    padding: 0.75rem 1.5rem;
    background: var(--accent, #0d9488);
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s;
    font-family: var(--font-heading, 'DM Sans', sans-serif);
}

#searchButton:hover {
    background: var(--teal-hero-deep, #0f766e);
}

/* Quick Filters */
.quick-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1rem;
}

.btn-filter {
    padding: 0.5rem 1rem;
    background: #f8fafc;
    border: 2px solid #e2e8f0;
    border-radius: 50px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-filter:hover {
    border-color: var(--accent, #0d9488);
    background: white;
}

.btn-filter.active {
    background: var(--accent, #0d9488);
    color: white;
    border-color: var(--accent, #0d9488);
}

/* Location Controls */
.location-controls {
    position: absolute;
    top: 20px;
    right: 20px;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.btn-location, .btn-layers {
    width: 44px;
    height: 44px;
    background: white;
    border: none;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    color: var(--accent, #0d9488);
    transition: all 0.3s;
}

.btn-location:hover, .btn-layers:hover {
    background: var(--accent, #0d9488);
    color: white;
    transform: translateY(-2px);
}

/* Map Legend */
.map-legend {
    position: absolute;
    bottom: 20px;
    left: 20px;
    background: white;
    border-radius: 8px;
    padding: 1rem;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    font-size: 0.875rem;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}

.legend-item:last-child {
    margin-bottom: 0;
}

.legend-icon {
    width: 16px;
    height: 16px;
    border-radius: 50%;
}

.marker-default {
    background: var(--accent, #0d9488);
    border: 2px solid white;
}

.marker-featured {
    background: #f8961e;
    border: 2px solid white;
    animation: pulse 2s infinite;
}

.marker-user {
    background: #4cc9f0;
    border: 2px solid white;
}

/* Sidebar */
.btn-toggle-sidebar {
    position: absolute;
    top: 20px;
    right: 80px;
    width: 44px;
    height: 44px;
    background: white;
    border: none;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    color: var(--accent, #0d9488);
    z-index: 1001;
    transition: all 0.3s;
}

.btn-toggle-sidebar:hover {
    background: var(--accent, #0d9488);
    color: white;
    transform: translateY(-2px);
}

.badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #f72585;
    color: white;
    font-size: 0.75rem;
    min-width: 20px;
    height: 20px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 0.25rem;
}

.map-sidebar {
    position: absolute;
    top: 0;
    right: 0;
    height: 100%;
    width: 400px;
    max-width: 90vw;
    background: white;
    box-shadow: -2px 0 10px rgba(0,0,0,0.1);
    z-index: 1000;
    transform: translateX(100%);
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
}

.map-sidebar.active {
    transform: translateX(0);
}

.sidebar-header {
    padding: 1.5rem;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.sidebar-header h4 {
    margin: 0;
    color: #1a202c;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-close-sidebar {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #718096;
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 4px;
    transition: color 0.3s;
}

.btn-close-sidebar:hover {
    color: #1a202c;
    background: #f7fafc;
}

.sidebar-filters {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #e2e8f0;
    background: #f8fafc;
}

.filter-group {
    margin-bottom: 1rem;
}

.filter-group:last-child {
    margin-bottom: 0;
}

.filter-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: #4a5568;
}

.form-select {
    width: 100%;
    padding: 0.5rem;
    border: 2px solid #e2e8f0;
    border-radius: 6px;
    font-size: 0.875rem;
    background: white;
    cursor: pointer;
}

.price-filters {
    display: flex;
    gap: 0.5rem;
}

.price-filter {
    flex: 1;
    padding: 0.5rem;
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 6px;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.3s;
    text-align: center;
}

.price-filter:hover {
    border-color: var(--accent, #0d9488);
}

.price-filter.active {
    background: var(--accent, #0d9488);
    color: white;
    border-color: var(--accent, #0d9488);
}

.restaurant-list-container {
    flex: 1;
    overflow-y: auto;
    padding: 1rem 1.5rem;
}

.restaurant-card {
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 1rem;
    cursor: pointer;
    transition: all 0.3s;
}

.restaurant-card:hover {
    border-color: var(--accent, #0d9488);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(13, 148, 136, 0.12);
}

.restaurant-card.selected {
    border-color: var(--accent, #0d9488);
    background: #f0fdfa;
}

.restaurant-image {
    height: 120px;
    overflow: hidden;
}

.restaurant-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.restaurant-card:hover .restaurant-image img {
    transform: scale(1.05);
}

.restaurant-info {
    padding: 1rem;
}

.restaurant-info h5 {
    margin: 0 0 0.5rem 0;
    color: #1a202c;
    font-size: 1rem;
    font-weight: 600;
}

.restaurant-meta {
    display: flex;
    gap: 1rem;
    margin-bottom: 0.75rem;
    font-size: 0.875rem;
    color: #718096;
}

.rating {
    color: #f8961e;
    font-weight: 600;
}

.price-range {
    color: #48bb78;
    font-weight: 600;
}

.distance {
    color: var(--accent, #0d9488);
    font-weight: 600;
}

.restaurant-categories {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.category-tag {
    padding: 0.25rem 0.75rem;
    background: #e2e8f0;
    color: #4a5568;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 500;
}

.restaurant-actions {
    display: flex;
    gap: 0.5rem;
}

.btn-view-menu {
    flex: 1;
    padding: 0.5rem;
    background: var(--accent, #0d9488);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s;
}

.btn-view-menu:hover {
    background: var(--teal-hero-deep, #0f766e);
}

.btn-get-directions {
    width: 40px;
    background: #f7fafc;
    border: 2px solid #e2e8f0;
    border-radius: 6px;
    color: var(--accent, #0d9488);
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-get-directions:hover {
    border-color: var(--accent, #0d9488);
    background: var(--accent, #0d9488);
    color: white;
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.9);
    z-index: 9999;
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(5px);
}

.spinner-border {
    width: 3rem;
    height: 3rem;
    border: 4px solid #e2e8f0;
    border-top-color: var(--accent, #0d9488);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Marker Styles */
.custom-marker {
    background: none;
    border: none;
}

.restaurant-marker {
    background: white;
    border-radius: 50%;
    border: 3px solid var(--accent, #0d9488);
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
    cursor: pointer;
    transition: all 0.3s ease;
}

.restaurant-marker:hover {
    transform: scale(1.1);
    border-color: #f72585;
}

.restaurant-marker.featured {
    border-color: #f8961e;
    animation: pulse 2s infinite;
}

.restaurant-marker img {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
}

.cluster-marker {
    background: var(--accent, #0d9488);
    color: white;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.875rem;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
}

.user-marker {
    background: #4cc9f0;
    color: white;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
}

/* No Results */
.no-results {
    text-align: center;
    padding: 3rem 1rem;
    color: #718096;
}

.no-results i {
    font-size: 3rem;
    margin-bottom: 1rem;
    color: #cbd5e0;
}

.no-results h5 {
    margin-bottom: 0.5rem;
    color: #4a5568;
}

/* Animations */
@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(248, 150, 30, 0.4);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(248, 150, 30, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(248, 150, 30, 0);
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .map-controls-overlay {
        left: 10px;
        right: 10px;
    }
    
    .search-container {
        padding: 0.75rem;
    }
    
    .map-sidebar {
        width: 100%;
    }
    
    .location-controls {
        top: auto;
        bottom: 20px;
        right: 20px;
    }
    
    .btn-toggle-sidebar {
        top: auto;
        bottom: 20px;
        right: 20px;
    }
    
    .map-legend {
        bottom: 80px;
        font-size: 0.75rem;
    }
}

@media (max-width: 480px) {
    .quick-filters {
        overflow-x: auto;
        flex-wrap: nowrap;
        padding-bottom: 0.5rem;
    }
    
    .btn-filter {
        white-space: nowrap;
    }
    
    .restaurant-meta {
        flex-direction: column;
        gap: 0.25rem;
    }
}

/* Map Detail Page */
.map-detail-page {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: #f5f7fa;
    min-height: 100vh;
}

.restaurant-detail-header {
    margin-bottom: 2rem;
}

.btn-back {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: white;
    color: var(--accent, #0d9488);
    text-decoration: none;
    border-radius: 8px;
    margin-bottom: 1rem;
    transition: all 0.3s;
}

.btn-back:hover {
    background: var(--accent, #0d9488);
    color: white;
}

.restaurant-cover-image {
    width: 100%;
    height: 300px;
    object-fit: cover;
    border-radius: 12px;
    margin-bottom: 2rem;
}

.restaurant-info-card {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    margin-bottom: 2rem;
}

.restaurant-actions-card {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.btn-block {
    width: 100%;
    margin-bottom: 0.5rem;
}

.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
    display: inline-block;
}

.btn-primary {
    background: var(--accent, #0d9488);
    color: white;
}

.btn-primary:hover {
    background: var(--teal-hero-deep, #0f766e);
}

.btn-success {
    background: #06d6a0;
    color: white;
}

.btn-success:hover {
    background: #05b888;
}
