/**
 * Template: Explore What's Nearby
 * Interactive map with sidebar, location cards, and filters
 * Matches Figma design exactly
 *
 * @package SCDA-2025
 */

/* ========================================
   HERO AREA - Green/Grey texture background
   ======================================== */

.explore-hero {
    color: var(--color-white);
    position: relative;
    
    @media screen and (max-width: 576px) {
        text-align: center;
    }

    .hero-texture {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 700px;
        
        &:after {
            background-color: var(--color-scda-green);
        }
    }

    .breadcrumbs-wrapper {
        background-color: rgba(var(--color-scda-green-rgb), .8);

        .breadcrumbs {
            color: #71808A;

            a {
                color: #71808A;

                &:hover, &:focus-visible {
                    color: var(--color-scda-blue) !important;

                    &:before {
                        background-color: var(--color-scda-blue);
                    }
                }
            }
            .current-page {
                color: var(--color-scda-blue);
            }
        }
    }

    .hero-content {
        position: relative;
        z-index: 2;

        .container {
            padding-top: 172px;
            display: flex;
            flex-direction: column;
            justify-content: center;

            @media screen and (max-width: 991px) {
                padding-top: 111px;
            }
        }

        .row {
            margin-top: 0;
            padding: var(--spacing-xl) 0;

            @media screen and (max-width: 991px) {
                padding: var(--spacing-lg) 0;
            }

            .col-12 {
                margin-top: 0;
                display: flex;
                flex-direction: column;
                justify-content: center;
            }
        }
    }
}

/* ========================================
   MAP LAYOUT - Sidebar + Map side by side
   ======================================== */

.map-layout {
    display: flex;
    flex-direction: column;
    height: calc(90vh - 172px);
    max-height: 790px;
    min-height: 450px;
    background-color: var(--color-white);
    overflow: visible;

    @media screen and (max-width: 991px) {
        height: auto;
        max-height: none;
    }
}

/* ========================================
   FULL-WIDTH HEADER
   ======================================== */

.map-header {
    background-color: var(--color-scda-moss);
    padding: 12px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;

    .sidebar-header-text {
        font-family: var(--font-secondary);
        font-size: 1.5rem;
        font-weight: 700;
        color: var(--color-white);
        margin: 0;
        flex: 1;
    }

    .sidebar-clear-location {
        font-family: var(--font-primary);
        font-size: 0.875rem;
        color: var(--color-white);
        text-decoration: underline;
        cursor: pointer;
        transition: opacity 0.2s ease;
        flex-shrink: 0;

        &:hover {
            opacity: 0.8;
        }
    }

    @media screen and (max-width: 991px) {
        display: none;
    }
}

/* ========================================
   FILTER BAR (Search + Enable Location + Filters)
   ======================================== */

.map-filter-bar {
    display: flex;
    align-items: center;
    gap: 30px;
    padding: 12px 16px;
    background-color: var(--color-white);
    border-bottom: 1px solid var(--color-scda-black);

    @media screen and (max-width: 991px) {
        display: none;
    }
}

.filter-bar-search {
    position: relative;
    flex-shrink: 0;

    .search-icon {
        position: absolute;
        left: 15px;
        top: 50%;
        transform: translateY(-50%);
        color: var(--color-scda-grey);
        pointer-events: none;
    }

    .map-search-input {
        width: 300px;
        padding: 12px 15px 12px 40px;
        border: 1px solid var(--color-scda-black);
        border-radius: 8px;
        font-family: var(--font-secondary);
        font-size: 1rem;
        color: var(--color-scda-black);
        background-color: var(--color-white);
        box-shadow: inset 0px 2px 4px rgba(74, 74, 104, 0.1);

        &::placeholder {
            color: #A8A9A4;
            font-size: 0.875rem;
        }

        &:focus {
            outline: none;
            border-color: var(--color-scda-moss);
        }
    }

    .search-suggestions {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--color-white);
        border: 1px solid var(--color-scda-grey);
        border-top: none;
        border-radius: 0 0 8px 8px;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
        z-index: 100;
        display: none;

        &.visible {
            display: block;
        }
    }

    .suggestion-item {
        display: block;
        width: 100%;
        padding: 10px 15px;
        text-align: left;
        background: none;
        border: none;
        font-family: var(--font-primary);
        font-size: 0.9375rem;
        color: var(--color-scda-black);
        cursor: pointer;
        border-bottom: 1px solid #EEEEEE;

        &:last-child {
            border-bottom: none;
        }

        &:hover {
            background-color: var(--color-scda-beige);
        }
    }
}

