
body, html {
    margin: 0;
    padding: 0;
    height: 100%;
    width: 100%;
    font-family: 'Roboto', Arial, sans-serif;
    overflow: hidden;
}

#map {
    height: 100%;
    width: 100%;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 1;
    background-color: #e5e3df; /* Google Maps default background color */
}

/* Search Wrapper */
.search-wrapper {
    position: absolute;
    top: 10px;
    left: 82px; /* 72px sidebar + 10px margin */
    z-index: 1000;
    width: 392px;
    max-width: calc(100% - 92px); /* Mobile responsiveness */
}

.search-box {
    background: white;
    border-radius: 24px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2), 0 -1px 0px rgba(0,0,0,0.02);
    display: flex;
    align-items: center;
    padding: 0 12px;
    height: 48px;
    box-sizing: border-box;
    width: 100%;
    transition: box-shadow 0.2s;
}

.search-box:hover {
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.search-box input {
    flex-grow: 1;
    border: none;
    outline: none;
    font-size: 15px;
    padding: 0 12px;
    color: #3c4043;
    background: transparent;
    min-width: 0;
}

.search-btn, .directions-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    font-size: 18px;
    color: #5f6368;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    transition: background-color 0.2s;
}

.search-btn {
    flex-shrink: 0;
}

.search-btn:hover, .directions-btn:hover {
    background-color: #f0f0f0;
    color: #202124;
}

.directions-btn {
    color: #1a73e8;
}

.directions-btn:hover {
    color: #174ea6;
}

.filter-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    font-size: 18px;
    color: #5f6368;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    transition: background-color 0.2s;
}
.filter-btn:hover {
    background-color: #f0f0f0;
    color: #202124;
}
.filter-btn {
    flex-shrink: 0;
}

.separator {
    width: 1px;
    height: 24px;
    background: #dfe1e5;
    margin: 0 5px;
}

/* Sidebar Mini - Default (Desktop) */
.sidebar-mini {
    position: fixed;
    top: 0;
    left: 0;
    width: 72px;
    height: 100%;
    background: white;
    z-index: 2000;
    box-shadow: 2px 0 12px rgba(0,0,0,0.1);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding-bottom: 20px;
    box-sizing: border-box;
    transition: left 0.3s ease;
}

.sidebar-mini.active {
    left: 0;
}

/* Sidebar Overlay */
.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1999;
    display: none;
}

.sidebar-overlay.active {
    display: block;
}

.sidebar-top, .sidebar-bottom {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}

.sidebar-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 12px 0;
    cursor: pointer;
    color: #5f6368;
    transition: background-color 0.2s, color 0.2s;
    text-decoration: none;
    box-sizing: border-box;
}

.sidebar-item:hover {
    background-color: #f8f9fa;
    color: #1a73e8;
}

.sidebar-item i {
    font-size: 20px;
    margin-right: 0;
    margin-bottom: 6px;
    width: auto;
    text-align: center;
}

.sidebar-item .label {
    font-size: 10px;
    text-align: center;
    line-height: 1.2;
    font-weight: 500;
}

.sidebar-item.menu-trigger {
    padding: 16px 0;
    margin-bottom: 8px;
    display: flex; /* Show in sidebar on desktop */
}

/* Mobile Menu Button in Search Box */
.mobile-menu-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    font-size: 18px;
    color: #5f6368;
    display: none; /* Hidden on desktop */
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    transition: background-color 0.2s;
    margin-right: 4px;
}

.mobile-menu-btn:hover {
    background-color: #f0f0f0;
    color: #202124;
}

/* Search Wrapper Adjustments - Default (Desktop) */
.search-wrapper {
    position: absolute;
    top: 10px;
    left: 82px; /* 72px sidebar + 10px margin */
    z-index: 1000;
    width: 392px;
    max-width: calc(100% - 92px);
}

