/* Stage 331：會員端附近餐飲地圖 */
.dining-map-shell {
    --map-card-shadow: 0 22px 54px rgba(112, 80, 48, .12);
}

.map-filter-form { margin: 0; }

.map-hero-section {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 330px;
    align-items: end;
    gap: 26px;
    padding: 34px 16px 24px;
}

.map-hero-copy h1 {
    margin: 0;
    font-family: "Noto Serif TC", serif;
    font-size: clamp(40px, 5vw, 62px);
    line-height: 1.18;
    color: #303437;
    letter-spacing: .03em;
}

.map-hero-copy > p:not(.eyebrow) {
    max-width: 690px;
    margin: 14px 0 20px;
    color: #5e564f;
    font-size: 16px;
    font-weight: 800;
    line-height: 1.9;
}

.map-control-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}

.map-soft-link {
    min-height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 17px;
    border-radius: 999px;
    border: 1px solid rgba(47, 124, 120, .24);
    background: #f3fbf8;
    color: var(--teal-dark);
    font-size: 14px;
    font-weight: 900;
}

.map-status-card {
    min-height: 112px;
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 18px;
    border: 1px solid rgba(222, 207, 184, .88);
    border-radius: 24px;
    background: rgba(255,252,246,.92);
    box-shadow: var(--map-card-shadow);
}

.map-status-icon {
    width: 54px;
    height: 54px;
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    border-radius: 18px;
    color: #fff;
    background: linear-gradient(135deg, #ec765e, #df654e);
    box-shadow: 0 14px 28px rgba(235, 113, 91, .25);
    font-size: 24px;
    font-weight: 900;
}

.map-status-card strong {
    display: block;
    margin-bottom: 5px;
    color: #303437;
    font-size: 18px;
    font-weight: 900;
}

.map-status-card p {
    margin: 0;
    color: #756b61;
    font-size: 13px;
    font-weight: 800;
    line-height: 1.55;
}

.map-board-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) 360px;
    gap: 24px;
    margin: 0 16px 28px;
    align-items: start;
}

.map-board-card,
.map-detail-card,
.map-list-card,
.nearby-service-panel,
.map-service-grid a {
    border: 1px solid rgba(222, 207, 184, .88);
    background: rgba(255,252,246,.95);
    box-shadow: var(--map-card-shadow);
}

.map-board-card {
    overflow: hidden;
    border-radius: 30px;
}

.map-board-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    padding: 22px 24px 16px;
}

.map-board-header h2 {
    margin: 0 0 6px;
    font-family: "Noto Serif TC", serif;
    font-size: 28px;
    color: #313435;
}

.map-board-header span {
    color: #756b61;
    font-size: 14px;
    font-weight: 800;
}

.map-board-header strong {
    min-width: 72px;
    min-height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 15px;
    border-radius: 999px;
    color: #fff;
    background: var(--teal);
    font-size: 14px;
    font-weight: 900;
    white-space: nowrap;
}

.solo-map-canvas {
    position: relative;
    height: 430px;
    overflow: hidden;
    margin: 0 24px 18px;
    border-radius: 25px;
    background: #efe4d4;
    box-shadow: inset 0 0 0 1px rgba(188, 166, 137, .38);
}

.solo-map-canvas img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform: scale(1.06);
    filter: saturate(.82) contrast(.98) brightness(1.03);
}

.solo-map-canvas::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background:
        radial-gradient(circle at 50% 47%, rgba(47, 124, 120, .14), transparent 21%),
        linear-gradient(180deg, rgba(255,255,255,.05), rgba(255,248,240,.16));
}

.solo-real-map-canvas {
    background: #efe4d4;
}

.solo-real-map-canvas::after {
    display: none;
}

.solo-real-map-canvas .leaflet-container,
.solo-real-map-canvas.leaflet-container {
    width: 100%;
    height: 100%;
    border-radius: 25px;
    font-family: "Noto Sans TC", sans-serif;
}

.solo-real-map-canvas .leaflet-popup-content-wrapper {
    border-radius: 16px;
}

.solo-osm-map-shell {
    background: #efe4d4;
}

.solo-osm-map-shell::after {
    display: none;
}

.solo-osm-map-shell iframe {
    width: 100%;
    height: 100%;
    border: 0;
    display: block;
    border-radius: 25px;
}