.filter-bar-location {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    flex-shrink: 0;

    input[type="checkbox"] {
        position: absolute;
        opacity: 0;
        width: 0;
        height: 0;
    }

    .filter-bar-checkbox {
        width: 36px;
        height: 36px;
        border: 1px solid var(--color-scda-grey);
        border-radius: 8px;
        background-color: var(--color-white);
        box-shadow: inset 0px 2px 2px -1px rgba(74, 74, 104, 0.1);
        display: flex;
        align-items: center;
        justify-content: center;
        transition: all 0.2s ease;
    }

    input:checked + .filter-bar-checkbox {
        background-color: var(--color-scda-moss);
        border-color: var(--color-scda-moss);
    }

    input:checked + .filter-bar-checkbox::after {
        content: '';
        display: block;
        width: 12px;
        height: 8px;
        border: 2px solid white;
        border-top: none;
        border-right: none;
        transform: rotate(-45deg) translateY(-2px);
    }

    .filter-bar-label {
        font-family: var(--font-primary);
        font-size: 1.125rem;
        font-weight: 700;
        color: #7C7E77;
    }
}

.filter-bar-mile-radius {
    flex-shrink: 0;

    .filter-dropdown-trigger {
        width: 100%;
        justify-content: space-between;
        padding: 8px 16px;
        background-color: var(--color-white);
        box-shadow: 0px 0px 12px rgba(81, 83, 74, 0.25);
        border-radius: 8px;
    }

    .filter-dropdown-label {
        font-family: var(--font-secondary);
        font-size: 1.125rem;
        font-weight: 900;
        color: var(--color-scda-black);
    }
}

.filter-bar-filters {
    flex-shrink: 0;

    .filter-dropdown-trigger {
        justify-content: space-between;
        padding: 8px 16px;
        background-color: var(--color-white);
        box-shadow: 0px 0px 12px rgba(81, 83, 74, 0.25);
        border-radius: 8px;
        min-width: 140px;
    }

    .filter-dropdown-label {
        font-family: var(--font-secondary);
        font-size: 1.125rem;
        font-weight: 900;
        color: var(--color-scda-black);
    }
}

/* ========================================
   CONTENT AREA (Sidebar + Map side by side)
   ======================================== */

.map-content-area {
    display: flex;
    flex: 1;
    min-height: 0;
}

/* ========================================
   SIDEBAR (Left side)
   ======================================== */

.map-sidebar {
    width: 440px;
    min-width: 440px;
    display: flex;
    flex-direction: column;
    background-color: var(--color-white);
    border-right: 1px solid #E0E0E0;

    @media screen and (max-width: 1200px) {
        width: 400px;
        min-width: 400px;
    }
    @media screen and (max-width: 991px) {
        width: 100%;
        min-width: 100%;
        max-height: none;
    }
}

/* Sidebar Header - Green (kept for backwards compatibility, now using .map-header) */
.sidebar-header {
    background-color: var(--color-scda-moss);
    padding: 20px 30px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px;

    h2, .sidebar-header-text {
        font-family: var(--font-secondary);
        font-size: 1.5rem;
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: 1px;
        color: var(--color-white);
        margin: 0;
        flex: 1;
    }

    .sidebar-clear-location {
        font-family: var(--font-primary);
        font-size: 0.875rem;
        color: var(--color-white);
        text-decoration: underline;
        cursor: pointer;
        transition: opacity 0.2s ease;
        flex-shrink: 0;

        &:hover {
            opacity: 0.8;
        }
    }

    /* When location is selected, header may wrap on smaller screens */
    &.has-location {
        .sidebar-header-text {
            font-size: 1.25rem;
        }
    }

    @media screen and (max-width: 991px) {
        h2, .sidebar-header-text {
            font-size: 1.25rem;
        }

        &.has-location .sidebar-header-text {
            font-size: 1rem;
        }
    }
}

/* Search */
.search-wrapper {
    position: relative;
    padding: 12px 16px;
}

.search-wrapper .search-icon {
    position: absolute;
    left: 28px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--color-scda-grey);
    pointer-events: none;
}

.map-search-input {
    width: 100%;
    padding: 10px 16px 10px 40px;
    border: 1px solid #E0E0E0;
    border-radius: var(--border-radius);
    font-family: var(--font-primary);
    font-size: 0.875rem;
    color: var(--color-scda-black);
    background-color: var(--color-white);

    &::placeholder {
        color: var(--color-scda-grey);
    }
    &:focus {
        outline: none;
        border-color: var(--color-scda-moss);
    }
}