/* Responsive adjustments (Mobile - max-width: 768px) */
@media (max-width: 768px) {
    /* Hide sidebar by default */
    .sidebar-mini {
        left: -280px;
        width: 280px;
    }
    
    .sidebar-mini.active {
        left: 0;
    }

    /* Adjust sidebar items for mobile menu style */
    .sidebar-top, .sidebar-bottom {
        align-items: flex-start;
    }

    .sidebar-item {
        flex-direction: row;
        justify-content: flex-start;
        padding: 12px 24px;
    }

    .sidebar-item i {
        margin-right: 16px;
        margin-bottom: 0;
        width: 24px;
    }

    .sidebar-item .label {
        font-size: 14px;
        text-align: left;
    }

    /* Hide sidebar menu trigger on mobile (it's in search bar) */
    .sidebar-item.menu-trigger {
        display: none;
    }

    /* Show mobile menu button */
    .mobile-menu-btn {
        display: flex;
    }
    
    .search-box {
        padding-left: 4px;
    }

    /* Adjust search wrapper position */
    .search-wrapper {
        left: 10px;
        width: calc(100% - 20px);
        max-width: none;
    }

    .leaflet-bottom.leaflet-right {
        bottom: 80px;
    }
}

/* Leaflet Customization */
.leaflet-control-zoom {
    border: none !important;
    box-shadow: 0 1px 4px rgba(0,0,0,0.3) !important;
    margin-right: 10px !important;
    margin-bottom: 24px !important;
}

.leaflet-control-zoom a {
    background: white !important;
    color: #666 !important;
    width: 32px !important;
    height: 32px !important;
    line-height: 32px !important;
    font-size: 18px !important;
    border-radius: 2px !important;
    transition: background-color 0.1s;
}
.leaflet-control-zoom a:first-child {
    border-bottom: 1px solid #e6e6e6 !important;
    border-top-left-radius: 4px !important;
    border-top-right-radius: 4px !important;
}
.leaflet-control-zoom a:last-child {
    border-bottom-left-radius: 4px !important;
    border-bottom-right-radius: 4px !important;
}
.leaflet-control-zoom a:hover {
    background-color: #f0f0f0 !important;
    color: #333 !important;
}

/* Custom Location Button */
.custom-map-control-button {
    background-color: white;
    border: none;
    border-radius: 4px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.3);
    width: 32px;
    height: 32px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    color: #666;
    margin-bottom: 10px;
    margin-right: 10px;
}
.custom-map-control-button:hover {
    background-color: #f0f0f0;
    color: #333;
}

/* Custom Marker Styles */
.custom-marker {
    display: flex !important;
    align-items: center;
    background: transparent;
    white-space: nowrap;
}

.marker-content {
    display: flex;
    align-items: center;
    background: white;
    padding: 4px 8px;
    border-radius: 20px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.3);
    border: 1px solid rgba(0,0,0,0.1);
    font-family: 'Poppins', sans-serif;
    transition: transform 0.2s, z-index 0.2s;
}

.marker-content:hover {
    transform: scale(1.05);
    z-index: 1000 !important;
}

.marker-text {
    font-size: 13px;
    font-weight: 500;
    color: #c04918; /* Example text color, will be overridden */
    margin-right: 8px;
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.marker-icon-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    color: white;
    font-size: 12px;
    position: relative;
}

/* Pin tail effect for icon */
.marker-icon-wrapper::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 5px solid white; /* Matches background */
    filter: drop-shadow(0 2px 1px rgba(0,0,0,0.1));
}

/* Responsive adjustments */
@media (max-width: 600px) {
    .search-wrapper {
        width: calc(100% - 20px);
        top: 10px;
        left: 10px;
    }
    .search-box {
        height: 48px;
    }
    .sidebar {
        width: 280px;
    }
    .leaflet-bottom.leaflet-right {
        bottom: 80px; /* Make space for potential bottom nav if added later, or just higher */
    }
}

/* Business Details Panel - Modern Redesign */
.business-details-panel {
    position: fixed;
    top: 0;
    left: -420px;
    width: 400px;
    height: 100vh;
    background: #fff;
    z-index: 2100;
    box-shadow: 0 0 20px rgba(0,0,0,0.15);
    transition: left 0.3s cubic-bezier(0.4, 0.0, 0.2, 1);
    overflow-y: auto;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
    font-family: 'Roboto', sans-serif;
}

