/* ================================================================
   UNiQ Mega-Menu Navbar – with Accordion Subheadings
   ================================================================ */

/* ---------- OVERRIDE OLD HEADER/MENU CSS ---------- */
#header.uniq-navbar {
  background: none !important;
  transform: none !important;
  height: auto !important;
  position: fixed !important;
}
#header.uniq-navbar .header-bg { display: none !important; }
#header.uniq-navbar nav { height: auto !important; padding: 0 !important; }
#header.uniq-navbar .navigation { display: none !important; }
#header.uniq-navbar .menu_bar { display: none !important; }
#header.uniq-navbar .overlay { display: none !important; }
.uniq-navbar ul.uniq-mainbar__nav {
  margin: 0;
  padding: 0;
  list-style: none;
}
.uniq-navbar .uniq-mainbar__nav > li {
  margin: 0;
  padding: 0;
  background: none;
}
.uniq-navbar .uniq-mainbar__nav > li > a:not(.uniq-cta-btn) {
  background: none;
  border: none;
}

/* ---------- CSS Variables ---------- */
:root {
  --nav-top-bg: #1a1a2e;
  --nav-top-color: #ccc;
  --nav-main-bg: #ffffff;
  --nav-main-shadow: 0 2px 12px rgba(0,0,0,.08);
  --nav-accent: #d3248d;
  --nav-accent-hover: #aa4282;
  --nav-link-color: #333;
  --nav-link-hover: #d3248d;
  --nav-mega-bg: #ffffff;
  --nav-mega-border: #f0f0f0;
  --nav-mega-shadow: 0 16px 48px rgba(0,0,0,.12);
  --nav-cta-bg: linear-gradient(135deg, #d3248d 0%, #aa4282 100%);
  --nav-transition: .25s cubic-bezier(.4,0,.2,1);
  --nav-height-top: 36px;
  --nav-height-main: 64px;
}

/* ====================== RESET ====================== */
.uniq-navbar, .uniq-navbar * {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
.uniq-navbar ul { list-style: none; }
.uniq-navbar a { text-decoration: none; color: inherit; }
.uniq-navbar .fas, .uniq-navbar .fab, .uniq-navbar .far {
  font-family: "Font Awesome 5 Free" !important;
  font-weight: 900 !important;
}
.uniq-navbar .fab {
  font-family: "Font Awesome 5 Brands" !important;
}

/* ====================== WRAPPER ====================== */
.uniq-navbar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 9999;
  font-family: 'Inter', 'Poppins', sans-serif;
}

/* ====================== TOP BAR ====================== */
.uniq-topbar {
  background: var(--nav-top-bg);
  height: var(--nav-height-top);
  display: flex;
  align-items: center;
  font-size: 12.5px;
  color: var(--nav-top-color);
  padding: 0 clamp(16px, 3vw, 48px);
}
.uniq-topbar__left,
.uniq-topbar__right {
  display: flex;
  align-items: center;
  gap: 6px;
}
.uniq-topbar__left { margin-right: auto; }
.uniq-topbar__right { margin-left: auto; }

.uniq-topbar a {
  color: var(--nav-top-color);
  padding: 4px 10px;
  border-radius: 3px;
  transition: color var(--nav-transition), background var(--nav-transition);
  font-weight: 500;
  letter-spacing: .2px;
}
.uniq-topbar a:hover {
  color: #fff;
  background: rgba(255,255,255,.08);
}
.uniq-topbar__sep {
  width: 1px;
  height: 14px;
  background: rgba(255,255,255,.15);
  margin: 0 2px;
}

/* ====================== MAIN BAR ====================== */
.uniq-mainbar {
  background: var(--nav-main-bg);
  height: var(--nav-height-main);
  display: flex;
  align-items: center;
  padding: 0 clamp(16px, 3vw, 48px);
  box-shadow: var(--nav-main-shadow);
  position: relative;
  z-index: 100;
}

/* Logo */
.uniq-mainbar__logo {
  flex-shrink: 0;
  margin-right: 32px;
}
.uniq-mainbar__logo img {
  height: 38px;
  width: auto;
  display: block;
}

/* Main Links */
.uniq-mainbar__nav {
  display: flex;
  align-items: center;
  gap: 0;
  flex: 1;
  height: 100%;
}
.uniq-mainbar__nav > li {
  position: relative;
  height: 100%;
  display: flex;
  align-items: center;
}
.uniq-mainbar__nav > li > a {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 0 18px;
  height: 100%;
  font-size: 14px;
  font-weight: 600;
  color: var(--nav-link-color);
  transition: color var(--nav-transition);
  white-space: nowrap;
  position: relative;
}
.uniq-mainbar__nav > li > a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 18px;
  right: 18px;
  height: 3px;
  background: var(--nav-accent);
  border-radius: 3px 3px 0 0;
  transform: scaleX(0);
  transition: transform var(--nav-transition);
}
.uniq-mainbar__nav > li:hover > a,
.uniq-mainbar__nav > li.active > a {
  color: var(--nav-accent);
}
.uniq-mainbar__nav > li:hover > a::after,
.uniq-mainbar__nav > li.active > a::after {
  transform: scaleX(1);
}
.uniq-mainbar__nav > li > a .nav-chevron {
  font-size: 10px;
  transition: transform var(--nav-transition);
  margin-top: 1px;
}
.uniq-mainbar__nav > li:hover > a .nav-chevron {
  transform: rotate(180deg);
}