.osm-open-link {
    position: absolute;
    z-index: 450;
    right: 18px;
    bottom: 18px;
    padding: 11px 16px;
    border-radius: 999px;
    background: rgba(255, 252, 246, .96);
    color: #2f7c78;
    font-size: 13px;
    font-weight: 900;
    text-decoration: none;
    box-shadow: 0 12px 26px rgba(63, 48, 31, .15);
}

.osm-open-link:hover {
    transform: translateY(-1px);
}


.user-location-dot {
    position: absolute;
    z-index: 5;
    left: 47%;
    top: 45%;
    transform: translate(-50%, -50%);
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 10px 7px 7px;
    border-radius: 999px;
    background: rgba(255, 252, 246, .96);
    color: var(--teal-dark);
    box-shadow: 0 14px 28px rgba(63, 48, 31, .16);
    font-size: 12px;
    font-weight: 900;
}

.user-location-dot span {
    width: 18px;
    height: 18px;
    border: 4px solid #fff;
    border-radius: 50%;
    background: var(--teal);
    box-shadow: 0 0 0 6px rgba(47,124,120,.16);
}

.user-location-dot em { font-style: normal; white-space: nowrap; }

.map-pin {
    position: absolute;
    z-index: 6;
    width: 42px;
    height: 42px;
    transform: translate(-50%, -100%);
    border: 0;
    border-radius: 50% 50% 50% 8px;
    background: linear-gradient(135deg, #f08067, #e4634d);
    color: #fff;
    box-shadow: 0 14px 26px rgba(205, 83, 61, .32);
    rotate: -45deg;
    transition: transform .18s ease, box-shadow .18s ease, background .18s ease;
}

.map-pin span {
    display: grid;
    place-items: center;
    width: 100%;
    height: 100%;
    rotate: 45deg;
    font-weight: 900;
}

.map-pin:hover,
.map-pin.active {
    transform: translate(-50%, -100%) scale(1.12);
    background: linear-gradient(135deg, #2f7c78, #266765);
    box-shadow: 0 18px 34px rgba(47, 124, 120, .28);
}

.map-legend-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 14px;
    padding: 0 24px 22px;
    color: #756b61;
    font-size: 12px;
    font-weight: 900;
}

.map-legend-row span {
    display: inline-flex;
    align-items: center;
    gap: 7px;
}

.map-legend-row i {
    width: 11px;
    height: 11px;
    display: inline-block;
    border-radius: 50%;
}
.legend-user { background: var(--teal); }
.legend-restaurant { background: var(--brand); }
.legend-service { background: var(--gold); }

.map-detail-stack {
    position: sticky;
    top: 100px;
}

.map-detail-card {
    display: none;
    overflow: hidden;
    border-radius: 28px;
}

.map-detail-card.active { display: block; }
.map-detail-card img {
    width: 100%;
    height: 190px;
    object-fit: cover;
}

.map-detail-body { padding: 18px; }
.map-cluster {
    display: inline-flex;
    min-height: 28px;
    align-items: center;
    padding: 0 10px;
    border-radius: 999px;
    color: var(--teal-dark);
    background: #eaf6f2;
    font-size: 12px;
    font-weight: 900;
}

.map-detail-body h3 {
    margin: 12px 0 7px;
    color: #303437;
    font-size: 23px;
    font-weight: 900;
}

.map-detail-body > p {
    margin: 0 0 12px;
    color: #73685e;
    font-size: 13px;
    font-weight: 800;
    line-height: 1.65;
}

.map-score-line {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.map-score-line strong { color: var(--gold); font-size: 16px; font-weight: 900; }
.map-score-line small {
    color: #fff;
    background: var(--teal);
    border-radius: 999px;
    padding: 6px 10px;
    font-size: 12px;
    font-weight: 900;
}

.map-tip {
    padding: 12px;
    border-radius: 16px;
    background: #fff4e8;
    color: #7a5c47 !important;
}

.map-mini-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin-bottom: 14px;
}

.map-mini-tags span {
    padding: 5px 9px;
    border-radius: 999px;
    background: #f7eee5;
    color: #746b60;
    font-size: 12px;
    font-weight: 900;
}

.map-detail-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 9px;
}

