/* ==========================================================================
   Site header (all frontend pages)
   Markup: resources/views/layouts/partials/header.blade.php
   Script: public/frontend/assets/js/header.js
   Design: "Webase — Services Section Redesign" canvas, Home.dc.html (header)

   Sits transparently over the top of the page (pages start with a dark
   hero / page-title band). After scrolling, header.js adds .is-scrolled and
   it becomes a fixed dark bar.
   ========================================================================== */

:root {
  /* Space the header covers at the top of the page — used by full-bleed heroes */
  --wb-header-height: 108px;
}

.wb-header,
.wb-drawer {
  --wb-header-bg: #0E0720;
  --wb-header-accent: #ED194E;
  --wb-header-navy: #202547;

  font-family: 'Inter Tight', system-ui, sans-serif;
}

.wb-header {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 999;
  padding: 28px 0;
  color: #FFFFFF;
  transition: background-color .3s ease, padding .3s ease, box-shadow .3s ease;
}

/* Scrolled: fixed dark glass bar */
.wb-header.is-scrolled {
  position: fixed;
  padding: 12px 0;
  background-color: rgba(14, 7, 32, .9);
  -webkit-backdrop-filter: blur(16px) saturate(150%);
          backdrop-filter: blur(16px) saturate(150%);
  box-shadow: 0 10px 30px -12px rgba(0, 0, 0, .5);
  animation: wb-header-in .35s ease both;
}

@keyframes wb-header-in {
  from { transform: translateY(-100%); }
  to   { transform: translateY(0); }
}

.wb-header a,
.wb-drawer a {
  color: #FFFFFF;
  text-decoration: none;
}

.wb-header a:hover,
.wb-drawer a:hover {
  color: #FFD0DB;
}

/* Width comes from Bootstrap's .container */
.wb-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.wb-header__brand {
  display: flex;
  align-items: center;
}

.wb-header__brand img {
  display: block;
  width: auto;
  height: 52px;
  transition: height .3s ease;
}

.wb-header.is-scrolled .wb-header__brand img {
  height: 44px;
}

/* ---------- Glass pill menu ---------- */

.wb-header__nav {
  position: relative;
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 6px;
  border: 1px solid rgba(255, 255, 255, .14);
  border-radius: 999px;
  background: rgba(255, 255, 255, .06);
  -webkit-backdrop-filter: blur(16px);
          backdrop-filter: blur(16px);
}

.wb-header__nav-link {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 12px 22px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: #FFFFFF;
  font-family: inherit;
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.2;
  white-space: nowrap;
  cursor: pointer;
  transition: background .2s;
}

.wb-header .wb-header__nav-link:hover,
.wb-header .wb-header__nav-link[aria-current="page"],
.wb-header__menu:hover > .wb-header__nav-link,
.wb-header__menu:focus-within > .wb-header__nav-link {
  color: #FFFFFF;
  background: rgba(255, 255, 255, .1);
}

.wb-header__chevron {
  flex: none;
  transition: transform .2s;
}

.wb-header__menu:hover .wb-header__chevron,
.wb-header__menu:focus-within .wb-header__chevron {
  transform: rotate(180deg);
}

/* ---------- Dropdown panels (open on hover / keyboard focus) ---------- */

.wb-header__menu {
  position: relative;
}

/* The mega panel is centred on the whole pill, not on its own item */
.wb-header__menu--mega {
  position: static;
}

.wb-header__panel {
  position: absolute;
  top: 100%;
  z-index: 5;
  box-sizing: border-box;
  margin-top: 12px;
  border: 1px solid rgba(32, 37, 71, .08);
  border-radius: 24px;
  background: #FFFFFF;
  box-shadow: 0 30px 70px -18px rgba(8, 4, 24, .7), 0 2px 8px rgba(8, 4, 24, .12);
  opacity: 0;
  visibility: hidden;
  transform: translateY(6px);
  transition: opacity .2s ease, transform .2s ease, visibility .2s;
}

/* Invisible bridge over the gap so the panel stays open while the pointer moves down */
.wb-header__panel::before {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: -14px;
  height: 14px;
}

.wb-header__menu:hover > .wb-header__panel,
.wb-header__menu:focus-within > .wb-header__panel {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.wb-header__panel--mega {
  left: 50%;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  width: min(880px, 90vw);
  margin-left: calc(min(880px, 90vw) / -2);
  padding: 24px 16px;
}

.wb-header__panel--list {
  left: 0;
  display: flex;
  flex-direction: column;
  min-width: 220px;
  padding: 10px;
}

.wb-header__panel-col {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.wb-header__panel-title {
  padding: 0 16px 8px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--wb-header-accent);
}

.wb-header__panel--mega .wb-header__panel-title {
  letter-spacing: .1em;
  white-space: nowrap;
}

/* Mega panel: thin dividers between the service columns */
.wb-header__panel--mega .wb-header__panel-col + .wb-header__panel-col {
  padding-left: 16px;
  border-left: 1px solid #EEE9DF;
}

.wb-header .wb-header__panel-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  border-radius: 14px;
  color: var(--wb-header-navy);
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.01em;
  transition: background .2s, color .2s;
}

