/* ==========================================================================
   WEBSITISM - Header & Mega Menu Styles
   Sticky header (in-flow, not fixed overlay), full-width mega panels,
   responsive centering, teal accent
   ========================================================================== */

/* ---- Header Base (sticky, not fixed) ---- */
.ws-header {
    position: sticky;
    top: 0;
    width: 100%;
    z-index: var(--ws-z-sticky);
    background: var(--ws-bg-raised, #111114);
    transition: box-shadow var(--ws-transition-base), padding var(--ws-transition-base);
    padding: var(--ws-space-3) 0;
    overflow: visible;      /* mega panels must not be clipped */
}

.ws-header--scrolled {
    box-shadow: 0 2px 24px rgba(0, 0, 0, 0.35);
    padding: var(--ws-space-2) 0;
}

/* Remove hide-on-scroll since header is sticky in-flow */

.ws-header__inner {
    position: relative;     /* panels anchor to this */
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--ws-space-6);
    overflow: visible;      /* never clip mega panels */
}

/* ---- Logo ---- */
.ws-header__logo { flex-shrink: 0; }

.ws-logo {
    display: inline-flex;
    align-items: center;
    text-decoration: none;
}

.ws-logo__text {
    font-family: var(--ws-font-primary);
    font-size: var(--ws-text-xl);
    font-weight: 700;
    color: #fff;
    letter-spacing: -0.02em;
    transition: color 0.2s ease;
    display: flex;
    flex-direction: column;
    line-height: 1;
}

.ws-logo__tagline {
    font-size: 0.55rem;
    font-weight: 400;
    color: rgba(255, 255, 255, 0.4);
    letter-spacing: 0.12em;
    text-transform: uppercase;
    margin-top: 3px;
    transition: color 0.2s ease;
}

.ws-logo:hover .ws-logo__tagline { color: rgba(0, 201, 219, 0.6); }

.ws-logo__mark {
    color: var(--ws-accent);
    font-weight: 700;
}

.ws-logo:hover .ws-logo__text { color: var(--ws-accent); }

.ws-logo img,
.ws-logo .custom-logo {
    max-height: 38px;
    width: auto;
}

/* ---- Primary Nav ---- */
.ws-header__nav {
    flex: 1;
    display: flex;
    justify-content: center;
    overflow: visible;
}

/* ---- Top-Level Menu ---- */
.ws-megamenu {
    list-style: none;
    display: flex;
    align-items: center;
    gap: 2px;
    margin: 0;
    padding: 0;
    overflow: visible;
}

/* CRITICAL: position: static so panels anchor to .ws-header__inner */
.ws-megamenu__item--top {
    position: static;
}

.ws-megamenu__link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 16px;
    font-family: var(--ws-font-primary);
    font-size: 0.82rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.75);
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    border-radius: 8px;
    transition: color 0.2s ease, background 0.2s ease;
    white-space: nowrap;
}

.ws-megamenu__link:hover,
.ws-megamenu__item--active > .ws-megamenu__link,
.ws-megamenu__item--open > .ws-megamenu__link,
.ws-megamenu__item--has-mega:hover > .ws-megamenu__link {
    color: #fff;
    background: rgba(255, 255, 255, 0.06);
}

.ws-megamenu__chevron {
    transition: transform 0.25s ease;
    opacity: 0.4;
}

.ws-megamenu__item--open > .ws-megamenu__link .ws-megamenu__chevron,
.ws-megamenu__item--has-mega:hover > .ws-megamenu__link .ws-megamenu__chevron {
    transform: rotate(180deg);
    opacity: 0.8;
}


/* ---- Mega Menu Panel (full-width, never overflows) ---- */
.ws-megamenu__panel {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    width: 100vw;
    max-width: 100vw;
    background: var(--ws-bg-elevated, #18181c);
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.25s ease, visibility 0.25s ease;
    z-index: var(--ws-z-megamenu);
}

.ws-megamenu__item--open > .ws-megamenu__panel,
.ws-megamenu__item--has-mega:hover > .ws-megamenu__panel {
    opacity: 1;
    visibility: visible;
    pointer-events: all;
}

.ws-megamenu__inner {
    padding: var(--ws-space-8);
    max-width: var(--ws-container-max);
    margin: 0 auto;
}

/* ---- Columns Grid ---- */
.ws-megamenu__columns {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--ws-space-8);
    list-style: none;
    margin: 0;
    padding: 0;
}

/* 2-col variant for About */
.ws-megamenu__columns--2col {
    grid-template-columns: repeat(2, 1fr);
    max-width: 520px;
}

.ws-megamenu__column {
    list-style: none;
    min-width: 0;
}

.ws-megamenu__column-title {
    display: block;
    font-family: var(--ws-font-primary);
    font-size: 0.7rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.55);
    text-transform: uppercase;
    letter-spacing: 0.14em;
    margin-bottom: var(--ws-space-4);
    padding-bottom: var(--ws-space-3);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    text-decoration: none;
}

a.ws-megamenu__column-title:hover {
    color: var(--ws-accent);
}


