#app-body {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 1.1rem;
    margin: 0 auto;
    padding: 2.2rem var(--page-gutter) 2.5rem;
    max-width: none;
    background: var(--color-accent);
    color: var(--color-ink);
    font-family: var(--font-body);
    box-sizing: border-box;
}

.find-us-title {
    position: relative;
    display: grid;
    align-items: center;
    min-height: 12.5rem;
    max-height: 220px;
    overflow: hidden;
}

.find-us-title img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    opacity: 0.45;
}

.find-us-title h1,
#app-body h1 {
    position: relative;
    z-index: 1;
    margin: 0;
    width: 100%;
    text-align: center;
    font-family: var(--font-display);
    font-size: clamp(1.8rem, 4.5vw, 3rem);
    font-weight: 400;
    letter-spacing: 0.02em;
    line-height: 0.95;
    text-transform: uppercase;
    background: rgba(0, 0, 0, 0.72);
    color: var(--color-white);
    padding: 0.85rem 1.25rem;
}

#app-body h2 {
    margin: 0 0 0.75rem;
    font-family: var(--font-display);
    font-size: 1.6rem;
    font-weight: 400;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    text-align: left;
}

#search-and-filter {
    display: flex;
    justify-content: space-between;
    align-items: stretch;
    flex-wrap: wrap;
    gap: 1.5rem;
    padding: 1.25rem 1.5rem 1rem;
    background: var(--color-white);
    border: 2px solid var(--color-black);
}

#search-section {
    display: flex;
    flex-direction: column;
    flex: 2;
    gap: 0.75rem;
    padding-right: 1.5rem;
    border-right: 1px solid #eee;
}

#controls {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    width: 100%;
}

.search-group {
    flex: 1 1 180px;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.search-group label,
#controls label {
    font-size: 0.85rem;
    font-weight: 400;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.search-group input,
#controls input[type="text"],
#rangeSelect {
    width: 100%;
    padding: 0.85rem 0.9rem;
    border: 1px solid #ccc;
    border-radius: 0;
    font: inherit;
    font-size: 1rem;
    color: var(--color-ink);
    background: var(--color-white);
}

.search-group input:focus,
#controls input[type="text"]:focus,
#rangeSelect:focus {
    outline: 3px solid rgba(141, 217, 191, 0.7);
    outline-offset: 2px;
}

#filter-key {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    flex: 1.4;
    min-width: 16rem;
    padding-right: 1.5rem;
    border-right: 1px solid #eee;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.key-icon {
    width: 1.35rem;
    height: 1.35rem;
    object-fit: contain;
    flex-shrink: 0;
}

#productFilter {
    width: 100%;
    min-height: 3rem;
}

.product-filter-option,
.product-filter-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    line-height: 1.2;
}

.product-filter-badge .key-icon,
.product-filter-option .key-icon {
    width: 1.25rem;
    height: 1.25rem;
    max-width: none;
    display: block;
}

#filter-key .select2-container {
    width: 100% !important;
}

#filter-key .select2-container--default .select2-selection--multiple {
    min-height: 3.15rem;
    padding: 0.2rem 0.35rem 0.35rem;
    border: 1px solid #ccc;
    border-radius: 0;
    background: var(--color-white);
}

#filter-key .select2-container--default.select2-container--focus .select2-selection--multiple,
#filter-key .select2-container--default.select2-container--open .select2-selection--multiple {
    outline: 3px solid rgba(141, 217, 191, 0.7);
    outline-offset: 2px;
    border-color: #ccc;
}

#filter-key .select2-container--default .select2-selection--multiple .select2-selection__rendered {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    padding: 0;
}

#filter-key .select2-container--default .select2-selection--multiple .select2-selection__choice {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    margin: 0.2rem 0.15rem 0 0;
    padding: 0.2rem 0.45rem 0.2rem 0.25rem;
    background: #e8f8f2;
    border: 1px solid var(--color-black);
    border-radius: 0;
    color: var(--color-ink);
    font-size: 0.85rem;
    line-height: 1.2;
}

#filter-key .select2-container--default .select2-selection--multiple .select2-selection__choice__remove {
    margin-right: 0.15rem;
    color: var(--color-ink);
    font-weight: 700;
}

#filter-key .select2-container--default .select2-selection--multiple .select2-selection__choice__remove:hover {
    color: #971b1e;
}

#filter-key .select2-container--default .select2-selection--multiple .select2-selection__placeholder {
    margin: 0.45rem 0.35rem;
    color: var(--color-muted);
}

#filter-key .select2-dropdown {
    border: 1px solid var(--color-black);
    border-radius: 0;
    z-index: 80;
}

#filter-key .select2-container--default .select2-results__option {
    padding: 0.55rem 0.75rem;
}

