* {
    box-sizing: border-box;
}

html,
body {
    width: 100%;
    height: 100%;
    margin: 0;
    font-family:
        Inter,
        ui-sans-serif,
        system-ui,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;
    color: #17211b;
    background: #f6f7f4;
}

body {
    overflow: hidden;
}

.map-header {
    height: 72px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    background: #ffffff;
    border-bottom: 1px solid #e4e8e2;
    position: relative;
    z-index: 20;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    color: #15231a;
    text-decoration: none;
}

.brand-mark {
    width: 40px;
    height: 40px;
    display: grid;
    place-items: center;
    border-radius: 12px;
    background: #1d6a43;
    color: #ffffff;
    font-size: 22px;
    font-weight: 800;
}

.brand strong,
.brand small {
    display: block;
}

.brand strong {
    font-size: 20px;
    line-height: 1.1;
}

.brand small {
    color: #6b746d;
    margin-top: 3px;
    font-size: 12px;
}

.home-link {
    color: #1d6a43;
    text-decoration: none;
    font-weight: 700;
}

.explore-layout {
    height: calc(100vh - 72px);
    display: grid;
    grid-template-columns: minmax(390px, 42%) 1fr;
}

.places-panel {
    min-width: 0;
    display: flex;
    flex-direction: column;
    background: #f6f7f4;
    border-right: 1px solid #dde2dc;
}

.filter-area {
    padding: 18px;
    background: #ffffff;
    border-bottom: 1px solid #e2e6e1;
}

.search-row {
    display: flex;
    gap: 10px;
}

#place-search,
.filter-row select {
    width: 100%;
    height: 46px;
    border: 1px solid #ced6cf;
    border-radius: 12px;
    background: #ffffff;
    padding: 0 14px;
    font-size: 14px;
    outline: none;
}

#place-search:focus,
.filter-row select:focus {
    border-color: #1d6a43;
    box-shadow: 0 0 0 3px rgba(29, 106, 67, 0.12);
}

.filter-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 10px;
}

.result-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 14px;
    font-size: 14px;
}

#reset-filters,
#mobile-map-toggle,
#mobile-list-toggle {
    border: 0;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 700;
}

#reset-filters {
    padding: 8px 10px;
    background: transparent;
    color: #1d6a43;
}

#mobile-map-toggle {
    display: none;
    padding: 0 16px;
    background: #1d6a43;
    color: #ffffff;
}

.place-list {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
}

.place-card {
    display: grid;
    grid-template-columns: 160px minmax(0, 1fr);
    min-height: 150px;
    margin-bottom: 14px;
    overflow: hidden;
    border-radius: 16px;
    background: #ffffff;
    border: 1px solid #e2e6e1;
    cursor: pointer;
    transition:
        transform 0.15s ease,
        box-shadow 0.15s ease;
}

.place-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 26px rgba(21, 35, 26, 0.12);
}

.place-photo {
    min-height: 150px;
    background: #dce4dc;
}

.place-photo img {
    width: 100%;
    height: 100%;
    min-height: 150px;
    object-fit: cover;
}

.photo-placeholder {
    width: 100%;
    height: 100%;
    min-height: 150px;
    display: grid;
    place-items: center;
    background:
        linear-gradient(
            135deg,
            #dce8df,
            #b9d0bf
        );
    color: #28583b;
    font-size: 13px;
    font-weight: 800;
}

.place-card-body {
    min-width: 0;
    padding: 15px;
}

.place-meta-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.category-pill {
    display: inline-block;
    max-width: 75%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    padding: 5px 8px;
    border-radius: 999px;
    background: #e8f2eb;
    color: #1d6a43;
    font-size: 11px;
    font-weight: 800;
}

.rating {
    white-space: nowrap;
    color: #9a6500;
    font-size: 13px;
    font-weight: 800;
}

.place-card h2 {
    margin: 10px 0 5px;
    font-size: 18px;
    line-height: 1.25;
}

.place-location,
.review-row {
    margin: 0;
    color: #667068;
    font-size: 13px;
    line-height: 1.45;
}

.review-row {
    margin-top: 6px;
}

.details-link {
    display: inline-block;
    margin-top: 11px;
    color: #1d6a43;
    font-size: 13px;
    font-weight: 800;
    text-decoration: none;
}

.map-panel {
    position: relative;
    min-width: 0;
}

#google-map {
    width: 100%;
    height: 100%;
}

.map-error {
    position: absolute;
    z-index: 5;
    top: 16px;
    left: 50%;
    transform: translateX(-50%);
    max-width: 480px;
    padding: 12px 16px;
    border-radius: 10px;
    background: #8c1d18;
    color: #ffffff;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.22);
    font-weight: 700;
}

#mobile-list-toggle {
    display: none;
    position: absolute;
    z-index: 5;
    bottom: 22px;
    left: 50%;
    transform: translateX(-50%);
    padding: 13px 20px;
    background: #17211b;
    color: #ffffff;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.25);
}

.map-popup {
    min-width: 190px;
    padding: 4px;
    color: #17211b;
}

.map-popup strong,
.map-popup span {
    display: block;
}

.map-popup strong {
    font-size: 15px;
}

.map-popup span {
    margin-top: 4px;
    color: #1d6a43;
    font-size: 12px;
    font-weight: 800;
}

.map-popup p {
    margin: 7px 0;
    color: #667068;
    font-size: 12px;
}

.map-popup a {
    color: #1d6a43;
    font-weight: 800;
    text-decoration: none;
}

.loading-message,
.empty-message,
.error-message {
    padding: 40px 20px;
    text-align: center;
    color: #647068;
}

.error-message {
    color: #9b211c;
}

@media (max-width: 820px) {
    .map-header {
        height: 62px;
        padding: 0 14px;
    }

    .brand small {
        display: none;
    }

    .brand strong {
        font-size: 17px;
    }

    .explore-layout {
        height: calc(100vh - 62px);
        display: block;
        position: relative;
    }

    .places-panel,
    .map-panel {
        position: absolute;
        inset: 0;
    }

    .places-panel {
        z-index: 2;
    }

    .map-panel {
        z-index: 1;
        visibility: hidden;
    }

    body.mobile-map-visible .places-panel {
        visibility: hidden;
    }

    body.mobile-map-visible .map-panel {
        visibility: visible;
        z-index: 3;
    }

    #mobile-map-toggle,
    #mobile-list-toggle {
        display: block;
    }

    .filter-area {
        padding: 12px;
    }

    .filter-row {
        grid-template-columns: 1fr;
    }

    .place-list {
        padding: 10px;
    }

    .place-card {
        grid-template-columns: 120px minmax(0, 1fr);
        min-height: 132px;
    }

    .place-photo,
    .place-photo img,
    .photo-placeholder {
        min-height: 132px;
    }

    .place-card-body {
        padding: 12px;
    }

    .place-card h2 {
        font-size: 16px;
    }
}


.map-panel::after {
    content: "Loading map locations…";
    position: absolute;
    inset: 0;
    z-index: 4;
    display: grid;
    place-items: center;
    background: #ffffff;
    color: #1d6a43;
    font-size: 16px;
    font-weight: 800;
    transition: opacity 0.2s ease;
}

.map-panel.map-ready::after {
    opacity: 0;
    pointer-events: none;
}
