:root {
  --pyrotech-nav-blue: #2563eb;
  --pyrotech-nav-blue-dark: #1e40af;
}

/* Top-of-document marker for scroll detection (1px strip; do not clip to zero or IO breaks) */
.pyrotech-nav-sentinel {
  height: 1px;
  width: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  overflow: hidden;
  position: relative;
  pointer-events: none;
  opacity: 0;
}

.pyrotech-nav {
  position: fixed;
  top: 30px;
  z-index: 9990;
  padding: 24px 48px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  background: transparent;
  width: 100%;
  box-sizing: border-box;
  transition: top 0.28s ease;
}

/* After scrolling — sit closer to the viewport top */
.pyrotech-nav.pyrotech-nav--scrolled {
  top: 10px;
}

body.admin-bar .pyrotech-nav {
  top: 32px;
}

body.admin-bar .pyrotech-nav.pyrotech-nav--scrolled {
  top: 42px; /* admin bar (32px) + 10px */
}

@media screen and (max-width: 782px) {
  body.admin-bar .pyrotech-nav {
    top: 46px;
  }

  body.admin-bar .pyrotech-nav.pyrotech-nav--scrolled {
    top: 56px; /* admin bar (46px) + 10px */
  }
}

.pyrotech-nav__backdrop {
  display: none;
}

.pyrotech-nav__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: var(--container-max-width);
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: 100px;
  box-shadow: 0px 4px 40px 0px #00000026;
  position: relative;
  z-index: 2;
  gap: 12px;
}