.map-detail-actions button,
.map-detail-actions a {
    min-height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 13px;
    font-size: 13px;
    font-weight: 900;
}

.map-detail-actions button {
    border: 1px solid rgba(235, 113, 91, .45);
    color: var(--brand-dark);
    background: #fff8f2;
}

.map-detail-actions button.saved {
    color: #fff;
    border-color: var(--teal);
    background: var(--teal);
}

.map-detail-actions a {
    border: 1px solid rgba(47,124,120,.28);
    color: var(--teal-dark);
    background: #f3fbf8;
}

.map-detail-actions a:last-child { grid-column: span 2; }

.map-list-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) .9fr;
    gap: 24px;
    margin: 0 16px 30px;
    align-items: start;
}

.map-restaurant-list,
.nearby-service-panel {
    min-width: 0;
}

.map-list-card {
    display: grid;
    grid-template-columns: 164px minmax(0, 1fr);
    gap: 16px;
    align-items: center;
    padding: 12px;
    border-radius: 22px;
    margin-bottom: 13px;
    cursor: pointer;
    transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}

.map-list-card:hover,
.map-list-card.active {
    transform: translateY(-2px);
    border-color: rgba(47,124,120,.45);
    box-shadow: 0 20px 44px rgba(47, 124, 120, .12);
}

.map-list-card img {
    width: 100%;
    height: 116px;
    border-radius: 16px;
    object-fit: cover;
}

.map-list-card small {
    display: block;
    margin-bottom: 6px;
    color: #c8794a;
    font-size: 12px;
    font-weight: 900;
}

.map-list-card h3 {
    margin: 0 0 7px;
    color: #303437;
    font-size: 19px;
    font-weight: 900;
}

.map-list-card p {
    margin: 0 0 10px;
    color: #756b61;
    font-size: 13px;
    font-weight: 800;
    line-height: 1.65;
}

.map-card-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.map-card-meta span {
    min-height: 27px;
    display: inline-flex;
    align-items: center;
    padding: 0 9px;
    border-radius: 999px;
    background: #f7eee5;
    color: #756b61;
    font-size: 12px;
    font-weight: 900;
}

