/* ==========================================================================
   VARIABLES GLOBALES & RESET
   ========================================================================== */
:root {
    --escady-yellow: #ffc400;
    --escady-black: #111111;
    --bg-light: #f8fafc;
    --text-color: #334155;
    --border-color: #e2e8f0;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-weight: normal;
    background-color: #ffffff;
    color: var(--text-color);
    line-height: 1.6;
}

.container {
    max-width: 1300px;
    margin: 0 auto;
    padding: 60px 20px;
}

/* ==========================================================================
   HEADER CON LOGO A LA IZQUIERDA Y MENÚ ALINEADO
   ========================================================================== */
.header {
    background-color: var(--escady-yellow);
    color: var(--escady-black);
    padding: 0.5rem 2rem;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(0,0,0,0.18);
}

.nav-container {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    gap: 45px;
}

.logo {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.logo-img {
    height: 60px;
    width: auto;
    display: block;
    object-fit: contain;
    transition: transform 0.2s ease;
}

.logo-img:hover {
    transform: scale(1.02);
}

.nav-links {
    display: flex;
    align-items: center;
    list-style: none;
    gap: 32px;
    flex-wrap: wrap;
}

.nav-links > li {
    position: relative;
}

.nav-links a {
    color: var(--escady-black);
    text-decoration: none;
    font-weight: 800;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    gap: 6px;
    letter-spacing: 0.3px;
    cursor: pointer;
}

.arrow {
    font-size: 0.9rem;
    transition: transform 0.2s;
}

/* Submenús */
.submenu {
    position: absolute;
    top: 100%;
    left: 0;
    background-color: #ffffff;
    min-width: 260px;
    list-style: none;
    border-radius: 8px;
    box-shadow: 0 12px 28px rgba(0,0,0,0.2);
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.25s ease-in-out;
    z-index: 1100;
    overflow: hidden;
}

.dropdown:hover .submenu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown:hover .arrow {
    transform: rotate(180deg);
}

.submenu li a {
    color: #1e293b;
    padding: 12px 20px;
    font-size: 1rem;
    font-weight: 700;
    display: block;
    text-align: left;
    transition: background-color 0.2s, color 0.2s;
}

.submenu li a:hover {
    background-color: var(--escady-yellow);
    color: var(--escady-black);
}

/* Quita la negrita a los enlaces del menú del header (Override original) */
.header, 
.header a, 
.nav-links, 
.nav-links a {
    font-weight: 400 !important;
}

/* ==========================================================================
   TARJETAS BASE (SHARED)
   ========================================================================== */
.titulo-seccion {
    text-align: center;
    font-size: 2.5rem;
    font-weight: 900;
    color: var(--escady-black);
    margin-bottom: 30px;
}

.grid-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 30px;
}

.card {
    background: #ffffff;
    border-radius: 10px;
    border: 3px solid var(--border-color);
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 24px rgba(0,0,0,0.12);
    border-color: #ffc400;
}

.card img {
    width: 100%;
    height: 220px;
    object-fit: cover;
    background-color: #f1f5f9;
}

.card-body {
    padding: 20px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.card-title {
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--escady-black);
    margin-bottom: 10px;
}

.card-desc {
    font-size: 0.95rem;
    color: #64748b;
    margin-bottom: 15px;
    flex-grow: 1;
}

.card-badge {
    display: inline-block !important;
    font-size: 10px;
    font-weight: 700;
    color: #ffc800;
    background-color: #1e293b;
    padding: 3px 8px;
    border-radius: 4px;
    width: fit-content;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    line-height: normal;
}

/* ==========================================================================
   BOTONES Y FLOATING WHATSAPP
   ========================================================================== */
.btn {
    padding: 10px 22px;
    border-radius: 30px;
    font-weight: 700;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
}

.btn-wsp-grande, .btn-wsp {
    background-color: #25d366;
    color: #ffffff;
    font-weight: 800;
    text-align: center;
}

.btn-wsp-grande:hover, .btn-wsp:hover {
    background-color: #1eb956;
}

.btn-secundario {
    background-color: #0f172a;
    color: #ffffff;
    text-align: center;
}

.btn-secundario:hover {
    background-color: #1e293b;
}

.btn-filtro {
    background-color: #ffc400;
    color: var(--escady-black);
}

.wsp-float {
    position: fixed;
    bottom: 25px;
    right: 25px;
    width: 60px;
    height: 60px;
    background-color: #25d366;
    color: #ffffff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
    z-index: 1500;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.wsp-icon {
    width: 34px;
    height: 34px;
}

.wsp-float:hover {
    transform: scale(1.08);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.35);
}

/* ==========================================================================
   ENCABEZADOS GLOBALES (Proyectos, Equipos, Soluciones)
   ========================================================================== */
.seccion-proyectos {
    padding-top: 40px;
    padding-bottom: 60px;
}

.encabezado-proyectos {
    display: flex;
    align-items: flex-start;
    gap: 25px;
    margin-bottom: 40px;
}

.icono-destacado {
    width: 80px;
    height: 80px;
    background-color: var(--escady-yellow);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.08);
}

.icono-destacado svg {
    width: 42px;
    height: 42px;
    color: var(--escady-black);
}

.texto-encabezado {
    flex-grow: 1;
}

.texto-encabezado h2 {
    font-size: 1.8rem;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 8px;
}

.texto-encabezado p {
    color: #475569;
    font-size: 0.95rem;
    line-height: 1.5;
    max-width: 1100px;
}

.titulo-destacado {
    font-size: 2.2rem;
    font-weight: 800;
    color: var(--escady-black);
    display: inline-block;
    position: relative;
    margin-bottom: 12px;
    line-height: 1.2;
}