/* Search Suggestions Dropdown */
.search-suggestions {
    position: absolute;
    top: 100%;
    left: 16px;
    right: 16px;
    background-color: var(--color-white);
    border: 1px solid #E0E0E0;
    border-top: none;
    border-radius: 0 0 var(--border-radius) var(--border-radius);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    z-index: 100;
    display: none;
}

.search-suggestions.visible {
    display: block;
}

.suggestion-item {
    display: block;
    width: 100%;
    padding: 10px 16px;
    text-align: left;
    background: none;
    border: none;
    font-family: var(--font-primary);
    font-size: 0.875rem;
    color: var(--color-scda-black);
    cursor: pointer;
    transition: background-color 0.15s ease;
}

.suggestion-item:hover,
.suggestion-item:focus,
.suggestion-item.is-highlighted {
    background-color: var(--color-scda-beige);
    outline: none;
}

.suggestion-item:not(:last-child) {
    border-bottom: 1px solid #E0E0E0;
}

/* Results Count */
.results-count-row {
    padding: 8px 16px 12px;
}

.results-count {
    font-size: 1rem;
    font-weight: 700;
    color: var(--color-scda-black);
}

/* ========================================
   MAP AREA (Right side with floating filters)
   ======================================== */

.map-area {
    flex: 1;
    position: relative;
}

/* Floating Filters - positioned ON TOP of map */
.map-filters {
    position: absolute;
    top: 12px;
    left: 30px;
    display: flex;
    gap: 30px;
    z-index: 10;

    @media screen and (max-width: 991px) {
        position: relative;
        top: 0;
        left: 0;
        padding: 12px;
        gap: 12px;
    }
}

/* Custom Filter Dropdowns */
.filter-dropdown {
    position: relative;
}

.filter-dropdown-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    width: 322px;
    padding: 20px 30px;
    background-color: var(--color-white);
    border: none;
    border-radius: 0;
    box-shadow: 0 0 12px rgba(81, 83, 74, 0.25);
    font-family: var(--font-secondary);
    font-size: 1.25rem;
    font-weight: 900;
    color: var(--color-scda-black);
    cursor: pointer;
    transition: box-shadow 0.2s ease;

    &:hover,
    &:focus {
        outline: none;
        box-shadow: 0 0 12px rgba(81, 83, 74, 0.4);
    }

    @media screen and (max-width: 991px) {
        font-size: 1rem;
        padding: 10px 16px;
        min-width: auto;
        flex: 1;
    }
}

.filter-dropdown-label {
    white-space: nowrap;
}

.filter-dropdown-chevron {
    flex-shrink: 0;
    transition: transform 0.2s ease;
    color: var(--color-scda-black);
}

.filter-dropdown.open .filter-dropdown-chevron {
    transform: rotate(180deg);
}

.filter-dropdown-panel {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    min-width: 290px;
    background-color: var(--color-white);
    border-radius: 12px;
    box-shadow: 0 0 12px rgba(81, 83, 74, 0.25);
    padding: 16px;
    display: none;
    z-index: 100;

    @media screen and (max-width: 991px) {
        min-width: 260px;
        right: 0;
        left: auto;
    }
}

.filter-dropdown.open .filter-dropdown-panel {
    display: block;
}

.filter-dropdown-section {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.filter-dropdown-section:not([style*="display: none"]) + .filter-dropdown-section:not([style*="display: none"]) {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--color-scda-grey-25);
}

/* Filter Search Input */
.filter-search-wrapper {
    position: relative;
}

.filter-search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--color-scda-grey);
    pointer-events: none;
}

.filter-search-input {
    width: 100%;
    padding: 10px 12px 10px 40px;
    border: 1px solid #E0E0E0;
    border-radius: 8px;
    font-family: var(--font-primary);
    font-size: 0.875rem;
    color: var(--color-scda-black);
    background-color: var(--color-white);

    &::placeholder {
        color: var(--color-scda-grey);
    }
    &:focus {
        outline: none;
        border-color: var(--color-scda-moss);
    }
}

/* Filter Section Header (collapsible) */
.filter-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 0;
    background: none;
    border: none;
    font-family: var(--font-secondary);
    font-size: 1.25rem;
    font-weight: 900;
    color: var(--color-scda-black);
    cursor: pointer;
}

.filter-section-chevron {
    flex-shrink: 0;
    transition: transform 0.2s ease;
    color: var(--color-scda-black);
}

.filter-section-header[aria-expanded="false"] .filter-section-chevron {
    transform: rotate(180deg);
}