.pyrotech-nav__logo-wrap {
  margin-left: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.pyrotech-nav__logo {
  height: 48px;
  width: auto;
}

.pyrotech-nav__links {
  display: flex;
  align-items: center;
  gap: 30px;

  font-weight: 400;
  font-size: 15px;

  text-transform: uppercase;
}

.pyrotech-nav__links a {
  color: #163764;
  text-decoration: none;
}

.pyrotech-nav__links a:hover {
  text-decoration: underline;
}

.pyrotech-nav__menu-btn {
  display: none;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  margin: 0;
  margin-right: 4px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: #163764;
  cursor: pointer;
  outline: none;
}

.pyrotech-nav__menu-btn:focus-visible {
  outline: 2px solid #2563eb;
  outline-offset: 2px;
}

.pyrotech-nav__menu-icon {
  position: relative;
  display: block;
  width: 20px;
  height: 14px;
}

.pyrotech-nav__menu-bar {
  position: absolute;
  left: 0;
  right: 0;
  height: 2px;
  border-radius: 1px;
  background: currentColor;
  transition:
    transform 0.25s ease,
    opacity 0.2s ease,
    top 0.25s ease;
}

.pyrotech-nav__menu-bar:nth-child(1) {
  top: 0;
}

.pyrotech-nav__menu-bar:nth-child(2) {
  top: 6px;
}

.pyrotech-nav__menu-bar:nth-child(3) {
  top: 12px;
}

.pyrotech-nav--open .pyrotech-nav__menu-bar:nth-child(1) {
  top: 6px;
  transform: rotate(45deg);
}

.pyrotech-nav--open .pyrotech-nav__menu-bar:nth-child(2) {
  opacity: 0;
}

.pyrotech-nav--open .pyrotech-nav__menu-bar:nth-child(3) {
  top: 6px;
  transform: rotate(-45deg);
}

@media (max-width: 1024px) {
  .pyrotech-nav {
    padding: 12px 16px;
    top: 20px;
  }

  .pyrotech-nav.pyrotech-nav--scrolled {
    top: 8px;
  }

  .pyrotech-nav__backdrop {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 1;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: rgba(0, 0, 0, 0.15);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition:
      opacity 0.35s ease,
      visibility 0.35s ease,
      backdrop-filter 0.35s ease,
      -webkit-backdrop-filter 0.35s ease;
  }

  .pyrotech-nav--open .pyrotech-nav__backdrop {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
  }

  .pyrotech-nav__inner {
    flex-wrap: nowrap;
    padding: 6px 8px 6px 10px;
    border-radius: 999px;
    max-width: none;
  }

  .pyrotech-nav__logo-wrap {
    margin-left: 6px;
  }

  .pyrotech-nav__logo {
    height: 34px;
  }

  .pyrotech-nav__cta-desktop {
    display: none !important;
  }

  .pyrotech-nav__menu-btn {
    display: inline-flex;
  }

  .pyrotech-nav__links {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: min(320px, 88vw);
    height: 100vh;
    height: 100dvh;
    max-height: 100vh;
    max-height: 100dvh;
    margin: 0;
    padding: max(88px, calc(env(safe-area-inset-top, 0px) + 72px)) 24px 32px;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
    gap: 4px;
    background: #fff;
    box-shadow: -8px 0 40px rgba(0, 0, 0, 0.12);
    transform: translateX(100%);
    visibility: hidden;
    pointer-events: none;
    transition:
      transform 0.35s cubic-bezier(0.4, 0, 0.2, 1),
      visibility 0.35s ease;
    z-index: 3;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    font-size: 16px;
    font-weight: 600;
    letter-spacing: 0.02em;
  }

  .pyrotech-nav__links > a,
  .pyrotech-nav__links > .pyrotech-nav__item {
    opacity: 0;
    transform: translateX(20px);
    transition:
      opacity 0.3s ease,
      transform 0.3s ease;
  }

  .pyrotech-nav__links > a {
    display: block;
    width: 100%;
    padding: 14px 0;
    border-bottom: 1px solid rgba(22, 55, 100, 0.1);
    color: #163764;
    -webkit-tap-highlight-color: transparent;
  }

  .pyrotech-nav__links .pyrotech-nav__item .pyrotech-nav__link {
    display: block;
    padding: 14px 0;
    color: #163764 !important;
    text-decoration: none;
    -webkit-tap-highlight-color: transparent;
    text-decoration: none !important;
  }

  .pyrotech-nav__links a:last-child {
    border-bottom: none;
  }

  .pyrotech-nav--open .pyrotech-nav__links {
    transform: translateX(0);
    visibility: visible;
    pointer-events: auto;
  }

  .pyrotech-nav--open .pyrotech-nav__links > a,
  .pyrotech-nav--open .pyrotech-nav__links > .pyrotech-nav__item {
    opacity: 1;
    transform: translateX(0);
  }

  .pyrotech-nav--open .pyrotech-nav__links > *:nth-child(1) { transition-delay: 0.08s; }
  .pyrotech-nav--open .pyrotech-nav__links > *:nth-child(2) { transition-delay: 0.12s; }
  .pyrotech-nav--open .pyrotech-nav__links > *:nth-child(3) { transition-delay: 0.16s; }
  .pyrotech-nav--open .pyrotech-nav__links > *:nth-child(4) { transition-delay: 0.20s; }
  .pyrotech-nav--open .pyrotech-nav__links > *:nth-child(5) { transition-delay: 0.24s; }
  .pyrotech-nav--open .pyrotech-nav__links > *:nth-child(6) { transition-delay: 0.28s; }
  .pyrotech-nav--open .pyrotech-nav__links > *:nth-child(7) { transition-delay: 0.32s; }
  .pyrotech-nav--open .pyrotech-nav__links > *:nth-child(8) { transition-delay: 0.36s; }
}

@media (max-width: 768px) {
  .pyrotech-nav {
    padding: 10px 12px;
  }

  .pyrotech-nav__inner {
    padding: 5px 6px 5px 8px;
  }

  .pyrotech-nav__logo {
    height: 30px;
  }

  .pyrotech-nav__menu-btn {
    width: 36px;
    height: 36px;
  }
}

/* ==========================================================================
   MEGA MENU — Desktop Hover Dropdowns
   ========================================================================== */

.pyrotech-nav__item {
  position: relative;
  display: flex;
  align-items: center;
}

.pyrotech-nav__item--has-mega .pyrotech-nav__link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none !important;
}

.pyrotech-nav__chevron {
  width: 10px;
  height: 6px;
  flex-shrink: 0;
  transition: transform 0.25s ease;
}

.pyrotech-nav__item--has-mega:hover .pyrotech-nav__chevron,
.pyrotech-nav__item--has-mega.pyrotech-nav__item--active .pyrotech-nav__chevron {
  transform: rotate(180deg);
}

.pyrotech-nav__accordion-toggle {
  display: none;
}