/* ---- Sub Links ---- */
.ws-megamenu__links {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.ws-megamenu__sublink {
    display: block;
    padding: 7px 10px;
    font-size: 0.84rem;
    font-weight: 400;
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    border-radius: 6px;
    transition: color 0.2s ease, background 0.2s ease, padding-left 0.2s ease;
    /* allow wrapping for long comparison titles */
    white-space: normal;
    line-height: 1.4;
}

.ws-megamenu__sublink:hover {
    color: #fff;
    background: rgba(0, 201, 219, 0.08);
    padding-left: 14px;
}

/* Highlight links (View All, etc.) */
.ws-megamenu__sublink--hl {
    color: var(--ws-accent) !important;
    font-weight: 500 !important;
}

.ws-megamenu__desc {
    display: block;
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.5);
    margin-top: 2px;
}


/* ---- CTA Card inside Mega Menu ---- */
.ws-megamenu__cta-card {
    margin-top: var(--ws-space-6);
    padding: var(--ws-space-5);
    background: rgba(0, 201, 219, 0.06);
    border-radius: var(--ws-radius-lg);
    border: 1px solid rgba(0, 201, 219, 0.1);
}

.ws-megamenu__cta-card--violet {
    background: rgba(123, 47, 255, 0.06);
    border-color: rgba(123, 47, 255, 0.1);
}

.ws-megamenu__cta-card__title {
    font-size: 0.85rem;
    font-weight: 600;
    color: #fff;
    margin-bottom: 4px;
}

.ws-megamenu__cta-card__desc {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.55);
    margin-bottom: var(--ws-space-3);
}


/* ---- Header Actions (CTA button) ---- */
.ws-header__actions {
    display: flex;
    align-items: center;
    gap: var(--ws-space-3);
    flex-shrink: 0;
}

.ws-header__cta {
    font-size: 0.78rem;
    padding: 10px 22px;
    border-radius: 8px;
}


/* ---- Hamburger ---- */
.ws-header__burger {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 44px;
    height: 44px;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    z-index: calc(var(--ws-z-overlay) + 1);
}

.ws-burger__line {
    display: block;
    width: 22px;
    height: 2px;
    background: #fff;
    border-radius: 2px;
    transition: transform 0.3s ease, opacity 0.15s ease;
    transform-origin: center;
}

.ws-burger--active .ws-burger__line:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.ws-burger--active .ws-burger__line:nth-child(2) { opacity: 0; }
.ws-burger--active .ws-burger__line:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }


/* ---- Mobile Navigation ---- */
.ws-mobile-nav {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    height: 100dvh;
    background: rgba(14, 14, 14, 0.98);
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    z-index: var(--ws-z-overlay);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.35s ease, visibility 0.35s ease;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.ws-mobile-nav--open {
    opacity: 1;
    visibility: visible;
    pointer-events: all;
}

.ws-mobile-nav__inner {
    padding: calc(80px + var(--ws-space-8)) var(--ws-space-6) var(--ws-space-8);
    min-height: 100%;
    display: flex;
    flex-direction: column;
}

.ws-mobile-nav__menu {
    list-style: none;
    margin: 0;
    padding: 0;
}

.ws-mobile-nav__menu > li {
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.ws-mobile-nav__menu > li > a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 0;
    font-size: 1.1rem;
    font-weight: 500;
    color: #fff;
    text-decoration: none;
    transition: color 0.2s ease;
}

.ws-mobile-nav__menu > li > a:hover { color: var(--ws-accent); }

/* Mobile submenu */
.ws-mobile-nav__menu .sub-menu {
    list-style: none;
    margin: 0;
    padding: 0 0 16px 16px;
    display: none;
}

.ws-mobile-nav__item--open > .sub-menu { display: block; }

.ws-mobile-nav__menu .sub-menu a {
    display: block;
    padding: 8px 0;
    font-size: 0.88rem;
    color: rgba(255, 255, 255, 0.45);
    text-decoration: none;
}

.ws-mobile-nav__menu .sub-menu a:hover { color: var(--ws-accent); }

.ws-mobile-nav__cta {
    margin-top: auto;
    padding-top: var(--ws-space-8);
}

/* Body lock */
.ws-body--nav-open { overflow: hidden; }


/* ---- Back to Top ---- */
.ws-back-to-top {
    position: fixed;
    bottom: 32px;
    right: 32px;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #1a1a1a;
    color: var(--ws-accent);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.3s ease;
    z-index: var(--ws-z-sticky);
}

.ws-back-to-top--visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.ws-back-to-top:hover {
    background: var(--ws-accent);
    color: #fff;
    transform: translateY(-3px);
    box-shadow: 0 8px 24px var(--ws-accent-glow);
}


/* ==========================================================================
   RESPONSIVE
   ========================================================================== */

@media (max-width: 1200px) {
    .ws-megamenu__inner {
        padding: var(--ws-space-6);
    }
    .ws-megamenu__columns {
        gap: var(--ws-space-5);
    }
}

@media (max-width: 1024px) {
    .ws-header__nav { display: none; }
    .ws-header__burger { display: flex; }
    .ws-header__cta { display: none; }
    .ws-megamenu__panel { display: none; }
}

@media (max-width: 768px) {
    .ws-mobile-nav__menu > li > a { font-size: 1rem; }
    .ws-back-to-top { bottom: 16px; right: 16px; width: 40px; height: 40px; }
}
