/**
 * SVG Map Global Styles
 * 
 * Estilos globais para mapas interativos SVG
 * Usado em: Pavilhão Negócios, Pecuária e Mulher
 */

/* ============================================
   CONTAINER E VIEWPORT
   ============================================ */

.mapa-svg-container {
    position: relative;
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
    padding: 0;
    overflow: hidden;
}

.mapa-svg-wrapper {
    position: relative;
    width: 100%;
    overflow: hidden;
    touch-action: none;
}

.svg-container {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: flex-start;
    justify-content: flex-start;
}

.svg-container svg {
    width: 100%;
    height: auto;
    display: block;
    transform-origin: 0 0;
    /* will-change: transform; */
    /* SVG recebe o transform diretamente para manter qualidade vetorial */
}

/* ============================================
   CONTROLES DE ZOOM
   ============================================ */

.zoom-controls {
    position: fixed;
    width: 40px;
    top: 20px;
    right: 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    background: white;
    border-radius: 12px;
    padding: 40px 12px 12px 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    cursor: move;
    user-select: none;
}

.zoom-controls::before {
    content: '⋮⋮⋮⋮';
    position: absolute;
    top: 6px;
    right: 18px;
    font-size: 24px;
    color: #003d5680;
    letter-spacing: -2px;
}

.zoom-btn {
    width: 40px;
    height: 40px;
    border: none;
    background: #003d56;
    color: white;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.zoom-btn:hover {
    background: #005577;
    transform: scale(1.05);
}

.zoom-btn:active {
    transform: scale(0.95);
}

.zoom-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px;
    font-size: 14px;
    font-weight: bold;
    color: #003d56;
    background: #f0f8ff;
    border-radius: 8px;
}

.zoom-hint {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 61, 86, 0.95);
    color: white;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 14px;
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    transition: opacity 0.3s ease;
    pointer-events: none;
}

/* ============================================
   ESTADOS DOS LOTES
   ============================================ */

.lote-interativo {
    cursor: pointer;
    transition: all 0.3s ease;
}

/* Lote disponível */
rect.lote-interativo.disponivel,
polygon.lote-interativo.disponivel {
    fill: #e7ffe5 !important;
    stroke: #4CAF50 !important;
    stroke-width: 1px !important;
    transition: all 0.3s ease;
}

rect.lote-interativo.disponivel:hover,
polygon.lote-interativo.disponivel:hover {
    fill: #82e586 !important;
    stroke: #000 !important;
    stroke-width: 2px !important;
}

/* Lote reservado */
rect.lote-interativo.reservado,
polygon.lote-interativo.reservado {
    fill: #fff !important;
    stroke: #999 !important;
    stroke-width: 1px !important;
    cursor: not-allowed;
    transition: all 0.3s ease;
}

rect.lote-interativo.reservado:hover,
polygon.lote-interativo.reservado:hover {
    fill: #ededed !important;
    stroke: #999 !important;
}

/* Lote vendido */
rect.lote-interativo.vendido,
polygon.lote-interativo.vendido {
    stroke: gray !important;
    stroke-width: 1px !important;
    cursor: default;
    transition: all 0.3s ease;
}

rect.lote-interativo.vendido:hover,
polygon.lote-interativo.vendido:hover {
    stroke: #000 !important;
    stroke-width: 1px !important;
}

/* Lote no carrinho */
rect.lote-interativo.carrinho,
polygon.lote-interativo.carrinho {
    fill: #03A9F4 !important;
    stroke: #000 !important;
    stroke-width: 1px !important;
    cursor: pointer;
    transition: all 0.3s ease;
}

rect.lote-interativo.carrinho:hover,
polygon.lote-interativo.carrinho:hover {
    fill: #03A9F4 !important;
    stroke: #000 !important;
    stroke-width: 2px !important;
}

/* Lote destacado (busca) */
.lote-interativo.highlighted {
    animation: pulse-highlight 1.5s ease-in-out 2;
    stroke: #FFEB3B !important;
    stroke-width: 4px !important;
}

@keyframes pulse-highlight {
    0%, 100% {
        filter: drop-shadow(0 0 8px rgba(255, 235, 59, 0.8));
    }
    50% {
        filter: drop-shadow(0 0 16px rgba(255, 235, 59, 1));
        stroke-width: 5px !important;
    }
}

