/* =========================================================================
 * Site Header — Sticky, Mobile Drawer, Hamburger
 *
 * The dropdown arrow is added via CSS (::after) on any
 * `.menu-item-has-children > .bes-nav__link`, so it renders identically
 * whether the menu is a real Polylang-assigned menu or the theme fallback.
 * ========================================================================= */

.bes-header {
  position: sticky;
  top: 0;
  z-index: 999;
  background: rgba(0, 0, 0, 0.78);
  backdrop-filter: saturate(140%) blur(12px);
  -webkit-backdrop-filter: saturate(140%) blur(12px);
  color: #fff;
  border-bottom: 1px solid rgba(234, 193, 23, 0.1);
  transition:
    background 0.3s ease,
    box-shadow 0.3s ease;
}

.bes-header.is-scrolled {
  background: rgba(0, 0, 0, 0.96);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
  border-bottom-color: rgba(234, 193, 23, 0.35);
}

/* Top Bar (Hidden on Mobile) */
.bes-header__top {
  background: rgba(11, 11, 11, 0.85);
  border-bottom: 1px solid rgba(219, 219, 219, 0.08);
  font-size: 0.875rem;
}

.bes-header__top-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 40px;
  padding-block: 6px;
}

.bes-header__top-list {
  display: flex;
  align-items: center;
  gap: 22px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.bes-header__top-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #ccc;
  text-decoration: none;
  white-space: nowrap;
}

.bes-header__top-item:hover {
  color: #eac117;
}

.bes-header__top-item svg {
  width: 14px;
  height: 14px;
  color: #eac117;
}

.bes-header__socials {
  display: flex;
  align-items: center;
  gap: 8px;
}

.bes-header__social {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  color: #ccc;
  border: 1px solid rgba(219, 219, 219, 0.18);
  transition: all 0.2s;
}

.bes-header__social:hover {
  background: #eac117;
  color: #000;
  border-color: #eac117;
}

.bes-header__quote-link {
  margin-left: 10px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  color: #eac117;
  text-decoration: none;
  white-space: nowrap;
}

/* Main Header Row */
.bes-header__main {
  padding-block: 14px;
}

.bes-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: nowrap;
}

/* Logo */
.bes-header__logo {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
  text-decoration: none;
}

.bes-header__logo-text {
  font-family: var(--bes-font-head, sans-serif);
  font-size: 1.5rem;
  font-weight: 700;
  color: #fff;
  text-transform: uppercase;
  white-space: nowrap;
}

.bes-header__logo-text span {
  color: #eac117;
}

.bes-header__logo-img {
  max-height: 44px;
  width: auto;
}

/* Desktop Navigation (Hidden on Mobile) */
.bes-nav {
  display: none;
  flex: 1;
  justify-content: center;
}

.bes-nav__list {
  display: flex;
  align-items: center;
  gap: 4px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.bes-nav__link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 14px;
  font-size: 0.9375rem;
  color: #ccc;
  text-decoration: none;
  white-space: nowrap;
}

.bes-nav__link:hover {
  color: #fff;
}

/* =========================================================================
 * Desktop dropdown arrow — CSS-based, language-agnostic.
 * Applies to ANY .menu-item-has-children (real menu or fallback).
 * ========================================================================= */

@media (min-width: 1024px) {
  .menu-item-has-children {
    position: relative;
  }

  /* The chevron arrow */
  .menu-item-has-children > .bes-nav__link::after {
    content: "";
    display: inline-block;
    width: 6px;
    height: 6px;
    margin-left: 2px;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(45deg) translateY(-2px);
    transform-origin: center;
    transition:
      transform 0.25s ease,
      color 0.2s ease;
    flex-shrink: 0;
  }

  /* Arrow flips on hover and when the item is open */
  .menu-item-has-children:hover > .bes-nav__link::after,
  .menu-item-has-children.is-open > .bes-nav__link::after {
    transform: rotate(225deg) translateY(-2px);
    color: #eac117;
  }

  /* --- Dropdown panel (2-column grid for the 13 services) --- */
  .bes-nav__submenu {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(10px);
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 4px;
    min-width: 550px;
    background: rgba(11, 11, 11, 0.98);
    backdrop-filter: blur(8px);
    border-top: 3px solid #eac117;
    box-shadow:
      0 24px 60px rgba(0, 0, 0, 0.6),
      0 0 0 1px rgba(234, 193, 23, 0.1);
    padding: 16px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 10;
    list-style: none;
    margin: 0;
  }

  .menu-item-has-children:hover > .bes-nav__submenu,
  .menu-item-has-children.is-open > .bes-nav__submenu {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
  }

  .bes-nav__submenu li {
    width: 100%;
  }

  .bes-nav__submenu a {
    display: block;
    padding: 10px 14px;
    font-size: 0.875rem;
    color: #ccc;
    text-decoration: none;
    border-radius: 4px;
    transition:
      background 0.2s,
      color 0.2s;
  }

  .bes-nav__submenu a:hover {
    background: rgba(234, 193, 23, 0.08);
    color: #eac117;
  }
}

