/**
 * ZONA Map Locations — Estilos do Mapa Público e Sidebar
 * Autor: Mauricio Kaleya <kaleyapt@gmail.com>
 * Cores de Referência: #2F7B57, #DE5D48, #FFFFFF, #EBEAE5
 * Tipografia: Red Hat Display
 */

:root {
    --zona-primary: #2F7B57;
    --zona-primary-dark: #225C41;
    --zona-secondary: #DE5D48;
    --zona-secondary-dark: #C64834;
    --zona-bg: #FFFFFF;
    --zona-card-bg: #FFFFFF;
    --zona-gray-light: #F8F9FA;
    --zona-gray-border: #EBEAE5;
    --zona-gray-text: #64748B;
    --zona-text: #1E293B;
    --zona-radius: 12px;
    --zona-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.zona-map-section {
    font-family: 'Red Hat Display', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    color: var(--zona-text);
    background: var(--zona-bg);
    border-radius: var(--zona-radius);
    box-shadow: var(--zona-shadow);
    overflow: hidden;
    margin: 24px auto;
    border: 1px solid var(--zona-gray-border);
    box-sizing: border-box;
}

.zona-map-section *, .zona-map-section *::before, .zona-map-section *::after {
    box-sizing: border-box;
}

/* ══ TOOLBAR SUPERIOR: BUSCA E FILTROS ══ */
.zona-map-toolbar {
    background: #FFFFFF;
    padding: 16px 20px;
    border-bottom: 1px solid var(--zona-gray-border);
}

.zona-toolbar-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
}

.zona-search-field-wrap {
    flex: 1;
    min-width: 250px;
    position: relative;
    display: flex;
    align-items: center;
}

.zona-search-icon {
    position: absolute;
    left: 12px;
    color: #94A3B8;
    font-size: 18px;
    pointer-events: none;
    line-height: 1;
}

.zona-search-input {
    width: 100% !important;
    padding: 10px 34px 10px 38px !important;
    border: 1.5px solid var(--zona-gray-border) !important;
    border-radius: 8px !important;
    font-size: 14px !important;
    font-family: inherit !important;
    background: var(--zona-gray-light) !important;
    transition: all 0.2s ease !important;
    color: var(--zona-text) !important;
    outline: none !important;
}

.zona-search-input:focus {
    border-color: var(--zona-primary) !important;
    background: #FFFFFF !important;
    box-shadow: 0 0 0 3px rgba(47, 123, 87, 0.15) !important;
}

.zona-clear-search {
    position: absolute;
    right: 10px;
    background: none;
    border: none;
    font-size: 18px;
    color: #94A3B8;
    cursor: pointer;
    line-height: 1;
    padding: 2px 6px;
}

.zona-clear-search:hover {
    color: var(--zona-secondary);
}

.zona-filters-group {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.zona-select-wrap select {
    appearance: none;
    background: #FFFFFF url("data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%2364748B%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.5-3.5%205.4-7.8%205.4-12.8%200-5-1.9-9.2-5.5-12.8z%22%2F%3E%3C%2Fsvg%3E") no-repeat right 12px center !important;
    background-size: 10px auto !important;
    padding: 9px 32px 9px 12px !important;
    border: 1.5px solid var(--zona-gray-border) !important;
    border-radius: 8px !important;
    font-size: 13px !important;
    font-family: inherit !important;
    color: var(--zona-text) !important;
    cursor: pointer;
    outline: none !important;
    transition: border-color 0.2s;
}

.zona-select-wrap select:focus {
    border-color: var(--zona-primary) !important;
}

/* Alternador de Camadas: Satélite / Mapa */
.zona-layer-switcher {
    display: inline-flex;
    background: #F1F5F9;
    border-radius: 8px;
    padding: 3px;
    border: 1px solid var(--zona-gray-border);
}

.zona-layer-btn {
    border: none;
    background: transparent;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12.5px;
    font-weight: 700;
    color: #64748B;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: all 0.2s ease;
    outline: none;
}

.zona-layer-btn .dashicons {
    font-size: 15px;
    width: 15px;
    height: 15px;
}

.zona-layer-btn.active {
    background: #FFFFFF;
    color: var(--zona-primary);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
}

/* Botões de Ação na Barra: GPS e Reset */
.zona-btn-geo, .zona-btn-reset-view {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #FFFFFF;
    border: 1.5px solid var(--zona-gray-border);
    border-radius: 8px;
    padding: 8px 14px;
    font-size: 13px;
    font-weight: 600;
    color: var(--zona-primary);
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    outline: none;
}

.zona-btn-reset-view {
    padding: 8px 10px;
    color: #64748B;
}

.zona-btn-geo .dashicons, .zona-btn-reset-view .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
}

.zona-btn-geo:hover, .zona-btn-reset-view:hover {
    background: #F0FDF4;
    border-color: var(--zona-primary);
    color: var(--zona-primary);
}

.zona-btn-geo.active {
    background: var(--zona-primary);
    color: #FFFFFF;
    border-color: var(--zona-primary-dark);
}

