/* =========================================================
   Brutus Store Locator
========================================================= */

:root {
    --bg: #111111;
    --panel: #1b1b1b;
    --panel-light: #202020;
    --panel-hover: #252525;
    --border: #2d2d2d;
    --border-hover: #424242;

    --text: #ffffff;
    --text-muted: #a8a8a8;

    --accent: #bed020;
    --accent-dark: #9fae1c;

    --danger: #e06b6b;
    --blue: #4285f4;

    --radius-small: 10px;
    --radius-medium: 14px;
    --radius-large: 18px;

    --header-height: 112px;
    --toolbar-height: 76px;
}


/* =========================================================
   Reset
========================================================= */

* {
    box-sizing: border-box;
}

html,
body {
    width: 100%;
    min-height: 100%;
    margin: 0;
}

body {
    overflow: hidden;
    background: var(--bg);
    color: var(--text);
    font-family: Arial, Helvetica, sans-serif;
}

button,
input {
    font: inherit;
}

button {
    cursor: pointer;
}

a {
    color: inherit;
}


/* =========================================================
   Application Layout
========================================================= */

.app {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100vh;
    min-height: 620px;
}


/* =========================================================
   Header
========================================================= */

.page-header {
    display: flex;
    align-items: center;
    gap: 28px;
    flex: 0 0 var(--header-height);
    padding: 22px 32px;
    border-bottom: 1px solid var(--border);
    background: var(--bg);
}

.logo {
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
}

.logo img {
    display: block;
    width: auto;
    height: 58px;
    max-width: 190px;
    object-fit: contain;
}

.header-content {
    min-width: 0;
}

.header-content h1 {
    margin: 0 0 7px;
    color: var(--text);
    font-size: clamp(1.65rem, 2.4vw, 2.35rem);
    line-height: 1.05;
    letter-spacing: -0.035em;
}

.header-content p {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.98rem;
    line-height: 1.5;
}


/* =========================================================
   Search Toolbar
========================================================= */

.search-toolbar {
    display: flex;
    align-items: center;
    gap: 14px;
    flex: 0 0 var(--toolbar-height);
    padding: 12px 32px;
    border-bottom: 1px solid var(--border);
    background: var(--bg);
}

.search-input {
    position: relative;
    flex: 1;
    min-width: 0;
}

.search-input svg {
    position: absolute;
    top: 50%;
    left: 17px;
    width: 20px;
    height: 20px;
    color: var(--text-muted);
    pointer-events: none;
    transform: translateY(-50%);
}

.search-input input {
    width: 100%;
    height: 50px;
    padding: 0 18px 0 50px;
    border: 1px solid var(--border);
    border-radius: var(--radius-medium);
    outline: none;
    background: var(--panel);
    color: var(--text);
    transition:
        border-color 160ms ease,
        background-color 160ms ease,
        box-shadow 160ms ease;
}

.search-input input::placeholder {
    color: #777777;
}

.search-input input:hover {
    border-color: var(--border-hover);
}

.search-input input:focus {
    border-color: var(--accent);
    background: var(--panel-light);
    box-shadow: 0 0 0 3px rgba(190, 208, 32, 0.12);
}

#location-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    flex-shrink: 0;
    height: 50px;
    padding: 0 20px;
    border: 1px solid var(--accent);
    border-radius: var(--radius-medium);
    background: transparent;
    color: var(--accent);
    font-weight: 700;
    transition:
        background-color 160ms ease,
        color 160ms ease,
        opacity 160ms ease,
        transform 160ms ease;
}

#location-btn svg {
    width: 19px;
    height: 19px;
}

#location-btn:hover:not(:disabled) {
    background: var(--accent);
    color: #111111;
}

#location-btn:active:not(:disabled) {
    transform: translateY(1px);
}

#location-btn:disabled {
    cursor: wait;
    opacity: 0.65;
}

#location-btn:focus-visible {
    outline: 3px solid rgba(190, 208, 32, 0.25);
    outline-offset: 3px;
}


/* =========================================================
   Main Locator Layout
========================================================= */