/* Right actions */
.uniq-mainbar__actions {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-left: auto;
  flex-shrink: 0;
}

/* Search */
.uniq-search-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1.5px solid #e0e0e0;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #555;
  font-size: 16px;
  transition: all var(--nav-transition);
}
.uniq-search-btn:hover {
  border-color: var(--nav-accent);
  color: var(--nav-accent);
  background: rgba(211,36,141,.04);
}

/* CTA Button */
.uniq-cta-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--nav-cta-bg);
  color: #fff !important;
  padding: 10px 22px;
  border-radius: 50px;
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: .3px;
  box-shadow: 0 4px 16px rgba(211,36,141,.25);
  transition: all var(--nav-transition);
  white-space: nowrap;
}
.uniq-cta-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 24px rgba(211,36,141,.35);
  filter: brightness(1.08);
}
.uniq-cta-btn i {
  font-size: 15px;
}

/* ====================== MEGA DROPDOWN ====================== */
.uniq-mega {
  position: absolute;
  top: 100%;
  left: 0;
  width: 100vw;
  background-color: #ffffff !important;
  box-shadow: 0 16px 48px rgba(0,0,0,.15) !important;
  border-top: 3px solid var(--nav-accent) !important;
  padding: 36px clamp(24px, 4vw, 64px) 32px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: opacity var(--nav-transition), transform var(--nav-transition), visibility 0s .3s;
  z-index: 2000 !important;
  margin-left: calc(-1 * (clamp(16px, 3vw, 48px)) - var(--mega-offset, 0px));
}
.uniq-mainbar__nav > li:hover > .uniq-mega,
.uniq-mainbar__nav > li.mega-open > .uniq-mega {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  transition: opacity var(--nav-transition), transform var(--nav-transition), visibility 0s 0s;
}

/* Mega Grid */
.uniq-mega__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 16px 36px;
  max-width: 1400px;
  margin: 0 auto;
  padding: 4px 0;
}

/* Mega Column */
.uniq-mega__col {
  min-width: 0;
}
.uniq-mega__col-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  font-weight: 700;
  color: #1a1a2e;
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--nav-accent);
  letter-spacing: 0.3px;
}
.uniq-mega__col-icon {
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(211,36,141,.08);
  border-radius: 6px;
  color: var(--nav-accent);
  font-size: 14px;
  flex-shrink: 0;
}