/* Page blur overlay when mega menu is active */
.pyrotech-mega-overlay {
  position: fixed;
  inset: 0;
  z-index: 9970;
  background: rgba(0, 0, 0, 0.08);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition:
    opacity 0.35s ease,
    visibility 0.35s ease,
    backdrop-filter 0.35s ease;
}

.pyrotech-mega-overlay.pyrotech-mega-overlay--active {
  opacity: 1;
  visibility: visible;
}

.pyrotech-mega {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  width: 100%;
  z-index: 9980;
  pointer-events: none;
  padding-top: 4px;
}

.pyrotech-mega__panel {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%) translateY(-10px);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition:
    opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1),
    transform 0.3s cubic-bezier(0.4, 0, 0.2, 1),
    visibility 0.3s ease;
  padding-top: 4px;
}

.pyrotech-mega__panel.pyrotech-mega__panel--active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0);
}

.pyrotech-mega__container {
  display: flex;
  gap: 60px;
  background: #fff;
  border-radius: 18px;
  padding: 32px;
  box-shadow:
    0 4px 6px -1px rgba(0, 0, 0, 0.1),
    0 10px 20px -2px rgba(0, 0, 0, 0.08),
    0 0 0 1px rgba(0, 0, 0, 0.03);
}

.pyrotech-mega__left {
  display: flex;
  flex-direction: column;
  width: 382px;
  flex-shrink: 0;
}

.pyrotech-mega__link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 16px;
  border-bottom: 1px solid #B8B8B8;
  text-decoration: none;
  transition: color 0.2s ease;
}

.pyrotech-mega__link:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.pyrotech-mega__link:not(:first-child) {
  padding-top: 16px;
}

.pyrotech-mega__link-text {
  font-size: 16px;
  color: #000000;
  transition: color 0.2s ease;
}

.pyrotech-mega__link-arrow {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  color: #000000;
  opacity: 0;
  transform: translateX(-8px);
  transition:
    opacity 0.22s ease,
    transform 0.22s ease;
}

.pyrotech-mega__link-arrow svg {
  width: 18px;
  height: 18px;
}

.pyrotech-mega__link:hover .pyrotech-mega__link-arrow {
  opacity: 1;
  transform: translateX(0);
}