.filter-section-header[aria-expanded="false"] + .filter-section-options {
    display: none;
}

/* Filter Checkbox Items */
.filter-section-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.filter-checkbox-item {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    border-radius: 8px;
    padding: 0;
}

.filter-checkbox-item input[type="checkbox"],
.filter-checkbox-item input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.filter-checkbox-box {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    background-color: var(--color-white);
    border: 1px solid #BBBCBC;
    border-radius: 8px;
    box-shadow: inset 0px 2px 2px -1px rgba(74, 74, 104, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.filter-checkbox-item input:checked + .filter-checkbox-box {
    background-color: var(--color-scda-moss);
    border-color: var(--color-scda-moss);
}

.filter-checkbox-item input:checked + .filter-checkbox-box::after {
    content: '';
    display: block;
    width: 10px;
    height: 16px;
    border: solid var(--color-white);
    border-width: 0 3px 3px 0;
    transform: rotate(45deg) translateY(-2px);
}

.filter-checkbox-item input:focus + .filter-checkbox-box {
    box-shadow: 0 0 0 2px rgba(91, 119, 85, 0.3);
}

.filter-checkbox-label {
    font-family: var(--font-primary);
    font-weight: 700;
    font-size: 0.9375rem;
    color: #7C7E77;
    letter-spacing: 0.0075em;
    white-space: nowrap;
}

.filter-checkbox-item input:checked ~ .filter-checkbox-label {
    color: var(--color-scda-black);
}

/* Tooltip Button */
.filter-tooltip-btn {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 1.5px solid var(--color-scda-blue);
    background-color: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    margin-left: auto;
    transition: all 0.2s ease;
    position: relative;

    span {
        font-family: var(--font-primary);
        font-weight: 900;
        font-size: 0.875rem;
        color: var(--color-scda-blue);
        line-height: 1;
    }

    &:hover {
        background-color: var(--color-scda-blue);

        span {
            color: var(--color-white);
        }
    }
}

/* Tooltip Popup - appears on hover, positioned directly above i-icon */
.filter-tooltip-btn::before {
    content: attr(data-tooltip-content);
    position: absolute;
    bottom: calc(100% + 12px);
    left: 50%;
    transform: translateX(-50%);
    background-color: var(--color-scda-blue);
    color: var(--color-white);
    padding: 12px 16px;
    border-radius: 8px;
    font-family: var(--font-primary);
    font-size: 0.875rem;
    font-weight: 400;
    line-height: 1.5;
    white-space: normal;
    width: max-content;
    max-width: 300px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
    z-index: 1000;
    pointer-events: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Arrow pointing down to i-icon */
.filter-tooltip-btn::after {
    content: '';
    position: absolute;
    bottom: calc(100% + 4px);
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-top: 8px solid var(--color-scda-blue);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
    z-index: 1000;
    pointer-events: none;
}

/* Show tooltip on hover */
.filter-tooltip-btn:hover::before,
.filter-tooltip-btn:hover::after {
    opacity: 1;
    visibility: visible;
}

/* Close dropdown when clicking outside */
.filter-dropdown-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 99;
}

/* ========================================
   LOCATION LIST
   ======================================== */

.location-list {
    flex: 1;
    overflow-y: auto;
    padding: 0;

    &::-webkit-scrollbar {
        width: 4px;
    }
    &::-webkit-scrollbar-track {
        background: #F5F5F5;
    }
    &::-webkit-scrollbar-thumb {
        background: #CCCCCC;
        border-radius: 2px;
    }
}

.loading-indicator {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    color: var(--color-scda-grey);
    gap: 12px;
    font-size: 0.875rem;

    .spinner {
        width: 28px;
        height: 28px;
        border: 3px solid rgba(0, 0, 0, 0.1);
        border-top-color: var(--color-scda-moss);
        border-radius: 50%;
        animation: spin 1s linear infinite;
    }
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ========================================
   LOCATION CARD - with border radius and shadow per Figma
   ======================================== */

.location-card {
    background-color: var(--color-white);
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    margin: 0 16px 12px;
    overflow: hidden;
    cursor: pointer;

    &:last-child {
        margin-bottom: 16px;
    }
    &.active {
        box-shadow: 0 2px 12px rgba(91, 119, 85, 0.3);
    }
}

.location-card .card-header {
    display: flex;
    flex-direction: row;
    align-items: stretch;
    gap: 14px;
    padding: 12px;
    cursor: pointer;
}

/* Card Image - only renders if image exists */
.location-card .card-image {
    width: 100px;
    height: 100px;
    flex-shrink: 0;
    border-radius: 8px;
    overflow: hidden;

    img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }
}

.location-card .card-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.location-card .card-title {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--color-scda-black);
    margin: 0;
    line-height: 1.3;
}

.location-card .card-title-link {
    color: inherit;
    text-decoration: none;
    pointer-events: none;
}

.location-card.expanded .card-title-link {
    pointer-events: auto;
    cursor: pointer;

    &:hover {
        text-decoration: underline;
    }
}

.location-card .card-meta-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: nowrap;
}