.business-details-panel.active {
    left: 0;
}

/* Hide legacy outer close button */
.close-details-btn {
    display: none !important;
}

/* Scrollbar Customization */
.business-details-panel::-webkit-scrollbar {
    width: 8px;
}
.business-details-panel::-webkit-scrollbar-track {
    background: transparent;
}
.business-details-panel::-webkit-scrollbar-thumb {
    background-color: #dadce0;
    border-radius: 4px;
}

/* Hero Image & Floating Back Button */
.business-hero-image {
    width: 100%;
    height: 220px;
    background-size: cover;
    background-position: center;
    background-color: #f1f3f4;
    position: relative;
    flex-shrink: 0;
}

.close-details-btn-floating {
    position: absolute;
    top: 16px;
    left: 16px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #3c4043;
    font-size: 18px;
    transition: all 0.2s;
    z-index: 10;
}

.close-details-btn-floating:hover {
    background: #fff;
    transform: scale(1.05);
}

/* Content Wrapper */
.business-content-wrapper {
    padding: 0;
}

/* Header Section */
.business-header {
    padding: 20px 24px 16px;
}

.business-title {
    font-family: 'Poppins', sans-serif;
    font-size: 24px;
    font-weight: 500;
    color: #202124;
    margin: 0 0 8px 0;
    line-height: 1.2;
}

.business-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    font-size: 14px;
    color: #70757a;
}

.rating-container {
    display: flex;
    align-items: center;
}

.rating-badge {
    font-weight: 500;
    color: #202124;
    margin-right: 4px;
}

.stars-wrapper {
    color: #e7711b;
    font-size: 12px;
    margin: 0 4px;
    display: flex;
}

.review-count {
    color: #70757a;
}

.dot-separator {
    margin: 0 8px;
}

.business-category {
    color: #70757a;
}

/* Action Grid (Circular Buttons) */
.action-grid {
    display: flex;
    justify-content: space-evenly;
    padding: 12px 16px 24px;
}

.action-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: none;
    border: none;
    cursor: pointer;
    min-width: 64px;
    gap: 8px;
}

.action-item:disabled {
    cursor: default;
    opacity: 0.5;
}

.action-icon-circle {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 1px solid #dadce0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #1a73e8;
    font-size: 20px;
    transition: background-color 0.2s;
}

.action-item:not(:disabled):hover .action-icon-circle {
    background-color: #e8f0fe;
    border-color: #1a73e8;
}

.action-label {
    font-size: 12px;
    color: #1a73e8;
    font-weight: 500;
}

/* Dividers */
.divider {
    height: 1px;
    background-color: #e8eaed;
    margin: 0;
    width: 100%;
}

/* CTA Section */
.cta-section {
    padding: 16px 24px;
}

.book-appointment-btn {
    width: 100%;
    background: #1a73e8;
    color: white;
    border: none;
    padding: 14px;
    border-radius: 24px;
    font-family: 'Poppins', sans-serif;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
    transition: background-color 0.2s, box-shadow 0.2s;
}

.book-appointment-btn:hover {
    background: #1558b0;
    box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}

.book-appointment-btn:active {
    background: #1558b0;
    transform: translateY(1px);
}

/* Info Section (List Style) */
.business-info-section {
    padding: 8px 0;
}

.info-row {
    display: flex;
    align-items: flex-start;
    padding: 16px 24px;
    cursor: default;
    transition: background-color 0.2s;
}

.info-row:hover {
    background-color: #f8f9fa;
}

.info-icon {
    width: 24px;
    margin-right: 20px;
    color: #70757a;
    font-size: 18px;
    display: flex;
    justify-content: center;
    margin-top: 2px;
}

.info-content {
    flex: 1;
    font-size: 14px;
    color: #3c4043;
    line-height: 1.5;
}

/* Hours specific styles */
.hours-row-trigger {
    cursor: pointer;
    position: relative;
}

