/* -- Force full height on parent containers -------------------------------- */

.dist-page-body #container-content {
    display: flex;
    flex-direction: column;
}

/* -- Distributor locator layout --------------------------------------------- */

.dist-page {
    position: relative;
    width: 100%;
    height: 700px; /* fallback, overridden by JS */
    overflow: hidden;
}

.dist-map {
    width: 100%;
    height: 100%;
}

.mapboxgl-ctrl-logo {
    display: none !important;
}

/* -- Panel overlay --------------------------------------------------------- */

.dist-panel {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 50%;
    background: rgba(255,255,255,0.97);
    z-index: 2;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.dist-panel-inner {
    padding: 20px;
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
}

.dist-panel-title {
    margin: 0 0 14px;
    font-size: 1.2em;
}

/* -- Search bar ------------------------------------------------------------ */

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

.dist-search {
    flex: 1;
    padding: 10px 12px;
    font-size: 0.95em;
    border: 1px solid var(--color-gray, #ccc);
    border-radius: 4px 0 0 4px;
    outline: none;
    transition: border-color 0.2s ease;
}

.dist-search:focus {
    border-color: var(--color-theme-blue, #3385bd);
}

.dist-search-btn {
    padding: 10px 16px;
    background: var(--color-theme-blue, #3385bd);
    color: #fff;
    border: none;
    border-radius: 0 4px 4px 0;
    cursor: pointer;
    transition: background 0.15s ease;
}

.dist-search-btn:hover {
    background: #2a6fa0;
}

/* -- Radius selector ------------------------------------------------------- */

.dist-radius-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 14px;
    font-size: 0.85em;
}

.dist-radius-wrap label {
    font-weight: 600;
    color: var(--color-text-gray, #555);
}

#dist-radius {
    padding: 4px 8px;
    border: 1px solid var(--color-gray, #ccc);
    border-radius: 4px;
    font-size: 1em;
}

/* -- Results list ---------------------------------------------------------- */

.dist-results {
    flex: 1;
    overflow-y: auto;
}

.dist-placeholder {
    padding: 20px 0;
    text-align: center;
    color: var(--color-text-gray, #888);
    font-size: 0.95em;
}

.dist-item {
    padding: 12px 0;
    border-bottom: 1px solid #e5e5e5;
    cursor: pointer;
    transition: background 0.15s ease;
}

.dist-item:hover {
    background: #f5f5f5;
}

.dist-item.active {
    background: #eef5fb;
}

.dist-item-name {
    font-weight: 700;
    font-size: 1em;
    margin-bottom: 2px;
}

.dist-item-address {
    font-size: 0.85em;
    color: var(--color-text-gray, #555);
    line-height: 1.4;
}

.dist-item-distance {
    font-size: 0.8em;
    color: var(--color-theme-blue, #3385bd);
    font-weight: 600;
    margin-top: 4px;
}

.dist-item-phone {
    font-size: 0.85em;
    margin-top: 4px;
}

.dist-item-phone a {
    color: var(--color-theme-blue, #3385bd);
    text-decoration: none;
}

.dist-item-phone a:hover {
    text-decoration: underline;
}

/* -- Online fallback ------------------------------------------------------- */

.dist-online {
    padding: 16px 0;
}

.dist-online h4 {
    margin: 0 0 8px;
    font-size: 1em;
}

.dist-online p {
    font-size: 0.9em;
    color: var(--color-text-gray, #555);
    margin: 0 0 12px;
}

.dist-online ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.dist-online li {
    padding: 8px 0;
    border-bottom: 1px solid #e5e5e5;
}

.dist-online li a {
    color: var(--color-theme-blue, #3385bd);
    font-weight: 600;
    text-decoration: none;
}

.dist-online li a:hover {
    text-decoration: underline;
}

/* -- Desktop layout -------------------------------------------------------- */

@media only screen and (min-width: 576px) {
    .dist-page {
        height: calc(100vh - 80px);
    }

    .dist-panel {
        top: 20px;
        left: 20px;
        width: 380px;
        height: calc(100% - 40px);
        border-radius: 10px;
        box-shadow: 0 4px 20px rgba(0,0,0,0.2);
    }

    .dist-panel-inner {
        padding: 24px;
    }
}

@media only screen and (min-width: 900px) {
    .dist-panel {
        width: 420px;
    }
}

/* -- Mapbox overrides ------------------------------------------------------ */

.mapboxgl-popup-content {
    padding: 12px 16px;
    font-family: 'Roboto', Arial, sans-serif;
    font-size: 0.9em;
}

.mapboxgl-popup-content strong {
    display: block;
    margin-bottom: 4px;
}