.location-card .card-meta {
    font-size: 0.8125rem;
    color: #7C7E77;
    margin: 0;
}

.location-card .card-meta-divider {
    width: 1px;
    height: 18px;
    background-color: var(--color-scda-grey);
    flex-shrink: 0;
}

.location-card .card-distance {
    font-size: 0.8125rem;
    font-weight: 700;
    color: var(--color-scda-moss);
    margin: 0;
    white-space: nowrap;
}

/* Right column - badges (top) + expand button (bottom) per Figma */
.location-card .card-right-col {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
    width: 24px;
    gap: 8px;
}

.location-card .card-right-col .card-badges {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.location-card .card-right-col .badge-icon {
    display: block;
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.location-card .card-expand-btn {
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--color-scda-beige);
    border: none;
    border-radius: 8px;
    color: var(--color-scda-black);
    flex-shrink: 0;
    cursor: pointer;
    transition: background-color 0.2s ease;

    .icon-plus {
        display: block;
    }
    .icon-minus {
        display: none;
    }

    &:hover {
        background-color: #E5D5C8;
    }
}

/* Expanded state - show minus, same beige background */
.location-card.expanded .card-expand-btn {
    background-color: var(--color-scda-beige);
    color: var(--color-scda-black);

    .icon-plus {
        display: none;
    }
    .icon-minus {
        display: block;
    }

    &:hover {
        background-color: #E5D5C8;
    }
}

/* ========================================
   EXPANDED CARD DETAILS
   ======================================== */

.location-card .card-details {
    display: none;
    padding: 0 20px 20px;

    .expanded & {
        display: block;
    }
}

/* Type Pill - Light grey background, dark blue text per Figma */
.location-card .card-type-pills {
    margin: 0;
}

.type-pill {
    display: inline-block;
    padding: 4px 8px 2px;
    border-radius: 8px;
    font-size: 0.8125rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    color: var(--color-scda-blue);
}

/* Type pill colors by post type */
.type-pill-agritourism-farm {
    background-color: var(--color-scda-green-25); /* #E9EEEB */
}

.type-pill-roadside-market {
    background-color: var(--color-scda-grey-25); /* #EEEEEE */
}

.type-pill-csa {
    background-color: var(--color-scda-moss-25); /* #D6DDD4 */
}

.type-pill-farmers-market {
    background-color: var(--color-scda-tan-25); /* #EFDCD7 */
}

/* Address Section */
.location-card .card-section {
    margin-bottom: 12px;

    &:last-of-type {
        margin-bottom: 16px;
    }
}

.location-card .card-section-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8125rem;
    font-weight: 700;
    color: var(--color-scda-black);
    margin-bottom: 4px;

    svg {
        width: 14px;
        height: 18px;
        flex-shrink: 0;
    }
}

.location-card .card-section-text {
    font-size: 0.9375rem;
    color: var(--color-scda-black);
    line-height: 1.5;
    margin: 0;
    text-decoration: underline;
}

.location-card .card-hours-text {
    text-decoration: none;
    white-space: pre-line;
}

/* Action Buttons - use global button classes */
.location-card .card-actions {
    display: flex;
    gap: 10px;
    align-items: stretch;

    .btn {
        flex: 1;
        display: flex;
        align-items: center;
        justify-content: center;
        text-align: center;
        font-size: 0.75rem;
        padding: 10px 16px;
        line-height: 1.2;

        @media screen and (max-width: 576px) {
            width: auto;
        }
    }
}

/* Load More Button - PERFORMANCE: Virtual scrolling */
.load-more-btn {
    display: block;
    width: calc(100% - 32px);
    margin: 16px 16px 24px;
    padding: 12px 20px;
    background-color: var(--color-scda-blue);
    color: var(--color-white);
    border: none;
    border-radius: 8px;
    font-family: var(--font-primary);
    font-size: 0.875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: background-color 0.2s ease;

    &:hover {
        background-color: #364451;
    }

    &:active {
        background-color: #2a3640;
    }
}

