/* ================= HERO HEXAGONAL ================= */
.infra-hero {
    position: relative;
    padding: 160px 0 100px 0;
    background: #051025;
    overflow: hidden;
}

/* Malha Hexagonal CSS */
.hex-bg {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    background-image: 
        linear-gradient(30deg, #0a192f 12%, transparent 12.5%, transparent 87%, #0a192f 87.5%, #0a192f),
        linear-gradient(150deg, #0a192f 12%, transparent 12.5%, transparent 87%, #0a192f 87.5%, #0a192f),
        linear-gradient(30deg, #0a192f 12%, transparent 12.5%, transparent 87%, #0a192f 87.5%, #0a192f),
        linear-gradient(150deg, #0a192f 12%, transparent 12.5%, transparent 87%, #0a192f 87.5%, #0a192f),
        linear-gradient(60deg, #112240 25%, transparent 25.5%, transparent 75%, #112240 75%, #112240),
        linear-gradient(60deg, #112240 25%, transparent 25.5%, transparent 75%, #112240 75%, #112240);
    background-size: 40px 70px;
    background-position: 0 0, 0 0, 20px 35px, 20px 35px, 0 0, 20px 35px;
    opacity: 0.2;
}

.hero-infra-content {
    position: relative; z-index: 2;
    display: grid; grid-template-columns: 1fr 1.5fr;
    gap: 60px; align-items: center;
}

/* Animação da Torre */
.tower-animation {
    width: 100%; height: 300px;
    position: relative;
    display: flex; justify-content: center; align-items: center;
}
.tower-body {
    width: 6px; height: 150px; background: #fff;
    position: relative; z-index: 2;
    box-shadow: 0 0 20px #fff;
}
.signal-ring {
    position: absolute; border: 2px solid var(--color-accent);
    border-radius: 50%; opacity: 0;
    animation: signal-expand 3s infinite linear;
}
.r1 { width: 50px; height: 50px; animation-delay: 0s; }
.r2 { width: 50px; height: 50px; animation-delay: 1s; }
.r3 { width: 50px; height: 50px; animation-delay: 2s; }

@keyframes signal-expand {
    0% { transform: scale(0.5); opacity: 1; border-width: 2px; }
    100% { transform: scale(4); opacity: 0; border-width: 0px; }
}

.sys-tag {
    color: var(--color-accent); font-weight: 700; letter-spacing: 1px;
    background: rgba(242, 100, 34, 0.28); padding: 5px 10px; border-radius: 4px;
}

/* ================= DIAGRAMA ================= */
.system-diagram { padding: 80px 0; background: var(--color-bg-secondary); }
.diagram-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 50px; align-items: center; }

.check-list li {
    margin-bottom: 10px; color: var(--color-text-secondary);
    display: flex; align-items: center; gap: 10px;
}
.check-list li::before { content: '✓'; color: var(--color-accent); font-weight: bold; }

/* Visual Map */
.node-map {
    width: 100%; 
    height: 350px; /* Aumentei um pouco para dar respiro */
    position: relative;
    border: 1px dashed rgba(255,255,255,0.1); 
    border-radius: 20px;
    display: flex; 
    justify-content: center; 
    align-items: center;
    background: radial-gradient(circle at center, rgba(255,255,255,0.02) 0%, transparent 70%);
}

.center-node {
    background: var(--color-accent); 
    color: #000; 
    font-weight: 800;
    padding: 15px 30px; 
    border-radius: 30px; 
    z-index: 2;
    box-shadow: 0 0 20px rgba(242, 101, 34, 0.4);
    font-size: 1.2rem;
}

.sub-node {
    position: absolute; 
    background: #020610; /* Cor do fundo do site para cobrir a linha */
    border: 1px solid var(--color-accent);
    padding: 8px 20px; 
    border-radius: 20px; 
    font-size: 0.9rem; 
    z-index: 2;
    color: #fff;
    font-weight: 600;
    
    /* CORREÇÃO DO SITE B (Não deixa quebrar linha) */
    white-space: nowrap; 
    min-width: 80px; 
    text-align: center;
}

/* Posicionamento Ajustado para bater com as linhas */
.n1 { 
    top: 15%; 
    left: 10%; 
} 

.n2 { 
    top: 15%; 
    right: 10%; 
} 

.n3 { 
    top: 80%; /* Fixado pelo topo (85% da altura) */
    left: 43%; 
}

.lines-svg { 
    position: absolute; 
    top: 0; left: 0; 
    width: 100%; height: 100%; 
    z-index: 1; 
    pointer-events: none;
}

/* ================= RACK CATALOG ================= */
.rack-catalog { padding: 80px 0; background: #020c1b; }

.rack-frame {
    border: 10px solid #1a1a1a;
    background: #000;
    padding: 20px;
    border-radius: 10px;
    box-shadow: inset 0 0 50px rgba(0,0,0,0.8);
    max-width: 900px; margin: 0 auto;
}

.rack-header {
    display: flex; justify-content: space-between;
    color: #555; font-family: monospace; border-bottom: 1px solid #333;
    padding-bottom: 10px; margin-bottom: 20px;
}

.status-lights { display: flex; gap: 5px; }
.led { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.led.green { background: #0f0; box-shadow: 0 0 5px #0f0; }
.led.blue { background: #00f; box-shadow: 0 0 5px #00f; }
.led.red { background: #f00; box-shadow: 0 0 5px #f00; }
.led.gray { background: #555; }
.led.blink { animation: blink 1s infinite alternate; }
@keyframes blink { from { opacity: 0.3; } to { opacity: 1; } }

/* Unidade do Rack (Card do Produto) */
.rack-unit {
    background: #151515;
    border-top: 1px solid #333;
    border-bottom: 1px solid #000;
    padding: 15px;
    margin-bottom: 5px;
    cursor: pointer;
    transition: 0.2s;
}
.rack-unit:hover { background: #222; border-left: 3px solid var(--color-accent); }
.rack-unit.tall { padding: 25px 15px; }

.unit-face {
    display: grid; grid-template-columns: 100px 1fr 150px 100px;
    align-items: center; gap: 20px;
}

/* Grade de Ventilação CSS */
.vent-grill {
    height: 100%; width: 100%;
    background-image: repeating-linear-gradient(90deg, #000, #000 2px, #333 2px, #333 4px);
    border-radius: 4px; height: 30px;
}
.vent-grill.simple { background: repeating-linear-gradient(90deg, #222, #222 5px, #333 5px, #333 6px); }

.unit-details h4 { color: #ccc; margin: 0; font-family: monospace; font-size: 1.1rem; }
.spec-mini { color: #666; font-size: 0.8rem; }

.unit-status { 
    color: #888; font-size: 0.7rem; font-family: monospace;
    display: flex; gap: 10px; align-items: center;
}

.btn-rack {
    background: transparent; border: 1px solid #444; color: #888;
    padding: 5px 10px; font-size: 0.8rem; cursor: pointer;
    text-transform: uppercase;
}
.rack-unit:hover .btn-rack { border-color: var(--color-accent); color: var(--color-accent); }

/* ================= MODAL INFRA ================= */
/* Fundo escuro necessário! */
.modal-backdrop {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.95); z-index: 9999;
    display: flex; justify-content: center; align-items: center;
    opacity: 0; visibility: hidden; transition: 0.3s;
}
.modal-backdrop.active { opacity: 1; visibility: visible; }

.infra-theme {
    background: #111; border: 1px solid #333;
    width: 90%; max-width: 800px;
    padding: 0; box-shadow: 0 0 50px rgba(0,0,0,0.8);
}

.modal-header-infra {
    background: #000; padding: 20px; border-bottom: 1px solid var(--color-accent);
    display: flex; justify-content: space-between; align-items: center;
}
.sys-id { color: var(--color-accent); font-family: monospace; }
.modal-header-infra h2 { color: #fff; margin: 0; }

.modal-layout-infra { display: flex; flex-direction: column; }
.modal-body-infra { display: grid; grid-template-columns: 1fr 1fr; padding: 30px; gap: 30px; }

.infra-img-container {
    background: #0a0a0a; border: 1px solid #222;
    display: flex; justify-content: center; align-items: center;
}
.infra-img-container img { max-width: 80%; }

.tech-table { margin: 20px 0; border: 1px solid #333; }
.tech-table .row {
    display: flex; justify-content: space-between;
    padding: 10px; border-bottom: 1px solid #333; color: #aaa; font-size: 0.9rem;
}
.tech-table .row:last-child { border-bottom: none; }

.modal-close {
    position: absolute; top: 15px; right: 20px;
    color: #fff; font-size: 2rem; border: none; background: none; cursor: pointer;
}


/* ============================================================
   RESPONSIVIDADE: REPETIDORAS (CAMISA DE FORÇA)
   Foco: Encolher elementos complexos para caber na tela
   ============================================================ */

/* MENU HAMBURGUER (FORÇAR APARECIMENTO) */
.mobile-menu-trigger { display: none; }

@media (max-width: 1024px) {

    /* 1. CABEÇALHO & MENU */
    .header-cta { display: none !important; }
    
    .mobile-menu-trigger {
        display: flex !important;
        flex-direction: column;
        justify-content: space-between;
        width: 30px; height: 22px;
        cursor: pointer; 
        z-index: 99999 !important; /* Z-Index altíssimo pra aparecer */
        margin-left: auto;
        position: relative;
    }

    .mobile-menu-trigger .bar {
        width: 100%; height: 3px; 
        background: var(--color-accent) !important; /* Cor Laranja Forçada */
        border-radius: 2px;
        transition: 0.3s;
    }

    /* Animação do X */
    .mobile-menu-trigger.active .bar:nth-child(1) { transform: rotate(45deg) translate(5px, 6px); }
    .mobile-menu-trigger.active .bar:nth-child(2) { opacity: 0; }
    .mobile-menu-trigger.active .bar:nth-child(3) { transform: rotate(-45deg) translate(5px, -6px); }

    /* GAVETA DO MENU */
    .main-nav {
        position: fixed; top: 0; right: -100%;
        width: 85%; height: 100vh;
        background: #020610;
        border-left: 2px solid var(--color-accent);
        padding: 100px 20px;
        transition: 0.3s ease;
        display: flex !important; flex-direction: column;
        z-index: 9999;
    }
    .main-nav.menu-open { right: 0; }
    .nav-list { flex-direction: column; width: 100%; gap: 0; }
    .nav-link { display: block; padding: 15px 0; border-bottom: 1px solid #333; width: 100%; font-size: 1.1rem; }
    .dropdown-menu { display: none; background: #000; padding-left: 20px; }
    .dropdown-item.active-mobile .dropdown-menu { display: block; }


    /* 2. HERO (Torre e Texto) */
    .infra-hero { padding: 120px 0 50px 0 !important; height: auto !important; }
    .hero-infra-content { grid-template-columns: 1fr !important; gap: 30px !important; text-align: center; }
    .infra-text h1 { font-size: 2rem !important; }
    .sys-tag{font-size: 0.6rem;}
    
    /* Encolhe a animação da torre pra não ocupar mto espaço */
    .tower-animation { height: 180px !important; transform: scale(0.7); margin-bottom: -30px; }


    /* 3. DIAGRAMA (BLOCO 02) - AJUSTE DE ESCALA */
    /* Não vamos mudar o layout, vamos encolher tudo pra caber */
    .diagram-grid { grid-template-columns: 1fr !important; gap: 30px !important; }
    
    .node-map {
        width: 100% !important;
        height: 300px !important; /* Altura fixa segura */
        overflow: hidden; /* Corta se vazar algo invisível */
    }

    /* Ajuste das posições para telas estreitas (320px-390px) */
    .center-node { 
        padding: 10px 20px !important; 
        font-size: 1rem !important; 
        width: auto !important;
    }
    
    .sub-node { 
        padding: 5px 10px !important; 
        font-size: 0.8rem !important; 
        min-width: auto !important;
    }

    /* Puxa os nós para dentro para não vazar na lateral */
    .n1 { left: 2% !important; top: 20% !important; } /* Site A */
    .n2 { right: 2% !important; top: 20% !important; } /* Site B */
    .n3 { top: 80% !important; left: 50% !important; transform: translateX(-50%); } /* Frota */


    /* 4. RACK DE SERVIDORES (BLOCO 03) - SIMPLIFICADO */
    .rack-catalog { padding: 40px 0 !important; }
    .rack-frame { padding: 5px !important; border-width: 5px !important; }
    
    .rack-header { display: none !important; } /* Remove cabeçalho complexo no mobile */

    /* A Unidade do Rack vira um bloco empilhado simples */
    .rack-unit {
        height: auto !important;
        padding: 15px !important;
        display: block !important;
    }

    .unit-face {
        display: flex !important;
        flex-direction: column !important; /* Empilha: Grade -> Texto -> Botão */
        gap: 10px !important;
        grid-template-columns: none !important; /* Mata o grid do desktop */
        text-align: center !important;
    }

    .vent-grill { height: 15px !important; width: 100% !important; margin-bottom: 5px; }
    
    .unit-details h4 { font-size: 1rem !important; color: #fff !important; margin-bottom: 5px !important; }
    .spec-mini { font-size: 0.8rem !important; color: #aaa !important; }

    /* Esconde status complexos para limpar a tela */
    .unit-status { display: none !important; } 

    .btn-rack {
        width: 100% !important;
        padding: 10px !important;
        margin-top: 5px !important;
        background: #222 !important;
        border: 1px solid #444 !important;
    }
    
    /* 5. MODAL (POP-UP) - AJUSTE DE TAMANHO */
    .modal-window.infra-theme {
        width: 90% !important;
        max-width: 360px !important;
        max-height: 80vh !important;
        overflow-y: auto !important;
        padding: 0 !important;
    }
    
    .modal-body-infra {
        display: flex !important;
        flex-direction: column !important;
        padding: 20px !important;
        gap: 15px !important;
    }
    
    .infra-img-container { height: 140px !important; }
    .infra-img-container img { max-height: 100% !important; }
    
    .modal-header-infra h2 { font-size: 0.8rem !important; }
    .infra-specs p { font-size: 0.8rem !important; }
}

/* AJUSTE PARA TELA MINÚSCULA (320px) */
@media (max-width: 360px) {
    .center-node { font-size: 0.85rem !important; }
    .infra-text h1 { font-size: 1.6rem !important; }
    .btn-rack { font-size: 0.75rem !important; }
}