/** =====================================================
 * HEADER MODERN
 * Compatible with current CTV-APTEC HTML structure
 * ===================================================== */

/* =========================================
   Base
========================================= */

header {
  position: relative;
  z-index: 9999;
  opacity: 1;
}

header * {
  box-sizing: border-box;
}

/* =========================================
   Logo Area
========================================= */

header .logo-bar {
  display: flex;
  gap: 20px;
  justify-content: space-between;
  align-items: center;
}

header .site-logo {
  width: 100px;
  height: auto;
}

header p {
  font-size: 5px;
  margin-bottom: 5px;
  font-weight: 600;
}

header .logo-wrapper {
  display: flex;
  flex-direction: column;
  margin-left: auto;
  gap: 10px;
}

header .logo-row {
  display: flex;
  gap: 20px;
}

header .logo-inner-row {
  display: flex;
  gap: 10px;
  align-items: center;
}

header .thkpa-logo {
  min-width: 60px;
  max-width: 84px;
}

header .years-logo {
  min-width: 17px;
  max-width: 24px;
}

header .aptec-logo {
  min-width: 36px;
  max-width: 50px;
}

header .ccidahk-logo {
  min-width: 31px;
  max-width: 40px;
}

header .govt-logo {
  min-width: 96px;
  max-width: 135px;
}

/* =========================================
   Mobile Open Button
========================================= */

header .open-btn {
  background-color: #d9d9d9;
  color: #4e4e4e;
  font-size: 18px;
  border-radius: 999px;
  padding: 12px 15px;
  border: none;
  cursor: pointer;
  transition: all 0.25s ease;
}

header .open-btn:hover {
  background-color: #c6c8c9;
}

header .open-btn i {
  transition: transform 0.25s ease;
}

header .open-btn:hover i {
  transform: scale(1.08);
}

/* =========================================
   Tablet
========================================= */

@media only screen and (min-width: 768px) {

  header .site-logo {
    width: 190px;
  }

  header p {
    font-size: 10px;
  }

  header .logo-wrapper {
    flex-direction: row;
    gap: 20px;
  }

}

/* =========================================
   Desktop
========================================= */

@media only screen and (min-width: 1024px) {

  header .open-btn {
    display: none;
  }

  header .logo-wrapper {
    gap: 50px;
  }

  header .logo-row {
    gap: 50px;
  }

  header .thkpa-logo {
    min-width: 156px;
    max-width: 230px;
  }

  header .years-logo {
    min-width: 44px;
    max-width: 65px;
  }

  header .aptec-logo {
    min-width: 100px;
    max-width: 120px;
  }

  header .ccidahk-logo {
    min-width: 78px;
    max-width: 115px;
  }

  header .govt-logo {
    min-width: 241px;
    max-width: 355px;
  }

}

/* =========================================
   Desktop Nav
========================================= */

nav.desktop-nav {
  display: none;
}

@media only screen and (min-width: 1024px) {

  nav.desktop-nav {
    display: flex;
    gap: 20px;
    margin-top: 30px;
    position: relative;
    z-index: 99999;
  }

  nav .menu-items,
  nav .language-selector {

    background-color: #d4d6d7;

    display: flex;
    align-items: center;

    gap: 20px;

    border-radius: 999px;

    padding: 12px 30px;

    list-style: none;

    text-transform: uppercase;

    font-size: 18px;

    font-weight: 600;
  }

  nav .menu-items {
    flex-grow: 1;
    justify-content: space-between;
  }

  nav .language-selector {
    justify-content: center;
    gap: 10px;
  }

  nav.desktop-nav .menu-items li {
    position: relative;
    margin-left: 0;
  }

  nav.desktop-nav a {
    color: #fff;
    text-decoration: none;
    transition: color 0.25s ease;
  }

  nav.desktop-nav a:hover,
  nav.desktop-nav a.active {
    color: #4e4e4e;
  }

  /* ===============================
     Submenu
  =============================== */

  nav.desktop-nav .sub-menu {

    position: absolute;

    top: calc(100% - 2px);
    left: 0;

    min-width: 240px;

    list-style: none;

    background-color: #d4d6d7;

    padding: 18px 22px;

    margin: 0;

    border-radius: 0 0 16px 16px;

    box-shadow:
      0 10px 25px rgba(0,0,0,0.12);

    opacity: 0;

    visibility: hidden;

    transform: translateY(10px);

    transition:
      opacity 0.25s ease,
      transform 0.25s ease,
      visibility 0.25s ease;

    pointer-events: none;

    z-index: 99999;
  }

  nav.desktop-nav .menu-items li:hover > .sub-menu,
  nav.desktop-nav .menu-items li:focus-within > .sub-menu {

    opacity: 1;

    visibility: visible;

    transform: translateY(0);

    pointer-events: auto;
  }

  nav.desktop-nav .sub-menu li {
    margin-bottom: 10px;
    line-height: 1.5;
    white-space: nowrap;
    font-weight: 400;
  }

  nav.desktop-nav .sub-menu li:last-child {
    margin-bottom: 0;
  }

  nav.desktop-nav .sub-menu a {
    display: inline-block;
    padding: 3px 0;
  }

  /* ===============================
     Desktop Arrow
  =============================== */

  nav.desktop-nav .menu-items li:has(.sub-menu) > a::after {

    content: "▼";

    font-size: 9px;

    margin-left: 7px;

    display: inline-block;

    transition: transform 0.25s ease;
  }

  nav.desktop-nav .menu-items li:hover > a::after {
    transform: rotate(180deg);
  }

}