.locator-layout {
    display: grid;
    grid-template-columns: 370px minmax(0, 1fr);
    gap: 16px;
    flex: 1;
    min-height: 0;
    padding: 16px 32px 24px;
}


/* =========================================================
   Store Panel
========================================================= */

.store-panel {
    display: flex;
    flex-direction: column;
    min-width: 0;
    min-height: 0;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: var(--radius-large);
    background: var(--panel);
}

.panel-header {
    flex-shrink: 0;
    padding: 20px;
    border-bottom: 1px solid var(--border);
}

.panel-header h2 {
    margin: 0 0 7px;
    color: var(--text);
    font-size: 1.1rem;
    line-height: 1.25;
}

.store-count {
    display: block;
    color: var(--text-muted);
    font-size: 0.85rem;
    line-height: 1.4;
}

.store-results {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 14px;
}


/* =========================================================
   Loading and Error Cards
========================================================= */

.placeholder-card,
.no-results-message {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    min-height: 210px;
    padding: 24px;
    border: 1px dashed #393939;
    border-radius: var(--radius-medium);
    background: #181818;
}

.placeholder-card svg,
.no-results-message svg {
    width: 30px;
    height: 30px;
    margin-bottom: 18px;
    color: var(--accent);
}

.placeholder-card h3,
.no-results-message h3 {
    margin: 0 0 10px;
    color: var(--text);
    font-size: 1rem;
}

.placeholder-card p,
.no-results-message p {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.9rem;
    line-height: 1.65;
}

.error-card svg {
    color: var(--danger);
}

.loading-icon {
    animation: loading-spin 900ms linear infinite;
}

@keyframes loading-spin {
    to {
        transform: rotate(360deg);
    }
}

.no-results-message[hidden] {
    display: none;
}


/* =========================================================
   Store Cards
========================================================= */

.store-card {
    position: relative;
    margin-bottom: 12px;
    padding: 18px;
    border: 1px solid var(--border);
    border-radius: var(--radius-medium);
    outline: none;
    background: #181818;
    transition:
        border-color 160ms ease,
        background-color 160ms ease,
        box-shadow 160ms ease,
        transform 160ms ease;
}

.store-card:last-of-type {
    margin-bottom: 0;
}

.store-card:hover,
.store-card.is-highlighted {
    border-color: var(--border-hover);
    background: var(--panel-hover);
}

.store-card.is-active {
    border-color: var(--accent);
    background: #202116;
    box-shadow:
        0 0 0 2px rgba(190, 208, 32, 0.12),
        0 12px 28px rgba(0, 0, 0, 0.2);
}

.store-card:focus-visible {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(190, 208, 32, 0.18);
}

.store-card[hidden] {
    display: none;
}

.store-card-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 16px;
}

.store-card-heading h3 {
    margin: 0 0 8px;
    color: var(--text);
    font-size: 1.08rem;
    line-height: 1.25;
}

.store-card-pin {
    flex-shrink: 0;
    width: 22px;
    height: 22px;
    color: var(--accent);
}

.store-status {
    display: flex;
    align-items: center;
    gap: 7px;
    color: var(--text-muted);
    font-size: 0.79rem;
    line-height: 1.35;
}

.status-dot {
    flex-shrink: 0;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--text-muted);
}

.store-status.is-open {
    color: var(--accent);
}

.store-status.is-open .status-dot {
    background: var(--accent);
    box-shadow: 0 0 0 4px rgba(190, 208, 32, 0.1);
}

.store-status.is-closed {
    color: #b7b7b7;
}

.store-status.is-closed .status-dot {
    background: #777777;
}

.store-address {
    display: flex;
    align-items: flex-start;
    gap: 11px;
    margin-bottom: 13px;
    color: var(--text-muted);
}

.store-address > svg {
    flex-shrink: 0;
    width: 17px;
    height: 17px;
    margin-top: 2px;
    color: var(--accent);
}

.store-address address {
    margin: 0;
    font-size: 0.87rem;
    font-style: normal;
    line-height: 1.55;
}