.titulo-destacado::before {
    content: '';
    position: absolute;
    bottom: 2px;
    left: 0;
    width: 100%;
    height: 10px;
    background-color: rgba(255, 196, 0, 0.35);
    z-index: -1;
    border-radius: 2px;
}

.descripcion-seccion {
    font-size: 1.05rem;
    color: #334155;
    line-height: 1.6;
    max-width: 1100px;
}

.subrayado-amarillo {
    background: linear-gradient(180deg, transparent 65%, #fef08a 65%);
    display: inline-block;
}

@media (max-width: 768px) {
    .encabezado-proyectos {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 15px;
    }
    .icono-destacado {
        width: 70px;
        height: 70px;
    }
    .icono-destacado svg {
        width: 36px;
        height: 36px;
    }
    .titulo-destacado {
        font-size: 1.8rem;
    }
    .descripcion-seccion {
        font-size: 0.98rem;
    }
}

/* ==========================================================================
   MODALES (COMÚN PARA EQUIPOS Y PROYECTOS)
   ========================================================================== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.75);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-container {
    background: #ffffff;
    width: 90%;
    max-width: 900px;
    max-height: 90vh;
    border-radius: 12px;
    position: relative;
    overflow-y: auto;
    padding: 35px 30px 30px 30px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

.modal-cerrar {
    position: absolute;
    top: 12px;
    right: 18px;
    background: transparent;
    border: none;
    font-size: 2.2rem;
    font-weight: bold;
    color: #475569;
    cursor: pointer;
    z-index: 20;
    padding: 5px 12px;
    line-height: 1;
    border-radius: 6px;
    transition: color 0.2s, background-color 0.2s;
}

.modal-cerrar:hover {
    color: #ef4444;
    background-color: #f1f5f9;
}

.modal-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-top: 10px;
}

.modal-galeria #modal-img-principal,
.modal-galeria #modal-proyecto-img {
    width: 100%;
    height: 280px;
    object-fit: contain;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.galeria-miniaturas {
    display: flex;
    gap: 10px;
    margin-top: 12px;
}

.galeria-miniaturas img {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 6px;
    cursor: pointer;
    border: 2px solid transparent;
    transition: border-color 0.2s;
}

.galeria-miniaturas img.active {
    border-color: var(--escady-yellow);
}

.badge-categoria {
    display: inline-block;
    background-color: var(--escady-yellow);
    color: var(--escady-black);
    font-weight: 700;
    padding: 4px 12px;
    border-radius: 15px;
    font-size: 0.85rem;
    margin: 10px 0;
}

.modal-desc {
    color: var(--text-color);
    margin: 15px 0;
    font-size: 0.98rem;
}

.modal-acciones {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 20px;
}

@media (max-width: 768px) {
    .modal-content {
        grid-template-columns: 1fr;
    }
}

/* ==========================================================================
   FOOTER COMPLETO
   ========================================================================== */
.footer-site {
    background-color: #181a1b;
    color: #d1d5db;
    padding-top: 50px;
    font-size: 0.95rem;
}

.footer-container {
    max-width: 1300px;
    margin: 0 auto;
    padding: 0 20px 40px 20px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 40px;
}

.footer-col h4 {
    color: #ffffff;
    font-size: 1.1rem;
    font-weight: 800;
    margin-bottom: 20px;
}

.footer-col p {
    margin-bottom: 8px;
    color: #9ca3af;
}

.footer-col ul {
    list-style: none;
    padding: 0;
}

.footer-col ul li {
    margin-bottom: 10px;
}

.footer-col a {
    color: #9ca3af;
    text-decoration: none;
    transition: color 0.2s ease;
}

.footer-col a:hover {
    color: #ffffff;
}

.footer-email {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 15px;
}

.icon-mail-sm {
    width: 18px;
    height: 18px;
    color: #9ca3af;
}

.footer-bottom {
    border-top: 1px solid #2a2d2f;
    padding: 25px 20px;
    text-align: center;
    color: #9ca3af;
    font-size: 0.9rem;
}

html, body {
    max-width: 100%;
    overflow-x: hidden;
}

/* FORCE DISPLAY DEL MENÚ MÓVIL */
.header {
    position: relative;
    z-index: 9999;
}

.menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 35px;
    height: 25px;
    cursor: pointer;
    z-index: 10000;
    padding: 2px;
}

.menu-toggle .bar {
    height: 4px;
    width: 100%;
    background-color: #000;
    border-radius: 2px;
    pointer-events: none; /* Evita que el clic sea capturado por las barras */
}

@media screen and (max-width: 900px) {
    .nav-container {
        display: flex !important;
        justify-content: space-between !important;
        align-items: center !important;
    }

    .menu-toggle {
        display: flex !important;
    }

    /* Ocultar menú en responsive por defecto */
    .nav-container ul.nav-links {
        display: none !important;
        position: absolute !important;
        top: 100% !important;
        left: 0 !important;
        width: 100% !important;
        background-color: #ffcc00 !important; /* Ajustar a var(--escady-yellow) */
        flex-direction: column !important;
        padding: 10px 0 !important;
        margin: 0 !important;
        box-shadow: 0px 8px 16px rgba(0,0,0,0.3) !important;
        z-index: 9999 !important;
    }

    /* Mostrar menú al hacer clic */
    .nav-container ul.nav-links.active {
        display: flex !important;
    }

    .nav-container ul.nav-links li {
        width: 100% !important;
        text-align: left !important;
    }

    .nav-container ul.nav-links li a {
        display: block !important;
        padding: 12px 20px !important;
        color: #000 !important;
    }
}