/* =============================================================================
   Store Locator Styles
   Matches theme variables: bg #2D2D2E, text #CAC7B9, green #64A70B
   ============================================================================= */

/* Layout
   ============================================================================= */

.store-locator-wrapper {
    display: flex;
    height: 80vh;
    position: relative;
    overflow: hidden;
    
}

/* Sidebar
   ============================================================================= */

.store-locator-sidebar {
    width: 360px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    z-index: 2;
}

/* Search panel
   ============================================================================= */

.store-locator-search {
    padding: 20px;
    flex-shrink: 0;
}

.search-input-wrap {
    display: flex;
    gap: 0;
    margin-bottom: 10px;
}

#stockist-search-input {
    flex: 1;
    border: none;
    border-right: none;
    color: #CAC7B9;
    padding: 10px 14px !important;
    font-family: 'Figtree', sans-serif;
    font-size: 25px !important;
    font-weight: 300;
    outline: none;
    transition: border-color 0.2s;
    min-width: 0;
    background: #D9D9D9 !important;
    color: #2D2D2E !important;
    text-transform: none !important;
    border: none !important;
}
#stockist-search-input::placeholder {
    color: #2D2D2E !important;
}

#stockist-search-input:focus {
    border-color: #64A70B;
}

#stockist-search-input::placeholder {
    color: rgba(202, 199, 185, 0.4);
}

#stockist-search-btn {
    background: #64A70B;
    color: #CAC7B9;
    border: 1px solid #64A70B;
    padding: 10px 16px;
    font-family: 'Figtree', sans-serif;
    font-size: 0.875rem;
    cursor: pointer;
    white-space: nowrap;
    flex-shrink: 0;
    text-transform: uppercase;
    font-weight: 600;
}

#stockist-search-btn:hover,
#stockist-search-btn:focus {
    color: #2D2D2E;
}

#stockist-search-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

#stockist-location-btn {
    width: 100%;
    background: transparent;
    border: none;
    color: #CAC7B9;
    padding: 9px 14px;
    font-family: 'Figtree', sans-serif;
    font-weight: 300;
    cursor: pointer;
    transition: border-color 0.2s, color 0.2s;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 7px;
    letter-spacing: 0.02em;
    font-size: 16px;
}

#stockist-location-btn:hover {
    border-color: #64A70B;
    color: #64A70B;
}

#stockist-location-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Results list
   ============================================================================= */

#stockist-results {
    flex: 1;
    overflow-y: auto;
    padding: 14px;
    scrollbar-width: thin;
    scrollbar-color: rgba(169, 171, 167, 0.2) transparent;
}

#stockist-results::-webkit-scrollbar {
    width: 5px;
}

#stockist-results::-webkit-scrollbar-thumb {
    background: rgba(169, 171, 167, 0.2);
    border-radius: 3px;
}

.stockist-results__prompt {
    color: rgba(202, 199, 185, 0.4);
    font-size: 1rem;
    text-align: center;
    margin-top: 28px;
    line-height: 1.5;
}

.stockist-results__location {
    font-size: 0.75rem;
    color: rgba(202, 199, 185, 0.5);
    margin-bottom: 14px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(169, 171, 167, 0.1);
}

.stockist-results__location strong {
    color: #CAC7B9;
}

.stockist-results__error,
.stockist-results__none {
    color: #e07b7b;
    font-size: 0.8rem;
    margin-top: 16px;
    line-height: 1.5;
}

.stockist-result {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(169, 171, 167, 0.1);
    padding: 13px 14px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
}

.stockist-result:last-child {
    margin-bottom: 0;
}

.stockist-result:hover,
.stockist-result.active {
    border-color: #64A70B;
}

.stockist-result__header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 5px;
    gap: 8px;
}

.stockist-result__name {
    font-weight: 500;
    color: #CAC7B9;
    font-size: 0.875rem;
    line-height: 1.3;
}

