.map-container {
    position: relative;
    width: 100%;
    height: calc(100vh - 40px); /* don't change this */
    overflow: hidden;
}

.map {
    width: 100%;
    height: 100%;
    border: 1px solid #ccc;
}

#mapError {
    position: fixed;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1200; /* Above map, nav, and footer */
    background: #fff;
    padding: 8px 12px;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    visibility: hidden;
    text-align: center;
}

    #mapError.show {
        visibility: visible;
    }

    #mapError.loading {
        color: #007bff;
        font-weight: bold;
    }

.search-area-btn {
    position: absolute;
    z-index: 1100; /* Above map, below error */
    background: #22c55e;
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 4px;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    font-size: 1rem;
    transition: opacity 0.3s ease;
}

    .search-area-btn:hover {
        background: #16a34a;
    }

.map-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    height: 40px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    padding: 0 5px;
}

.nav-container {
    display: flex;
    align-items: center;
    width: 100%;
    gap: 3px;
    padding-top: 10px;
}

.back-btn {
    padding: 8px 12px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    font-size: 1rem;
    outline: none;
    transition: border-color 0.2s;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
    background-color: white;
}

    .back-btn:hover {
        transform: scale(1.05);
    }

.back-icon {
    width: 20px;
    height: 20px;
    color: #ffffff;
}

.search-container {
    flex: 1;
    position: relative;
}

.search-input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    font-size: 1rem;
    outline: none;
    transition: border-color 0.2s;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
}

    .search-input:focus {
        border-color: #22c55e;
        box-shadow: 0 0 4px rgba(34, 197, 94, 0.3);
    }

.autocomplete-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
    z-index: 1100;
    max-height: 60vh;
    overflow-y: auto;
    margin-top: 8px;
    padding: 8px;
    display: none;
    width: 100%; /* Ensure full width by default */
}

    .autocomplete-results.show {
        display: block;
    }

.autocomplete-close {
    position: absolute;
    top: 8px;
    right: 8px;
    background: #dc2626;
    color: white;
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.8rem;
}

    .autocomplete-close:hover {
        background: #b91c1c;
    }

.autocomplete-section {
    margin-bottom: 12px;
}

    .autocomplete-section h4 {
        font-size: 1rem;
        color: #1f2937;
        margin: 8px 0;
        padding-left: 8px;
    }

.autocomplete-item {
    display: block;
    padding: 8px 12px;
    background: #e5e7eb;
    color: #1f2937;
    border-radius: 12px;
    margin: 4px 8px;
    cursor: pointer;
    text-align: left;
    font-size: 0.9rem;
    transition: background 0.2s;
}

    .autocomplete-item:hover {
        background: #d1d5db;
    }

.autocomplete-tag {
    display: inline-block;
    padding: 6px 10px;
    background: #e5e7eb;
    color: #1f2937;
    border-radius: 12px;
    margin: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background 0.2s;
}

    .autocomplete-tag:hover {
        background: #d1d5db;
    }

.map-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #ffffff;
    border-top-left-radius: 12px;
    border-top-right-radius: 12px;
    box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    transition: height 0.3s ease;
    overflow: hidden;
}

    .map-footer[data-mode="sliver"] {
        height: 40px;
    }

    .map-footer[data-mode="preview"] {
        height: 33vh;
    }

    .map-footer[data-mode="max"] {
        height: 80vh;
    }

.footer-back {
    position: absolute;
    top: 3px;
    left: 10px;
    font-size: small;
}

.handle-container {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 8px;
    padding-bottom: 24px;
    cursor: pointer;
}

.handle-btn {
    background: #22c55e;
    border: none;
    border-radius: 6px;
    width: 50%;
    height: 5px;
    cursor: pointer;
    transition: background 0.2s, transform 0.2s;
}

    .handle-btn:hover {
        background: #16a34a;
        transform: scale(1.05);
    }

