/* Google Maps Page Custom CSS */
body.google-maps-page {
    margin: 0 !important;
    padding: 0 !important;
    font-family: 'Roboto', 'Google Sans', Arial, sans-serif !important;
    overflow: hidden !important; /* Prevent body scroll, layout handles it */
    background-color: #fff !important;
    color: #202124 !important;
}

body.google-maps-page h1, 
body.google-maps-page h2, 
body.google-maps-page h3, 
body.google-maps-page p, 
body.google-maps-page a,
body.google-maps-page span,
body.google-maps-page div {
    font-family: 'Roboto', 'Google Sans', Arial, sans-serif;
}

/* Reset WP Admin Bar if present */
body.google-maps-page.admin-bar .gm-layout {
    height: calc(100vh - 32px);
    top: 32px;
}

.material-icons {
    font-family: 'Material Icons' !important;
    font-weight: normal;
    font-style: normal;
    font-size: 24px;  /* Preferred icon size */
    display: inline-block;
    line-height: 1;
    text-transform: none;
    letter-spacing: normal;
    word-wrap: normal;
    white-space: nowrap;
    direction: ltr;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    -moz-osx-font-smoothing: grayscale;
}

.gm-layout {
    display: flex;
    width: 100vw;
    height: 100vh;
    position: relative;
}

/* Sidebar */
.gm-sidebar {
    width: 408px;
    height: 100%;
    background: #fff;
    box-shadow: 0 0 20px rgba(0,0,0,0.3);
    z-index: 5;
    display: flex;
    flex-direction: column;
    position: relative;
    flex-shrink: 0;
}

/* Header */
.gm-header {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid #e0e0e0;
    background: #fff;
    z-index: 10;
}

.gm-logo {
    height: 24px;
    margin-right: 16px;
}

.gm-search-box {
    flex-grow: 1;
    background: #fff;
    border: 1px solid #dfe1e5;
    border-radius: 24px;
    height: 48px;
    display: flex;
    align-items: center;
    padding: 0 16px;
    box-shadow: 0 1px 6px rgba(32,33,36,0.28);
}

.gm-search-input {
    border: none;
    background: transparent;
    flex-grow: 1;
    font-size: 16px;
    color: #202124;
    outline: none;
    font-family: 'Roboto', sans-serif;
}

.gm-search-icon, .gm-close-icon {
    color: #5f6368;
    cursor: pointer;
    font-size: 20px;
}
.gm-search-icon { margin-right: 8px; }

.gm-header-actions {
    display: none !important; /* Esconde para não vazar pro mapa */
}

.gm-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background-color: #00F305;
    color: #000;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Sidebar Scrollable Content */
.gm-sidebar-content {
    flex-grow: 1;
    overflow-y: auto;
    overflow-x: hidden;
    background: #f8f9fa;
}

/* Tabs */
.gm-tabs {
    display: flex;
    border-bottom: 1px solid #e0e0e0;
    background: #fff;
    padding: 0 20px;
}
.gm-tab {
    padding: 16px 0;
    font-size: 14px;
    color: #1a73e8;
    border-bottom: 3px solid #1a73e8;
    font-weight: 500;
}

/* Business Card */
.gm-business-card {
    background: #fff;
    margin-bottom: 8px;
    border-bottom: 1px solid #e0e0e0;
}

.gm-hero-image {
    width: 100%;
    height: 220px;
    background: #ddd;
    overflow: hidden;
    position: relative;
}
.gm-hero-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.gm-info-header {
    padding: 20px;
}

.gm-business-name {
    font-size: 22px;
    font-weight: 400;
    color: #202124;
    margin: 0 0 8px 0;
    font-family: 'Google Sans', 'Roboto', sans-serif;
}

.gm-rating-row {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 14px;
    color: #70757a;
    margin-bottom: 4px;
}

.gm-score {
    color: #202124;
    font-weight: 500;
}

.gm-stars {
    color: #fbbc04;
    display: flex;
    align-items: center;
}
.gm-stars .material-icons {
    font-size: 14px;
}

.gm-category {
    font-size: 14px;
    color: #70757a;
}

.gm-action-buttons {
    display: flex;
    justify-content: space-around;
    padding: 16px 0;
    border-top: 1px solid #e0e0e0;
    border-bottom: 1px solid #e0e0e0;
}

.gm-action-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: #1a73e8;
    gap: 8px;
    flex: 1; /* Distribui o espaço igualmente */
}

.gm-action-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1px solid #dadce0;
    font-size: 20px !important;
    flex-shrink: 0;
    box-sizing: border-box;
    display: inline-block !important;
    text-align: center !important;
    line-height: 34px !important; /* Altura 36 menos a borda para centralizar verticalmente */
}