/* ========================================
   MAP CONTAINER - fills full height
   ======================================== */

.map-container {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
}

.google-map {
    width: 100%;
    height: 100%;
    background-color: #e5e3df;
}

/* Map Controls */
.map-controls {
    position: absolute;
    top: 16px;
    right: 16px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    z-index: 5;
}

.map-control-btn {
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--color-white);
    border: none;
    border-radius: 50%;
    box-shadow: 0 0 12px rgba(81, 83, 74, 0.25);
    color: var(--color-scda-black);
    cursor: pointer;
    transition: all 0.2s ease;

    &:hover {
        background-color: #F5F5F5;
    }
}

.map-zoom-controls {
    display: flex;
    flex-direction: column;
    background-color: var(--color-white);
    border-radius: 50px;
    box-shadow: 0 0 12px rgba(81, 83, 74, 0.25);
    overflow: hidden;

    .map-control-btn {
        border-radius: 0;
        box-shadow: none;
        width: 42px;
        height: 42px;

        &:first-child {
            border-bottom: 1px solid var(--color-scda-grey);
        }
    }
}

/* Fix for sticky search button layout breaking on this page */
.search-flyout {
    flex-wrap: nowrap !important;
    width: 360px !important;
    min-width: 360px !important;
}

.search-flyout .search-icon {
    flex-shrink: 0 !important;
}

.search-flyout .search-form-wrapper {
    flex-shrink: 0 !important;
}

.search-flyout .search-form input {
    width: 280px !important;
    min-width: 280px !important;
}

/* Google Maps info window overrides */
.gm-style-iw {
    padding: 0 !important;
}
.gm-style-iw-d {
    overflow: hidden !important;
}

/* Cluster marker text positioning - uses .map-cluster class from MarkerClusterer */
.map-cluster {
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
}

.map-cluster > div {
    text-align: center !important;
    transform: translateY(-10px) !important;
}

/* ========================================
   NO RESULTS STATE
   ======================================== */

.no-results {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    text-align: center;

    svg {
        margin-bottom: 16px;
        color: var(--color-scda-grey);
    }
    h3 {
        font-size: 1rem;
        color: var(--color-scda-black);
        margin: 0 0 8px;
    }
    p {
        font-size: 0.875rem;
        color: var(--color-scda-grey);
        margin: 0;
    }
}

/* ========================================
   MOBILE STYLES (992px and below)
   ======================================== */

/* Hide mobile elements on desktop */
.mobile-map-header,
.mobile-nav-bar,
.mobile-floating-card,
.mobile-results-count,
.mobile-filter-modal {
    display: none;
}