/* ============================================
   TOOLTIP
   ============================================ */

.lote-tooltip {
    position: fixed;
    padding: 8px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 10001;
    display: none;
    pointer-events: none;
    max-width: 250px;
    font-family: 'Arial', sans-serif;
    font-size: 14px;
    line-height: 1.4;
    white-space: normal;
}

/* Tooltip - Disponível (verde) */
.lote-tooltip.disponivel,
.lote-tooltip.carrinho {
    background-color: #e8f5e8;
    border: 1px solid #4caf50;
    color: #2e7d32;
}

/* Tooltip - Reservado/Vendido (branco) */
.lote-tooltip.reservado,
.lote-tooltip.vendido {
    background-color: #ffffff;
    border: 1px solid #e0e0e0;
    color: #333333;
}

.lote-tooltip h3 {
    margin: 0 0 8px 0;
    font-size: 16px;
    font-weight: normal;
    color: #1a1a1a;
}

.lote-tooltip .tooltip-description {
    margin-bottom: 8px;
    color: #000;
    font-size: 13px;
    line-height: 1.5;
}

/* Permitir quebras de linha */
.lote-tooltip .tooltip-description br {
    display: block;
}

/* Tags <p> dentro da descrição */
.lote-tooltip .tooltip-description p {
    margin: 8px 0;
    display: block;
}

.lote-tooltip .tooltip-description p:first-child {
    margin-top: 0;
}

.lote-tooltip .tooltip-description p:last-child {
    margin-bottom: 0;
}

.lote-tooltip .status-badge {
    margin-bottom: 0;
    font-size: 14px;
    font-weight: normal;
}

.lote-tooltip.disponivel .status-badge,
.lote-tooltip.carrinho .status-badge {
    color: #2e7d32;
}

.lote-tooltip.reservado .status-badge,
.lote-tooltip.vendido .status-badge {
    color: #000;
}

.lote-tooltip .empresa-info {
    font-size: 14px;
    color: #666;
    margin: 4px 0;
}

.lote-tooltip .tooltip-image {
    text-align: center;
    margin-top: 8px;
}

.lote-tooltip .tooltip-image img {
    border-radius: 4px;
    border: 1px solid #e0e0e0;
    background-color: #f5f5f5;
    padding: 4px;
}

/* ============================================
   ESTILOS SVG INTERNOS
   ============================================ */

/* Desabilita interação em elementos decorativos */
.st1, .st2, .st3, .st4, .st5, .st6, .st7 {
    pointer-events: none !important;
}

/* Desabilita pointer events em paths e grupos de decoração */
svg path:not([data-lote]) {
    pointer-events: none !important;
}

/* Grupos sem data-lote não bloqueiam eventos (deixa passar para filhos) */
svg g:not([data-lote]):not(.area-clicavel) {
    pointer-events: inherit;
}

svg text {
    pointer-events: none !important;
}

/* IMPORTANTE: Apenas shapes com data-lote devem ser clicáveis */
svg rect:not([data-lote]),
svg polygon:not([data-lote]),
svg path:not([data-lote]) {
    pointer-events: none !important;
}

svg rect[data-lote],
svg polygon[data-lote],
svg path[data-lote] {
    pointer-events: auto !important;
    cursor: pointer !important;
}

/* Áreas clicáveis (botões de pavilhões) */
.area-clicavel {
    cursor: pointer !important;
    pointer-events: auto !important;
    transition: opacity 0.3s ease;
}

.area-clicavel * {
    pointer-events: auto !important;
}

/* ============================================
   RESPONSIVO
   ============================================ */

@media (max-width: 768px) {
    .zoom-controls {
        top: 10px;
        right: 10px;
        padding: 8px;
        gap: 6px;
    }
    
    .zoom-btn {
        width: 36px;
        height: 36px;
    }
    
    .zoom-hint {
        bottom: 80px;
        font-size: 12px;
        padding: 10px 20px;
        max-width: 90%;
    }
    
    .lote-tooltip {
        font-size: 12px;
        max-width: 200px;
    }
}