.store-distance {
    margin: -2px 0 14px 28px;
    color: var(--accent);
    font-size: 0.8rem;
    font-weight: 700;
}

.store-contact-link {
    display: inline-flex;
    align-items: center;
    gap: 11px;
    margin-bottom: 15px;
    color: var(--text-muted);
    font-size: 0.87rem;
    text-decoration: none;
}

.store-contact-link svg {
    width: 17px;
    height: 17px;
    color: var(--accent);
}

.store-contact-link:hover {
    color: var(--text);
}


/* =========================================================
   Opening Hours
========================================================= */

.opening-hours {
    margin: 3px 0 16px;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}

.opening-hours summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 0;
    color: var(--text-muted);
    font-size: 0.85rem;
    list-style: none;
    cursor: pointer;
    user-select: none;
}

.opening-hours summary::-webkit-details-marker {
    display: none;
}

.opening-hours-label {
    display: inline-flex;
    align-items: center;
    gap: 11px;
}

.opening-hours-label svg {
    width: 17px;
    height: 17px;
    color: var(--accent);
}

.opening-hours-chevron {
    width: 17px;
    height: 17px;
    transition: transform 160ms ease;
}

.opening-hours[open] .opening-hours-chevron {
    transform: rotate(180deg);
}

.opening-hours-list {
    padding: 0 0 12px 28px;
}

.opening-hours-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 4px 0;
    color: var(--text-muted);
    font-size: 0.78rem;
    line-height: 1.4;
}

.opening-hours-row span:last-child {
    color: var(--text);
}


/* =========================================================
   Store Actions
========================================================= */

.store-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 9px;
}

.store-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 40px;
    padding: 9px 12px;
    border-radius: var(--radius-small);
    font-size: 0.81rem;
    font-weight: 700;
    text-align: center;
    text-decoration: none;
    transition:
        border-color 160ms ease,
        background-color 160ms ease,
        color 160ms ease,
        transform 160ms ease;
}

.store-action svg {
    width: 16px;
    height: 16px;
}

.store-action-primary {
    border: 1px solid var(--accent);
    background: var(--accent);
    color: #111111;
}

.store-action-primary:hover {
    border-color: #d1df39;
    background: #d1df39;
}

.store-action-secondary {
    border: 1px solid var(--border-hover);
    background: transparent;
    color: var(--text);
}

.store-action-secondary:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.store-action:active {
    transform: translateY(1px);
}


/* =========================================================
   Map Panel
========================================================= */

.map-panel {
    position: relative;
    min-width: 0;
    min-height: 0;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: var(--radius-large);
    background: var(--panel);
}

#map {
    width: 100%;
    height: 100%;
    min-height: 380px;
    background: var(--panel);
}

.map-error-message {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    min-height: 380px;
    padding: 30px;
    background: var(--panel);
    color: var(--text-muted);
    text-align: center;
}


/* =========================================================
   Leaflet Base Styling
========================================================= */

.leaflet-container {
    background: var(--panel);
    color: var(--text);
    font-family: inherit;
}

.leaflet-container a {
    color: var(--accent-dark);
}


/* =========================================================
   Leaflet Zoom Controls
========================================================= */

.leaflet-control-zoom {
    overflow: hidden;
    border: 1px solid var(--border) !important;
    border-radius: var(--radius-small) !important;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.24) !important;
}

.leaflet-control-zoom a {
    display: flex !important;
    align-items: center;
    justify-content: center;
    width: 38px !important;
    height: 38px !important;
    border: 0 !important;
    border-bottom: 1px solid var(--border) !important;
    background: var(--panel) !important;
    color: var(--text) !important;
    font-size: 21px !important;
    line-height: 38px !important;
    transition:
        background-color 160ms ease,
        color 160ms ease;
}

.leaflet-control-zoom a:last-child {
    border-bottom: 0 !important;
}

.leaflet-control-zoom a:hover {
    background: var(--accent) !important;
    color: #111111 !important;
}


/* =========================================================
   Leaflet Popup
========================================================= */

.leaflet-popup-content-wrapper {
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--panel);
    color: var(--text);
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.32);
}

