:root {
    --bg-light: #f5f6f8;
    --red-fage: #e50914;
    --red-glow: rgba(229, 9, 20, 0.4);
    --text-dark: #111111;
    --text-muted: #666666;
    --card-bg: rgba(255, 255, 255, 0.95);
    --card-border: rgba(220, 225, 230, 0.9);
    --font-main: 'Montserrat', sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--bg-light);
    color: var(--text-dark);
    font-family: var(--font-main);
    min-height: 100vh;
    overflow-x: hidden;
}

/* FONDO CLARO */
#bg-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    background: linear-gradient(to bottom, rgba(245, 246, 248, 0.94) 0%, rgba(245, 246, 248, 0.98) 100%);
}

/* ENCABEZADO SUPERIOR CLARO */
.header-bar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    padding: 15px 5%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 500;
    background: rgba(245, 246, 248, 0.92) !important;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(220, 225, 230, 0.6);
}

.brand-logo {
    display: flex;
    align-items: center;
    z-index: 600;
}

.logo-img {
    height: clamp(34px, 4.5vw, 48px);
    width: auto;
    object-fit: contain;
}

/* NAV ESCRITORIO */
.top-nav {
    display: flex;
    gap: 20px;
    align-items: center;
}

.nav-link {
    color: var(--text-muted) !important;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: color 0.2s ease, font-weight 0.2s ease;
}

.nav-link:hover,
.nav-link.active {
    color: var(--text-dark) !important;
    font-weight: 800;
}

.btn-glow {
    background-color: var(--red-fage);
    color: #ffffff;
    padding: 12px 26px;
    border-radius: 25px;
    text-decoration: none;
    font-weight: 800;
    font-size: 0.8rem;
    letter-spacing: 1px;
    box-shadow: 0 4px 18px var(--red-glow);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.btn-glow:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(229, 9, 20, 0.7);
}

/* BOTÓN HAMBURGUESA */
.nav-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    cursor: pointer;
    padding: 8px;
    border: none;
    background: transparent;
    z-index: 600;
    outline: none;
}

.nav-toggle span {
    display: block;
    width: 26px;
    height: 2px;
    background: var(--text-dark);
    border-radius: 2px;
    transition: all 0.35s cubic-bezier(0.23, 1, 0.32, 1);
}

.nav-toggle.open span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
    background: var(--red-fage);
}

.nav-toggle.open span:nth-child(2) {
    opacity: 0;
    transform: scaleX(0);
}

.nav-toggle.open span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
    background: var(--red-fage);
}

/* MENÚ DESPLEGABLE MÓVIL */
.nav-dropdown {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    height: 100dvh;
    background: rgba(245, 246, 248, 0.98);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    z-index: 550;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    padding: 80px 10% 40px 10%;
    gap: 10px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-20px);
    transition: all 0.35s ease;
}

.nav-dropdown.open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.mobile-nav-link {
    display: flex;
    align-items: center;
    gap: 15px;
    text-decoration: none;
    color: var(--text-muted);
    font-size: clamp(1.3rem, 4vw, 2.2rem);
    font-weight: 900;
    text-transform: uppercase;
    padding: 8px 0;
    width: 100%;
    transition: all 0.3s ease;
}

.mobile-nav-link:hover,
.mobile-nav-link.active {
    color: var(--red-fage);
    padding-left: 10px;
}

.mobile-nav-link .nav-num {
    font-size: 0.8rem;
    color: rgba(0, 0, 0, 0.3);
}

.mobile-nav-link:hover .nav-num,
.mobile-nav-link.active .nav-num {
    color: var(--red-fage);
}

/* CONTENEDOR PRINCIPAL */
.proyectos-container {
    padding-top: 130px;
    padding-left: 5%;
    padding-right: 5%;
    padding-bottom: 70px;
    max-width: 1350px;
    margin: 0 auto;
}

.header-section {
    text-align: center;
    margin-bottom: 35px;
}

.badge-tag {
    font-size: 0.75rem;
    font-weight: 800;
    color: var(--red-fage);
    letter-spacing: 2px;
}

.page-title {
    font-size: clamp(2rem, 3.5vw, 2.6rem);
    font-weight: 900;
    text-transform: uppercase;
    color: var(--text-dark);
    margin-top: 5px;
}

.red-highlight {
    color: var(--red-fage);
}

.subtitle-text {
    font-size: 0.92rem;
    color: var(--text-muted);
    margin-top: 8px;
}

/* ACORDEÓN EJECUTIVO */
.categories-accordion {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.acc-group {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.03);
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.acc-group.active {
    border-color: rgba(229, 9, 20, 0.4);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.06);
}

