/* =============================================================
   HCCKSA Corporate Theme – Top Bar + Header + Navigation
   ============================================================= */

/* ── Top Bar ───────────────────────────────────────────────── */
.top-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 910;
  height: var(--topbar-h);
  background: var(--color-primary-dark, #061530);
  border-bottom: 1px solid rgba(243,112,33,.25);
  transition: transform var(--transition);
}

/* Slides up when user scrolls – JS adds this class */
.top-bar.is-hidden {
  transform: translateY(-100%);
}

.top-bar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  gap: 1rem;
}

/* Contact items row */
.top-bar-contact {
  display: flex;
  align-items: center;
  gap: 0;
  flex-wrap: nowrap;
}

.top-bar-item {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  color: rgba(255,255,255,.75);
  text-decoration: none;
  font-size: .78rem;
  font-weight: 500;
  padding: 0 .85rem;
  height: var(--topbar-h);
  transition: color var(--transition-fast), background var(--transition-fast);
  white-space: nowrap;
}

.top-bar-item:hover {
  color: var(--color-white);
  background: rgba(255,255,255,.06);
}

/* Orange accent on the phone number to make it pop */
.top-bar-phone {
  color: var(--color-accent-light, #ff8c42);
  font-weight: 700;
  letter-spacing: .02em;
}
.top-bar-phone:hover { color: var(--color-white); }

/* WhatsApp item – green tint */
.top-bar-wa { color: #5bdf8a; }
.top-bar-wa:hover { color: #ffffff; }

/* Icons */
.tb-icon {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}
.tb-icon svg {
  width: 13px;
  height: 13px;
  stroke-width: 2;
}
.top-bar-wa .tb-icon svg {
  width: 14px;
  height: 14px;
}

/* Vertical divider between items */
.top-bar-divider {
  display: block;
  width: 1px;
  height: 16px;
  background: rgba(255,255,255,.15);
  flex-shrink: 0;
}

/* Right side: hours */
.top-bar-right {
  display: flex;
  align-items: center;
}

.top-bar-hours {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  font-size: .75rem;
  color: rgba(255,255,255,.5);
  white-space: nowrap;
}
.top-bar-hours svg {
  width: 12px;
  height: 12px;
  flex-shrink: 0;
  opacity: .7;
}

/* ── Site Header ───────────────────────────────────────────── */
.site-header {
  position: fixed;
  top: var(--topbar-h);        /* sits directly below top bar */
  left: 0;
  right: 0;
  z-index: 900;
  height: var(--header-h);
  transition: top var(--transition), background var(--transition),
              box-shadow var(--transition), height var(--transition);
  background: transparent;
}

/* When top bar slides up, header moves to very top */
.site-header.is-sticky {
  top: 0;
  background: var(--color-primary);
  box-shadow: 0 2px 20px rgba(6,21,48,.35);
  height: 68px;
}

/* Solid background on inner pages */
body:not(.hccksa-home) .site-header {
  background: var(--color-primary);
  box-shadow: 0 2px 20px rgba(6,21,48,.2);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  gap: 1.5rem;
}

/* ── Logo ──────────────────────────────────────────────────── */
.header-logo a {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}

.header-logo img,
.header-logo .custom-logo {
  max-height: 54px;
  width: auto;
  display: block;
}

.site-header.is-sticky .header-logo img,
.site-header.is-sticky .custom-logo {
  max-height: 44px;
}

.logo-text {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--color-white);
  letter-spacing: .02em;
  text-transform: uppercase;
}
.logo-text span { color: var(--color-accent); }

/* ── Primary Navigation ────────────────────────────────────── */
.main-navigation {
  display: flex;
  align-items: center;
  gap: 2rem;
}

/* Nav menu list */
.nav-menu {
  display: flex;
  align-items: center;
  gap: .25rem;
  list-style: none;
}

.nav-menu > li > a {
  display: block;
  padding: .55rem 1rem;
  font-size: .9rem;
  font-weight: 500;
  color: rgba(255,255,255,.9);
  text-decoration: none;
  border-radius: var(--radius-sm);
  transition: color var(--transition-fast), background var(--transition-fast);
  position: relative;
  white-space: nowrap;
}

.nav-menu > li > a::after {
  content: '';
  position: absolute;
  bottom: 4px;
  left: 1rem;
  right: 1rem;
  height: 2px;
  background: var(--color-accent);
  border-radius: 99px;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--transition);
}

.nav-menu > li:hover > a,
.nav-menu > li.current-menu-item > a,
.nav-menu > li.current-page-ancestor > a {
  color: var(--color-white);
}

.nav-menu > li:hover > a::after,
.nav-menu > li.current-menu-item > a::after {
  transform: scaleX(1);
}

/* Last item as accent button */
.nav-menu > li:last-child > a {
  background: var(--color-accent);
  color: var(--color-white);
  border-radius: var(--radius-sm);
  padding: .5rem 1.25rem;
}
.nav-menu > li:last-child > a::after { display: none; }
.nav-menu > li:last-child > a:hover {
  background: var(--color-accent-dark);
}

/* ── Language switcher ─────────────────────────────────────── */
.lang-switcher {
  display: flex;
  align-items: center;
  gap: .35rem;
  font-size: .8rem;
  font-weight: 600;
  color: rgba(255,255,255,.7);
}
.lang-active { color: var(--color-white); }
.lang-sep    { opacity: .4; }
.lang-link   { cursor: pointer; transition: color var(--transition-fast); }
.lang-link:hover { color: var(--color-accent); }

/* ── Hamburger (mobile) ────────────────────────────────────── */
/* Button sits directly in .header-inner so it stays visible
   even when the nav panel slides off-screen on mobile.       */
.menu-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 42px;
  height: 42px;
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.2);
  border-radius: var(--radius-sm);
  cursor: pointer;
  padding: 0;
  order: 3;            /* after logo and nav on desktop (hidden anyway) */
  flex-shrink: 0;
  transition: background var(--transition-fast);
}

