/* ============================================
   MAPA INTERATIVO - AQUAFLEX AQUECEDORES
   Versão Ultra Sofisticada e Futurista
   Versão Final Corrigida
============================================ */

/* ===== VARIÁVEIS ===== */
:root {
    --aquaflex-orange: #ff5500;
    --aquaflex-blue: #007bff;
    --aquaflex-dark: #010F1C;
    --aquaflex-gray: #5C6574;
}

/* ===== SEÇÃO PRINCIPAL ===== */
.aquaflex-map-section {
    position: relative;
    width: 100%;
    background: #f8f9fa;
    overflow: hidden;
}

/* ===== CABEÇALHO ===== */
.aquaflex-map-header {
    padding: 80px 0 40px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    position: relative;
    z-index: 2;
}

.aquaflex-map-header-content {
    text-align: center;
}

.aquaflex-map-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 24px;
    background: linear-gradient(135deg, var(--aquaflex-blue) 0%, #0056b3 100%);
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    border-radius: 50px;
    margin-bottom: 20px;
    box-shadow: 0 4px 15px rgba(0, 123, 255, 0.3);
    animation: aquaflexMapFadeIn 0.6s ease-out;
}

.aquaflex-map-badge i {
    font-size: 16px;
    color: var(--aquaflex-orange);
}

.aquaflex-map-title {
    font-family: 'Epilogue', 'Roboto', sans-serif;
    font-size: 48px;
    font-weight: 700;
    color: var(--aquaflex-dark);
    margin-bottom: 15px;
    line-height: 1.2;
    animation: aquaflexMapFadeIn 0.8s ease-out;
}

