/* =============================================
   Nocterra Beer Finder - dark skin
   All selectors prefixed .nbf- (plus scoped Mapbox overrides).
   Tokens from docs/BUILD.md: page #090909, panel #1E3037 (alt #373A3E),
   cream (now white #FFFFFF), orange #F3911F, teal #4BBFAD, green #55BA57.
   ============================================= */

.nbf-wrap {
    --nbf-bg: #090909;
    --nbf-panel: #1E3037;
    --nbf-panel-alt: #373A3E;
    --nbf-cream: #FFFFFF;
    --nbf-cream-78: rgba(255, 255, 255, .78);
    --nbf-cream-55: rgba(255, 255, 255, .55);
    --nbf-line: rgba(255, 255, 255, .14);
    --nbf-orange: #F3911F;
    --nbf-blue: #2F6DB5; /* Nocterra blue: the search button (Adam 2026-11-04); orange stays for retail markers */
    --nbf-teal: #4BBFAD;
    --nbf-green: #55BA57;
    --nbf-font: 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
    --nbf-head: 'Fjalla One', 'Roboto Condensed', Impact, 'Arial Narrow', sans-serif;
}

/* Scoped box-sizing reset */
.nbf-wrap,
.nbf-wrap *,
.nbf-wrap *::before,
.nbf-wrap *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* Layout */
.nbf-wrap {
    display: flex;
    flex-direction: column;
    height: min(760px, calc(100vh - 96px));
    min-height: 560px;
    font-family: var(--nbf-font);
    font-size: 16px;
    color: var(--nbf-cream);
    background: var(--nbf-bg);
    border: 1px solid var(--nbf-line);
    border-radius: 6px;
    overflow: hidden;
    -webkit-font-smoothing: antialiased;
    position: relative;
}

.nbf-visually-hidden {
    position: absolute !important;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    white-space: nowrap;
}

/* Toolbar */
.nbf-toolbar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    padding: 12px 16px;
    background: var(--nbf-panel);
    border-bottom: 1px solid var(--nbf-line);
    flex-shrink: 0;
    position: relative;
    z-index: 10;
}

.nbf-main {
    display: flex;
    flex: 1;
    min-height: 0;
    position: relative;
}

.nbf-sidebar {
    width: 360px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    background: var(--nbf-bg);
    border-right: 1px solid var(--nbf-line);
    z-index: 5;
    min-height: 0;
}

.nbf-map {
    flex: 1;
    position: relative;
    background: #0f1a1f;
    min-height: 0;
}

/* Toolbar - zip input */
.nbf-zip-wrap {
    position: relative;
    flex: 0 0 200px;
}

.nbf-wrap .nbf-zip-wrap input {
    width: 100%;
    height: 44px;
    padding: 0 36px 0 14px;
    border: 1.5px solid var(--nbf-line);
    border-radius: 4px;
    font-family: inherit;
    font-size: 16px;
    color: var(--nbf-cream);
    background: var(--nbf-bg);
    outline: none;
    transition: border-color .2s;
    -webkit-appearance: none;
    appearance: none;
}

.nbf-wrap .nbf-zip-wrap input::placeholder {
    color: var(--nbf-cream-55);
    opacity: 1;
}

.nbf-wrap .nbf-zip-wrap input:focus,
.nbf-wrap .nbf-zip-wrap input:focus-visible {
    border-color: var(--nbf-orange);
    box-shadow: 0 0 0 3px rgba(243, 145, 31, .25);
}

.nbf-zip-wrap.nbf-zip-error input {
    border-color: var(--nbf-orange) !important;
    animation: nbfShake .4s ease;
}

@keyframes nbfShake {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-4px); }
    40%, 80% { transform: translateX(4px); }
}

.nbf-wrap .nbf-zip-clear {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    font-size: 22px;
    line-height: 1;
    color: var(--nbf-cream-55);
    cursor: pointer;
    padding: 6px;
    display: none;
}