.gm-action-text {
    font-size: 12px;
    font-weight: 500;
}

.gm-details-list {
    padding: 8px 0;
}

.gm-detail-item {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    font-size: 14px;
    color: #202124;
}

.gm-detail-icon {
    color: #1a73e8;
    margin-right: 16px;
    font-size: 20px;
}

.gm-status-open {
    color: #188038;
    font-weight: 500;
}

.gm-link {
    color: #1a0dab;
    text-decoration: none;
}
.gm-link:hover {
    text-decoration: underline;
}

/* Reviews */
.gm-reviews-section {
    padding: 20px;
    border-top: 1px solid #e0e0e0;
}

.gm-section-title {
    font-size: 16px;
    font-weight: 500;
    color: #202124;
    margin: 0 0 16px 0;
    font-family: 'Google Sans', 'Roboto', sans-serif;
}

.gm-review {
    margin-bottom: 24px;
}

.gm-review-author {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
}

.gm-reviewer-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #e91e63;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 500;
    margin-right: 12px;
}

.gm-reviewer-name {
    font-size: 14px;
    font-weight: 500;
    color: #202124;
}

.gm-reviewer-meta {
    font-size: 12px;
    color: #70757a;
}

.gm-review-stars {
    display: flex;
    align-items: center;
    color: #fbbc04;
    margin-bottom: 8px;
}
.gm-review-stars .material-icons {
    font-size: 14px;
}

.gm-review-time {
    color: #70757a;
    font-size: 12px;
    margin-left: 8px;
}

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

/* Web Results */
.gm-web-results {
    background: #fff;
    padding: 20px 0;
}