/* =========================================
   Overlay
========================================= */

.overlay {

  position: fixed;

  inset: 0;

  background: rgba(0,0,0,0.45);

  backdrop-filter: blur(2px);

  display: none;

  z-index: 9998;
}

.overlay.active {
  display: block;
}

/* =========================================
   Mobile Offcanvas
========================================= */

.off-canvas-menu {

  position: fixed;

  top: 0;
  left: 0;

  width: 100%;
  max-width: 420px;

  height: 100vh;

  background-color: rgba(64,64,64,0.97);

  transform: translateX(-100%);

  transition: transform 0.3s ease;

  z-index: 99999;

  overflow-y: auto;

 /*  border-radius: 0 18px 18px 0; */

  box-shadow:
    0 10px 40px rgba(0,0,0,0.2);
}

.off-canvas-menu.active {
  transform: translateX(0);
}

.off-canvas-menu * {
  color: #fff;
}

.off-canvas-menu .menu-header {
  padding: 20px;
  text-align: right;
}

.off-canvas-menu .close-btn {

  font-size: 30px;

  cursor: pointer;

  transition: opacity 0.25s ease;
}

.off-canvas-menu .close-btn:hover {
  opacity: 0.7;
}

/* =========================================
   Mobile Nav
========================================= */

.off-canvas-menu nav.mobile-nav {
  padding: 10px 25px 40px;
}

nav.mobile-nav .menu-items {

  list-style: none;

  padding: 0;
  margin: 0;

  text-transform: uppercase;

  font-size: 15px;

  font-weight: 500;
}

nav.mobile-nav .menu-items > li {

  border-bottom:
    1px solid rgba(255,255,255,0.1);
}

nav.mobile-nav .menu-items > li > a {

  display: flex;

  justify-content: space-between;

  align-items: center;

  width: 100%;

  padding: 16px 0;

  text-decoration: none;
}

/* =========================================
   Mobile Submenu
========================================= */

nav.mobile-nav .sub-menu {

  list-style: none;

  padding-left: 15px;

  max-height: 0;

  overflow: hidden;

  opacity: 0;

  transition:
    max-height 0.3s ease,
    opacity 0.3s ease;
}

nav.mobile-nav li.open > .sub-menu {

  max-height: 500px;

  opacity: 1;
}

nav.mobile-nav .sub-menu li {
  margin-bottom: 10px;
}

nav.mobile-nav .sub-menu a {
  font-size: 13px;
  opacity: 0.9;
}

/* =========================================
   Mobile Arrow
========================================= */

nav.mobile-nav li.has-submenu > a::after {

  content: "+";

  font-size: 20px;

  line-height: 1;

  transition: transform 0.25s ease;
}

nav.mobile-nav li.open > a::after {
  transform: rotate(45deg);
}

/* =========================================
   Bottom Row
========================================= */

.off-canvas-menu .bottom-row {

  margin-top: 30px;

  display: flex;

  justify-content: center;

  align-items: center;

  gap: 30px;

  flex-wrap: wrap;
}

.social-icons {

  display: flex;

  justify-content: center;

  gap: 20px;
}

.social-icons a i {

  background-color: #fff;

  border-radius: 999px;

  color: #414643;

  width: 35px;
  height: 35px;

  display: flex;

  justify-content: center;

  align-items: center;

  transition: transform 0.25s ease;
}

.social-icons a:hover i {
  transform: scale(1.08);
}

.off-canvas-menu .language-selector a {
  padding: 0 5px;
  font-weight: 500;
}

/* =========================================
   Prevent Conflict
========================================= */

@media only screen and (max-width: 1023px) {

  nav.desktop-nav {
    display: none !important;
  }

}

@media only screen and (min-width: 1024px) {

  .off-canvas-menu,
  .overlay {
    display: none !important;
  }

}
