/**
 * HEADER.CSS — nws Web Agency
 * Desktop header, mobile header, mega menus, burger, drawer
 * Breakpoints: 768px (tablet), 1024px (desktop)
 */

/* ============================================================
   CSS VARIABLES (header-specific)
   ============================================================ */
:root {
    --header-height: 70px;
    --header-height-mobile: 64px;
    /* Header white, identic cu nws.ro live */
    --header-bg: #ffffff;
    --header-border: #e5e7eb; /* Doar linia separatoare */
    --header-shadow: none; /* Fără umbră, doar border! */
    --header-shadow-scroll: 0 4px 20px rgba(0, 0, 0, 0.12);
    --nav-link-color: #0A0D31;
    --nav-link-hover: var(--nws-primary, #010ED0);
    --nav-link-size: 16px;
    --nav-link-weight: 500;
    --mega-shadow: 0 20px 60px rgba(0, 0, 0, 0.12), 0 4px 16px rgba(0, 0, 0, 0.06);
    --mega-bg: #ffffff;
    --mega-border: rgba(0, 0, 0, 0.06);
    --drawer-width: 320px;
    --drawer-bg: #ffffff;
    --drawer-overlay-bg: rgba(0, 0, 0, 0.5);
    --transition-fast: 200ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-medium: 300ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 400ms cubic-bezier(0.16, 1, 0.3, 1);
}

/* Dark mode overrides */
[data-theme="dark"] {
    --header-bg: #0d0d0d;
    --header-border: rgba(255, 255, 255, 0.08);
    --header-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
    --header-shadow-scroll: 0 4px 20px rgba(0, 0, 0, 0.3);
    --nav-link-color: #e5e5e5;
    --mega-bg: #141414;
    --mega-shadow: 0 20px 60px rgba(0, 0, 0, 0.4), 0 4px 16px rgba(0, 0, 0, 0.2);
    --mega-border: rgba(255, 255, 255, 0.06);
    --drawer-bg: #141414;
    --drawer-overlay-bg: rgba(0, 0, 0, 0.7);
}

/* Logo swap: light ↔ dark mode */
.logo-dark-mode { display: none !important; }
.logo-light { display: block !important; }

[data-theme="dark"] .logo-light { display: none !important; }
[data-theme="dark"] .logo-dark-mode { display: block !important; }

/* Iconițe temă: soare/lună — vizibilitate ── */
.icon-sun { display: none; }
[data-theme="dark"] .icon-sun { display: block; }
[data-theme="dark"] .icon-moon { display: none; }

/* ============================================================
   SKIP LINK (accessibility)
   ============================================================ */
.skip-link {
    position: absolute;
    top: -100%;
    left: 16px;
    z-index: 10000;
    padding: 8px 16px;
    background: var(--nws-primary, #010ED0);
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    border-radius: var(--radius, 4px);
    transition: top var(--transition-fast);
}

.skip-link:focus {
    top: 8px;
}

/* ============================================================
   TOP BAR — Banda albastră superioară (identic nws.ro)
   ============================================================ */
.top-bar {
    width: 100%;
    display: flex;
    min-height: 15px;
    background-color: var(--nws-primary, #010ED0);
}

/* ============================================================
   DESKTOP HEADER
   ============================================================ */
.site-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: var(--header-bg);
    /* Inlocuim border-ul cu inset shadow pentru a elimina acel 1px in afara containerului care fura hover-ul! */
    box-shadow: inset 0 -1px 0 var(--header-border);
    transition: box-shadow var(--transition-medium);
}

/* Scrolled state — JS adds .is-scrolled */
.site-header.is-scrolled {
    box-shadow: var(--header-shadow-scroll);
}

.header-container {
    display: flex;
    align-items: center;
    max-width: var(--container-max, 1330px);
    height: var(--header-height); /* Înălțime fixă exactă, nu min-height */
    margin: 0 auto;
    padding: 0 30px;
}

/* Logo - 25% match Elementor col-25 */
.header-logo {
    flex: 0 0 25%;
    max-width: 25%;
    display: flex;
    align-items: center;
}

.header-logo a {
    display: flex;
    align-items: center;
    text-decoration: none;
}

.header-logo__img {
    height: 42px;
    width: auto;
    display: block;
}

@media (max-width: 1023px) {
    .header-logo {
        flex: 0 0 auto;
        max-width: none;
    }
    .header-logo__img {
        height: 36px;
        object-fit: contain;
    }
}

/* Nav — preia 50% din spațiu (col-50 Elementor) */
.header-nav {
    flex: 0 0 50%;
    max-width: 50%;
    display: flex;
    justify-content: center;
    height: 100%;
}

.nav-menu {
    display: flex;
    align-items: stretch;
    height: 100%;
    gap: 40px;
    list-style: none;
    margin: 0;
    padding: 0;
}
.nav-menu > li {
    display: flex;
    align-items: center;
    height: 100%; /* Esențial! */
}

.nav-menu > li > a {
    display: flex;
    align-items: center;
    height: 100%; /* Acopera 100% din inaltime, fara gauri */
    gap: 4px;
    padding: 0 5px; /* Padding stanga/dreapta pt text */
    font-size: var(--nav-link-size);
    font-weight: var(--nav-link-weight);
    font-family: 'Inter Tight', sans-serif;
    line-height: 1.2em;
    color: var(--nav-link-color);
    text-decoration: none;
    border-radius: var(--radius, 4px);
    position: relative;
    transition: color var(--transition-fast), background var(--transition-fast);
    white-space: nowrap;
}

.nav-menu > li > a:hover,
.nav-menu > li > a:focus-visible {
    color: var(--nav-link-hover);
}

/* Active link underline */
.nav-menu > li.active > a,
.nav-menu > li > a.active {
    color: var(--nav-link-hover);
}

.nav-menu > li.active > a::after,
.nav-menu > li > a.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 16px;
    right: 16px;
    height: 2px;
    background: var(--nws-primary, #010ED0);
    border-radius: 2px 2px 0 0;
}

/* Caret icon */
.nav-caret {
    transition: transform var(--transition-fast);
    flex-shrink: 0;
}

.has-mega-menu.is-open .nav-caret {
    transform: rotate(180deg);
}

/* CTA area - 25% match Elementor col-25 */
.header-cta {
    flex: 0 0 25%;
    max-width: 25%;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
}

/* Theme toggle button */
.header-theme-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: none;
    border: 1px solid rgba(0, 0, 0, 0.15);
    border-radius: 4px;
    cursor: pointer;
    color: var(--nav-link-color);
    transition: background var(--transition-fast), color var(--transition-fast), border-color var(--transition-fast);
}

.header-theme-toggle:hover {
    background: rgba(1, 14, 208, 0.06);
    border-color: var(--nws-primary, #010ED0);
    color: var(--nws-primary, #010ED0);
}

[data-theme="dark"] .header-theme-toggle .icon-moon { display: none; }
[data-theme="dark"] .header-theme-toggle .icon-sun { display: block !important; }

/* Primary button */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 28px;
    font-size: 14px;
    font-weight: 600;
    font-family: var(--font-body, 'Inter', sans-serif);
    text-decoration: none;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background var(--transition-fast), color var(--transition-fast), transform var(--transition-fast), box-shadow var(--transition-fast);
    white-space: nowrap;
}

.btn-primary {
    background: var(--nws-primary, #010ED0);
    color: #ffffff;
}

.btn-primary:hover {
    background: var(--nws-btn-hover, #242627);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-outline-primary {
    background: transparent;
    color: var(--nws-primary, #010ED0);
    border: 1.5px solid var(--nws-primary, #010ED0);
}

.btn-outline-primary:hover {
    background: var(--nws-primary, #010ED0);
    color: #fff;
}

.btn-sm {
    padding: 7px 16px;
    font-size: 13px;
}

/* Hide desktop header on mobile */
@media (max-width: 1023px) {
    .site-header { display: none; }
}

/* ============================================================
   MEGA MENU OVERLAY
   ============================================================ */
.mega-menu-overlay {
    position: fixed;
    inset: 0;
    z-index: 998;
    background: transparent;
    pointer-events: none;
    opacity: 0;
    transition: opacity var(--transition-medium);
}

.mega-menu-overlay.is-active {
    pointer-events: auto;
    opacity: 1;
}

/* ============================================================
   MEGA MENU PANELS
   ============================================================ */
.mega-menu {
    position: absolute;
    top: var(--header-height);
    left: 0;
    right: 0;
    z-index: 999;
    background: var(--mega-bg);
    border-top: 1px solid var(--mega-border);
    box-shadow: var(--mega-shadow);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: opacity var(--transition-medium), transform var(--transition-medium), visibility 0s var(--transition-medium);
    pointer-events: none;
}

.mega-menu.is-open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
    transition: opacity var(--transition-medium), transform var(--transition-medium), visibility 0s 0s;
}

.mega-menu__container {
    max-width: var(--max-width, 1280px);
    margin: 0 auto;
    padding: 32px var(--sp-24, 24px) 40px;
}

/* 3-column grid */
.mega-menu__grid--3col {
    display: grid;
    grid-template-columns: 1.2fr 1fr 1fr;
    gap: 40px;
}

/* Column titles */
.mega-menu__col-title {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--nws-text-muted, #6b7280);
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--mega-border);
}

/* ============================================================
   MEGA MENU — SERVICE CARDS (Col 1)
   ============================================================ */
.mega-service-card {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 10px 12px;
    margin: 0 -12px;
    text-decoration: none;
    border-radius: var(--radius, 4px);
    transition: background var(--transition-fast);
}

.mega-service-card:hover {
    background: rgba(1, 14, 208, 0.04);
}

[data-theme="dark"] .mega-service-card:hover {
    background: rgba(255, 255, 255, 0.04);
}

.mega-service-card__icon {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: rgba(1, 14, 208, 0.06);
    border-radius: 8px;
    color: var(--nws-primary, #010ED0);
    transition: background var(--transition-fast), color var(--transition-fast);
}

.mega-service-card:hover .mega-service-card__icon {
    background: var(--nws-primary, #010ED0);
    color: #ffffff;
}

.mega-service-card__text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.mega-service-card__name {
    font-size: 14px;
    font-weight: 600;
    color: var(--nws-text, #1a1a1a);
    transition: color var(--transition-fast);
}

.mega-service-card:hover .mega-service-card__name {
    color: var(--nws-primary, #010ED0);
}

.mega-service-card__desc {
    font-size: 12px;
    color: var(--nws-text-muted, #6b7280);
    line-height: 1.4;
}

/* ============================================================
   MEGA MENU — POPULAR LINKS (Col 2)
   ============================================================ */
.mega-menu__links {
    list-style: none;
    margin: 0;
    padding: 0;
}

.mega-menu__links li {
    margin-bottom: 4px;
}

.mega-menu__links a {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 0;
    font-size: 14px;
    font-weight: 500;
    color: var(--nws-text, #1a1a1a);
    text-decoration: none;
    transition: color var(--transition-fast);
}

.mega-menu__links a:hover {
    color: var(--nws-primary, #010ED0);
}

.mega-menu__links a svg {
    color: var(--nws-text-muted, #6b7280);
    transition: color var(--transition-fast), transform var(--transition-fast);
    flex-shrink: 0;
}

.mega-menu__links a:hover svg {
    color: var(--nws-primary, #010ED0);
    transform: translateX(3px);
}

.mega-menu__tagline {
    margin-top: 16px;
    padding: 12px 16px;
    background: rgba(1, 14, 208, 0.04);
    border-radius: var(--radius, 4px);
    font-size: 13px;
    font-weight: 500;
    color: var(--nws-text-muted, #6b7280);
    border-left: 3px solid var(--nws-primary, #010ED0);
}

[data-theme="dark"] .mega-menu__tagline {
    background: rgba(255, 255, 255, 0.03);
}

.mega-menu__view-all {
    display: inline-flex;
    align-items: center;
    margin-top: 12px;
    font-size: 13px;
    font-weight: 600;
    color: var(--nws-primary, #010ED0);
    text-decoration: none;
    transition: gap var(--transition-fast);
}

.mega-menu__view-all:hover {
    text-decoration: underline;
}

/* ============================================================
   MEGA MENU — PLATFORM CARDS (Col 3)
   ============================================================ */
.mega-menu__col-desc {
    font-size: 13px;
    color: var(--nws-text-muted, #6b7280);
    margin-bottom: 16px;
}

.mega-platform-cards {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.mega-platform-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background: rgba(1, 14, 208, 0.03);
    border: 1px solid var(--mega-border);
    border-radius: 8px;
    text-decoration: none;
    transition: background var(--transition-fast), border-color var(--transition-fast), transform var(--transition-fast);
}

.mega-platform-card:hover {
    background: rgba(1, 14, 208, 0.06);
    border-color: var(--nws-primary, #010ED0);
    transform: translateY(-1px);
}

[data-theme="dark"] .mega-platform-card {
    background: rgba(255, 255, 255, 0.03);
}

[data-theme="dark"] .mega-platform-card:hover {
    background: rgba(255, 255, 255, 0.06);
}

.mega-platform-card__icon {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: var(--nws-primary, #010ED0);
    color: #fff;
    border-radius: 8px;
}

.mega-platform-card__text {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 0;
}

.mega-platform-card__name {
    font-size: 14px;
    font-weight: 600;
    color: var(--nws-text, #1a1a1a);
}

.mega-platform-card__desc {
    font-size: 12px;
    color: var(--nws-text-muted, #6b7280);
}

.mega-platform-card__arrow {
    flex-shrink: 0;
    color: var(--nws-text-muted, #6b7280);
    transition: color var(--transition-fast), transform var(--transition-fast);
}

.mega-platform-card:hover .mega-platform-card__arrow {
    color: var(--nws-primary, #010ED0);
    transform: translate(2px, -2px);
}

/* ============================================================
   MEGA MENU — INFRA: Intro heading (Col 1)
   ============================================================ */
.mega-menu__heading {
    font-family: var(--font-heading, 'Inter Tight', sans-serif);
    font-size: 24px;
    font-weight: 700;
    line-height: 1.3;
    color: var(--nws-text, #1a1a1a);
    margin-bottom: 12px;
}

.mega-menu__intro-text {
    font-size: 14px;
    line-height: 1.6;
    color: var(--nws-text-muted, #6b7280);
    margin-bottom: 20px;
}

/* ============================================================
   MEGA MENU — INFRA: Nav items (Col 2)
   ============================================================ */
.mega-menu__nav-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.mega-nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 0;
    font-size: 14px;
    font-weight: 500;
    color: var(--nws-text, #1a1a1a);
    text-decoration: none;
    border-bottom: 1px solid var(--mega-border);
    transition: color var(--transition-fast);
}

.mega-nav-item:hover {
    color: var(--nws-primary, #010ED0);
}

.mega-nav-item svg {
    color: var(--nws-text-muted, #6b7280);
    transition: color var(--transition-fast);
}

.mega-nav-item:hover svg {
    color: var(--nws-primary, #010ED0);
}

.mega-menu__nav-list li:last-child .mega-nav-item {
    border-bottom: none;
}

/* ============================================================
   MEGA MENU — INFRA: Certifications (Col 3)
   ============================================================ */
.mega-menu__cert-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.mega-cert-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 0;
    font-size: 14px;
    font-weight: 500;
    color: var(--nws-text, #1a1a1a);
    border-bottom: 1px solid var(--mega-border);
}

.mega-cert-item:last-child {
    border-bottom: none;
}

.mega-cert-item svg {
    flex-shrink: 0;
}

/* Hide mega menus on mobile */
@media (max-width: 1023px) {
    .mega-menu,
    .mega-menu-overlay { display: none; }
}

/* ============================================================
   MOBILE HEADER
   ============================================================ */
.mobile-header {
    display: none;
    position: sticky;
    top: 0;
    z-index: 1000;
    background: var(--header-bg);
    border-bottom: 1px solid var(--header-border);
    box-shadow: var(--header-shadow);
    transition: box-shadow var(--transition-medium);
}

.mobile-header.is-scrolled {
    box-shadow: var(--header-shadow-scroll);
}

@media (max-width: 1023px) {
    .mobile-header { display: block; }
}

.mobile-header-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: var(--header-height-mobile);
    padding: 0 16px;
    max-width: var(--max-width, 1280px);
    margin: 0 auto;
}

.mobile-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* ============================================================
   BURGER BUTTON
   ============================================================ */
.burger-btn {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    width: 40px;
    height: 40px;
    padding: 8px;
    background: none;
    border: 1px solid var(--header-border);
    border-radius: var(--radius, 4px);
    cursor: pointer;
    transition: border-color var(--transition-fast);
}

.burger-btn:hover {
    border-color: var(--nws-primary, #010ED0);
}

.burger-btn span {
    display: block;
    width: 20px;
    height: 2px;
    background: var(--nav-link-color);
    border-radius: 2px;
    transition: transform var(--transition-medium), opacity var(--transition-medium);
    transform-origin: center;
}

/* Burger → X animation */
.burger-btn.is-active span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.burger-btn.is-active span:nth-child(2) {
    opacity: 0;
    transform: scaleX(0);
}

.burger-btn.is-active span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* ============================================================
   MOBILE DRAWER
   ============================================================ */
.mobile-drawer {
    position: fixed;
    inset: 0;
    z-index: 2000;
    pointer-events: none;
    visibility: hidden;
}

.mobile-drawer.is-open {
    pointer-events: auto;
    visibility: visible;
}

/* Overlay backdrop */
.drawer-overlay {
    position: absolute;
    inset: 0;
    background: var(--drawer-overlay-bg);
    opacity: 0;
    transition: opacity var(--transition-medium);
}

.mobile-drawer.is-open .drawer-overlay {
    opacity: 1;
}

/* Panel */
.drawer-panel {
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    width: var(--drawer-width);
    max-width: 85vw;
    background: var(--drawer-bg);
    box-shadow: 4px 0 30px rgba(0, 0, 0, 0.15);
    transform: translateX(-100%);
    transition: transform var(--transition-slow);
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
}

.mobile-drawer.is-open .drawer-panel {
    transform: translateX(0);
}

/* Drawer header */
.drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--header-border);
}

.drawer-header img {
    height: 36px;
    width: auto;
}

.drawer-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: none;
    border: 1px solid var(--header-border);
    border-radius: var(--radius, 4px);
    cursor: pointer;
    color: var(--nav-link-color);
    transition: background var(--transition-fast), border-color var(--transition-fast);
}

.drawer-close:hover {
    background: rgba(239, 68, 68, 0.06);
    border-color: #ef4444;
    color: #ef4444;
}

/* Drawer navigation */
.drawer-nav {
    padding: 8px 0;
}

/* Drawer section (accordion) */
.drawer-section {
    border-bottom: 1px solid var(--header-border);
}

.drawer-section-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 14px 20px;
    font-size: 15px;
    font-weight: 600;
    color: var(--nws-text, #1a1a1a);
    background: none;
    border: none;
    cursor: pointer;
    text-align: left;
    font-family: var(--font-body, 'Inter', sans-serif);
    transition: color var(--transition-fast);
}

.drawer-section-title:hover {
    color: var(--nws-primary, #010ED0);
}

.drawer-chevron {
    transition: transform var(--transition-fast);
    flex-shrink: 0;
    color: var(--nws-text-muted, #6b7280);
}

.drawer-section-title[aria-expanded="true"] .drawer-chevron {
    transform: rotate(180deg);
}

/* Drawer submenu (collapsed by default) */
.drawer-submenu {
    list-style: none;
    margin: 0;
    padding: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height var(--transition-slow), padding var(--transition-medium);
}

.drawer-submenu.is-open {
    max-height: 600px;
    padding-bottom: 8px;
}

.drawer-submenu li a {
    display: block;
    padding: 10px 20px 10px 36px;
    font-size: 14px;
    font-weight: 400;
    color: var(--nws-text-muted, #6b7280);
    text-decoration: none;
    transition: color var(--transition-fast), background var(--transition-fast), padding-left var(--transition-fast);
}

.drawer-submenu li a:hover {
    color: var(--nws-primary, #010ED0);
    background: rgba(1, 14, 208, 0.03);
    padding-left: 40px;
}

.drawer-submenu li.view-all a {
    font-weight: 600;
    color: var(--nws-primary, #010ED0);
}

/* Direct drawer links */
.drawer-link {
    display: block;
    padding: 14px 20px;
    font-size: 15px;
    font-weight: 600;
    color: var(--nws-text, #1a1a1a);
    text-decoration: none;
    border-bottom: 1px solid var(--header-border);
    transition: color var(--transition-fast), background var(--transition-fast);
}

.drawer-link:hover {
    color: var(--nws-primary, #010ED0);
    background: rgba(1, 14, 208, 0.03);
}

/* Drawer platforms */
.drawer-section--platforms {
    padding: 16px 20px;
}

.drawer-section-label {
    display: block;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--nws-text-muted, #6b7280);
    margin-bottom: 10px;
}

.drawer-platforms {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.drawer-platform-link {
    display: block;
    padding: 10px 14px;
    font-size: 13px;
    font-weight: 600;
    color: var(--nws-primary, #010ED0);
    text-decoration: none;
    background: rgba(1, 14, 208, 0.04);
    border-radius: var(--radius, 4px);
    transition: background var(--transition-fast);
}

.drawer-platform-link:hover {
    background: rgba(1, 14, 208, 0.08);
}

/* Hide drawer on desktop */
@media (min-width: 1024px) {
    .mobile-drawer { display: none; }
}

/* Body scroll lock when drawer is open */
body.drawer-open {
    overflow: hidden;
}

/* ============================================================
   RESPONSIVE FINE-TUNING
   ============================================================ */

/* Tablet adjustments */
@media (max-width: 768px) {
    .mobile-header-container {
        padding: 0 12px;
    }

    .btn-sm {
        padding: 6px 12px;
        font-size: 12px;
    }

    .drawer-panel {
        width: 280px;
    }
}

/* Narrow mega menu for smaller desktops */
@media (min-width: 1024px) and (max-width: 1200px) {
    .mega-menu__grid--3col {
        gap: 24px;
    }

    .nav-menu > li > a {
        padding: 8px 10px;
        font-size: 13px;
    }

    .header-logo__img {
        height: 38px;
    }
}

/* Mega menu is full-width (left 0, right 0) of the site header */
.mega-menu {
    position: absolute;
    top: 77px; /* Ajustat la 77px la cererea utilizatorului */
    left: 0;
    right: 0;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease-in-out;
    background: transparent;
    z-index: 110;
}

/* Folosim strict clasa activată din JavaScript, pentru a preveni bug-urile CSS */
.has-mega-menu.js-mega-active .mega-menu {
    opacity: 1;
    visibility: visible;
    pointer-events: auto; /* ESENȚIAL: suprascrie pointer-events: none de la linia 338! */
}

.mega-menu-inner {
    display: flex;
    width: 100%;
    max-width: var(--container-max, 1330px);
    margin: 0 auto;
    padding: 0;
    text-align: left;
    background: transparent;
    border-radius: 0 0 16px 16px; /* Doar pentru mijloc dacă e cazul */
}

/* Base column styles */
.mega-col {
    padding: 35px 30px;
    background: var(--mega-bg); /* Background-ul principal e pe coloane acum */
    position: relative;
}

/* Coloana stanga */
.mega-col-services {
    flex: 0 0 30%;
    border-right: 1px solid var(--nws-border); /* Bara subtire despartitoare */
}

/* Extinde backgroundul alb în stânga la infinit (dincolo de container) */
.mega-col-services::before {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    right: 100%;
    width: 50vw;
    background: var(--mega-bg);
}


/* Coloana centru */
.mega-col-popular {
    flex: 0 0 41%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    border-right: 1px solid var(--nws-border); /* Bara subtire despartitoare */
}

/* Coloana dreapta */
.mega-col-clients {
    flex: 0 0 29%;
    background: var(--nws-surface-2); /* Culoarea exactă din devtools */
}

/* Extinde backgroundul gri în dreapta la infinit */
.mega-col-clients::after {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    left: 100%;
    width: 50vw;
    background: var(--nws-surface-2);
}

/* Lista servicii stanga */
.mega-services-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.mega-link {
    display: flex;
    align-items: flex-start;
    text-decoration: none;
}

.mega-icon {
    width: 22px;
    height: 22px;
    margin-top: 2px;
    flex-shrink: 0;
    transition: transform 0.2s;
}

.mega-link:hover .mega-icon {
    transform: translateX(3px);
}

.mega-link-text {
    margin-left: 16px;
}

.mega-title {
    display: block;
    font-size: 18px; /* Cerut de user */
    font-family: 'Lato', sans-serif;
    font-weight: 400; /* Cerut de user */
    color: var(--nws-text); /* Actualizat din live */
    transition: color 0.2s;
    line-height: 1.1em;
    letter-spacing: -0.2px;
}

.mega-link:hover .mega-title {
    color: #2563eb;
}

.mega-desc {
    display: block;
    font-size: 16px; /* Actualizat din live (era 13px) */
    font-family: 'Lato', sans-serif;
    color: var(--nws-text-soft);
    margin-top: 0px; /* Redus de la 4px pentru a fi lipit ca pe live */
    font-weight: 400;
    line-height: 1.3em;
}

/* Titluri coloane */
.mega-col-title {
    font-size: 24px; /* Actualizat din live (era 20px) */
    font-family: 'Lato', sans-serif;
    font-weight: 600;
    color: var(--nws-text);
    margin-bottom: 24px;
    margin-top: 0;
    letter-spacing: normal;
}

.mega-col-title strong {
    font-weight: 700;
}

/* Grid carduri populare */
.mega-popular-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr); /* Cate 2 boxuri pe rand distribuite egal */
    grid-auto-rows: 1fr; /* TOATE boxurile vor lua înălțimea celui mai mare dintre ele, fiind absolut egale */
    gap: 12px;
}

.popular-card {
    border: 1px solid var(--nws-border); /* conform var accent 7 pe live */
    border-radius: 6px;
    width: 100%; /* Lățime egală bazată pe grid */
    max-width: 215px; /* Din CSS-ul Live */
    height: 100%; /* Înălțime forțată la fel pentru toate */
    padding: 10px 20px 20px 20px; /* Padding-ul exact din Live */
    display: flex;
    flex-direction: column;
    align-items: flex-start; /* Aliniem la stânga conform Live .elementor-cta__content text-align:start */
    justify-content: flex-start;
    background: var(--nws-surface);
    text-decoration: none;
    transition: all 0.3s;
    margin: 0;
    box-sizing: border-box; /* Prevenim padding-ul să strice gridul */
}

.popular-card:hover {
    border-color: #3b82f6;
    box-shadow: var(--shadow-sm);
}

.popular-icon {
    width: 46px; /* conform SVG width pe live */
    height: auto;
    margin-bottom: 14px; /* Fix din css live */
    transition: transform 0.3s;
}

.popular-card:hover .popular-icon {
    transform: scale(1.05);
}

.popular-title {
    font-size: 16px; /* Pe live este 16px */
    font-family: 'Lato', sans-serif;
    font-weight: 500; /* Pe live nu e bold pronunțat */
    color: var(--nws-text-soft); /* Culoare font-live */
    text-align: left; /* Text la stanga */
    line-height: 1.1em;
    transition: color 0.3s;
}

.popular-card:hover .popular-title {
    color: #2563eb;
}

/* Footer centru */
.mega-popular-footer {
    margin-top: 32px;
    text-align: center;
    margin-bottom: 4px;
}

.mega-popular-footer p {
    font-size: 16px;
    font-weight: 500;
    color: #3b82f6;
    margin: 0;
}

.mega-popular-footer a {
    font-weight: 700;
    color: #f59e0b;
    text-decoration: none;
}

.mega-popular-footer a:hover {
    text-decoration: underline;
}

/* Dreapta clienti */
.mega-col-clients .mega-col-title {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 4px;
}

.mega-col-clients .mega-col-title span {
    font-weight: 400;
    color: #4b5563;
}

.mega-clients-desc {
    font-size: 16px; /* Din live CSS */
    font-family: 'Lato', sans-serif;
    color: var(--nws-text-soft);
    margin-top: 0;
    margin-bottom: 32px;
    font-weight: 400;
    line-height: 1.3em;
}

.mega-login-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.login-link {
    display: flex;
    align-items: center;
    text-decoration: none;
}

.login-icon-box {
    background: #dbeafe;
    padding: 12px;
    border-radius: 12px;
    transition: all 0.2s;
    flex-shrink: 0;
}

.login-link:hover .login-icon-box {
    background: #bfdbfe;
    transform: translateY(-2px);
}

.login-icon {
    width: 22px;
    height: 22px;
}

.login-text {
    margin-left: 16px;
}

.login-title {
    display: block;
    font-size: 18px; /* Din live CSS */
    font-family: 'Lato', sans-serif;
    font-weight: 600;
    color: var(--nws-text);
    line-height: 1.1em;
    transition: color 0.2s;
}

.login-link:hover .login-title {
    color: #2563eb;
}

.login-desc {
    display: block;
    font-size: 16px; /* Din live CSS */
    font-family: 'Lato', sans-serif;
    color: var(--nws-text-soft);
    margin-top: 2px;
    font-weight: 400;
    line-height: 1.25;
}

.login-desc strong {
    font-weight: 600;
    color: #374151;
}

@media (max-width: 1024px) {
    .mega-menu {
        display: none;
    }
}

/* =========================================================
   MEGA MENU - INFRASTRUCTURA
   ========================================================= */

.mega-col-infra-left {
    flex: 0 0 44%; /* Marit de la 30% pentru a impinge coloana de centru sub butonul Infrastructura */
    border-right: none;
    display: flex;
    align-items: center;
}

.mega-infra-title {
    font-family: 'Lato', sans-serif;
    font-size: 24px;
    font-weight: 600;
    color: var(--nws-text);
    line-height: 1.2em;
    letter-spacing: -0.2px;
    margin: 0;
    padding-right: 40px;
}

.mega-col-infra-center {
    flex: 0 0 27%; /* Redus corespunzator pentru a mentine totalul la 100% */
    display: flex;
    flex-direction: column;
    justify-content: center;
    border-right: 1px solid #eaeaea;
    padding-left: 30px; /* Redus pentru un aliniament precis */
}

.mega-infra-link-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 12px; /* Redus considerabil conform cerintei "mult mai apropiate" */
}

.mega-infra-link {
    font-family: 'Lato', sans-serif;
    font-size: 18px;
    font-weight: 400;
    color: var(--nws-text);
    line-height: 1.5em;
    text-decoration: none;
    transition: color 0.3s;
}

.mega-infra-link:hover {
    color: #2563eb;
}

.mega-col-infra-right {
    flex: 0 0 29%;
    background: var(--nws-surface-2); /* Background-ul subtil gri cerut in designurile anterioare */
}

.mega-cert-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 20px; /* Mai multa "respiratie" intre elemente */
}

.cert-item {
    display: flex;
    align-items: center;
    gap: 16px; /* Spatiu curat intre cutie si text */
}

.cert-icon {
    display: inline-flex;
    width: 36px;
    height: 36px;
    align-items: center;
    justify-content: center;
    background: var(--nws-surface); /* Cutie curata care sa scoata iconita in evidenta pe gri */
    border-radius: 8px; /* Colturi moderne */
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04); /* Umbra subtila premium */
    flex-shrink: 0;
}

.cert-icon svg {
    /* Uniformizeaza aspectul tuturor iconitelor svg din lista */
    width: 20px !important;
    height: 20px !important;
}

.cert-text {
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    font-weight: 500;
    color: var(--nws-text);
}

/* =========================================================
   EXTINDERE FUNDAL MEGA MENU INFRASTRUCTURA
   (Acopera background-ul de dedesubt de pe margini)
   ========================================================= */
.mega-col-infra-left::before {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    right: 100%;
    width: 50vw;
    background: var(--mega-bg);
}

.mega-col-infra-right::after {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    left: 100%;
    width: 50vw;
    background: var(--nws-surface-2); /* Asortat cu backgroundul gri */
}

/* ============================================================
   INFRASTRUCTURA INTERACTIVE PREVIEWS & CERTS
   ============================================================ */
.mega-col-infra-left {
    position: relative;
    display: grid !important; /* Suprascriem display: flex anterior */
    grid-template-columns: 1fr;
    grid-template-rows: auto;
    align-items: start;
}
.infra-preview {
    grid-column: 1 / 2;
    grid-row: 1 / 2;
    opacity: 0;
    transform: translateY(4px);
    transition: opacity 0.25s ease, transform 0.25s ease;
    pointer-events: none;
    z-index: 10;
}
.infra-preview.active {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
    z-index: 11;
}
.infra-preview-desc {
    font-family: 'Lato', sans-serif;
    font-size: 16px;
    color: var(--nws-text-soft);
    margin-top: 14px;
    line-height: 1.6;
    max-width: 90%;
}

/* Certifications Hover FX */
.mega-cert-list {
    transition: opacity 0.3s ease;
}
.mega-cert-list:hover .cert-item {
    opacity: 0.3;
    filter: grayscale(100%);
}
.mega-cert-list .cert-item {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 8px;
    padding: 8px;
    margin: -8px;
    cursor: default;
}
.mega-cert-list .cert-item:hover {
    opacity: 1 !important;
    filter: grayscale(0) !important;
    background-color: var(--nws-gray-100, #f3f4f6);
    transform: translateX(6px);
}
[data-theme="dark"] .mega-cert-list .cert-item:hover {
    background-color: rgba(255,255,255, 0.05);
}