.nbf-wrap .nbf-zip-clear.visible { display: block; }
.nbf-wrap .nbf-zip-clear:hover,
.nbf-wrap .nbf-zip-clear:focus-visible { color: var(--nbf-orange); outline: none; }

/* Toolbar - native selects, styled dark */
.nbf-select-wrap {
    position: relative;
    flex: 0 1 220px;
    min-width: 150px;
}

.nbf-select-wrap--radius {
    flex: 0 0 130px;
    min-width: 120px;
}

.nbf-wrap select.nbf-select {
    width: 100%;
    height: 44px;
    padding: 0 36px 0 12px;
    border: 1.5px solid var(--nbf-line);
    border-radius: 4px;
    font-family: inherit;
    font-size: 15px;
    color: var(--nbf-cream);
    background: var(--nbf-bg) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23F3E3C3' stroke-width='1.5' fill='none'/%3E%3C/svg%3E") no-repeat right 12px center;
    -webkit-appearance: none;
    appearance: none;
    cursor: pointer;
    text-overflow: ellipsis;
    white-space: nowrap;
    overflow: hidden;
    transition: border-color .2s;
}

.nbf-wrap select.nbf-select:focus,
.nbf-wrap select.nbf-select:focus-visible {
    outline: none;
    border-color: var(--nbf-orange);
    box-shadow: 0 0 0 3px rgba(243, 145, 31, .25);
}

/* The dropdown list itself is browser-drawn; this keeps it dark where supported. */
.nbf-wrap select.nbf-select option,
.nbf-wrap select.nbf-select optgroup {
    background: var(--nbf-panel);
    color: var(--nbf-cream);
}

.nbf-wrap select.nbf-select optgroup {
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .5px;
    font-size: 12px;
    color: var(--nbf-cream-55);
}

/* Toolbar - primary button */
.nbf-wrap .nbf-btn-search {
    height: 44px;
    padding: 0 32px;
    background: var(--nbf-blue);
    color: #FFFFFF;
    border: 1.5px solid var(--nbf-blue);
    border-radius: 4px;
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 2px;
    cursor: pointer;
    white-space: nowrap;
    transition: background .2s, border-color .2s, color .2s;
}