.footer-content {
    padding: 0px;
    overflow-y: auto;
    height: calc(100% - 40px); /* don't change this */
}

.mode-content {
    display: none;
}

.map-footer[data-mode="sliver"] .sliver-content {
    display: block;
}

.map-footer[data-mode="preview"] .preview-content {
    display: block;
}

.map-footer[data-mode="max"] .max-content {
    display: block;
}


.search-context {
    color: #6b7280;
    font-size: 0.9rem;
    font-weight: 400;
    margin: 0 0 8px 0;
}

.results-container, .business-container {
    color: #4b5563;
}

.business-result {
    cursor: pointer;
    padding: 8px;
    border-bottom: 1px solid #e5e7eb;
}

.business-result:hover {
    background: #f3f4f6;
    
}

.business-image {
    width: 100%;
    max-height: 300px;
    object-fit: cover;
    border-radius: 8px;
    margin: 16px 0;
}

.business-details p {
    margin: 8px 0;
    line-height: 1.5;
}

.business-details a {
    color: #16a34a;

    text-decoration: none;
}

    .business-details a:hover {
        color: #16a34a;
        text-decoration: underline;
    }

.tag-badge {
    display: inline-block;
    background: #e5e7eb;
    color: #1f2937;
    padding: 4px 8px;
    border-radius: 12px;
    margin: 4px;
    font-size: 0.9rem;
}

.loading-text {
    text-align: center;
    font-style: italic;
}

.action-btn {
    background: #22c55e;
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    transition: background 0.2s, transform 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 8px 0;
}

    .action-btn:hover {
        background: #16a34a;
        transform: scale(1.05);
    }

    .action-btn a {
        color: white !important;
        text-decoration: none;
    }

        .action-btn a:hover {
            text-decoration: none;
        }



/* Filter container and list */
.filter-container {
    width: 100%;
    padding: 8px 5px;
    overflow: hidden;
    /*visibility: hidden;*/
}

.filter-list {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    gap: 8px;
    padding-bottom: 8px;
    -webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS */
    scrollbar-width: none; /* Hide scrollbar for Firefox */
    -ms-overflow-style: none; /* Hide scrollbar for IE/Edge */
}

    .filter-list::-webkit-scrollbar {
        display: none; /* Hide scrollbar for Chrome/Safari */
    }

.filter-btn {
    flex: 0 0 auto;
    padding: 6px 12px;
    background: #fff;
    color: #1f2937;
    border: none;
    border-radius: 12px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: background 0.2s, transform 0.2s;
}

    .filter-btn:hover {
        background: #d1d5db;
        transform: scale(1.05);
    }

    .filter-btn.active {
        background: #22c55e;
        color: white;
    }

@media (min-width: 768px) {
    .map-container {
        /*max-width: 1200px;*/
        margin: 0 auto;
        height: calc(100vh); /* don't change this */
    }

    #mapError {
        max-width: 600px; /* Prevent overly wide error messages */
    }
    
    .map-footer {
        max-width: 1200px;
        left: 50%;
        transform: translateX(-50%);
    }

    .map-nav {
        max-width: 1200px;
        left: 50%;
        transform: translateX(-50%);
    }

    .autocomplete-results {
        max-width: 600px;
        left: 50%;
        transform: translateX(-50%);
    }

    .filter-container {
        max-width: 1200px;
        margin: 0 auto;
    }
}

@media (max-width: 767px) {
    .map-footer {
        max-width: 100%;
    }
    
    .map-nav {
        max-width: 100%;
    }

    .autocomplete-results {
        width: 100%; /* Full width on mobile */
        left: 0;
        right: 0;
    }

    .map-container {
        max-width: 100%;
        height: calc(100vh - 40px); /* don't change this */
    }

    #mapError {
        max-width: 90%; /* Ensure it fits on mobile screens */
        bottom: 50px; /* Slightly higher to avoid footer overlap */
    }

    .filter-container {
        max-width: 100%;
    }
}