:root {
    --bg: #f3f6fb;
    --card: #ffffff;
    --line: #d9e2ef;
    --text: #183153;
    --muted: #62748a;
    --accent: #206bc4;
    --shadow: 0 24px 60px rgba(24, 49, 83, 0.12);
    --brand-burgundy: #7b2630;
    --brand-burgundy-dark: #5f1b23;
    --brand-gold: #e0c15b;
    --brand-gold-dark: #c8a73f;
    --frame-height: 650px;
}

* {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
    height: 100%;
    font-family: Inter, Arial, sans-serif;
    color: var(--text);
    background: linear-gradient(180deg, #f7f9fc 0%, #eef3f8 100%);
}

.store-map-layout {
    height: var(--frame-height);
    min-height: var(--frame-height);
    max-height: var(--frame-height);
    overflow: hidden;
}

.map-panel {
    height: var(--frame-height);
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.map-panel--full {
    width: 100%;
}

.map-topbar {
    background: var(--card);
    border: 1px solid rgba(217, 226, 239, 0.95);
    border-radius: 16px;
    box-shadow: 0 16px 36px rgba(24, 49, 83, 0.10);
    padding: 10px 12px;
}

.map-toolbar {
    display: flex;
    align-items: center;
    gap: 10px;
}

.search-input {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 10px 12px;
    font-size: .92rem;
    outline: none;
    color: var(--text);
    background: #fff;
}

.search-input--topbar {
    flex: 1;
    min-width: 0;
    padding: 12px 14px;
    font-size: .95rem;
}

.search-input:focus {
    border-color: rgba(123, 38, 48, 0.45);
    box-shadow: 0 0 0 4px rgba(123, 38, 48, 0.10);
}

.reset-button {
    appearance: none;
    border: 1px solid rgba(200, 167, 63, 0.85);
    border-radius: 0;
    background: linear-gradient(180deg, #ecd372 0%, var(--brand-gold) 100%);
    color: #5f1b23;
    padding: 12px 16px;
    font-weight: 800;
    font-size: .9rem;
    cursor: pointer;
    text-decoration: none;
    white-space: nowrap;
    box-shadow: 0 10px 22px rgba(200, 167, 63, 0.22);
    transition: transform .18s ease, box-shadow .18s ease, filter .18s ease;
}

.reset-button:hover {
    transform: translateY(-1px);
    box-shadow: 0 14px 28px rgba(200, 167, 63, 0.28);
    filter: saturate(1.03);
}

#map {
    flex: 1;
    min-height: 0;
    height: 100%;
    border-radius: 22px;
    overflow: hidden;
    box-shadow: var(--shadow);
}

#map .light-basemap {
    filter: grayscale(1) brightness(1.1) contrast(0.9) saturate(0.45);
}

.leaflet-popup-content {
    min-width: 240px;
}

.popup-title {
    font-size: 1rem;
    font-weight: 800;
    margin-bottom: 8px;
}

.popup-line {
    margin-bottom: 6px;
    line-height: 1.45;
}

.popup-line--multiline {
    white-space: pre-line;
}

.brand-marker {
    position: relative;
    width: 51px;
    height: 66px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.brand-marker__glow {
    position: absolute;
    top: 6px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(224, 193, 91, 0.45) 0%, rgba(224, 193, 91, 0) 72%);
    filter: blur(2px);
}

.brand-marker__badge {
    position: relative;
    width: 38px;
    height: 38px;
    border-radius: 12px;
    background: linear-gradient(180deg, #8e3039 0%, var(--brand-burgundy) 56%, var(--brand-burgundy-dark) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 20px rgba(95, 27, 35, 0.32), 0 0 0 2px rgba(224, 193, 91, 0.95);
    overflow: hidden;
}

.brand-marker__badge img {
    width: 28px;
    height: 28px;
    object-fit: contain;
    display: block;
}

.brand-marker__tip {
    width: 0;
    height: 0;
    margin-top: -1px;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-top: 14px solid var(--brand-burgundy-dark);
    filter: drop-shadow(0 5px 4px rgba(95, 27, 35, 0.28));
}

.brand-cluster {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, #ecd372 0%, var(--brand-gold) 55%, #bf9726 100%);
    border: 3px solid rgba(123, 38, 48, 0.96);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 14px 28px rgba(95, 27, 35, 0.22);
}

.brand-cluster span {
    color: #5f1b23;
    font-weight: 800;
    font-size: .95rem;
}

@media (max-width: 700px) {
    .map-panel {
        padding: 10px;
        gap: 8px;
    }

    .map-topbar {
        padding: 8px;
    }

    .map-toolbar {
        gap: 8px;
    }

    .search-input--topbar {
        padding: 10px 12px;
        font-size: .9rem;
    }

    .reset-button {
        padding: 10px 12px;
        font-size: .84rem;
    }

    #map {
        border-radius: 16px;
    }
}