.uniq-mega__col ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.uniq-mega__col ul li a {
  display: block;
  padding: 6px 0;
  font-size: 13.5px;
  color: #555555 !important;
  transition: color var(--nav-transition), padding-left var(--nav-transition), background var(--nav-transition);
  line-height: 1.5;
  border-radius: 3px;
}
.uniq-mega__col ul li a:hover {
  color: var(--nav-accent) !important;
  padding-left: 6px;
}

/* ====================== SUBHEADER ACCORDION (Desktop + Mobile) ====================== */
.uniq-mega__col ul li.uniq-mega__subheader {
  padding-top: 10px;
  padding-bottom: 6px;
  margin-top: 8px;
  border-top: 1px solid #e8e8e8;
  font-size: 10px;
  font-weight: 700;
  color: #1a1a2e !important;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  line-height: 1.2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  user-select: none;
  transition: color var(--nav-transition);
}
.uniq-mega__col ul li.uniq-mega__subheader:first-child {
  border-top: none;
  padding-top: 0;
  margin-top: 0;
}
.uniq-mega__col ul li.uniq-mega__subheader:hover {
  color: var(--nav-accent) !important;
}

/* Chevron icon in subheaders */
.sub-chevron {
  font-size: 9px;
  color: #999;
  transition: transform 0.3s ease, color 0.3s ease;
  margin-left: auto;
}
.uniq-mega__subheader:hover .sub-chevron {
  color: var(--nav-accent);
}
.uniq-mega__col ul li.sub-subheader.sub-sub-open ~ li.sub-sub-item {
  display: block;
}


/* Sub-items: HIDDEN by default (for old sibling structure) */
.uniq-mega__col ul li.sub-item {
  display: none;
  padding-left: 8px;
}

/* Ensure items inside nested sub-list are always visible (parent UL handles hiding) */
.uniq-mega__col ul.sub-list > li.sub-item {
  display: block;
}
.uniq-mega__col ul li.uniq-mega__subheader.sub-open ~ li.sub-item {
  display: block;
}
/* Stop showing at the next subheader */
.uniq-mega__col ul li.uniq-mega__subheader.sub-open ~ li.uniq-mega__subheader ~ li.sub-item {
  display: none;
}
/* But if THAT next subheader is also open, show its items */
.uniq-mega__col ul li.uniq-mega__subheader.sub-open ~ li.uniq-mega__subheader.sub-open ~ li.sub-item {
  display: block;
}

/* Sub-subheaders (e.g., "1-1", "1-1 & Many" under CAT6a.STP) */
li.sub-subheader {
  padding-top: 6px !important;
  padding-bottom: 4px !important;
  font-size: 10px !important;
  font-weight: 700 !important;
  color: #666 !important;
  cursor: pointer;
  user-select: none;
  display: none;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  padding-left: 12px !important;
}

/* Subheader links override default sub-item a styles */
.uniq-mega__col ul li.uniq-mega__subheader > a,
.uniq-mega__col ul li.sub-subheader > a {
  display: inline-block;
  padding: 0;
  font-size: inherit;
  color: inherit !important;
  text-transform: inherit;
  font-weight: inherit;
  line-height: inherit;
  border-radius: 0;
  transition: color var(--nav-transition);
}
.uniq-mega__col ul li.uniq-mega__subheader > a:hover,
.uniq-mega__col ul li.sub-subheader > a:hover {
  color: var(--nav-accent) !important;
  padding-left: 0;
}

/* Sub-subheader chevron */
li.sub-subheader.sub-sub-open .sub-chevron {
  transform: rotate(180deg);
  color: var(--nav-accent);
}

/* Sub-lists: HIDDEN by default */
.uniq-mega__col ul.sub-list {
  display: none;
}

/* Show sub-list when previous subheader has .sub-open */
.uniq-mega__col li.uniq-mega__subheader.sub-open + ul.sub-list {
  display: block;
}