.aquaflex-map-highlight {
    color: var(--aquaflex-orange);
    position: relative;
    background: linear-gradient(135deg, var(--aquaflex-orange) 0%, #ff7733 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.aquaflex-map-subtitle {
    font-family: 'Roboto', sans-serif;
    font-size: 18px;
    color: var(--aquaflex-gray);
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.6;
    animation: aquaflexMapFadeIn 1s ease-out;
}

/* ===== CONTAINER DO MAPA ===== */
.aquaflex-map-container {
    position: relative;
    width: 100%;
    height: 700px;
    display: flex;
    background: #fff;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
}

/* ===== SIDEBAR ===== */
.aquaflex-map-sidebar {
    width: 380px;
    height: 100%;
    background: #fff;
    border-right: 1px solid #e9ecef;
    display: flex;
    flex-direction: column;
    position: relative;
    z-index: 1000;
    box-shadow: 2px 0 20px rgba(0, 0, 0, 0.05);
}

.aquaflex-sidebar-header {
    padding: 30px 25px 20px;
    background: linear-gradient(135deg, var(--aquaflex-blue) 0%, #0056b3 100%);
    color: #fff;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.aquaflex-sidebar-title {
    font-family: 'Epilogue', 'Roboto', sans-serif;
    font-size: 20px;
    font-weight: 700;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.aquaflex-sidebar-title i {
    color: var(--aquaflex-orange);
    font-size: 22px;
}

.aquaflex-sidebar-count {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 8px 15px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    backdrop-filter: blur(10px);
}

.aquaflex-count-number {
    font-size: 24px;
    font-weight: 700;
    line-height: 1;
}

.aquaflex-count-label {
    font-size: 11px;
    opacity: 0.9;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ===== BOTÃO DE FECHAR (MOBILE) ===== */
.aquaflex-sidebar-close {
    display: none;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.aquaflex-sidebar-close i {
    color: #fff;
    font-size: 18px;
    transition: transform 0.3s ease;
}

.aquaflex-sidebar-close:hover {
    background: rgba(255, 85, 0, 0.9);
    border-color: #ff5500;
}

.aquaflex-sidebar-close:hover i {
    transform: rotate(90deg);
}

/* ===== BUSCA ===== */
.aquaflex-sidebar-search {
    padding: 20px 25px;
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
    position: relative;
}

.aquaflex-sidebar-search i {
    position: absolute;
    left: 40px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--aquaflex-gray);
    font-size: 14px;
}

.aquaflex-search-input {
    width: 100%;
    padding: 12px 15px 12px 40px;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    font-family: 'Roboto', sans-serif;
    font-size: 14px;
    transition: all 0.3s ease;
    background: #fff;
}

.aquaflex-search-input:focus {
    outline: none;
    border-color: var(--aquaflex-orange);
    box-shadow: 0 0 0 3px rgba(255, 85, 0, 0.1);
}

/* ===== LISTA DE CIDADES ===== */
.aquaflex-cities-list {
    flex: 1;
    overflow-y: auto;
    padding: 15px;
}

.aquaflex-cities-list::-webkit-scrollbar {
    width: 6px;
}

.aquaflex-cities-list::-webkit-scrollbar-track {
    background: #f8f9fa;
}

.aquaflex-cities-list::-webkit-scrollbar-thumb {
    background: var(--aquaflex-orange);
    border-radius: 10px;
}

.aquaflex-city-item {
    padding: 15px 18px;
    margin-bottom: 8px;
    background: #fff;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 12px;
    position: relative;
    overflow: hidden;
}

.aquaflex-city-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    width: 4px;
    height: 100%;
    background: var(--aquaflex-orange);
    transform: scaleY(0);
    transition: transform 0.3s ease;
}

.aquaflex-city-item:hover {
    border-color: var(--aquaflex-orange);
    transform: translateX(5px);
    box-shadow: 0 4px 15px rgba(255, 85, 0, 0.15);
}

.aquaflex-city-item:hover::before {
    transform: scaleY(1);
}

.aquaflex-city-item.active {
    background: linear-gradient(135deg, var(--aquaflex-orange) 0%, #ff7733 100%);
    color: #fff;
    border-color: var(--aquaflex-orange);
    box-shadow: 0 4px 15px rgba(255, 85, 0, 0.3);
}

.aquaflex-city-icon {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--aquaflex-blue) 0%, #0056b3 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 14px;
    flex-shrink: 0;
    transition: all 0.3s ease;
}

.aquaflex-city-item.active .aquaflex-city-icon {
    background: #fff;
    color: var(--aquaflex-orange);
}

.aquaflex-city-name {
    font-family: 'Roboto', sans-serif;
    font-size: 15px;
    font-weight: 500;
    flex: 1;
}

.aquaflex-city-arrow {
    opacity: 0;
    transform: translateX(-10px);
    transition: all 0.3s ease;
    font-size: 14px;
}

.aquaflex-city-item:hover .aquaflex-city-arrow {
    opacity: 1;
    transform: translateX(0);
}

/* ===== FOOTER DA SIDEBAR ===== */
.aquaflex-sidebar-footer {
    padding: 20px 25px;
    background: #f8f9fa;
    border-top: 1px solid #e9ecef;
    display: flex;
    gap: 10px;
}

.aquaflex-contact-btn {
    flex: 1;
    padding: 14px 20px;
    border-radius: 12px;
    text-decoration: none;
    font-family: 'Roboto', sans-serif;
    font-size: 14px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
}

.aquaflex-btn-phone {
    background: linear-gradient(135deg, var(--aquaflex-blue) 0%, #0056b3 100%);
    color: #fff;
}

.aquaflex-btn-phone:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 123, 255, 0.3);
	color: #fff;  /* ← ADICIONADO */
}

.aquaflex-btn-whatsapp {
    background: linear-gradient(135deg, #25D366 0%, #128C7E 100%);
    color: #fff;
}

.aquaflex-btn-whatsapp:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(37, 211, 102, 0.3);
	color: #fff;  /* ← ADICIONADO */
}

/* ===== MAPA ===== */
.aquaflex-map-wrapper {
    flex: 1;
    position: relative;
    background: #e9ecef;
}

.aquaflex-map {
    width: 100%;
    height: 100%;
    z-index: 1;
}

/* Customização dos marcadores Leaflet */
.leaflet-popup-content-wrapper {
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.leaflet-popup-content {
    margin: 15px;
    font-family: 'Roboto', sans-serif;
}

/* ===== CONTROLES DO MAPA ===== */
.aquaflex-map-controls {
    position: absolute;
    top: 20px;
    right: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 1001;
}

.aquaflex-map-control {
    width: 44px;
    height: 44px;
    background: #fff;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    color: var(--aquaflex-dark);
    font-size: 16px;
}

.aquaflex-map-control:hover {
    background: var(--aquaflex-orange);
    color: #fff;
    border-color: var(--aquaflex-orange);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 85, 0, 0.3);
}

/* ===== INFO CARD FLUTUANTE ===== */
.aquaflex-info-card {
    position: absolute;
    bottom: 20px;
    left: 20px;
    right: 20px;
    max-width: 400px;
    background: #fff;
    border-radius: 16px;
    padding: 25px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    z-index: 1001;
    transform: translateY(150%);
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.aquaflex-info-card.active {
    transform: translateY(0);
    opacity: 1;
}

.aquaflex-info-close {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 32px;
    height: 32px;
    background: #f8f9fa;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    color: var(--aquaflex-gray);
}

.aquaflex-info-close:hover {
    background: var(--aquaflex-orange);
    color: #fff;
    transform: rotate(90deg);
}

.aquaflex-info-title {
    font-family: 'Epilogue', 'Roboto', sans-serif;
    font-size: 22px;
    font-weight: 700;
    color: var(--aquaflex-dark);
    margin-bottom: 10px;
    padding-right: 30px;
}

.aquaflex-info-description {
    font-family: 'Roboto', sans-serif;
    font-size: 14px;
    color: var(--aquaflex-gray);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.aquaflex-info-description i {
    color: var(--aquaflex-orange);
}

.aquaflex-info-actions {
    display: flex;
    gap: 10px;
}

.aquaflex-info-btn {
    flex: 1;
    padding: 12px 20px;
    border-radius: 12px;
    text-decoration: none;
    font-family: 'Roboto', sans-serif;
    font-size: 14px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.3s ease;
}

.aquaflex-info-phone {
    background: linear-gradient(135deg, var(--aquaflex-blue) 0%, #0056b3 100%);
    color: #fff;
}

.aquaflex-info-phone:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 123, 255, 0.3);
}

.aquaflex-info-whats {
    background: linear-gradient(135deg, #25D366 0%, #128C7E 100%);
    color: #fff;
}

.aquaflex-info-whats:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(37, 211, 102, 0.3);
}

/* ===== TOGGLE SIDEBAR (MOBILE) ===== */
.aquaflex-sidebar-toggle {
    position: absolute;
    top: 20px;
    left: 20px;
    width: 44px;
    height: 44px;
    background: #fff;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    display: none;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 1002;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    color: var(--aquaflex-dark);
    font-size: 18px;
    transition: all 0.3s ease;
}

.aquaflex-sidebar-toggle:hover {
    background: var(--aquaflex-orange);
    color: #fff;
    border-color: var(--aquaflex-orange);
}

.aquaflex-sidebar-toggle i {
    transition: transform 0.3s ease;
}

.aquaflex-sidebar-toggle:active i {
    transform: scale(0.9);
}

/* ===== EFEITO DE LUZ ===== */
.aquaflex-map-light-effect {
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(
        45deg,
        transparent 0%,
        transparent 40%,
        rgba(255, 85, 0, 0.08) 45%,
        rgba(255, 255, 255, 0.2) 50%,
        rgba(0, 123, 255, 0.08) 55%,
        transparent 60%,
        transparent 100%
    );
    animation: aquaflexMapLightSweep 10s linear infinite;
    pointer-events: none;
    z-index: 999;
}

/* ===== ESTATÍSTICAS ===== */
.aquaflex-map-stats {
    padding: 60px 0;
    background: #fff;
}

.aquaflex-stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 30px;
}

.aquaflex-stat-item {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 30px;
    background: #f8f9fa;
    border-radius: 16px;
    transition: all 0.3s ease;
    pointer-events: none;
}

.aquaflex-stat-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.aquaflex-stat-icon {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, var(--aquaflex-orange) 0%, #ff7733 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 24px;
    flex-shrink: 0;
}

.aquaflex-stat-content {
    display: flex;
    flex-direction: column;
}

.aquaflex-stat-number {
    font-family: 'Epilogue', 'Roboto', sans-serif;
    font-size: 28px;
    font-weight: 700;
    color: var(--aquaflex-dark);
    line-height: 1;
    margin-bottom: 5px;
}

.aquaflex-stat-label {
    font-family: 'Roboto', sans-serif;
    font-size: 14px;
    color: var(--aquaflex-gray);
}

/* ===== ANIMAÇÕES ===== */
@keyframes aquaflexMapFadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes aquaflexMapLightSweep {
    0% {
        transform: translateX(-100%) translateY(-100%) rotate(45deg);
    }
    100% {
        transform: translateX(100%) translateY(100%) rotate(45deg);
    }
}

/* ===== RESPONSIVIDADE ===== */

/* Tablets */
@media (max-width: 991px) {
    .aquaflex-map-title {
        font-size: 36px;
    }

    .aquaflex-map-sidebar {
        width: 320px;
    }

    .aquaflex-stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .aquaflex-map-container {
        height: 600px;
    }
}

/* Mobile */
@media (max-width: 767px) {
    .aquaflex-map-header {
        padding: 60px 0 30px;
    }

    .aquaflex-map-title {
        font-size: 28px;
    }

    .aquaflex-map-subtitle {
        font-size: 16px;
    }

    .aquaflex-map-container {
        height: calc(100vh - 200px);
        min-height: 500px;
    }

    .aquaflex-map-sidebar {
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
        max-width: 100%;
        height: 100%;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        z-index: 1003;
        box-shadow: none;
    }

    .aquaflex-map-sidebar.active {
        transform: translateX(0);
    }

    .aquaflex-sidebar-toggle {
        display: flex;
    }

    .aquaflex-map-sidebar.active ~ .aquaflex-map-wrapper {
        display: none;
    }

    .aquaflex-map-controls {
        top: 80px;
        right: 15px;
    }

    .aquaflex-map-control {
        width: 40px;
        height: 40px;
        font-size: 14px;
    }

    .aquaflex-info-card {
        left: 10px;
        right: 10px;
        bottom: 10px;
        padding: 20px;
        max-width: none;
    }

    .aquaflex-info-title {
        font-size: 18px;
    }

    .aquaflex-info-actions {
        flex-direction: column;
    }

    /* ESCONDE ESTATÍSTICAS NO MOBILE */
    .aquaflex-map-stats {
        display: none !important;
    }

    .aquaflex-sidebar-header {
        padding: 25px 20px 15px;
    }

    .aquaflex-sidebar-title {
        font-size: 18px;
    }

    /* ESCONDE O CONTADOR NO MOBILE */
    .aquaflex-sidebar-count {
        display: none !important;
    }

    /* MOSTRA O BOTÃO DE FECHAR NO MOBILE */
    .aquaflex-sidebar-close {
        display: flex !important;
    }

    .aquaflex-sidebar-search {
        padding: 15px 20px;
    }

    .aquaflex-cities-list {
        padding: 10px;
    }

    .aquaflex-city-item {
        padding: 12px 15px;
        margin-bottom: 6px;
    }

    .aquaflex-city-icon {
        width: 32px;
        height: 32px;
        font-size: 13px;
    }

    .aquaflex-city-name {
        font-size: 14px;
    }

    .aquaflex-sidebar-footer {
        flex-direction: column;
        padding: 15px 20px;
    }

    .aquaflex-contact-btn {
        padding: 12px 15px;
        font-size: 13px;
    }

    .aquaflex-map-sidebar.active ~ .aquaflex-map-wrapper .aquaflex-sidebar-toggle {
        background: #ff5500;
        color: #fff;
        border-color: #ff5500;
    }

    /* CORRIGE POPUP NO MOBILE */
    .leaflet-popup-content-wrapper {
        max-width: calc(100vw - 80px) !important;
    }

    .leaflet-popup {
        margin-bottom: 20px !important;
    }

    .aquaflex-popup {
        max-width: 100%;
        padding: 12px;
    }

    .aquaflex-popup h4 {
        font-size: 14px !important;
    }

    .aquaflex-popup p {
        font-size: 12px !important;
    }
}

/* Small Mobile */
@media (max-width: 575px) {
    .aquaflex-map-container {
        height: calc(100vh - 180px);
        min-height: 450px;
    }

    .aquaflex-map-badge {
        font-size: 12px;
        padding: 8px 20px;
    }

    .aquaflex-map-title {
        font-size: 24px;
    }

    .aquaflex-sidebar-toggle {
        width: 40px;
        height: 40px;
        font-size: 16px;
    }

    .aquaflex-info-card {
        padding: 15px;
    }

    .aquaflex-info-title {
        font-size: 16px;
    }

    .aquaflex-info-btn {
        font-size: 13px;
        padding: 10px 15px;
    }
}