.hours-summary-text {
    font-weight: 400;
}

.hours-dropdown {
    display: none;
    margin-top: 12px;
    padding-top: 8px;
    border-top: 1px solid #f1f3f4;
}

.hours-dropdown.show {
    display: block;
}

.hours-row {
    display: flex;
    justify-content: space-between;
    padding: 6px 0;
    font-size: 13px;
}

.hours-row.today {
    font-weight: 700;
    color: #202124;
}

.hours-row .day-name {
    width: 100px;
}

.expand-arrow {
    color: #70757a;
    font-size: 12px;
    transition: transform 0.3s;
    margin-left: 12px;
    margin-top: 4px;
}

.hours-row-trigger.expanded .expand-arrow {
    transform: rotate(180deg);
}

/* Reviews Section */
.reviews-section {
    padding: 24px;
    padding-bottom: 40px;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.section-title {
    font-family: 'Poppins', sans-serif;
    font-size: 18px;
    font-weight: 500;
    color: #202124;
    margin: 0;
}

.section-badge {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.badge-score {
    font-size: 24px;
    font-weight: 500;
    color: #202124;
    line-height: 1;
}

.badge-stars {
    font-size: 10px;
    color: #e7711b;
    margin-top: 2px;
}

/* Review Cards */
.reviews-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.review-card {
    background: #fff;
    border: 1px solid #e8eaed;
    border-radius: 8px;
    padding: 16px;
}

.review-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
}

.review-author {
    font-weight: 500;
    color: #202124;
    font-size: 14px;
}

.review-date {
    font-size: 12px;
    color: #70757a;
}

.review-rating {
    margin-bottom: 10px;
    font-size: 12px;
    color: #e7711b;
}

.review-text {
    font-size: 14px;
    color: #3c4043;
    line-height: 1.5;
}

.no-reviews {
    text-align: center;
    color: #70757a;
    padding: 20px;
    font-style: italic;
    background: #f8f9fa;
    border-radius: 8px;
}

/* Loading & Error */
.loading-spinner {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100vh;
    color: #1a73e8;
    font-size: 16px;
    gap: 12px;
}

.error-container {
    padding: 40px 24px;
    text-align: center;
    color: #d93025;
}

.back-btn {
    margin-top: 20px;
    padding: 10px 24px;
    background: #f1f3f4;
    color: #3c4043;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    font-weight: 500;
}

.inline-status {
    margin: 8px 24px;
    padding: 10px 12px;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 500;
}
.inline-status.success {
    background: #e6f4ea;
    color: #137333;
}
.inline-status.error {
    background: #fce8e6;
    color: #a50e0e;
}
.inline-status.info {
    background: #e8f0fe;
    color: #1a73e8;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .business-details-panel {
        width: 100%;
        left: -100%;
        z-index: 3000; /* Higher than sidebar */
    }
    
    .business-hero-image {
        height: 250px;
    }
    
    .close-details-btn-floating {
        top: 20px;
        left: 20px;
    }
}

.directions-overlay {
    position: fixed;
    left: 50%;
    bottom: 16px;
    transform: translateX(-50%) translateY(20px);
    background: #ffffff;
    color: #202124;
    border-radius: 16px;
    box-shadow: 0 6px 20px rgba(0,0,0,0.2);
    width: 560px;
    max-width: calc(100% - 32px);
    z-index: 5000;
    opacity: 0;
    transition: transform 240ms ease, opacity 240ms ease;
}
.directions-overlay.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}
.directions-inner {
    display: grid;
    grid-template-columns: 56px 1fr 80px;
    align-items: center;
    gap: 8px;
    padding: 12px;
}
.turn-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #e8f0fe;
    color: #0b57d0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}