.map-card-meta span:first-child { color: var(--gold); background: #fff6dd; }

.nearby-service-panel {
    padding: 20px;
    border-radius: 28px;
}

.map-service-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.map-service-grid a {
    min-height: 215px;
    padding: 14px 12px;
    border-radius: 20px;
    text-align: center;
}

.map-service-grid img,
.service-fallback-icon {
    width: 66px;
    height: 66px;
    margin: 0 auto 10px;
    border-radius: 50%;
    object-fit: cover;
    background: #eaf6f2;
}

.service-fallback-icon {
    display: grid;
    place-items: center;
    color: var(--teal-dark);
    font-size: 28px;
    font-weight: 900;
}

.map-service-grid strong {
    display: block;
    margin-bottom: 5px;
    color: #303437;
    font-size: 16px;
    font-weight: 900;
}

.map-service-grid small {
    display: block;
    color: #756b61;
    font-size: 12px;
    font-weight: 800;
}

.map-service-grid em {
    display: block;
    margin: 7px 0;
    color: var(--gold);
    font-size: 12px;
    font-style: normal;
    font-weight: 900;
}

.map-service-grid p {
    margin: 0;
    color: #756b61;
    font-size: 12px;
    font-weight: 800;
    line-height: 1.55;
}

@media (max-width: 1120px) {
    .map-hero-section,
    .map-board-layout,
    .map-list-layout {
        grid-template-columns: 1fr;
    }
    .map-status-card { align-self: stretch; }
    .map-detail-stack { position: static; }
    .map-detail-card { display: block; }
    .map-detail-card:not(.active) { display: none; }
}

@media (max-width: 760px) {
    .map-hero-section {
        display: block;
        padding: 22px 18px 14px;
    }
    .map-hero-copy h1 { font-size: 30px; }
    .map-hero-copy > p:not(.eyebrow) {
        max-width: 330px;
        margin: 8px 0 15px;
        font-size: 13px;
        line-height: 1.75;
    }
    .map-control-row {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
    }
    .map-control-row .filter-select,
    .map-soft-link {
        width: 100%;
        min-height: 38px;
        border-radius: 14px;
        justify-content: center;
        font-size: 12px;
    }
    .map-status-card {
        margin-top: 12px;
        min-height: 84px;
        padding: 14px;
        border-radius: 20px;
    }
    .map-status-icon {
        width: 44px;
        height: 44px;
        border-radius: 15px;
        font-size: 20px;
    }
    .map-status-card strong { font-size: 15px; }
    .map-status-card p { font-size: 12px; }

    .map-board-layout,
    .map-list-layout {
        margin: 0 18px 22px;
        gap: 18px;
    }
    .map-board-card { border-radius: 23px; }
    .map-board-header {
        align-items: flex-start;
        padding: 18px 16px 12px;
    }
    .map-board-header .eyebrow { display: none; }
    .map-board-header h2 { font-size: 20px; margin-bottom: 4px; }
    .map-board-header span { display: block; font-size: 11px; line-height: 1.55; }
    .map-board-header strong { min-width: 56px; min-height: 32px; font-size: 12px; }
    .solo-map-canvas {
        height: 315px;
        margin: 0 14px 12px;
        border-radius: 19px;
    }
    .map-pin {
        width: 36px;
        height: 36px;
    }
    .user-location-dot {
        padding: 6px;
    }
    .user-location-dot em { display: none; }
    .map-legend-row {
        padding: 0 16px 16px;
        gap: 10px;
        font-size: 10px;
    }

    .map-detail-card { border-radius: 22px; }
    .map-detail-card img { height: 160px; }
    .map-detail-body { padding: 15px; }
    .map-detail-body h3 { font-size: 20px; }
    .map-score-line { align-items: flex-start; flex-direction: column; gap: 7px; }
    .map-detail-actions { grid-template-columns: 1fr; }
    .map-detail-actions a:last-child { grid-column: auto; }

    .map-list-card {
        grid-template-columns: 104px 1fr;
        gap: 12px;
        padding: 10px;
        border-radius: 18px;
    }
    .map-list-card img { height: 112px; border-radius: 14px; }
    .map-list-card small { font-size: 10px; }
    .map-list-card h3 { font-size: 15px; margin-bottom: 5px; }
    .map-list-card p {
        display: -webkit-box;
        overflow: hidden;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        font-size: 11px;
        line-height: 1.55;
    }
    .map-card-meta { gap: 5px; }
    .map-card-meta span { min-height: 23px; padding: 0 7px; font-size: 10px; }

    .nearby-service-panel { padding: 16px; border-radius: 22px; }
    .map-service-grid { grid-template-columns: 1fr; }
    .map-service-grid a {
        min-height: 0;
        display: grid;
        grid-template-columns: 58px 1fr;
        align-items: center;
        text-align: left;
        column-gap: 12px;
    }
    .map-service-grid img,
    .service-fallback-icon {
        grid-row: span 4;
        width: 58px;
        height: 58px;
        margin: 0;
    }
    .map-service-grid strong { font-size: 15px; }
    .map-service-grid p { font-size: 11px; }
}

@media (max-width: 390px) {
    .map-control-row { grid-template-columns: 1fr; }
    .solo-map-canvas { height: 285px; }
    .map-list-card { grid-template-columns: 96px 1fr; }
}

/* UAT fix：避免地圖容器因 JS / Leaflet 未載入而空白，改用 OSM iframe 直接顯示 */
.solo-osm-map-shell {
    display: block;
    min-height: 430px;
    height: 430px;
    background: #efe4d4;
}

.solo-osm-map-shell iframe {
    width: 100%;
    height: 100%;
    min-height: 430px;
    display: block;
    border: 0;
    border-radius: 25px;
}

.solo-osm-map-shell::after {
    display: none !important;
}

/* UAT fix：附近餐飲地圖頁避免 Topbar / 右側欄位撐出整頁水平捲動 */
.dining-map-shell,
.map-filter-form,
.map-hero-section,
.map-board-layout,
.map-list-layout,
.map-board-card,
.map-detail-stack {
    max-width: 100%;
    min-width: 0;
}

.map-detail-stack,
.map-status-card,
.map-board-card {
    min-width: 0;
}

.solo-osm-map-shell,
.solo-osm-map-shell iframe,
.solo-real-map-canvas,
.solo-real-map-canvas .leaflet-container {
    max-width: 100%;
}
