.tf-map-section-wrapper {
    position: relative;
    width: 100%;
    height: 600px;
    background-color: #e5e5e5;
}

#tf-leaflet-map-canvas {
    width: 100%;
    height: 100%;
    z-index: 1;
}

/* Floating interface container */
.tf-map-search-card {
    position: absolute;
    top: 40px;
    left: 40px;
    width: 100%;
    max-width: 400px;
    background: #ffffff;
    padding: 40px;
    border-radius: 4px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    z-index: 10;
}

.tf-map-search-card h2 {
    font-size: 32px;
    color: var(--tf-text-dark);
    margin: 0 0 15px 0;
    font-weight: 800;
}

.tf-map-search-card p {
    font-size: 14px;
    color: #666666;
    line-height: 1.5;
    margin: 0 0 25px 0;
}

/* Form inputs matching Total Fitness branding */
.tf-search-input-group {
    display: flex;
    gap: 0;
    border: 1px solid var(--tf-gray-border);
    border-radius: 4px;
    overflow: hidden;
}

#tf-postcode-input {
    flex: 1;
    border: none;
    padding: 15px;
    font-size: 16px;
    outline: none;
    background: #f4f7f8;
}

#tf-postcode-btn {
    background-color: var(--tf-teal-bright);
    color: #ffffff;
    border: none;
    padding: 0 25px;
    font-weight: 700;
    cursor: pointer;
    font-size: 15px;
    transition: background-color 0.2s;
}

#tf-postcode-btn:hover {
    background-color: #00bdf3;
}

.tf-search-error-msg {
    color: #d9534f;
    font-size: 13px;
    margin-top: 10px;
    font-weight: 500;
}

/* Branded map custom layout overrides */
.leaflet-popup-content-wrapper {
    border-radius: 4px;
    padding: 5px;
}
.leaflet-popup-content h3 {
    margin: 0 0 5px 0;
    color: var(--tf-teal-dark);
}
.leaflet-popup-content a {
    color: var(--tf-teal-bright);
    text-decoration: none;
    font-weight: 700;
}
.tf-use-location-btn {
    width: 100%;
    margin-top: 12px;
    border: 1px solid var(--tf-teal-bright);
    background: #ffffff;
    color: var(--tf-teal-dark);
    padding: 12px 15px;
    border-radius: 4px;
    font-weight: 800;
    cursor: pointer;
    transition: all 0.2s ease;
}

.tf-use-location-btn:hover {
    background: #e9fbff;
}

.tf-use-location-btn:disabled,
#tf-postcode-btn:disabled {
    opacity: 0.65;
    cursor: wait;
}


.tf-nearest-results {
    margin-top: 16px;
    border-top: 1px solid var(--tf-gray-border);
    padding-top: 14px;
}

.tf-nearest-summary {
    background: linear-gradient(135deg, #e9fff2 0%, #f6fffa 100%);
    border: 1px solid #b9f3ce;
    border-left: 6px solid #16a34a;
    padding: 14px 14px 14px 16px;
    border-radius: 8px;
    margin-bottom: 12px;
    box-shadow: 0 8px 22px rgba(22, 163, 74, 0.12);
}

.tf-nearest-summary strong {
    display: block;
    color: #087a32;
    font-size: 15px;
    margin-bottom: 5px;
    font-weight: 900;
}

.tf-nearest-summary span {
    display: block;
    color: #14532d;
    font-size: 13px;
    font-weight: 600;
}

.tf-nearest-list {
    display: grid;
    gap: 8px;
}

.tf-nearest-result {
    width: 100%;
    text-align: left;
    background: #ffffff;
    border: 1px solid var(--tf-gray-border);
    border-radius: 7px;
    padding: 10px 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.tf-nearest-result:hover {
    border-color: var(--tf-teal-bright);
    box-shadow: 0 4px 12px rgba(0, 163, 196, 0.12);
    transform: translateY(-1px);
}

.tf-nearest-result.is-nearest {
    background: linear-gradient(135deg, #dcfce7 0%, #f0fdf4 100%);
    border: 2px solid #22c55e;
    box-shadow: 0 8px 20px rgba(34, 197, 94, 0.16);
}

.tf-nearest-result.is-nearest:hover {
    border-color: #16a34a;
    box-shadow: 0 10px 24px rgba(22, 163, 74, 0.22);
}

.tf-nearest-result.is-nearest .tf-nearest-rank {
    background: #16a34a;
    color: #ffffff;
    padding: 4px 8px;
    border-radius: 999px;
    margin-bottom: 6px;
}

.tf-nearest-rank {
    display: inline-block;
    color: var(--tf-teal-bright);
    font-size: 11px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 3px;
}

.tf-nearest-result strong,
.tf-nearest-result small {
    display: block;
}

.tf-nearest-result strong {
    color: var(--tf-text-dark);
    font-size: 14px;
}

.tf-nearest-result small {
    color: #666666;
    font-size: 12px;
    margin-top: 3px;
}

.tf-nearest-result.is-nearest strong {
    color: #064e3b;
}

.tf-nearest-result.is-nearest small {
    color: #166534;
    font-weight: 600;
}

@media (max-width: 768px) {
    .tf-map-search-card {
        left: 18px;
        right: 18px;
        top: 18px;
        max-width: none;
        padding: 24px;
    }

    .tf-map-section-wrapper {
        height: 720px;
    }
}

/* Responsive map layout */
@media (max-width: 900px) {
    .tf-map-section-wrapper {
        height: auto;
        min-height: 760px;
        display: flex;
        flex-direction: column;
    }

    #tf-leaflet-map-canvas {
        order: 2;
        height: 470px;
        min-height: 470px;
    }

    .tf-map-search-card {
        order: 1;
        position: relative;
        top: auto;
        left: auto;
        right: auto;
        max-width: none;
        width: calc(100% - 36px);
        margin: 18px auto;
        padding: 26px;
        box-shadow: 0 8px 28px rgba(0, 0, 0, 0.14);
    }
}

@media (max-width: 560px) {
    .tf-map-section-wrapper { min-height: 800px; }
    .tf-map-search-card {
        width: calc(100% - 24px);
        margin: 12px auto;
        padding: 22px 18px;
    }
    .tf-map-search-card h2 { font-size: 26px; }
    .tf-search-input-group { flex-direction: column; border: none; gap: 10px; }
    #tf-postcode-input {
        width: 100%;
        border: 1px solid var(--tf-gray-border);
        border-radius: 4px;
    }
    #tf-postcode-btn {
        width: 100%;
        min-height: 48px;
        border-radius: 4px;
    }
    #tf-leaflet-map-canvas {
        height: 430px;
        min-height: 430px;
    }
    .tf-nearest-result { padding: 12px; }
}