.turn-icon.pulse {
    animation: pulse 300ms ease-out;
}
@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.08); }
    100% { transform: scale(1); }
}
.next-text {
    font-size: 16px;
    font-weight: 600;
    line-height: 1.2;
}
.summary {
    font-size: 14px;
    color: #3c4043;
    margin-top: 2px;
}
.status {
    font-size: 12px;
    color: #5f6368;
    margin-top: 2px;
}
.directions-right {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
}
.overlay-btn {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    border: none;
    background: #f1f3f4;
    color: #3c4043;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 160ms ease, transform 80ms ease;
}
.overlay-btn:active {
    transform: scale(0.98);
}
.overlay-btn:hover {
    background: #e8eaed;
}
.directions-steps {
    max-height: 180px;
    overflow: auto;
    border-top: 1px solid #eee;
    padding: 8px 12px 12px;
    display: none;
}
.directions-steps.show {
    display: block;
}
.step-row {
    padding: 8px 10px;
    border-radius: 10px;
    font-size: 14px;
    color: #3c4043;
}
.step-row.active {
    background: #f1f3f4;
    font-weight: 600;
}
@media (max-width: 768px) {
    .directions-overlay {
        bottom: 12px;
        border-radius: 14px;
        width: 96%;
    }
    .directions-inner {
        grid-template-columns: 48px 1fr 72px;
        padding: 10px;
    }
    .turn-icon {
        width: 36px;
        height: 36px;
        font-size: 16px;
    }
    .next-text {
        font-size: 15px;
    }
    .summary {
        font-size: 13px;
    }
    .status {
        font-size: 12px;
    }
    .overlay-btn {
        width: 34px;
        height: 34px;
        border-radius: 8px;
    }
}

/* Search Results Panel */
.search-results-panel {
    position: absolute;
    top: 64px;
    left: 82px;
    width: 420px;
    max-width: calc(100% - 92px);
    max-height: calc(100% - 84px);
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.18);
    z-index: 1100;
    overflow-y: auto;
    overflow-x: hidden;
    display: none;
    animation: fadeIn 160ms ease-out;
}
.search-results-panel.show {
    display: block;
}
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-4px); }
    to { opacity: 1; transform: translateY(0); }
}
.search-results-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-bottom: 1px solid #f1f3f4;
}
.search-results-title {
    font-family: 'Poppins', sans-serif;
    font-size: 15px;
    color: #202124;
    font-weight: 500;
}
.search-results-count {
    font-size: 13px;
    color: #70757a;
}
.search-result-item {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    padding: 12px 16px;
    cursor: pointer;
    transition: background-color 0.15s ease, box-shadow 0.15s ease;
    border-bottom: 1px solid #f1f3f4;
}
.search-result-item:hover {
    background: #f8f9fa;
}
.result-content {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
    flex: 1;
}
.result-title {
    font-family: 'Poppins', sans-serif;
    font-size: 16px;
    color: #202124;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.result-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #5f6368;
}
.rating-badge {
    color: #202124;
    font-weight: 500;
}
.stars-inline {
    display: inline-flex;
    gap: 2px;
    color: #fbbc04;
    font-size: 12px;
}
.result-distance {
    color: #70757a;
}
.result-address {
    font-size: 13px;
    color: #3c4043;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.result-thumb {
    width: 84px;
    height: 84px;
    border-radius: 8px;
    background-color: #f1f3f4;
    background-size: cover;
    background-position: center;
    flex-shrink: 0;
    margin-left: 12px;
    box-shadow: inset 0 0 0 1px #e0e3e7;
}
.search-loading {
    padding: 16px;
    display: grid;
    grid-template-columns: 1fr 84px;
    gap: 12px;
}
.loading-line {
    height: 12px;
    background: linear-gradient(90deg, #f1f3f4 25%, #e8eaed 50%, #f1f3f4 75%);
    background-size: 400% 100%;
    border-radius: 6px;
    animation: shimmer 1.2s infinite;
}
@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}
.search-empty {
    padding: 16px;
    font-size: 14px;
    color: #70757a;
    text-align: center;
}
.search-error {
    padding: 16px;
    font-size: 14px;
    color: #d93025;
    text-align: center;
}

@media (max-width: 768px) {
    .search-results-panel {
        left: 10px;
        width: calc(100% - 20px);
        top: 64px;
        max-height: calc(100% - 84px);
    }
}