@media screen and (max-width: 992px) {
    /* Show mobile elements */
    .mobile-map-header,
    .mobile-nav-bar {
        display: flex;
    }

    /* Hide desktop elements */
    .sidebar-header,
    .search-wrapper,
    .results-count-row,
    .map-filters {
        display: none;
    }

    /* ========================================
       MOBILE MAP LAYOUT
       ======================================== */

    .map-layout {
        flex-direction: column;
        height: 75vh;
        max-height: none;
        position: relative;
        overflow: hidden;
    }

    .map-content-area {
        flex: 1;
        min-height: 0;
        overflow: hidden;
    }

    /* ========================================
       MOBILE HEADER BAR
       ======================================== */

    .mobile-map-header {
        display: flex;
        align-items: center;
        gap: 8px;
        background-color: var(--color-scda-moss);
        padding: 8px 14px;
        width: 100%;
        flex-shrink: 0;
    }

    .mobile-back-btn {
        display: flex;
        align-items: center;
        gap: 8px;
        background: none;
        border: none;
        color: var(--color-white);
        font-family: var(--font-primary);
        font-size: 1rem;
        font-weight: 500;
        letter-spacing: 0.12px;
        cursor: pointer;
        padding: 0;
        flex-shrink: 0;

        svg {
            flex-shrink: 0;
        }
    }

    .mobile-header-title {
        font-family: var(--font-primary);
        font-size: 14px;
        font-weight: 700;
        color: var(--color-white);
        letter-spacing: 0.105px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        flex: 1;
        min-width: 0;
        text-align: right;
    }

    .mobile-clear-location {
        display: none;
        align-items: center;
        justify-content: center;
        background: none;
        border: none;
        color: var(--color-white);
        cursor: pointer;
        padding: 4px;
        flex-shrink: 0;
        width: 20px;
        height: 20px;

        svg {
            display: block;
        }
    }

    /* ========================================
       MOBILE NAV BAR (Location, Filters, Toggle)
       ======================================== */

    .mobile-nav-bar {
        display: flex;
        flex-direction: column;
        gap: 10px;
        padding: 10px 14px;
        background-color: transparent;
        position: absolute;
        top: 38px;
        left: 0;
        right: 0;
        z-index: 10;
    }

    .mobile-search-wrapper {
        position: relative;
        background-color: var(--color-white);
        border-radius: 8px;
        box-shadow: 0 0 12px rgba(81, 83, 74, 0.25);
    }

    .mobile-search-icon {
        position: absolute;
        left: 16px;
        top: 50%;
        transform: translateY(-50%);
        color: var(--color-scda-grey);
        pointer-events: none;
    }

    .mobile-map-search-input {
        width: 100%;
        padding: 12px 16px 12px 44px;
        border: none;
        border-radius: 8px;
        font-family: var(--font-primary);
        font-size: 0.875rem;
        color: var(--color-scda-black);
        background-color: transparent;

        &::placeholder {
            color: var(--color-scda-grey);
        }

        &:focus {
            outline: none;
        }
    }

    /* Mobile Search Suggestions */
    .mobile-search-wrapper .search-suggestions {
        left: 0;
        right: 0;
        border-radius: 0 0 8px 8px;
        box-shadow: 0 4px 12px rgba(81, 83, 74, 0.25);
    }

    .mobile-filters-row {
        display: flex;
        align-items: center;
        gap: 10px;
    }

    .mobile-filters-btn {
        display: flex;
        align-items: center;
        justify-content: space-between;
        flex: 1;
        background-color: var(--color-white);
        border: none;
        padding: 10px 16px;
        border-radius: 8px;
        box-shadow: 0 0 12px rgba(81, 83, 74, 0.25);
        font-family: var(--font-secondary);
        font-size: 0.9375rem;
        font-weight: 700;
        color: #7C7E77;
        letter-spacing: 0.6px;
        text-transform: capitalize;
        cursor: pointer;

        svg {
            flex-shrink: 0;
            color: #7C7E77;
        }
    }

    /* ========================================
       MOBILE VIEW TOGGLE (MAP/LIST)
       ======================================== */

    .mobile-view-toggle {
        display: flex;
        gap: 8px;
    }

    .mobile-view-toggle .toggle-btn {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 8px;
        width: 78px;
        height: 40px;
        background-color: var(--color-white);
        border: none;
        border-radius: 8px;
        box-shadow: 0 1px 6px rgba(0, 0, 0, 0.25);
        font-family: var(--font-secondary);
        font-size: 0.75rem;
        font-weight: 700;
        color: var(--color-scda-blue);
        letter-spacing: 0.48px;
        text-transform: uppercase;
        cursor: pointer;
        transition: all 0.2s ease;

        svg {
            flex-shrink: 0;
        }
    }

    .mobile-view-toggle .toggle-btn.active {
        background-color: var(--color-scda-blue);
        color: var(--color-white);

        svg {
            fill: var(--color-white);
        }

        svg path {
            stroke: var(--color-white);
            fill: var(--color-white);
        }
    }

    /* ========================================
       MOBILE SIDEBAR (LIST VIEW)
       ======================================== */

    .map-sidebar {
        display: none;
        width: 100%;
        min-width: 100%;
        flex: 1;
        overflow-y: auto;
        padding-top: 130px;
        background-color: var(--color-white);
    }

    .map-layout.list-view .map-sidebar {
        display: flex;
        flex-direction: column;
        height: 100%;
        overflow-y: auto;
    }

    .map-layout.list-view .location-list {
        flex: 1;
        overflow-y: auto;
    }

    .map-layout.list-view .map-area {
        display: none;
    }

    .map-layout.list-view .mobile-results-count {
        display: block;
    }

    .map-layout.list-view .mobile-nav-bar {
        position: relative;
        top: 0;
        flex-shrink: 0;
    }

    .map-layout.list-view .map-sidebar {
        padding-top: 0;
    }

    /* ========================================
       MOBILE MAP AREA (MAP VIEW)
       ======================================== */

    .map-area {
        flex: 1;
        position: relative;
    }

    .map-layout.map-view .map-area {
        display: block;
    }

    .map-layout.map-view .map-sidebar {
        display: none;
    }

    .map-container {
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
    }

    /* ========================================
       MOBILE RESULTS COUNT (LIST VIEW)
       ======================================== */

    .mobile-results-count {
        display: none;
        position: absolute;
        top: 140px;
        left: 0;
        right: 0;
        text-align: center;
        font-family: var(--font-primary);
        font-size: 1.125rem;
        font-weight: 700;
        color: var(--color-white);
        padding: 10px;
        z-index: 5;
    }

    /* ========================================
       MOBILE FLOATING CARD (MAP VIEW)
       Container that holds the reused location-card component
       ======================================== */

    .mobile-floating-card {
        display: none;
        position: absolute;
        bottom: 14px;
        left: 0;
        right: 0;
        z-index: 15;
    }

    .mobile-floating-card.visible {
        display: block;
    }

    /* The location-card inside floating container inherits all desktop styling */
    .mobile-floating-card .location-card {
        margin: 0 14px;
        box-shadow: 0 0 12px rgba(66, 66, 66, 0.25);
    }

    /* ========================================
       MOBILE FILTER MODAL (BOTTOM SHEET)
       ======================================== */

    .mobile-filter-modal {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 1000;
    }

    .mobile-filter-modal.open {
        display: block;
    }

    .mobile-filter-overlay {
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background-color: rgba(66, 85, 99, 0.6);
    }

    .mobile-filter-sheet {
        position: absolute;
        bottom: 0;
        left: 0;
        right: 0;
        background-color: var(--color-white);
        border-radius: 8px 8px 0 0;
        box-shadow: 0 -5px 12px rgba(81, 83, 74, 0.5);
        max-height: 80vh;
        display: flex;
        flex-direction: column;
    }

    .mobile-filter-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 10px 31px;
        border-bottom: 1px solid transparent;
    }

    .mobile-filter-title {
        font-family: var(--font-secondary);
        font-size: 0.9375rem;
        font-weight: 700;
        color: var(--color-scda-black);
        letter-spacing: 0.6px;
        text-transform: capitalize;
    }

    .mobile-filter-close {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 32px;
        height: 32px;
        background: none;
        border: none;
        color: var(--color-scda-black);
        cursor: pointer;
        padding: 0;
    }

    .mobile-filter-content {
        flex: 1;
        overflow-y: auto;
        padding: 0 31px 20px;
    }

    .mobile-filter-section {
        display: flex;
        flex-direction: column;
        gap: 16px;
        padding: 16px 0;
    }

    .mobile-filter-divider {
        height: 1px;
        background-color: var(--color-scda-grey);
        margin: 0;
    }

    .mobile-filter-section-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        width: 100%;
        padding: 0;
        background: none;
        border: none;
        font-family: var(--font-secondary);
        font-size: 0.9375rem;
        font-weight: 700;
        color: var(--color-scda-black);
        letter-spacing: 0.6px;
        cursor: pointer;

        svg {
            transition: transform 0.2s ease;
        }

        &[aria-expanded="false"] svg {
            transform: rotate(180deg);
        }
    }

    .mobile-filter-radius-options {
        display: flex;
        flex-direction: column;
        gap: 16px;
        margin-top: 16px;
    }

    .mobile-filter-section-header[aria-expanded="false"] + .mobile-filter-radius-options {
        display: none;
    }

    .mobile-filter-actions {
        display: flex;
        flex-direction: column;
        gap: 12px;
        padding: 20px;
        border-top: 1px solid var(--color-scda-grey);
        background-color: var(--color-white);
    }

    .mobile-filter-actions .btn {
        width: 100%;
        text-align: center;
        justify-content: center;
    }

    /* Mobile checkbox adjustments */
    .filter-checkbox-item.mobile .filter-checkbox-box {
        width: 30px;
        height: 30px;
    }

    .filter-checkbox-item.mobile .filter-checkbox-label {
        font-size: 0.8125rem;
        font-weight: 500;
    }

    .filter-checkbox-item.mobile .filter-tooltip-btn {
        width: 16px;
        height: 16px;

        span {
            font-size: 0.75rem;
        }
    }

    /* ========================================
       MOBILE LOCATION CARDS
       ======================================== */

    .location-card {
        margin: 0 14px 10px;
    }

    /* Override inherited text-align: center from .explore-hero */
    .card-info,
    .card-details,
    .card-type-pills,
    .card-section,
    .card-section-label,
    .card-section-text,
    .card-actions {
        text-align: left;
    }

    .card-title,
    .card-meta,
    .card-distance {
        text-align: left;
    }

    .type-pill {
        text-align: left;
    }

    /* Map controls repositioning for mobile */
    .map-controls {
        top: auto;
        bottom: 100px;
        right: 14px;
    }
}