/* Ensure sub-subheaders within an opened sub-list are shown */
.uniq-mega__col ul li.uniq-mega__subheader.sub-open + ul.sub-list li.sub-subheader {
  display: flex;
}

/* Hide sub-sub-list by default */
.uniq-mega__col ul li ul.sub-sub-list {
  display: none;
  width: 100%;
}

/* Show nested sub-sub-list when sub-subheader is open */
.uniq-mega__col ul li.sub-subheader.sub-sub-open > ul.sub-sub-list {
  display: block;
}

/* Ensure items inside nested sub-sub-list are always visible (parent UL handles hiding) */
.uniq-mega__col ul li ul.sub-sub-list li.sub-sub-item {
  display: block;
}

/* Sub-sub items hidden by default (for old sibling structure) */
.uniq-mega__col ul li.sub-sub-item {
  display: none;
  padding-left: 24px !important;
}

/* Legacy support: Show old sibling sub-sub-items when their sub-subheader has .sub-sub-open */
li.sub-subheader.sub-sub-open ~ li.sub-sub-item {
  display: block;
}
li.sub-subheader.sub-sub-open ~ li.sub-subheader ~ li.sub-sub-item {
  display: none;
}
li.sub-subheader.sub-sub-open ~ li.sub-subheader.sub-sub-open ~ li.sub-sub-item {
  display: block;
}

/* "View All" link */
.uniq-mega__viewall {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 14px;
  padding: 6px 0;
  font-size: 13px;
  font-weight: 700;
  color: var(--nav-accent);
  transition: gap var(--nav-transition), color var(--nav-transition);
  text-transform: uppercase;
  letter-spacing: 0.4px;
}
.uniq-mega__viewall:hover {
  gap: 10px;
  color: var(--nav-accent-hover);
}

/* Solutions mega (simpler) */
.uniq-mega--solutions .uniq-mega__grid {
  grid-template-columns: repeat(4, 1fr);
  max-width: 900px;
}

/* ====================== MOBILE HAMBURGER ====================== */
.uniq-hamburger {
  display: none;
  width: 40px;
  height: 40px;
  border: none;
  background: #1a1a2e;
  border-radius: 50%;
  color: #fff;
  font-size: 18px;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  margin-left: auto;
  transition: background var(--nav-transition);
}
.uniq-hamburger:hover { background: var(--nav-accent); }

/* ====================== MOBILE OVERLAY ====================== */
.uniq-mobile-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  z-index: 10001;
  backdrop-filter: blur(4px);
  opacity: 0;
  transition: opacity 0.3s ease;
}
.uniq-mobile-overlay.active { 
  display: block; 
  opacity: 1;
}

/* ====================== RESPONSIVE ====================== */
@media (max-width: 1100px) {
  .uniq-mainbar__nav > li > a { padding: 0 12px; font-size: 13px; }
  .uniq-cta-btn { padding: 8px 16px; font-size: 12.5px; }
  .uniq-cta-btn span { display: none; }
}