.leaflet-popup-content {
    min-width: 210px;
    margin: 16px 18px;
    color: var(--text);
    font-size: 0.88rem;
    line-height: 1.5;
}

.leaflet-popup-tip {
    background: var(--panel);
}

.leaflet-popup-close-button {
    color: var(--text-muted) !important;
}

.leaflet-popup-close-button:hover {
    color: var(--accent) !important;
}

.store-popup-name {
    display: block;
    margin: 0 22px 7px 0;
    color: var(--text);
    font-size: 1rem;
}

.store-popup-address {
    margin-bottom: 10px;
    color: var(--text-muted);
}

.store-popup-status {
    margin-bottom: 12px;
    color: var(--accent);
    font-size: 0.8rem;
    font-weight: 700;
}

.store-popup-links {
    display: flex;
    flex-wrap: wrap;
    gap: 7px 12px;
}

.popup-contact-link,
.popup-directions-link {
    color: var(--accent) !important;
    font-size: 0.8rem;
    font-weight: 700;
    text-decoration: none;
}

.popup-contact-link:hover,
.popup-directions-link:hover {
    text-decoration: underline;
}


/* =========================================================
   Leaflet Attribution
========================================================= */

.leaflet-control-attribution {
    padding: 4px 7px !important;
    border-top-left-radius: 7px;
    background: rgba(17, 17, 17, 0.82) !important;
    color: #b5b5b5 !important;
    font-size: 10px !important;
    backdrop-filter: blur(8px);
}

.leaflet-control-attribution a {
    color: var(--accent) !important;
}


/* =========================================================
   Custom Brutus Marker
========================================================= */

.brutus-marker-wrapper {
    border: 0;
    background: transparent;
}

.brutus-marker {
    position: relative;
    width: 30px;
    height: 30px;
    border: 4px solid #111111;
    border-radius: 50% 50% 50% 0;
    background: var(--accent);
    box-shadow: 0 5px 14px rgba(0, 0, 0, 0.38);
    transform: rotate(-45deg);
    transition:
        transform 160ms ease,
        box-shadow 160ms ease;
}

.brutus-marker::after {
    position: absolute;
    top: 8px;
    left: 8px;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #111111;
    content: "";
}

.brutus-marker-wrapper:hover .brutus-marker,
.brutus-marker-wrapper.is-hovered .brutus-marker,
.brutus-marker-wrapper.is-active .brutus-marker {
    box-shadow:
        0 6px 18px rgba(0, 0, 0, 0.45),
        0 0 0 5px rgba(190, 208, 32, 0.2);
    transform: rotate(-45deg) scale(1.14);
}

.brutus-marker-wrapper.is-active {
    z-index: 1000 !important;
}


/* =========================================================
   Scrollbar
========================================================= */

.store-results {
    scrollbar-width: thin;
    scrollbar-color: #4a4a4a transparent;
}

.store-results::-webkit-scrollbar {
    width: 8px;
}

.store-results::-webkit-scrollbar-track {
    background: transparent;
}

.store-results::-webkit-scrollbar-thumb {
    border: 2px solid var(--panel);
    border-radius: 999px;
    background: #4a4a4a;
}

.store-results::-webkit-scrollbar-thumb:hover {
    background: #5d5d5d;
}


/* =========================================================
   Responsive Layout
========================================================= */

@media (max-width: 900px) {

    body {
        overflow: auto;
    }

    .app {
        height: auto;
        min-height: 100vh;
    }

    .page-header {
        flex-basis: auto;
        padding: 20px;
    }

    .logo img {
        height: 46px;
    }

    .search-toolbar {
        flex-basis: auto;
        padding: 12px 20px;
    }

    .locator-layout {
        grid-template-columns: 1fr;
        grid-template-rows: auto minmax(500px, 62vh);
        padding: 14px 20px 22px;
    }

    .store-panel {
        max-height: 480px;
    }

    .map-panel {
        min-height: 500px;
    }

}