#filter-key .select2-container--default .select2-results__option--highlighted[aria-selected] {
    background: var(--color-accent);
    color: var(--color-ink);
}

#filter-key .select2-container--default .select2-results__option[aria-selected="true"] {
    background: #f3f3f3;
    color: var(--color-ink);
}

#find-button-container {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: center;
    gap: 0.75rem;
    min-width: 12rem;
}

.cant-find-cta--compact {
    flex: 1 1 100%;
    margin: 0;
    padding-top: 0.75rem;
    border-top: 1px solid #eee;
    font-size: 0.95rem;
    line-height: 1.4;
}

.cant-find-cta--compact a {
    display: inline;
    margin: 0 0 0 0.25rem;
    text-decoration: underline;
    text-transform: none;
    letter-spacing: 0;
}

#findButton,
#locateButton {
    width: 100%;
    margin-top: 0;
}

#container {
    display: flex;
    min-height: 28rem;
    overflow: hidden;
}

#sidebar {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 400px;
    height: 60vh;
    background: var(--color-white);
    border: 1px solid var(--color-black);
    border-right: 0;
    overflow: hidden;
}

#results {
    flex: 1;
    overflow-y: auto;
    padding: 0.75rem;
}

#map {
    flex: 2;
    min-height: 400px;
    height: 60vh;
    border: 1px solid var(--color-black);
}

.store_entry {
    margin-bottom: 0.75rem;
    padding: 0.85rem;
    background: #f7fffb;
    border: 1px solid #cfeee3;
    cursor: pointer;
}

.store_entry:hover {
    border-color: var(--color-black);
    background: var(--color-accent);
}

.store_entry h4 {
    font-family: var(--font-display);
    font-size: 1.35rem;
    font-weight: 400;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    margin: 0 0 0.35rem;
}

.store-reporter-link {
    display: inline-block;
    margin-top: 0.5rem;
    font-size: 0.9rem;
    text-decoration: underline;
}

.store_tags {
    display: flex;
    float: right;
    gap: 0.25rem;
    padding: 0;
    margin: 0 0 0.25rem 0.5rem;
}

.store_tags img {
    width: 2rem;
    height: 2rem;
}

.leaflet-popup-content .store_tags {
    float: none;
    margin: 0 0 0.5rem;
}

img.ncco-map-pin.leaflet-marker-icon {
    border-radius: 50%;
}

#pagination {
    text-align: center;
    padding: 0.75rem;
}

#pagination button {
    background: var(--color-white);
    color: var(--color-black);
    border: 1px solid var(--color-black);
    padding: 0.4rem 0.75rem;
    margin: 0 0.2rem;
    cursor: pointer;
    font: inherit;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

#pagination button:hover,
#pagination button.active {
    background: var(--color-accent);
    color: var(--color-black);
    border-color: var(--color-black);
}

.leaflet-popup-content-wrapper {
    width: auto;
    max-width: 300px;
    min-width: 200px;
    border-radius: 0;
}

.leaflet-popup-content b {
    font-family: var(--font-display);
    font-size: 1.15rem;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    color: var(--color-ink);
}

.leaflet-popup-content a {
    display: inline-block;
    margin-top: 0.5rem;
    padding: 0.5rem 0.85rem;
    background: var(--color-black);
    color: var(--color-white);
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 0.8rem;
}

.leaflet-popup-content a:hover {
    background: var(--color-ink);
}

#loading,
#store-count {
    text-align: center;
    font-weight: 700;
    margin: 0.75rem 0 0.35rem;
}

#store-range {
    font-size: 0.9em;
    color: var(--color-muted);
    margin-top: 0.25rem;
    font-weight: 400;
}

.error {
    color: #971b1e;
    padding: 0.75rem;
}

.bluey-result {
    border-color: var(--color-accent);
    box-shadow: 0 0 0 2px var(--color-accent);
}

.hidden {
    display: none;
}

@media (max-width: 900px) {
    #search-and-filter,
    #container {
        flex-direction: column;
    }

    #search-section,
    #filter-key {
        padding-right: 0;
        border-right: 0;
        border-bottom: 1px solid #eee;
        padding-bottom: 1rem;
    }

    #find-button-container {
        min-width: 0;
        width: 100%;
    }

    #sidebar,
    #map {
        width: 100%;
        height: auto;
        min-height: 300px;
        border: 1px solid var(--color-black);
    }

    #sidebar {
        order: -1;
        max-height: 40vh;
        overflow-y: auto;
        border-bottom: 0;
    }
}

@media (max-width: 600px) {
    .find-us-title {
        min-height: 8.5rem;
        max-height: 160px;
    }

    .find-us-title h1,
    #app-body h1 {
        font-size: clamp(1.5rem, 8vw, 2.2rem);
    }

    .search-group {
        flex: 1 1 100%;
    }
}