@media (max-width: 991px) {
  .uniq-topbar { display: none; }

  .uniq-mainbar {
    height: 60px;
    padding: 0 16px;
  }
  .uniq-mainbar__logo img { height: 32px; }

  .uniq-hamburger { display: flex; }
  .uniq-search-btn { display: none; }
  .uniq-cta-btn { display: none; }

  .uniq-mainbar__nav {
    display: none;
    position: fixed;
    top: 0;
    right: 0;
    width: 85%;
    max-width: 320px;
    height: 100vh;
    background: #ffffff !important;
    background-color: #ffffff !important;
    opacity: 1 !important;
    visibility: visible !important;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 70px 0 30px;
    overflow-y: auto;
    box-shadow: -10px 0 40px rgba(0,0,0,0.3);
    z-index: 10002 !important;
    transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  }
  .uniq-mainbar__nav.mobile-open {
    display: flex;
    transform: translateX(0);
  }

  .uniq-mainbar__nav > li {
    height: auto;
    flex-direction: column;
    align-items: stretch;
    border-bottom: 1px solid #f0f0f0;
  }
  .uniq-mainbar__nav > li > a {
    padding: 14px 20px;
    height: auto;
    font-size: 15px;
    justify-content: space-between;
  }
  .uniq-mainbar__nav > li > a::after { display: none; }

  .uniq-mega {
    position: static;
    width: 100%;
    box-shadow: none;
    border-top: none;
    padding: 0 20px 16px;
    margin-left: 0;
    display: none;
    opacity: 1;
    visibility: visible;
    transform: none;
    transition: none;
    border-top: 1px solid #f5f5f5;
    background: #fafafa;
  }
  .uniq-mainbar__nav > li.mega-open > .uniq-mega {
    display: block;
  }

  .uniq-mega__grid, 
  .uniq-mega--solutions .uniq-mega__grid {
    grid-template-columns: 1fr !important;
    gap: 16px 0;
    padding-top: 12px;
  }
  .uniq-mega__col-title { font-size: 13.5px; margin-bottom: 8px; padding-bottom: 6px; }
  .uniq-mega__col ul li a { font-size: 13px; padding: 4px 0; }

  .uniq-mobile-close {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: none;
    background: #f5f5f5;
    color: #333;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 11;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  }
  .uniq-mobile-close:hover { background: var(--nav-accent); color: #fff; }

  /* Mobile: column accordions */
  .uniq-mega__col ul {
    margin-top: 10px;
  }
  .uniq-mega__viewall {
    display: none;
  }
  .uniq-mega__col-title {
    position: relative;
    cursor: pointer;
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
    margin-bottom: 0;
  }
  .uniq-mega__col-title::after {
    content: '\f107';
    font-family: 'Font Awesome 5 Free';
    font-weight: 900;
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    font-size: 12px;
    color: #888;
    transition: transform 0.3s ease;
  }
  .uniq-mega__col.col-expanded .uniq-mega__col-title::after {
    transform: translateY(-50%) rotate(180deg);
  }
  /* On mobile, hide primary UL by default, show when col-expanded */
  .uniq-mega__col > ul {
    display: none;
  }
  .uniq-mega__col.col-expanded > ul {
    display: block;
  }
  .uniq-mega__col.col-expanded .uniq-mega__viewall {
    display: block;
  }

  .uniq-mobile-cta {
    display: block;
    margin: 24px 20px;
    text-align: center;
  }
  .uniq-mobile-cta .uniq-cta-btn {
    display: flex;
    width: 100%;
    justify-content: center;
    padding: 14px;
    font-size: 14px;
  }

  body.menu-open .icon-bar,
  body.menu-open .chat-widget,
  body.menu-open [class*="chat"],
  body.menu-open [id*="chat"],
  body.menu-open [class*="whatsapp"],
  body.menu-open #tidio-chat,
  body.menu-open .tidio-chat-iframe {
    display: none !important;
  }
}

body.menu-open #header.uniq-navbar {
  z-index: 10005 !important;
}

@media (min-width: 992px) {
  .uniq-mobile-close { display: none !important; }
  li.uniq-mobile-cta { display: none !important; }

  .uniq-mainbar__nav > li {
    position: static;
  }
  .uniq-mega {
    left: 0;
    right: 0;
    margin-left: 0;
    width: 100%;
    position: absolute;
  }
}

/* ====================== STICKY STATE ====================== */
.uniq-navbar.scrolled .uniq-topbar {
  height: 0;
  overflow: hidden;
  padding: 0;
  transition: height .3s ease, padding .3s ease;
}
.uniq-navbar.scrolled .uniq-mainbar {
  box-shadow: 0 2px 16px rgba(0,0,0,.1);
}

/* ====================== ANIMATIONS ====================== */
@keyframes navSlideIn {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}
.uniq-navbar { animation: navSlideIn .4s ease-out; }