@media (max-width: 620px) {

    .page-header {
        align-items: flex-start;
        gap: 17px;
        padding: 18px 16px;
    }

    .logo img {
        height: 38px;
        max-width: 125px;
    }

    .header-content h1 {
        margin-bottom: 5px;
        font-size: 1.4rem;
    }

    .header-content p {
        font-size: 0.86rem;
    }

    .search-toolbar {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
        padding: 12px 16px;
    }

    #location-btn {
        width: 100%;
    }

    .locator-layout {
        grid-template-rows: auto 470px;
        gap: 12px;
        padding: 12px 16px 18px;
    }

    .store-panel {
        max-height: 520px;
    }

    .map-panel {
        min-height: 470px;
    }

}

/* =========================================================
   Geographic Search Feedback
========================================================= */

.search-message {
    flex-shrink: 0;
    min-height: 34px;
    padding: 8px 32px;
    border-bottom: 1px solid var(--border);
    background: #161616;
    color: var(--text-muted);
    font-size: 0.8rem;
    line-height: 1.4;
}

.search-message[hidden] {
    display: none;
}

.search-message.is-success {
    color: var(--accent);
}

.search-message.is-error {
    color: #e98a8a;
}

.search-message.is-loading {
    color: var(--text);
}

.search-input input.is-searching {
    opacity: 0.72;
}

@media (max-width: 900px) {

    .search-message {
        padding-right: 20px;
        padding-left: 20px;
    }

}

@media (max-width: 620px) {

    .search-message {
        padding-right: 16px;
        padding-left: 16px;
    }

}
/* =========================================================
   Worldwide Search, Distance Filter and Status Enhancements
========================================================= */

.radius-filter-wrap {
    display: flex;
    align-items: center;
    gap: 9px;
    flex-shrink: 0;
}

.radius-filter-wrap label {
    color: var(--text-muted);
    font-size: 0.82rem;
    font-weight: 700;
}

#radius-filter {
    height: 50px;
    min-width: 145px;
    padding: 0 38px 0 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-medium);
    outline: none;
    background: var(--panel);
    color: var(--text);
    font: inherit;
    cursor: pointer;
    transition: border-color 160ms ease, background-color 160ms ease, opacity 160ms ease;
}

#radius-filter:hover:not(:disabled),
#radius-filter:focus {
    border-color: var(--accent);
    background: var(--panel-light);
}

#radius-filter:disabled {
    cursor: not-allowed;
    opacity: 0.45;
}

.search-message {
    flex-shrink: 0;
    min-height: 34px;
    padding: 8px 32px;
    border-bottom: 1px solid var(--border);
    background: #161616;
    color: var(--text-muted);
    font-size: 0.8rem;
    line-height: 1.4;
}

.search-message[hidden],
.no-results-message[hidden],
.store-card[hidden],
.store-distance[hidden] {
    display: none !important;
}

.search-message.is-success {
    color: var(--accent);
}

.search-message.is-error {
    color: #e98a8a;
}

.search-message.is-loading,
.search-message.is-information {
    color: var(--text-muted);
}

.search-input input.is-searching {
    opacity: 0.72;
}

.store-distance {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    margin: 2px 0 14px 28px;
    padding: 5px 9px;
    border: 1px solid rgba(190, 208, 32, 0.28);
    border-radius: 999px;
    background: rgba(190, 208, 32, 0.08);
    color: var(--accent);
    font-size: 0.78rem;
    font-weight: 700;
}

.store-popup-status.is-open {
    color: #718000;
}

.store-popup-status.is-closed {
    color: #777777;
}

@media (max-width: 900px) {
    .search-toolbar {
        flex-wrap: wrap;
        height: auto;
        flex-basis: auto;
    }

    .search-input {
        flex-basis: 100%;
    }

    .radius-filter-wrap {
        flex: 1;
    }

    #radius-filter {
        flex: 1;
    }

    .search-message {
        padding-right: 20px;
        padding-left: 20px;
    }
}

@media (max-width: 620px) {
    .radius-filter-wrap {
        width: 100%;
    }

    #location-btn {
        width: 100%;
    }

    .search-message {
        padding-right: 16px;
        padding-left: 16px;
    }
}