/* Arrow slides in on hover */
.wb-header .wb-header__panel-link::after {
  content: '→';
  color: var(--wb-header-accent);
  opacity: 0;
  transform: translateX(-6px);
  transition: opacity .2s, transform .2s;
}

.wb-header .wb-header__panel-link:hover,
.wb-header .wb-header__panel-link:focus-visible {
  color: var(--wb-header-accent);
  background: #F4F1EA;
}

.wb-header .wb-header__panel-link:hover::after,
.wb-header .wb-header__panel-link:focus-visible::after {
  opacity: 1;
  transform: translateX(0);
}

.wb-header .wb-header__panel-link:focus-visible {
  outline: 2px solid var(--wb-header-accent);
  outline-offset: -2px;
}

/* ---------- Actions: CTA + menu button ---------- */

.wb-header__actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.wb-header .wb-header__cta,
.wb-drawer .wb-header__cta {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 52px;
  box-sizing: border-box;
  padding: 14px 22px;
  border-radius: 999px;
  background: var(--wb-header-accent);
  color: #FFFFFF;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.2;
  transition: transform .2s, box-shadow .2s;
}

.wb-header .wb-header__cta:hover,
.wb-drawer .wb-header__cta:hover {
  color: #FFFFFF;
  transform: translateY(-2px);
  box-shadow: 0 18px 50px rgba(237, 25, 78, .45);
}

.wb-drawer .wb-header__cta--block {
  justify-content: center;
  margin-top: auto;
}

.wb-header__icon-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, .25);
  border-radius: 999px;
  background: rgba(255, 255, 255, .06);
  color: #FFFFFF;
  cursor: pointer;
  transition: background .2s, border-color .2s;
}

.wb-header__icon-btn:hover {
  border-color: rgba(255, 255, 255, .4);
  background: rgba(255, 255, 255, .14);
}

.wb-header__menu-toggle {
  display: none;
}

.wb-header a:focus-visible,
.wb-header button:focus-visible,
.wb-drawer a:focus-visible,
.wb-drawer button:focus-visible,
.wb-drawer summary:focus-visible {
  outline: 2px solid #FFFFFF;
  outline-offset: 3px;
}

/* ---------- Mobile drawer ---------- */

.wb-drawer {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 24px;
  box-sizing: border-box;
  padding: 20px;
  overflow-y: auto;
  background: var(--wb-header-bg);
  color: #FFFFFF;
}

.wb-drawer[hidden] {
  display: none;
}

.wb-drawer__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.wb-drawer__title {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, .6);
}

.wb-drawer__nav {
  display: flex;
  flex-direction: column;
}

.wb-drawer .wb-drawer__link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 4px;
  border-bottom: 1px solid rgba(255, 255, 255, .1);
  color: #FFFFFF;
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.02em;
  list-style: none;
  cursor: pointer;
}

.wb-drawer__link::-webkit-details-marker {
  display: none;
}

.wb-drawer__group {
  display: flex;
  flex-direction: column;
}

.wb-drawer__group[open] .wb-header__chevron {
  transform: rotate(180deg);
}

.wb-drawer__group > .wb-header__panel-title {
  display: block;
  padding: 16px 4px 4px;
}

.wb-drawer .wb-drawer__sub {
  display: block;
  padding: 10px 4px 10px 16px;
  font-size: 17px;
  font-weight: 500;
  color: rgba(255, 255, 255, .8);
}

.wb-drawer .wb-drawer__sub--all {
  color: #FFFFFF;
  font-weight: 600;
}

/* ---------- Responsive (Bootstrap container steps: xxl 1400 · xl 1200 · lg 992) ---------- */

/* Below xxl the container is 1140px: tighten the six-item pill */
@media (max-width: 1399.98px) {
  .wb-header__nav-link {
    padding: 12px 14px;
    font-size: 16px;
  }
}

/* Below xl the container is 960px: the CTA shrinks to its arrow */
@media (max-width: 1199.98px) {
  .wb-header .wb-header__cta-label {
    display: none;
  }
}

/* Below lg: the pill is replaced by the menu button */
@media (max-width: 991.98px) {
  :root {
    --wb-header-height: 92px;
  }

  .wb-header {
    padding: 20px 0;
  }

  .wb-header.is-scrolled {
    padding: 10px 0;
  }

  .wb-header__nav {
    display: none;
  }

  .wb-header__menu-toggle {
    display: flex;
  }
}

@media (prefers-reduced-motion: reduce) {
  .wb-header,
  .wb-header.is-scrolled {
    animation: none;
    transition: none;
  }
}