/* Header Actions (Right Side) */
.bes-header__actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
  margin-left: auto;
}

/* Language Switcher */
.bes-lang-switcher {
  display: flex;
  align-items: center;
  gap: 2px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.bes-lang-switcher a {
  display: inline-block;
  padding: 7px 10px;
  font-size: 0.8125rem;
  font-weight: 600;
  color: #ccc;
  text-decoration: none;
  white-space: nowrap;
}

.bes-lang-switcher li.is-active a {
  background: #eac117;
  color: #000;
}

/* Desktop CTA Button */
.bes-header__cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  background: #eac117;
  color: #000;
  font-size: 0.875rem;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
  border-radius: 4px;
}

/* Hamburger Button */
.bes-menu-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  color: #fff;
  background: transparent;
  border: 1px solid rgba(219, 219, 219, 0.22);
  cursor: pointer;
}

.bes-menu-toggle:hover {
  border-color: #eac117;
  color: #eac117;
}

.bes-menu-toggle svg {
  width: 24px;
  height: 24px;
}

.bes-menu-toggle__close {
  display: none;
}

.bes-menu-toggle.is-open .bes-menu-toggle__open {
  display: none;
}

.bes-menu-toggle.is-open .bes-menu-toggle__close {
  display: block;
}

.bes-menu-toggle.is-open {
  background: #eac117;
  color: #000;
  border-color: #eac117;
}

/* =========================================================================
 * Mobile Drawer & Overlay
 * ========================================================================= */

.bes-mobile-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(3px);
  opacity: 0;
  visibility: hidden;
  transition:
    opacity 0.3s ease,
    visibility 0.3s ease;
  z-index: 998;
}

.bes-mobile-overlay.is-open {
  opacity: 1;
  visibility: visible;
}

.bes-mobile-drawer {
  position: fixed;
  top: 0;
  right: 0;
  height: 100dvh;
  width: min(380px, 92vw);
  background: #0a0a0a;
  color: #fff;
  transform: translateX(100%);
  transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1);
  z-index: 999;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  border-left: 4px solid #eac117;
  box-shadow: -30px 0 60px rgba(0, 0, 0, 0.6);
}

.bes-mobile-drawer.is-open {
  transform: none;
}

.bes-mobile-drawer__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px;
  border-bottom: 1px solid rgba(219, 219, 219, 0.1);
  background: rgba(0, 0, 0, 0.4);
}

.bes-mobile-drawer__title {
  font-size: 1.125rem;
  font-weight: 700;
  text-transform: uppercase;
  color: #eac117;
}

.bes-mobile-drawer__close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  color: #fff;
  background: none;
  border: 1px solid rgba(219, 219, 219, 0.22);
  cursor: pointer;
}

.bes-mobile-drawer__body {
  padding: 20px 22px;
  flex: 1;
  overflow-y: auto;
}

/* =========================================================================
 * MOBILE MENU ACCORDION
 * ========================================================================= */

.bes-mobile-drawer__body ul,
.bes-mobile-nav__list {
  display: flex !important;
  flex-direction: column !important;
  width: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
  list-style: none !important;
  gap: 10px !important;
}

.bes-mobile-drawer__body li,
.bes-mobile-nav__list > li {
  display: block !important;
  width: 100% !important;
  float: none !important;
  margin: 0 !important;
  padding: 0 !important;
  position: relative;
}

/* Premium Card Style for Links */
.bes-mobile-drawer__body li a,
.bes-mobile-nav__list > li > a {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  width: 100% !important;
  padding: 16px 60px 16px 20px !important; /* room for the arrow button */
  background: rgba(255, 255, 255, 0.03) !important;
  border-left: 3px solid transparent !important;
  border-radius: 8px !important;
  color: #ccc !important;
  text-decoration: none !important;
  font-size: 1rem !important;
  font-weight: 500 !important;
  box-sizing: border-box !important;
  transition: all 0.3s ease !important;
}

