/* --- Header modification for sub-page --- */
.header-nav-only {
    background-color: var(--dark-green);
    color: var(--text-light);
    padding: 20px 80px;
}

/* --- Map Page Structural Split Layout --- */
.map-search-container {
    display: flex;
    height: calc(100vh - 85px);
    overflow: hidden;
    background-color: #fcf9ee;
}

/* --- Left Results Panel --- */
.results-panel {
    width: 430px;
    min-width: 430px;
    height: 100%;
    display: flex;
    flex-direction: column;
    border-right: 1px solid rgba(14, 61, 38, 0.1);
    background: #fbf8eb;
    z-index: 2;
}

.panel-header {
    padding: 22px 24px;
    background: #fbf8eb;
    border-bottom: 1px solid rgba(14, 61, 38, 0.1);
}

.panel-header h2 {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--dark-green);
    margin-bottom: 4px;
}

.panel-header p {
    font-size: 0.9rem;
    color: var(--orange-primary, #ff7a00);
    font-weight: 700;
    margin-bottom: 14px;
}

/* Sidebar filter box */
.panel-search {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #ffffff;
    border: 1px solid rgba(14, 61, 38, 0.15);
    border-radius: 12px;
    padding: 10px 14px;
    color: #777;
    transition: box-shadow 0.2s ease;
}

.panel-search:focus-within {
    box-shadow: 0 0 0 2px var(--orange-primary, #ff7a00);
}

.panel-search input {
    border: none;
    outline: none;
    background: transparent;
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 500;
    width: 100%;
    color: var(--text-dark);
}

.restaurant-list {
    flex-grow: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

/* --- Interactive Item Cards --- */
.map-item-card {
    display: flex;
    gap: 16px;
    padding: 16px;
    background: #ffffff;
    border: 2px solid rgba(14, 61, 38, 0.1);
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.map-item-card:hover {
    border-color: rgba(14, 61, 38, 0.3);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04);
}

/* Selected card gets the brand orange outline */
.map-item-card.active {
    border: 2px solid var(--orange-primary, #ff7a00);
    background-color: #ffffff;
    box-shadow: 0 6px 16px rgba(255, 122, 0, 0.12);
}

.card-img-box {
    width: 85px;
    height: 85px;
    min-width: 85px;
    border-radius: 14px;
    overflow: hidden;
    background: #f0f0f0;
}

.card-img-box img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.card-info {
    display: flex;
    flex-direction: column;
    justify-content: center;
    flex-grow: 1;
    min-width: 0;
}

.card-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
    gap: 8px;
}

.cuisine {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Walking-time chip */
.walk-time {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--dark-green);
    background-color: rgba(14, 61, 38, 0.08);
    padding: 3px 8px;
    border-radius: 8px;
    white-space: nowrap;
    flex-shrink: 0;
}

.card-info h3 {
    font-size: 1.12rem;
    font-weight: 800;
    color: var(--text-dark);
    margin-bottom: 4px;
}

.status {
    font-size: 0.85rem;
    font-weight: 700;
    color: #2b8a3e;
    margin-bottom: 6px;
}

.card-menu-link {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--orange-primary, #ff7a00);
    text-decoration: none;
}

.card-menu-link:hover {
    text-decoration: underline;
}

/* --- Right Side Interactive Map --- */
.map-view-area {
    flex-grow: 1;
    height: 100%;
    position: relative;
}

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

/* Branded Leaflet pin (divIcon) */
.mb-pin-wrap {
    background: transparent;
    border: none;
}

.mb-pin {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--orange-primary, #ff7a00);
    border: 3px solid #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.35);
}

.mb-pin-tail {
    width: 0;
    height: 0;
    margin: -3px auto 0 auto;
    border-left: 7px solid transparent;
    border-right: 7px solid transparent;
    border-top: 12px solid var(--orange-primary, #ff7a00);
    filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.25));
}

/* Popup card styling */
.leaflet-popup-content-wrapper {
    border-radius: 16px;
    overflow: hidden;
    padding: 0;
}

.leaflet-popup-content {
    margin: 0;
    width: 220px !important;
    font-family: 'Plus Jakarta Sans', sans-serif;
}

.mb-popup img {
    width: 100%;
    height: 110px;
    object-fit: cover;
    display: block;
}

.mb-popup-body {
    padding: 12px 14px 14px 14px;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.mb-popup-body strong {
    font-size: 1rem;
    color: var(--dark-green, #0e3d26);
}

.mb-popup-body span {
    font-size: 0.8rem;
    color: #777;
    font-weight: 600;
}

.mb-popup-body .mb-popup-status {
    color: #2b8a3e;
    font-weight: 700;
}

.mb-popup-body a {
    margin-top: 8px;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--orange-primary, #ff7a00);
    text-decoration: none;
}

.mb-popup-body a:hover {
    text-decoration: underline;
}

/* --- Responsive Adjustments --- */
@media (max-width: 992px) {
    .header-nav-only {
        padding-left: 40px;
        padding-right: 40px;
    }
}

@media (max-width: 768px) {
    .header-nav-only {
        padding-left: 20px;
        padding-right: 20px;
    }
    .map-search-container {
        flex-direction: column-reverse;
        height: auto;
        overflow: visible;
    }
    .results-panel {
        width: 100%;
        min-width: 100%;
        height: 500px;
    }
    .map-view-area {
        width: 100%;
        height: 380px;
    }
}
