/* Menú principal del sitio (templates/snippets/navbar.html). Se usa en todo el sitio y en las mini apps:
   por eso vive en un archivo y no dentro del HTML (las mini apps no permiten estilos en línea). */
    /* ========== VARIABLES ========== */
    :root {
        --primary-dark: #1a1f3a;
        --card-bg: #242945;
        --card-border: rgba(255, 255, 255, 0.1);
        --text-primary: #ffffff;
        --text-secondary: #a0aec0;
        --accent-cyan: #00d4ff;
        --accent-teal: #00ffa3;
        --transition: all 0.3s ease;
    }

    /* ========== HEADER ========== */
    .headers {
        display: block; /* <headers> no es una etiqueta HTML conocida: sin esto se comporta como texto */
        align-self: stretch; /* en páginas cuyo body es flex, ocupa todo el ancho */
        background: rgba(26, 31, 58, 0.95);
        backdrop-filter: blur(10px);
        padding: 1rem 2rem;
        position: sticky;
        top: 0;
        z-index: 1000;
        border-bottom: 1px solid var(--card-border);
        /* Misma letra en todas las páginas: el menú no cambia según la fuente de cada una */
        font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
        line-height: 1.4;
    }

    .headers-container {
        max-width: 1400px;
        margin: 0 auto;
        display: flex;
        justify-content: space-between;
        align-items: center;
    }
    .logo {
        font-size: 1.5rem;
        font-weight: 700;
        color: var(--accent-cyan);
        text-decoration: none;
        display: flex;
        align-items: center;
        gap: 0.5rem;
    }

    .logo-icon {
        width: 32px;
        height: 32px;
        background: linear-gradient(135deg, var(--accent-cyan), var(--accent-teal));
        border-radius: 8px;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 1rem;
        color: var(--primary-dark);
    }
    .navs {
        display: flex;
        gap: clamp(1rem, 1.5vw, 2rem);
        align-items: center;
    }
    .logo { flex-shrink: 0; margin-right: 1.5rem; white-space: nowrap; }

    .navs a {
        color: var(--text-secondary);
        text-decoration: none;
        font-weight: 500;
        transition: var(--transition);
        font-size: 0.95rem;
        position: relative;
        white-space: nowrap; /* "Alquiler Herramientas" no se parte en dos renglones */
    }

    .navs a:hover {
        color: var(--accent-cyan);
    }
    .ctas-buttons {
        background: linear-gradient(135deg, var(--accent-cyan), var(--accent-teal));
        color: var(--primary-dark);
        padding: 0.7rem 1.5rem;
        border-radius: 8px;
        text-decoration: none;
        font-weight: 600;
        transition: var(--transition);
        border: none;
        cursor: pointer;
        font-size: 0.95rem;
        white-space: nowrap;
    }

    /* .navs a pisaba el color del botón y el texto quedaba casi invisible sobre el degradé */
    .navs a.ctas-buttons {
        color: var(--primary-dark);
    }

    .ctas-buttons:hover {
        transform: translateY(-2px);
        box-shadow: 0 8px 20px rgba(0, 212, 255, 0.3);
        color: var(--primary-dark);
    }

    /* Dropdown Menu Styles */
    .nav-item-dropdown {
        position: relative;
    }

    .dropdown-toggle {
        display: flex;
        align-items: center;
        gap: 0.3rem;
        cursor: pointer;
    }
    .dropdown-menu-modern {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        margin-top: 0.5rem;
        background: rgba(36, 41, 69, 0.98);
        backdrop-filter: blur(10px);
        border: 1px solid var(--card-border);
        border-radius: 12px;
        min-width: 220px;
        padding: 0.5rem 0;
        box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    }

    .nav-item-dropdown:hover .dropdown-menu-modern {
        display: block;
    }

    .dropdown-menu-modern a {
        display: block;
        padding: 0.7rem 1.2rem;
        color: var(--text-secondary);
        transition: var(--transition);
        border-left: 3px solid transparent;
    }

    .dropdown-menu-modern a:hover {
        background: rgba(0, 212, 255, 0.1);
        border-left-color: var(--accent-cyan);
        color: var(--text-primary);
    }
    .user-avatar {
        width: 40px;
        height: 40px;
        border-radius: 50%;
        border: 2px solid var(--accent-cyan);
        object-fit: cover;
    }

    .logout-buttons {
        background: rgba(255, 59, 48, 0.2);
        color: #ff3b30;
        padding: 0.6rem 1.2rem;
        border-radius: 8px;
        text-decoration: none;
        font-weight: 500;
        transition: var(--transition);
        font-size: 0.9rem;
    }

    .logout-buttons:hover {
        background: rgba(255, 59, 48, 0.3);
        color: #ff3b30;
    }

    .menu-toggle {
        display: none;
        background: none;
        border: none;
        color: var(--text-primary);
        font-size: 1.5rem;
        cursor: pointer;
    }
    /* Mobile Responsive */
    @media (max-width: 1200px) {
        .headers {
            padding: 0.75rem 1rem;
        }

        /* Antes apuntaba a .nav, que no existe: en el celular el menú no se ocultaba y desbordaba la pantalla. */
        .navs {
            display: none;
            position: absolute;
            top: 100%;
            left: 0;
            right: 0;
            background: #1a1f3a; /* opaco: con transparencia, el texto de la página se veía a través del menú abierto */
            box-shadow: 0 18px 30px -12px rgba(0, 0, 0, .6);
            flex-direction: column;
            padding: 2rem;
            gap: 1rem;
            border-bottom: 1px solid var(--card-border);
        }

        .navs.active {
            display: flex;
            align-items: stretch;
            max-height: calc(100vh - 70px);
            overflow-y: auto;
        }

        .menu-toggle {
            display: block;
        }

        .dropdown-menu-modern {
            position: static;
            box-shadow: none;
            border: none;
            margin-top: 0.5rem;
            padding-left: 1rem;
        }

        .nav-item-dropdown:hover .dropdown-menu-modern {
            display: none;
        }
        .nav-item-dropdown.active .dropdown-menu-modern {
            display: block;
        }
    }

    .dropdown-toggle .flecha { font-size: .75em; opacity: .8; }
    .dropdown-menu-modern { z-index: 1001; }
    .dropdown-menu-modern.derecha { left: auto; right: 0; }
    .dropdown-menu-modern small { display: block; font-size: .75rem; opacity: .7; }
    .dropdown-menu-modern a.salir { color: #ff8a80; border-top: 1px solid var(--card-border); margin-top: .3rem; }
    /* El desplegable no se cierra al bajar el mouse desde el botón */
    .nav-item-dropdown::after { content: ""; position: absolute; left: 0; right: 0; top: 100%; height: .6rem; }
    /* Página actual */
    .navs a.actual, .navs .nav-item-dropdown.actual > a { color: var(--accent-cyan); }
    .navs > a.actual:not(.ctas-buttons)::after, .navs .nav-item-dropdown.actual > a::after {
        content: ""; position: absolute; left: 0; right: 0; bottom: -8px; height: 2px; border-radius: 2px; background: var(--accent-cyan); }
    .navs a.ctas-buttons.actual { color: var(--primary-dark); }
    .navs .dropdown-toggle { position: relative; }
    /* Botón de WhatsApp siempre a la vista */
    .wa-nav { display: inline-flex; align-items: center; gap: .4rem; margin-left: 1rem; padding: .55rem .9rem; border-radius: 999px;
        background: #25d366; color: #06210f; font-weight: 700; font-size: .9rem; text-decoration: none; white-space: nowrap; flex-shrink: 0; }
    .wa-nav:hover { color: #06210f; text-decoration: none; box-shadow: 0 6px 18px rgba(37,211,102,.35); }
    @media (max-width: 1200px) {
        .wa-nav { margin-left: auto; margin-right: .75rem; padding: .5rem .7rem; }
        .navs .nav-item-dropdown.actual > a::after, .navs > a.actual::after { display: none; }
        .nav-item-dropdown::after { display: none; }
    }
    /* Bootstrap le agrega su propia flecha a .dropdown-toggle: se usa solo la nuestra */
    .navs .dropdown-toggle::after { content: none; border: 0; margin: 0; }
    @media (max-width: 1200px) {
        .headers-container { gap: .25rem; }
        .logo { margin-right: .5rem; font-size: 1.25rem; min-width: 0; }
        .menu-toggle { flex-shrink: 0; padding: 0 .25rem; }
    }
    @media (max-width: 480px) { .wa-nav span { display: none; } .wa-nav { padding: .55rem; } }

    /* Print styles */
    @media print {
        .headers {
            display: none;
        }
    }

/* Páginas con estilos propios para los enlaces (por ejemplo, las mini apps: ".mini a"): el menú mantiene sus colores. */
.headers a.wa-nav, .headers a.wa-nav:hover { color: #06210f; }
.headers a.logo { color: var(--accent-cyan); }