/* Meta Bar: Resultados */
.zona-toolbar-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 10px;
    padding-top: 8px;
    font-size: 12.5px;
    color: var(--zona-gray-text);
}

.zona-results-count {
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 600;
}

/* ══ LAYOUT PRINCIPAL: MAPA + SIDEBAR ══ */
.zona-map-main-wrapper {
    display: flex;
    position: relative;
    height: 650px;
    background: #111827;
}

.zona-map-canvas-container {
    flex: 1;
    position: relative;
    height: 100%;
}

.zona-map-canvas {
    width: 100%;
    height: 100%;
    z-index: 10;
}

.zona-map-loading-overlay {
    position: absolute;
    inset: 0;
    background: rgba(17, 24, 39, 0.7);
    backdrop-filter: blur(2px);
    z-index: 500;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    font-size: 14px;
    font-weight: 600;
    color: #FFFFFF;
    transition: opacity 0.3s ease;
}

.zona-spinner {
    width: 38px;
    height: 38px;
    border: 3.5px solid rgba(255, 255, 255, 0.2);
    border-top-color: var(--zona-primary);
    border-radius: 50%;
    animation: zonaSpin 0.8s linear infinite;
}

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

/* ══ LISTA LATERAL (SIDEBAR) ══ */
.zona-map-sidebar {
    width: 380px;
    height: 100%;
    background: #FFFFFF;
    border-left: 1px solid var(--zona-gray-border);
    display: flex;
    flex-direction: column;
    z-index: 20;
    flex-shrink: 0;
}

.zona-sidebar-header {
    padding: 14px 18px;
    border-bottom: 1px solid var(--zona-gray-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #FAFAFA;
}

.zona-sidebar-header h4 {
    margin: 0;
    font-size: 14px;
    font-weight: 800;
    color: var(--zona-text);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.zona-sidebar-counter {
    background: var(--zona-primary);
    color: #FFFFFF;
    font-size: 12px;
    font-weight: 700;
    padding: 2px 9px;
    border-radius: 12px;
}

.zona-stores-list {
    flex: 1;
    overflow-y: auto;
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    scroll-behavior: smooth;
}

.zona-stores-list::-webkit-scrollbar {
    width: 6px;
}
.zona-stores-list::-webkit-scrollbar-track {
    background: #F1F5F9;
}
.zona-stores-list::-webkit-scrollbar-thumb {
    background: #CBD5E1;
    border-radius: 4px;
}
.zona-stores-list::-webkit-scrollbar-thumb:hover {
    background: #94A3B8;
}

/* ══ CARD DO ESTABELECIMENTO NA SIDEBAR ══ */
.zona-store-item {
    background: var(--zona-card-bg);
    border: 1.5px solid var(--zona-gray-border);
    border-radius: var(--zona-radius);
    padding: 14px 16px;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
}

.zona-store-item:hover {
    border-color: var(--zona-primary);
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(47, 123, 87, 0.12);
}

.zona-store-item.is-active {
    border-color: var(--zona-primary);
    background: #FAFDFB;
    box-shadow: 0 0 0 2px var(--zona-primary), 0 8px 20px rgba(47, 123, 87, 0.16);
}

.zona-store-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
}

.zona-store-avatar {
    width: 42px;
    height: 42px;
    border-radius: 8px;
    background: #FFFFFF;
    border: 1px solid var(--zona-gray-border);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    overflow: hidden;
    padding: 3px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.zona-store-avatar img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.zona-avatar-fallback {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--zona-primary) 0%, var(--zona-primary-dark) 100%);
    color: #FFFFFF;
    font-weight: 800;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-transform: uppercase;
    border-radius: 6px;
}

.zona-store-title-wrap {
    flex: 1;
    min-width: 0;
}

.zona-store-name {
    margin: 0 0 2px 0;
    font-size: 15px;
    font-weight: 700;
    color: var(--zona-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.zona-store-brand {
    font-size: 12px;
    color: var(--zona-gray-text);
    font-weight: 500;
}

.zona-store-category-tag {
    display: inline-block;
    background: #F1F5F9;
    color: #475569;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 6px;
    margin-bottom: 8px;
}

.zona-store-location-info {
    font-size: 12.5px;
    color: #475569;
    line-height: 1.4;
    margin-bottom: 10px;
    display: flex;
    align-items: flex-start;
    gap: 4px;
}

.zona-store-location-info .dashicons {
    font-size: 15px;
    width: 15px;
    height: 15px;
    color: var(--zona-primary);
    margin-top: 2px;
    flex-shrink: 0;
}

/* Ações do Card */
.zona-store-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    border-top: 1px solid #F1F5F9;
    padding-top: 10px;
}

.zona-btn-action {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    text-decoration: none !important;
    transition: all 0.2s ease;
    line-height: 1.2;
}

.zona-btn-action .dashicons {
    font-size: 14px;
    width: 14px;
    height: 14px;
}

.zona-btn-directions {
    background: var(--zona-secondary);
    color: #FFFFFF !important;
}

.zona-btn-directions:hover {
    background: var(--zona-secondary-dark);
    transform: translateY(-1px);
}

.zona-btn-whatsapp {
    background: #25D366;
    color: #FFFFFF !important;
}

.zona-btn-whatsapp:hover {
    background: #1DA851;
}

.zona-btn-call {
    background: #F1F5F9;
    color: var(--zona-text) !important;
    border: 1px solid #CBD5E1;
}

.zona-btn-call:hover {
    background: #E2E8F0;
}

/* ══ MARCADORES COM LOGÓTIPOS DAS MARCAS ══ */
.zona-brand-marker {
    position: relative;
    cursor: pointer;
}

.zona-marker-badge {
    width: 44px;
    height: 44px;
    background: #FFFFFF;
    border-radius: 50%;
    border: 2.5px solid var(--zona-primary);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4px;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
}

.zona-marker-badge::after {
    content: '';
    position: absolute;
    bottom: -6px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-top: 6px solid var(--zona-primary);
}

.zona-marker-badge img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 50%;
}