.menu-toggle:hover { background: rgba(255,255,255,.16); }
.menu-toggle:focus-visible { outline: 2px solid var(--color-accent); outline-offset: 3px; }

.hamburger-line {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--color-white);
  border-radius: 99px;
  transition: transform var(--transition), opacity var(--transition);
}

/* Animated X state */
.menu-toggle[aria-expanded="true"] .hamburger-line:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.menu-toggle[aria-expanded="true"] .hamburger-line:nth-child(2) {
  opacity: 0;
}
.menu-toggle[aria-expanded="true"] .hamburger-line:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* Mobile overlay */
.nav-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(6,21,48,.6);
  z-index: 800;
  backdrop-filter: blur(3px);
}
.nav-overlay.is-open { display: block; }

/* ── Mobile Navigation ─────────────────────────────────────── */
@media (max-width: 992px) {
  .menu-toggle { display: flex; }

  .main-navigation {
    position: fixed;
    top: 0;
    right: -320px;
    width: 300px;
    max-width: 85vw;
    height: 100vh;
    background: var(--color-primary);
    flex-direction: column;
    align-items: flex-start;
    padding: calc(var(--header-h) + 1rem) 1.5rem 2rem;
    gap: 0;
    z-index: 850;
    overflow-y: auto;
    transition: right var(--transition);
    box-shadow: -4px 0 30px rgba(0,0,0,.25);
  }

  .main-navigation.is-open {
    right: 0;
  }

  .nav-menu {
    flex-direction: column;
    align-items: stretch;
    gap: .25rem;
    width: 100%;
  }

  .nav-menu > li > a {
    display: block;
    padding: .85rem 1rem;
    font-size: 1rem;
    border-radius: var(--radius-sm);
    color: rgba(255,255,255,.85);
  }
  .nav-menu > li > a::after { display: none; }
  .nav-menu > li:hover > a { background: rgba(255,255,255,.08); }
  .nav-menu > li.current-menu-item > a {
    background: rgba(243,112,33,.15);
    color: var(--color-accent);
  }
  .nav-menu > li:last-child { margin-top: 1rem; }
  .nav-menu > li:last-child > a {
    display: block;
    text-align: center;
  }

  .lang-switcher {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255,255,255,.1);
    width: 100%;
  }
}

@media (max-width: 480px) {
  .header-inner { gap: 1rem; }
  .logo-text     { font-size: 1.3rem; }
}