.nbf-wrap .nbf-btn-search:hover { background: #FFFFFF; border-color: #FFFFFF; color: var(--nbf-bg); }
.nbf-wrap .nbf-btn-search:focus-visible { outline: 2px solid var(--nbf-cream); outline-offset: 2px; }
.nbf-wrap .nbf-btn-search:disabled { background: var(--nbf-panel-alt); border-color: var(--nbf-panel-alt); color: var(--nbf-cream-55); cursor: wait; }

/* Inline message under the zip field (replaces alert()) */
.nbf-msg {
    flex: 1 1 100%;
    display: none;
    font-size: 14px;
    line-height: 1.4;
    color: var(--nbf-cream-78);
    padding: 2px 2px 0;
}

.nbf-msg.is-visible { display: block; }
.nbf-msg--error { color: var(--nbf-orange); }

/* Spinner overlay on the map */
.nbf-spinner {
    display: none;
    position: absolute;
    inset: 0;
    background: rgba(9, 9, 9, .72);
    z-index: 20;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 12px;
}

.nbf-spinner.active { display: flex; }

.nbf-dot-loader { display: flex; gap: 6px; }

.nbf-dot-loader span {
    width: 10px;
    height: 10px;
    background: var(--nbf-orange);
    border-radius: 50%;
    animation: nbfDotBounce .6s alternate infinite;
}

.nbf-dot-loader span:nth-child(2) { animation-delay: .2s; }
.nbf-dot-loader span:nth-child(3) { animation-delay: .4s; }

@keyframes nbfDotBounce {
    0%   { transform: translateY(0); opacity: .4; }
    100% { transform: translateY(-10px); opacity: 1; }
}

.nbf-spinner p {
    font-size: 14px;
    color: var(--nbf-cream-78);
    font-weight: 500;
}

/* Map unavailable panel (no token) */
.nbf-map-unavailable {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: var(--nbf-panel);
    color: var(--nbf-cream-55);
    text-align: center;
    padding: 24px;
}

.nbf-map-unavailable svg { width: 48px; height: 48px; opacity: .5; }
.nbf-map-unavailable p {
    font-family: var(--nbf-head);
    font-size: 20px;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.nbf-wrap.nbf-no-map.is-busy .nbf-map-unavailable { opacity: .4; }

/* Sidebar header */
.nbf-sidebar-header {
    padding: 14px 16px;
    border-bottom: 1px solid var(--nbf-line);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
    flex-wrap: wrap;
    gap: 6px;
    background: var(--nbf-panel);
}

.nbf-wrap .nbf-sidebar-title {
    font-family: var(--nbf-head);
    font-size: 18px;
    font-weight: 600;
    color: var(--nbf-cream);
    text-transform: uppercase;
    letter-spacing: 2px;
    line-height: 1.2;
}

.nbf-result-count {
    font-size: 13px;
    color: var(--nbf-cream-55);
}

/* Legend */
.nbf-legend {
    display: flex;
    gap: 12px;
    width: 100%;
    padding-top: 6px;
    flex-wrap: wrap;
}

.nbf-legend-item {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 11px;
    color: var(--nbf-cream-78);
}

.nbf-legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.nbf-legend-dot.bar    { background: var(--nbf-teal); }
.nbf-legend-dot.retail { background: var(--nbf-orange); }
.nbf-legend-dot.venue  { background: var(--nbf-green); }

/* Listings */
.nbf-listings {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: var(--nbf-panel-alt) transparent;
}

.nbf-listings::-webkit-scrollbar { width: 6px; }
.nbf-listings::-webkit-scrollbar-thumb { background: var(--nbf-panel-alt); border-radius: 3px; }

.nbf-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 16px;
    border-bottom: 1px solid var(--nbf-line);
    cursor: pointer;
    transition: background .15s;
}

.nbf-item:hover { background: rgba(30, 48, 55, .6); }
.nbf-item.active { background: var(--nbf-panel); box-shadow: inset 3px 0 0 var(--nbf-orange); }

.nbf-item-num {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--nbf-orange);
    color: var(--nbf-bg);
    font-size: 12px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 2px;
}

.nbf-item-num.premise-bar    { background: var(--nbf-teal); }
.nbf-item-num.premise-retail { background: var(--nbf-orange); }
.nbf-item-num.premise-venue  { background: var(--nbf-green); }

.nbf-item-info { flex: 1; min-width: 0; }

.nbf-item-name {
    font-family: var(--nbf-head);
    font-size: 16px;
    font-weight: 600;
    color: var(--nbf-cream);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 2px;
    line-height: 1.2;
}

.nbf-item-address {
    font-size: 13px;
    color: var(--nbf-cream-78);
    line-height: 1.4;
}

.nbf-item-distance {
    font-size: 12px;
    color: var(--nbf-orange);
    font-weight: 600;
    margin-top: 4px;
}

.nbf-item details { width: 100%; }

.nbf-item details summary {
    list-style: none;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    cursor: pointer;
}

.nbf-item details summary::-webkit-details-marker { display: none; }
.nbf-item details summary:focus-visible { outline: 2px solid var(--nbf-orange); outline-offset: 2px; border-radius: 2px; }

.nbf-item details[open] .nbf-beer-list {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid var(--nbf-line);
}

.nbf-beer-list {
    font-size: 14px;
    line-height: 1.6;
    color: var(--nbf-cream-78);
}

.nbf-beer-list ul { list-style: none; padding: 0; margin: 0 0 8px 0; }
.nbf-beer-list li { padding: 2px 0; }

.nbf-wrap .nbf-beer-list li a {
    color: var(--nbf-cream);
    font-weight: 500;
    text-decoration: none;
    border-bottom: 1px solid var(--nbf-line);
}