.zona-marker-badge .zona-marker-char {
    font-weight: 800;
    font-size: 18px;
    color: var(--zona-primary);
}

.zona-brand-marker:hover .zona-marker-badge {
    transform: translateY(-4px) scale(1.15);
    border-color: var(--zona-secondary);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.45);
}

.zona-brand-marker:hover .zona-marker-badge::after {
    border-top-color: var(--zona-secondary);
}

/* Marcador Ativo */
.zona-marker-active .zona-marker-badge {
    border-color: var(--zona-secondary) !important;
    box-shadow: 0 0 0 4px rgba(222, 93, 72, 0.35), 0 8px 22px rgba(0,0,0,0.5) !important;
    transform: translateY(-5px) scale(1.2) !important;
}
.zona-marker-active .zona-marker-badge::after {
    border-top-color: var(--zona-secondary) !important;
}

/* ══ ESTILO DO POPUP CONFORME O ITEM 10 ══ */
.zona-leaflet-popup .leaflet-popup-content-wrapper {
    background: #FFFFFF;
    color: var(--zona-text);
    border-radius: 12px;
    padding: 0;
    overflow: hidden;
    box-shadow: 0 12px 34px rgba(0, 0, 0, 0.3);
    border: 1px solid var(--zona-gray-border);
}

.zona-leaflet-popup .leaflet-popup-content {
    margin: 0;
    padding: 16px;
    font-family: 'Red Hat Display', sans-serif;
    min-width: 250px;
    max-width: 280px;
}

.zona-popup-box {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.zona-popup-header {
    display: flex;
    align-items: center;
    gap: 10px;
}

.zona-popup-logo {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    object-fit: contain;
    border: 1px solid #E2E8F0;
    padding: 2px;
    background: #FFFFFF;
    flex-shrink: 0;
}

.zona-popup-title {
    margin: 0;
    font-size: 15px;
    font-weight: 800;
    color: var(--zona-text);
    line-height: 1.2;
}

.zona-popup-category {
    font-size: 11.5px;
    font-weight: 600;
    color: var(--zona-primary);
}

.zona-popup-province {
    font-size: 12.5px;
    color: #475569;
    margin: 2px 0 6px 0;
}

.zona-popup-actions {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 6px;
    border-top: 1px solid #F1F5F9;
    padding-top: 8px;
}

.zona-popup-actions .zona-btn-action {
    justify-content: center;
    padding: 8px 12px;
    font-size: 12.5px;
}

/* Rodapé Limpo */
.zona-public-footer {
    padding: 10px 20px;
    background: #FAFAFA;
    border-top: 1px solid var(--zona-gray-border);
    font-size: 12px;
    font-weight: 700;
    color: #64748B;
    text-align: right;
}

/* ══ RESPONSIVIDADE ══ */
@media (max-width: 960px) {
    .zona-map-main-wrapper {
        flex-direction: column;
        height: auto;
    }
    .zona-map-canvas-container {
        height: 420px;
    }
    .zona-map-sidebar {
        width: 100%;
        height: 380px;
        border-left: none;
        border-top: 1px solid var(--zona-gray-border);
    }
}

@media (max-width: 640px) {
    .zona-toolbar-row {
        flex-direction: column;
        align-items: stretch;
    }
    .zona-search-field-wrap {
        min-width: 100%;
    }
    .zona-filters-group {
        flex-direction: column;
        align-items: stretch;
    }
    .zona-select-wrap select {
        width: 100% !important;
    }
    .zona-layer-switcher {
        width: 100%;
        justify-content: center;
    }
    .zona-layer-btn {
        flex: 1;
        justify-content: center;
    }
    .zona-btn-geo {
        justify-content: center;
        width: 100%;
    }
    .zona-map-canvas-container {
        height: 350px;
    }
    .zona-map-sidebar {
        height: 340px;
    }
}