/* Mobile Arrow Button */
.bes-mobile-nav__toggle {
  position: absolute;
  right: 10px;
  top: 8px;
  width: 40px;
  height: 40px;
  background: transparent;
  border: none;
  color: #eac117;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
}

.bes-mobile-nav__toggle::after {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(-45deg);
  transition: transform 0.3s ease;
}

.bes-mobile-nav__toggle[aria-expanded="true"]::after {
  transform: rotate(45deg);
}

/* Hover State */
.bes-mobile-drawer__body li a:hover,
.bes-mobile-nav__list > li > a:hover {
  background: rgba(234, 193, 23, 0.08) !important;
  border-left-color: #eac117 !important;
  color: #eac117 !important;
  padding-left: 26px !important;
}

/* Active Page State */
.bes-mobile-drawer__body li.current-menu-item > a,
.bes-mobile-nav__list > li.current-menu-item > a {
  background: rgba(234, 193, 23, 0.15) !important;
  border-left-color: #eac117 !important;
  color: #eac117 !important;
}

/* Submenu Styling */
.bes-mobile-drawer__body .sub-menu,
.bes-mobile-nav__submenu {
  display: none !important;
  flex-direction: column !important;
  gap: 4px !important;
  padding: 10px 0 10px 20px !important;
  margin: 0 0 10px 10px !important;
  border-left: 2px solid rgba(234, 193, 23, 0.3) !important;
  width: auto !important;
}

.bes-mobile-drawer__body .sub-menu.is-open,
.bes-mobile-nav__submenu.is-open {
  display: flex !important;
  animation: besFadeIn 0.3s ease forwards;
}

.bes-mobile-drawer__body .sub-menu a,
.bes-mobile-nav__submenu a {
  padding: 10px 16px !important;
  background: transparent !important;
  border-left: none !important;
  font-size: 0.9rem !important;
  color: #999 !important;
}

.bes-mobile-drawer__body .sub-menu a:hover,
.bes-mobile-nav__submenu a:hover {
  color: #fff !important;
  background: rgba(255, 255, 255, 0.05) !important;
  padding-left: 20px !important;
}

@keyframes besFadeIn {
  from {
    opacity: 0;
    transform: translateY(-5px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Drawer Footer */
.bes-mobile-drawer__foot {
  padding: 20px 22px;
  border-top: 1px solid rgba(219, 219, 219, 0.12);
  background: rgba(0, 0, 0, 0.3);
}

.bes-mobile-drawer__contact a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  color: #ccc;
  text-decoration: none;
}

.bes-mobile-drawer__contact svg {
  width: 16px;
  height: 16px;
  color: #eac117;
}

.bes-btn--block {
  display: block;
  width: 100%;
  text-align: center;
  padding: 14px;
  background: #eac117;
  color: #000;
  font-weight: 700;
  text-decoration: none;
  margin-top: 16px;
  border-radius: 6px;
}

/* =========================================================================
 * Breakpoints
 * ========================================================================= */

/* Desktop: Show Nav, Hide Hamburger */
@media (min-width: 1024px) {
  .bes-nav {
    display: flex !important;
  }
  .bes-menu-toggle {
    display: none !important;
  }
  .bes-header__top {
    display: block !important;
  }
}

/* Mobile & Tablet: Hide Nav & CTA, Show Hamburger */
@media (max-width: 1023px) {
  .bes-header__top {
    display: none !important;
  }
  .bes-nav {
    display: none !important;
  }
  .bes-header__cta {
    display: none !important;
  }
  .bes-menu-toggle {
    display: inline-flex !important;
  }
}

@media (max-width: 480px) {
  .bes-header__logo-text {
    font-size: 1.25rem;
  }
}

/* =========================================================================
 * Reduced Motion
 * ========================================================================= */
@media (prefers-reduced-motion: reduce) {
  .bes-header__cta {
    animation: none;
  }
  .bes-mobile-drawer {
    transition: none;
  }
  .bes-mobile-overlay {
    transition: none;
  }
  .menu-item-has-children > .bes-nav__link::after {
    transition: none !important;
  }
}