.acc-header {
    padding: 22px 28px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    user-select: none;
    background: #ffffff;
    transition: background-color 0.3s ease;
}

.acc-header:hover {
    background: #fafafa;
}

.acc-title-wrap {
    display: flex;
    align-items: center;
    gap: 20px;
}

.acc-icon {
    width: 48px;
    height: 48px;
    background: rgba(229, 9, 20, 0.08);
    color: var(--red-fage);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
}

.acc-title-wrap h2 {
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--text-dark);
}

.acc-title-wrap p {
    font-size: 0.82rem;
    color: var(--text-muted);
    margin-top: 2px;
}

.acc-status {
    display: flex;
    align-items: center;
    gap: 15px;
}

.badge-count {
    font-size: 0.75rem;
    font-weight: 800;
    background: #f0f2f5;
    color: var(--text-dark);
    padding: 6px 14px;
    border-radius: 15px;
}

.acc-arrow {
    color: var(--text-muted);
    transition: transform 0.3s ease;
}

.acc-group.active .acc-arrow {
    transform: rotate(180deg);
    color: var(--red-fage);
}

.acc-body {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease;
    background: #fafbfc;
}

.acc-group.active .acc-body {
    max-height: 2500px;
    border-top: 1px solid var(--card-border);
}

/* MINI TARJETAS DE PROYECTO DENTRO DEL ACCORDION */
.projects-mini-grid {
    padding: 25px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 18px;
}

.project-mini-card {
    background: #ffffff;
    border: 1px solid var(--card-border);
    border-radius: 12px;
    padding: 18px;
    cursor: pointer;
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.project-mini-card:hover {
    transform: translateY(-4px);
    border-color: var(--red-fage);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.06);
}

.mini-code {
    font-size: 0.7rem;
    font-weight: 800;
    color: var(--red-fage);
    letter-spacing: 1px;
    margin-bottom: 8px;
    display: block;
}

.project-mini-card h3 {
    font-size: 0.92rem;
    font-weight: 800;
    color: var(--text-dark);
    line-height: 1.35;
    margin-bottom: 8px;
}

.mini-loc {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-bottom: 12px;
}

.mini-link {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--red-fage);
    display: flex;
    align-items: center;
    gap: 6px;
}

/* MODAL DE FICHA TÉCNICA */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(6px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.modal-card {
    background: #ffffff;
    border-radius: 20px;
    padding: 35px 40px;
    max-width: 550px;
    width: 90%;
    position: relative;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.2);
    transform: translateY(20px);
    transition: transform 0.3s ease;
}

.modal-overlay.active .modal-card {
    transform: translateY(0);
}

.modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: none;
    border: none;
    font-size: 1.2rem;
    color: var(--text-muted);
    cursor: pointer;
}

.modal-badge {
    font-size: 0.75rem;
    font-weight: 800;
    color: var(--red-fage);
    background: rgba(229, 9, 20, 0.08);
    padding: 4px 12px;
    border-radius: 10px;
    display: inline-block;
    margin-bottom: 12px;
}

.modal-card h2 {
    font-size: 1.25rem;
    font-weight: 900;
    color: var(--text-dark);
    margin-bottom: 12px;
    line-height: 1.3;
}

.modal-meta p {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.red-icon {
    color: var(--red-fage);
}

.modal-divider {
    border: none;
    height: 1px;
    background: var(--card-border);
    margin: 18px 0;
}

.modal-desc {
    font-size: 0.9rem;
    line-height: 1.6;
    color: var(--text-dark);
    margin-bottom: 25px;
}

.modal-footer {
    text-align: center;
}

/* ==========================================
   REGLAS RESPONSIVAS
   ========================================== */

@media (max-width: 900px) {
    .top-nav {
        display: none;
    }

    .nav-toggle {
        display: flex;
    }

    .btn-header-cta {
        display: none;
    }

    .acc-header {
        padding: 16px 20px;
    }

    .acc-title-wrap {
        gap: 12px;
    }

    .acc-icon {
        width: 40px;
        height: 40px;
        font-size: 1.1rem;
    }

    .acc-title-wrap h2 {
        font-size: 1rem;
    }

    .badge-count {
        display: none; /* Oculta la etiqueta de cantidad en pantallas pequeñas para ahorrar espacio */
    }
}

@media (max-width: 480px) {
    .proyectos-container {
        padding-top: 100px;
    }

    .projects-mini-grid {
        padding: 15px;
        grid-template-columns: 1fr;
    }

    .modal-card {
        padding: 25px 20px;
    }
}