/*
 * YTI&W Smart Maps - Frontend Styles
 *
 * Estiliza a "Fachada" (Lazy Load Container) para garantir UX suave
 * antes do mapa pesado do Google ser carregado.
 */

/* Container Principal (Fachada) */
.ytiw-map-facade {
    width: 100%;
    background-color: #f0f0f0; /* Cor neutra de fundo */
    position: relative; /* CRUCIAL: Define o contexto para o mapa absoluto */
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.3s ease;
    border-radius: 4px;
}

/* Placeholder (Ícone e Texto) */
.ytiw-map-placeholder {
    text-align: center;
    color: #999;
    z-index: 10;
    pointer-events: none;
    transition: opacity 0.3s ease;
    /* Garante que o placeholder ocupe espaço e centralize */
    width: 100%;
    position: relative;
}

.ytiw-map-placeholder .dashicons {
    font-size: 48px;
    width: 48px;
    height: 48px;
    opacity: 0.4;
    margin-bottom: 10px;
    display: block;
    margin-left: auto;
    margin-right: auto;
}

.ytiw-map-placeholder p {
    margin: 0;
    font-size: 11px;
    font-weight: 500;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

/* Animação de "Pulse" */
@keyframes ytiwMapPulse {
    0% { opacity: 0.4; }
    50% { opacity: 0.6; }
    100% { opacity: 0.4; }
}
.ytiw-map-placeholder {
    animation: ytiwMapPulse 2s infinite;
}

/* Elemento do Mapa Real (Injetado via JS) */
.ytiw-map-canvas {
    width: 100% !important;
    height: 100% !important;
    position: absolute !important; /* FORÇA O OVERLAY */
    top: 0;
    left: 0;
    z-index: 20; /* Fica acima do placeholder (z-10) */
    opacity: 0;
    transition: opacity 0.5s ease;
    background: #e5e3df; /* Cor de fundo padrão do Google Maps para evitar flash */
}

/* Estado: Carregado (Mapa visível, Placeholder oculto) */
.ytiw-map-facade.is-loaded .ytiw-map-canvas {
    opacity: 1;
}

.ytiw-map-facade.is-loaded .ytiw-map-placeholder {
    opacity: 0;
    display: none !important; /* REMOVE O ELEMENTO DO FLUXO */
}