.gm-web-result-card {
    display: block;
    padding: 16px 20px;
    background: #fff;
    border: 1px solid #dfe1e5;
    border-radius: 8px;
    margin: 0 20px 16px 20px;
    text-decoration: none;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.gm-web-result-header {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
}

.gm-web-favicon {
    width: 16px;
    height: 16px;
    margin-right: 8px;
    border-radius: 50%;
}

.gm-web-url {
    font-size: 12px;
    color: #202124;
}

.gm-web-title {
    font-size: 18px;
    color: #1a0dab;
    margin: 0 0 8px 0;
    font-weight: 400;
}

.gm-web-desc {
    font-size: 14px;
    color: #4d5156;
    margin: 0;
    line-height: 1.4;
}

/* Map Area */
.gm-map-container {
    flex-grow: 1;
    position: relative;
    background: #e5e3df;
}

.gm-map-overlays {
    position: absolute;
    right: 16px;
    bottom: 32px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.gm-map-btn {
    width: 40px;
    height: 40px;
    background: #fff;
    border: none;
    border-radius: 4px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.3);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #666;
}
.gm-map-btn:hover { background: #f8f8f8; color: #333; }

.gm-zoom-btns {
    display: flex;
    flex-direction: column;
    background: #fff;
    border-radius: 4px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.3);
}
.gm-zoom-btns .gm-map-btn {
    box-shadow: none;
    border-radius: 0;
}
.gm-zoom-btns .gm-map-btn:first-child { border-bottom: 1px solid #e0e0e0; }

/* Responsive - Mobile Native App Bottom Sheet Look */
@media (max-width: 768px) {
    body.google-maps-page { 
        background-color: #202124 !important; 
        overflow-y: auto !important; /* Allow page scrolling */
    }
    
    .gm-layout { 
        display: flex; 
        flex-direction: column; 
        height: auto;
        min-height: 100vh;
    }
    
    /* Map covers top area */
    .gm-map-container {
        position: relative;
        width: 100%;
        height: 50vh;
        z-index: 1;
        order: 1;
    }
    
    /* Floating Search Bar */
    .gm-header {
        display: none !important;
    }
    .gm-search-box {
        background: #303134;
        border: none;
        box-shadow: 0 2px 10px rgba(0,0,0,0.5);
        width: 100%;
    }
    .gm-search-input { color: #e8eaed; }
    .gm-search-icon, .gm-close-icon { color: #9aa0a6; }
    .gm-logo-link { display: none; }
    .gm-header-actions { display: none !important; }
    
    /* Bottom Sheet - Now part of normal scroll flow */
    .gm-sidebar {
        position: relative;
        width: 100%;
        height: auto;
        max-height: none;
        background: #202124;
        z-index: 20;
        border-radius: 20px 20px 0 0;
        box-shadow: 0 -4px 15px rgba(0,0,0,0.4);
        padding-top: 12px;
        margin-top: -20px; /* Overlaps the map slightly */
        overflow: visible;
        order: 2;
    }
    
    /* Drag Handle */
    .gm-sidebar::before {
        content: '';
        display: block;
        width: 40px;
        height: 4px;
        background: #5f6368;
        border-radius: 4px;
        margin: 0 auto 12px auto;
    }
    
    /* Reordering Elements to match App */
    .gm-sidebar-content { 
        display: flex; 
        flex-direction: column; 
        background: transparent; 
    }
    .gm-tabs { 
        order: 2; 
        background: transparent; 
        border-color: #3c4043; 
        overflow-x: auto;
    }
    .gm-tabs::-webkit-scrollbar { display: none; }
    .gm-tab { color: #8ab4f8; white-space: nowrap; margin-right: 15px; padding: 12px 0; border-bottom-width: 2px;}
    
    .gm-business-card { 
        order: 1; 
        display: flex; 
        flex-direction: column; 
        background: transparent; 
        border: none; 
    }
    .gm-info-header { order: 1; padding: 0 20px 10px 20px; }
    .gm-action-buttons { order: 2; }
    .gm-hero-image { order: 3; }
    .gm-details-list { order: 4; }
    .gm-reviews-section { order: 5; }
    .gm-web-results { order: 3; background: transparent; }
    
    /* Dark Mode Texts */
    .gm-business-name { color: #e8eaed; font-size: 24px; font-weight: 500; }
    .gm-score, .gm-section-title, .gm-reviewer-name, .gm-detail-item { color: #e8eaed; }
    .gm-category, .gm-review-count, .gm-reviewer-meta, .gm-review-time, .gm-review-text { color: #9aa0a6; }
    
    /* Action Buttons - Pill Style */
    .gm-action-buttons {
        justify-content: flex-start;
        gap: 10px;
        overflow-x: auto;
        padding: 10px 20px 20px 20px;
        border: none;
    }
    .gm-action-buttons::-webkit-scrollbar { display: none; }
    .gm-action-btn {
        flex-direction: row;
        background: #1e3a35; /* Dark teal background matching screenshot */
        color: #80cbc4;
        padding: 8px 16px;
        border-radius: 20px;
        flex: none;
    }
    .gm-action-icon {
        width: auto; height: auto;
        border: none;
        background: transparent;
        color: #80cbc4 !important;
        font-size: 18px !important;
        line-height: 18px !important;
        margin-right: 6px;
    }
    .gm-action-text { font-size: 14px; }
    
    /* Hero Image */
    .gm-hero-image {
        margin: 0 20px 15px 20px;
        width: calc(100% - 40px);
        height: 180px;
        border-radius: 16px;
    }
    
    /* Adjust Map Overlays */
    .gm-map-overlays {
        bottom: 65vh; /* Stay above the bottom sheet */
        right: 16px;
    }
    .gm-map-btn {
        background: #303134;
        color: #e8eaed;
        box-shadow: 0 2px 5px rgba(0,0,0,0.5);
    }
    
    /* Details List adjustments */
    .gm-details-list { border-top: 1px solid #3c4043; padding-top: 15px; }
    .gm-detail-icon { color: #9aa0a6; }
    .gm-status-open { color: #81c995; }
    .gm-link { color: #8ab4f8; }
    
    /* Web results */
    .gm-web-result-card {
        background: #303134;
        border-color: #3c4043;
    }
    .gm-web-url { color: #9aa0a6; }
    .gm-web-title { color: #8ab4f8; }
    .gm-web-desc { color: #e8eaed; }
}

/* Spinner Animation for 'Mostrar mais' button */
.gm-spinner {
    border: 3px solid rgba(255, 255, 255, 0.1);
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border-left-color: #1a73e8;
    animation: gm-spin 1s linear infinite;
    display: inline-block;
}
@keyframes gm-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Image Modal */
.gm-modal {
    display: none; 
    position: fixed; 
    z-index: 9999; 
    padding-top: 100px; 
    left: 0;
    top: 0;
    width: 100%; 
    height: 100%; 
    overflow: auto; 
    background-color: rgba(0,0,0,0.9); 
}
.gm-modal-content {
    margin: auto;
    display: block;
    width: 90%;
    max-width: 700px;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.5);
    animation: gm-zoom 0.3s;
}
@keyframes gm-zoom {
    from {transform:scale(0.8); opacity:0} 
    to {transform:scale(1); opacity:1}
}
.gm-modal-close {
    position: absolute;
    top: 15px;
    right: 35px;
    color: #f1f1f1;
    font-size: 40px;
    font-weight: bold;
    transition: 0.3s;
    cursor: pointer;
}
.gm-modal-close:hover,
.gm-modal-close:focus {
    color: #bbb;
    text-decoration: none;
    cursor: pointer;
}