.nbf-wrap .nbf-beer-list li a:hover,
.nbf-wrap .nbf-beer-list li a:focus-visible { color: var(--nbf-orange); border-bottom-color: var(--nbf-orange); outline: none; }

.nbf-wrap .nbf-directions {
    display: inline-block;
    margin-top: 6px;
    padding: 8px 16px;
    border: 1.5px solid var(--nbf-cream);
    color: var(--nbf-cream);
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 2px;
    text-decoration: none;
    border-radius: 4px;
    transition: background .2s, color .2s;
}

.nbf-wrap .nbf-directions:hover,
.nbf-wrap .nbf-directions:focus-visible { background: var(--nbf-cream); color: var(--nbf-bg); outline: none; }

/* Disclaimer */
.nbf-disclaimer {
    padding: 12px 16px;
    border-top: 1px solid var(--nbf-line);
    flex-shrink: 0;
    font-size: 12px;
    color: var(--nbf-cream-55);
    line-height: 1.5;
    background: var(--nbf-panel);
}

/* Empty state */
.nbf-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 48px 20px;
    text-align: center;
    color: var(--nbf-cream-55);
    min-height: 220px;
}

.nbf-empty svg { width: 48px; height: 48px; margin-bottom: 12px; opacity: .5; }
.nbf-empty p { font-size: 15px; line-height: 1.5; }

/* Hidden fields */
.nbf-hidden { display: none !important; }

/* =============================================
   Mapbox overrides (dark popup, dark controls)
   ============================================= */
.nbf-wrap .mapboxgl-map { font-family: var(--nbf-font); }

.nbf-wrap .mapboxgl-popup { z-index: 100; max-width: 280px; }

.nbf-wrap .mapboxgl-popup-content {
    font-family: var(--nbf-font);
    background: var(--nbf-panel);
    color: var(--nbf-cream);
    padding: 14px 16px;
    border-radius: 6px;
    box-shadow: 0 6px 24px rgba(0, 0, 0, .5);
}

.nbf-wrap .mapboxgl-popup-anchor-top .mapboxgl-popup-tip,
.nbf-wrap .mapboxgl-popup-anchor-top-left .mapboxgl-popup-tip,
.nbf-wrap .mapboxgl-popup-anchor-top-right .mapboxgl-popup-tip { border-bottom-color: var(--nbf-panel); }
.nbf-wrap .mapboxgl-popup-anchor-bottom .mapboxgl-popup-tip,
.nbf-wrap .mapboxgl-popup-anchor-bottom-left .mapboxgl-popup-tip,
.nbf-wrap .mapboxgl-popup-anchor-bottom-right .mapboxgl-popup-tip { border-top-color: var(--nbf-panel); }
.nbf-wrap .mapboxgl-popup-anchor-left .mapboxgl-popup-tip { border-right-color: var(--nbf-panel); }
.nbf-wrap .mapboxgl-popup-anchor-right .mapboxgl-popup-tip { border-left-color: var(--nbf-panel); }

.nbf-wrap .mapboxgl-popup-close-button {
    color: var(--nbf-cream-55);
    font-size: 18px;
    padding: 2px 8px;
    border-radius: 0 6px 0 0;
}
.nbf-wrap .mapboxgl-popup-close-button:hover { background: rgba(255, 255, 255, .1); color: var(--nbf-cream); }

.nbf-wrap .mapboxgl-popup-content h3 {
    font-family: var(--nbf-head);
    font-size: 16px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin: 0 20px 4px 0;
    color: var(--nbf-cream);
    line-height: 1.2;
}

.nbf-wrap .mapboxgl-popup-content h4 {
    font-size: 13px;
    color: var(--nbf-cream-78);
    margin: 0;
    font-weight: 400;
    line-height: 1.4;
}

.nbf-wrap .popup-directions {
    display: inline-block;
    margin-top: 8px;
    color: var(--nbf-orange);
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    text-decoration: none;
}
.nbf-wrap .popup-directions:hover { text-decoration: underline; }