.pyrotech-mega__link:hover .pyrotech-mega__link-text {
  color: var(--pyrotech-nav-blue, #2563eb);
}

.pyrotech-mega__right {
  display: flex;
  flex-direction: column;
  gap: 24px;
  width: 364px;
  flex-shrink: 0;
}

.pyrotech-mega__image {
  width: 100%;
  height: 156px;
  object-fit: cover;
  border-radius: 16px;
}

.pyrotech-mega__promo-content {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.pyrotech-mega__title {
  font-size: 21px;
  line-height: 140%;
  color: #000000;
  margin: 0;
}

.pyrotech-mega__title-normal {
  font-weight: 400;
}

.pyrotech-mega__title-bold {
  font-weight: 700;
}

.pyrotech-mega__desc {
  font-weight: 400;
  font-size: 16px;
  line-height: 150%;
  color: #000000;
  margin: 0;
}

.pyrotech-mega__cta {
  align-self: flex-start;
}

/* ==========================================================================
   MOBILE — Accordion Submenus in Hamburger Drawer
   ========================================================================== */

.pyrotech-nav__mobile-submenu {
  display: none;
}

@media (max-width: 1024px) {
  .pyrotech-mega {
    display: none !important;
  }

  .pyrotech-nav__item {
    display: flex;
    flex-wrap: wrap;
    width: 100%;
  }

  .pyrotech-nav__item--has-mega {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
  }

  .pyrotech-nav__item--has-mega .pyrotech-nav__link {
    flex: 1;
    color: #163764 !important;
    pointer-events: none;
    -webkit-tap-highlight-color: transparent;
    text-decoration: none !important;
  }

  .pyrotech-nav__chevron {
    display: none;
  }

  .pyrotech-nav__accordion-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: none;
    background: rgba(22, 55, 100, 0.08);
    border-radius: 8px;
    color: #163764;
    cursor: pointer;
    flex-shrink: 0;
    margin-left: 8px;
    -webkit-tap-highlight-color: transparent;
    transition:
      background-color 0.2s ease,
      transform 0.25s ease;
  }

  .pyrotech-nav__accordion-toggle:hover {
    background: rgba(22, 55, 100, 0.15);
  }

  .pyrotech-nav__accordion-toggle svg {
    transition: transform 0.25s ease;
  }

  .pyrotech-nav__accordion-toggle[aria-expanded="true"] svg {
    transform: rotate(45deg);
  }

  .pyrotech-nav__mobile-submenu {
    display: flex;
    flex-direction: column;
    width: 100%;
    padding: 0 16px;
    gap: 0;
    background: #f8f9fa;
    overflow: hidden;
    max-height: 0;
    border-radius: 8px;
    margin-top: 0;
    margin-bottom: 0;
    transition:
      max-height 0.35s cubic-bezier(0.4, 0, 0.2, 1),
      padding 0.35s cubic-bezier(0.4, 0, 0.2, 1),
      margin 0.35s cubic-bezier(0.4, 0, 0.2, 1),
      opacity 0.3s ease;
    opacity: 0;
  }

  .pyrotech-nav__mobile-submenu[aria-hidden="false"] {
    max-height: 600px;
    padding: 12px 16px;
    margin-top: 8px;
    margin-bottom: 8px;
    opacity: 1;
  }

  .pyrotech-nav__mobile-sublink {
    display: block;
    padding: 10px 0;
    font-size: 14px;
    font-weight: 400;
    color: #163764;
    text-decoration: none;
    text-transform: none;
    border-bottom: 1px solid rgba(22, 55, 100, 0.08);
    -webkit-tap-highlight-color: transparent;
    opacity: 0;
    transform: translateY(8px);
    transition:
      color 0.2s ease,
      opacity 0.25s ease,
      transform 0.25s ease;
  }

  .pyrotech-nav__mobile-submenu[aria-hidden="false"] .pyrotech-nav__mobile-sublink {
    opacity: 1;
    transform: translateY(0);
  }

  .pyrotech-nav__mobile-submenu[aria-hidden="false"] .pyrotech-nav__mobile-sublink:nth-child(1) { transition-delay: 0.05s; }
  .pyrotech-nav__mobile-submenu[aria-hidden="false"] .pyrotech-nav__mobile-sublink:nth-child(2) { transition-delay: 0.08s; }
  .pyrotech-nav__mobile-submenu[aria-hidden="false"] .pyrotech-nav__mobile-sublink:nth-child(3) { transition-delay: 0.11s; }
  .pyrotech-nav__mobile-submenu[aria-hidden="false"] .pyrotech-nav__mobile-sublink:nth-child(4) { transition-delay: 0.14s; }
  .pyrotech-nav__mobile-submenu[aria-hidden="false"] .pyrotech-nav__mobile-sublink:nth-child(5) { transition-delay: 0.17s; }
  .pyrotech-nav__mobile-submenu[aria-hidden="false"] .pyrotech-nav__mobile-sublink:nth-child(6) { transition-delay: 0.20s; }
  .pyrotech-nav__mobile-submenu[aria-hidden="false"] .pyrotech-nav__mobile-sublink:nth-child(7) { transition-delay: 0.23s; }
  .pyrotech-nav__mobile-submenu[aria-hidden="false"] .pyrotech-nav__mobile-sublink:nth-child(8) { transition-delay: 0.26s; }
  .pyrotech-nav__mobile-submenu[aria-hidden="false"] .pyrotech-nav__mobile-sublink:nth-child(9) { transition-delay: 0.29s; }

  .pyrotech-nav__mobile-sublink:last-child {
    border-bottom: none;
  }

  .pyrotech-nav__mobile-sublink:hover,
  .pyrotech-nav__mobile-sublink:active {
    color: var(--pyrotech-nav-blue, #2563eb);
  }

  .pyrotech-nav__links {
    overflow-y: auto;
  }

  .pyrotech-nav__links .pyrotech-nav__item {
    border-bottom: 1px solid rgba(22, 55, 100, 0.1);
    padding: 0;
    flex-wrap: wrap;
  }

  .pyrotech-nav__links .pyrotech-nav__item .pyrotech-nav__link {
    padding: 14px 0;
    border-bottom: none;
  }

  .pyrotech-nav__links .pyrotech-nav__item:last-child {
    border-bottom: none;
  }
}