.stockist-result__dist {
    font-size: 0.7rem;
    color: #64A70B;
    white-space: nowrap;
    flex-shrink: 0;
    margin-top: 1px;
    font-weight: 500;
    display: none;
}

.stockist-result__addr,
.stockist-result__phone {
    font-size: 0.775rem;
    color: rgba(202, 199, 185, 0.5);
    margin: 2px 0;
    line-height: 1.4;
}

.stockist-result__phone a {
    color: rgba(202, 199, 185, 0.5);
    text-decoration: none;
}

.stockist-result__phone a:hover {
    color: #CAC7B9;
}

.stockist-result__website {
    margin: 4px 0 0;
}

.stockist-result__website a {
    font-size: 0.75rem;
    color: #64A70B;
    text-decoration: none;
}

.stockist-result__website a:hover {
    text-decoration: underline;
}

/* Map
   ============================================================================= */

#stockist-map {
    flex: 1;
    min-height: 0;
    z-index: 1;
}

/* Custom pin marker
   ============================================================================= */

.sl-marker {
    width: 30px;
    height: 30px;
    background: #64A70B;
    border-radius: 50% 50% 50% 0;
    transform: rotate(-45deg);
    border: 2px solid rgba(255, 255, 255, 0.25);
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.5);
    transition: background 0.15s;
}

.sl-marker--active {
    background: #64A70B;
    border-color: #64A70B;
    box-shadow: 0 3px 14px rgba(100, 167, 11, 0.6);
}

/* Leaflet popup theming
   ============================================================================= */

.leaflet-popup-content-wrapper {
    background: #2D2D2E;
    border: 1px solid rgba(169, 171, 167, 0.2);
    border-radius: 0;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    color: #CAC7B9;
}

.leaflet-popup-tip {
    background: #2D2D2E;
}

.leaflet-popup-close-button {
    color: rgba(202, 199, 185, 0.5) !important;
}

.leaflet-popup-close-button:hover {
    color: #CAC7B9 !important;
}

.stockist-popup {
    font-family: 'Figtree', sans-serif;
    min-width: 180px;
}

.stockist-popup strong {
    display: block;
    font-weight: 500;
    font-size: 0.9rem;
    color: #CAC7B9;
    margin-bottom: 6px;
}

.stockist-popup p {
    font-size: 0.8rem;
    color: rgba(202, 199, 185, 0.65);
    margin: 3px 0;
    line-height: 1.4;
}

.stockist-popup a {
    color: #64A70B;
    text-decoration: none;
}

.stockist-popup a:hover {
    text-decoration: underline;
}

/* Leaflet controls on dark map
   ============================================================================= */

.leaflet-control-zoom a {
    background: #2D2D2E !important;
    color: #CAC7B9 !important;
    border-color: rgba(169, 171, 167, 0.2) !important;
}

.leaflet-control-zoom a:hover {
    background: #3a3a3b !important;
    color: #fff !important;
}

.leaflet-control-attribution {
    background: rgba(45, 45, 46, 0.85) !important;
    color: rgba(202, 199, 185, 0.5) !important;
    font-size: 0.65rem !important;
}

.leaflet-control-attribution a {
    color: rgba(100, 167, 11, 0.8) !important;
}

/* Responsive
   ============================================================================= */

@media (max-width: 900px) {
    .store-locator-wrapper {
        flex-direction: column;
        height: auto;
    }

    .store-locator-sidebar {
        width: 100%;
        order: 2;
        max-height: 460px;
    }

    #stockist-map {
        order: 1;
        height: 360px;
        min-height: 360px;
    }

    #stockist-results {
        max-height: 320px;
    }
}

@media (max-width: 480px) {
    .search-input-wrap {
        flex-direction: column;
        gap: 8px;
    }

    #stockist-search-input {
        border-right: 1px solid rgba(169, 171, 167, 0.25);
    }

    #stockist-search-btn {
        width: 100%;
    }
}