.nbf-wrap .popup-beers {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid var(--nbf-line);
    font-size: 13px;
}

.nbf-wrap .popup-beers strong {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--nbf-cream-55);
}

.nbf-wrap .popup-beers ul { list-style: none; padding: 0; margin: 4px 0 0; }
.nbf-wrap .popup-beers li { padding: 1px 0; color: var(--nbf-cream); }
.nbf-wrap .popup-beers a { color: var(--nbf-cream); text-decoration: none; border-bottom: 1px solid var(--nbf-line); }
.nbf-wrap .popup-beers a:hover { color: var(--nbf-orange); border-bottom-color: var(--nbf-orange); }

/* Navigation control, darkened */
.nbf-wrap .mapboxgl-ctrl-group {
    background: var(--nbf-panel);
    box-shadow: 0 0 0 1px var(--nbf-line);
}
.nbf-wrap .mapboxgl-ctrl-group button + button { border-top-color: var(--nbf-line); }
.nbf-wrap .mapboxgl-ctrl-group button .mapboxgl-ctrl-icon { filter: invert(.92) sepia(.3); }
.nbf-wrap .mapboxgl-ctrl-group button:hover { background: var(--nbf-panel-alt); }
.nbf-wrap .mapboxgl-ctrl-attrib { background: rgba(9, 9, 9, .6); color: var(--nbf-cream-55); }
.nbf-wrap .mapboxgl-ctrl-attrib a { color: var(--nbf-cream-78); }

/* Numbered markers */
.nbf-wrap .nbf-marker-icon {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--nbf-orange);
    color: var(--nbf-bg);
    font-family: var(--nbf-font);
    font-size: 12px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border: 2px solid var(--nbf-bg);
    box-shadow: 0 2px 8px rgba(0, 0, 0, .6);
    transition: transform .15s;
    padding: 0;
    line-height: 1;
}

.nbf-wrap .nbf-marker-icon:hover { transform: scale(1.15); }
.nbf-wrap .nbf-marker-icon:focus-visible { outline: 2px solid var(--nbf-cream); outline-offset: 2px; }

.nbf-wrap .nbf-marker-icon.premise-bar    { background: var(--nbf-teal); }
.nbf-wrap .nbf-marker-icon.premise-retail { background: var(--nbf-orange); }
.nbf-wrap .nbf-marker-icon.premise-venue  { background: var(--nbf-green); }

.nbf-wrap .nbf-marker-icon.active {
    background: var(--nbf-cream) !important;
    color: var(--nbf-bg);
    border-color: var(--nbf-orange);
    transform: scale(1.2);
    z-index: 2;
}

/* =============================================
   Mobile (< 768px): map (50vh) above the list
   ============================================= */
@media (max-width: 768px) {
    .nbf-wrap {
        height: auto;
        min-height: 0;
        border-radius: 0;
        border-left: 0;
        border-right: 0;
    }

    .nbf-toolbar {
        gap: 8px;
        padding: 12px;
    }

    .nbf-zip-wrap { flex: 1 1 100%; order: 1; }
    .nbf-select-wrap { flex: 1 1 calc(60% - 4px); min-width: 0; order: 2; }
    .nbf-select-wrap--radius { flex: 1 1 calc(40% - 4px); order: 3; }
    .nbf-wrap .nbf-btn-search { flex: 1 1 100%; order: 4; }
    .nbf-msg { order: 5; }

    .nbf-main { flex-direction: column; }

    .nbf-map {
        order: 1;
        height: 50vh;
        min-height: 280px;
        flex: none;
    }

    .nbf-sidebar {
        width: 100%;
        order: 2;
        border-right: none;
        border-top: 1px solid var(--nbf-line);
    }

    .nbf-listings {
        max-height: 70vh;
    }
}

@media (max-width: 420px) {
    .nbf-select-wrap,
    .nbf-select-wrap--radius { flex: 1 1 100%; }
}
