/* Header Styles */
.header {
  background-color: #000;
  width: 100%;
  border-bottom: 1px solid #262626;
  padding: 1.5rem;
  position: relative;
  z-index: 100;
}

.header-container {
  max-width: 80rem;
  margin: 0 auto;
  padding: 0 1rem;
  display: flex;
  height: 5rem;
  align-items: center;
  justify-content: space-between;
  position: relative;
  z-index: 1;
}

.logo-section {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.logo-link {
  flex-shrink: 0;
  outline: none;
  display: flex;
  align-items: center;
}

.logo-link:focus-visible {
  outline: 2px solid #ffd046;
  outline-offset: 2px;
}

.logo-img {
  display: block;
  height: 4rem;
  width: auto;
  max-width: 100%;
  object-fit: contain;
}

/* WordPress Custom Logo sizing */
.logo-link img.custom-logo {
  height: 4rem !important;
  width: auto !important;
  max-width: 320px !important;
  object-fit: contain;
}

.search-btn-desktop {
  display: none;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  color: #fff;
  background: transparent;
  border: 1px solid #404040;
  cursor: pointer;
  transition: all 0.2s;
  font-size: 1rem;
}

.search-btn-desktop:hover,
.search-btn-desktop:focus-visible,
.search-btn-desktop[aria-expanded="true"] {
  border-color: #ffd046;
  color: #ffd046;
}

.search-btn-desktop:focus-visible {
  outline: 2px solid #ffd046;
  outline-offset: 2px;
}

/* Navigation Styles */
.nav {
  background-color: #000;
  width: 100%;
  border-bottom: 1px solid #262626;
  position: relative;
  z-index: 100;
}

.nav-container {
  max-width: 80rem;
  margin: 0 auto;
  padding: 0 1rem;
  display: flex;
  height: 3.5rem;
  align-items: center;
  justify-content: center;
  position: relative;
  z-index: 100;
}

.nav-list {
  display: none;
  align-items: center;
  gap: 0;
  list-style: none;
}

.nav-item {
  position: relative;
}

.nav-link,
.nav-dropdown-btn {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.5rem 1.25rem;
  color: #fff;
  background: transparent;
  border: none;
  cursor: pointer;
  font-weight: 500;
  font-size: 1rem;
  text-decoration: none;
  transition: color 0.2s;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.nav-link:hover,
.nav-link:focus-visible,
.nav-dropdown-btn:hover,
.nav-dropdown-btn:focus-visible {
  color: #ffd046;
}

.nav-link:focus-visible,
.nav-dropdown-btn:focus-visible {
  outline: 2px solid #ffd046;
  outline-offset: 2px;
  border-radius: 2px;
}

/* Ensure nav links with dropdowns are keyboard accessible */
.nav-link-has-dropdown {
  position: relative;
}

/* Touch device support - make dropdown links clickable on touch */
@media (hover: none) and (pointer: coarse) {
  .nav-link-has-dropdown {
    cursor: pointer;
  }
  
  .nav-item:hover .dropdown-menu {
    /* Disable hover-only behavior on touch devices */
    opacity: 0;
    pointer-events: none;
  }
  
  .nav-item .dropdown-menu.open {
    opacity: 1;
    pointer-events: auto;
  }
}

.chevron-icon {
  width: 1rem;
  height: 1rem;
  transition: transform 0.2s;
}

.nav-dropdown-btn[aria-expanded="true"] .chevron-icon,
.nav-link-has-dropdown[aria-expanded="true"] .chevron-icon,
.nav-link-has-dropdown:hover .chevron-icon,
.nav-item:hover .nav-link-has-dropdown .chevron-icon {
  transform: rotate(180deg);
}

/* Dropdown Menu - Desktop Only */
@media (min-width: 1024px) {
  .dropdown-menu {
    position: absolute;
    left: 0;
    top: 100%;
    z-index: 50;
    min-width: 320px;
    background-color: #000;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    opacity: 0;
    transform: scaleY(0.95) translateY(-0.5rem);
    transform-origin: top;
    pointer-events: none;
    transition: all 0.2s;
  }

  .dropdown-menu.open,
  .nav-item:hover .dropdown-menu,
  .nav-item .dropdown-menu:hover {
    opacity: 1;
    transform: scaleY(1) translateY(0);
    pointer-events: auto;
  }

  .dropdown-menu-inner {
    padding: 0.5rem 0;
  }

  .dropdown-group {
    position: relative;
  }

  .dropdown-group,
  .dropdown-menu-inner > .dropdown-item {
    border-bottom: 1px solid #262626;
  }

  .dropdown-group:last-child,
  .dropdown-menu-inner > .dropdown-item:last-child {
    border-bottom: none;
  }

  .dropdown-item {
    display: flex;
    flex-direction: column;
    padding: 0.75rem 1.25rem;
    color: #fff;
    text-decoration: none;
    transition: all 0.2s;
  }

  .dropdown-group .dropdown-item {
    border-bottom: none;
  }

  .dropdown-item-parent {
    padding-bottom: 0.625rem;
  }

  .dropdown-item-main {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    width: 100%;
  }

  .dropdown-item-main .chevron-icon {
    width: 0.875rem;
    height: 0.875rem;
    flex-shrink: 0;
  }

  .dropdown-group:hover .dropdown-item-main .chevron-icon,
  .dropdown-group:focus-within .dropdown-item-main .chevron-icon,
  .dropdown-group.submenu-open .dropdown-item-main .chevron-icon {
    transform: translateX(0.125rem);
  }

  .dropdown-submenu {
    display: none;
    position: absolute;
    left: 100%;
    top: 0;
    z-index: 60;
    min-width: 280px;
    max-height: min(70vh, 36rem);
    overflow-y: auto;
    padding: 0.125rem 0 0.5rem;
    background-color: #000;
    border-left: 1px solid #262626;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
  }

  .dropdown-group:hover > .dropdown-submenu,
  .dropdown-group:focus-within > .dropdown-submenu,
  .dropdown-group.submenu-open > .dropdown-submenu {
    display: block;
  }

  .dropdown-subitem {
    padding: 0.75rem 1.25rem;
    color: #fff;
    font-size: 0.9375rem;
  }

  .dropdown-subitem .dropdown-item-label {
    font-weight: 500;
  }

  .dropdown-item:hover,
  .dropdown-item:focus-visible {
    background-color: #171717;
  }

  .dropdown-item:focus-visible {
    outline: 2px solid #ffd046;
    outline-offset: -2px;
    border-radius: 2px;
  }
  
  .dropdown-item {
    -webkit-tap-highlight-color: rgba(255, 208, 70, 0.2);
    touch-action: manipulation;
  }

  .dropdown-item:hover .dropdown-item-label,
  .dropdown-item:focus-visible .dropdown-item-label {
    color: #ffd046;
  }

  .dropdown-item-label {
    font-weight: 500;
    transition: color 0.2s;
  }

  .dropdown-item-desc {
    font-size: 0.875rem;
    color: #a3a3a3;
    margin-top: 0.125rem;
  }
}

/* Mobile Controls */
.mobile-controls {
  display: none;
  align-items: center;
  gap: 0.5rem;
  margin-left: auto;
  position: relative;
  z-index: 100;
}

@media (max-width: 1023px) {
  .mobile-controls {
    display: flex;
  }
}

.mobile-btn {
  padding: 0.5rem;
  color: #fff;
  background: transparent;
  border: none;
  cursor: pointer;
  transition: color 0.2s;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  min-width: 44px;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.mobile-btn:hover,
.mobile-btn:focus-visible {
  color: #ffd046;
}

.mobile-btn:focus-visible {
  outline: 2px solid #ffd046;
  outline-offset: 2px;
}

.mobile-btn svg {
  width: 1.5rem;
  height: 1.5rem;
}

/* Search Panel */
.search-panel {
  border-top: 1px solid #262626;
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transition: all 0.3s ease-in-out;
  visibility: hidden;
  pointer-events: none;
}

.search-panel.open {
  max-height: 400px;
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.search-panel-inner {
  max-width: 80rem;
  margin: 0 auto;
  padding: 0 1rem;
}

.search-form {
  padding: 1.5rem 0;
}

.search-form-inner {
  max-width: 42rem;
  margin: 0 auto;
  position: relative;
}

/* Header search panel styles - scoped to .search-panel to prevent conflicts */
.search-panel .search-input {
  width: 100%;
  background-color: #171717;
  color: #fff;
  padding: 1rem 1.25rem;
  padding-right: 3.5rem;
  border: 1px solid #404040;
  font-size: 1.125rem;
  position: relative; /* Ensure it's not affected by .no-results styles */
}

.search-panel .search-input::placeholder {
  color: #737373;
}

.search-panel .search-input:focus {
  border-color: #ffd046;
  outline: none;
}

.search-panel .search-input:focus-visible {
  outline: 2px solid #ffd046;
  outline-offset: -2px;
}

.search-panel .search-submit {
  position: absolute;
  right: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  padding: 0.5rem;
  color: #a3a3a3;
  background: transparent;
  border: none;
  cursor: pointer;
  transition: color 0.2s;
}

.search-panel .search-submit:hover,
.search-panel .search-submit:focus-visible {
  color: #ffd046;
}

.search-panel .search-submit:focus-visible {
  outline: 2px solid #ffd046;
  outline-offset: 2px;
}

.search-submit svg {
  width: 1.5rem;
  height: 1.5rem;
}

/* Mobile Menu */
.mobile-menu {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 90;
  background-color: #000;
  overflow-y: auto;
  display: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s, visibility 0.3s;
  -webkit-overflow-scrolling: touch;
  pointer-events: none;
  padding-top: calc(5rem + 1.5rem + 3.5rem + 1.5rem); /* header height + header top padding + nav height + header bottom padding */
}

/* Calculate mobile menu padding-top dynamically */
@media (min-width: 640px) and (max-width: 1023px) {
  .mobile-menu {
    padding-top: calc(8rem + 1.5rem + 3.5rem + 1.5rem); /* larger header height on tablet+ */
  }
}

.mobile-menu.open {
  display: block;
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.mobile-menu-inner {
  padding: 1rem;
}

.mobile-nav-item {
  border-bottom: 1px solid #262626;
}

.mobile-nav-item-with-dropdown {
  display: flex;
  align-items: center;
  width: 100%;
  border-bottom: 1px solid #262626;
}

.mobile-nav-item-with-dropdown .mobile-nav-link {
  flex: 1;
  padding: 1rem;
  text-decoration: none;
}

.mobile-nav-item-with-dropdown .mobile-dropdown-btn {
  flex-shrink: 0;
  width: auto;
  padding: 1rem;
  justify-content: center;
}

.mobile-nav-link,
.mobile-dropdown-btn {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  padding: 1rem;
  color: #fff;
  background: transparent;
  border: none;
  cursor: pointer;
  font-weight: 500;
  font-size: 1.125rem;
  text-decoration: none;
  transition: all 0.2s;
  -webkit-tap-highlight-color: rgba(255, 208, 70, 0.2);
  touch-action: manipulation;
  min-height: 44px;
}

.mobile-nav-link:hover,
.mobile-nav-link:focus-visible,
.mobile-dropdown-btn:hover,
.mobile-dropdown-btn:focus-visible {
  background-color: #171717;
  color: #ffd046;
}

.mobile-nav-link:focus-visible,
.mobile-dropdown-btn:focus-visible {
  outline: 2px solid #ffd046;
  outline-offset: -2px;
}

.mobile-dropdown-btn .chevron-icon {
  width: 1.25rem;
  height: 1.25rem;
}

.mobile-dropdown-btn[aria-expanded="true"] .chevron-icon {
  transform: rotate(180deg);
}

.mobile-dropdown-menu {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.2s;
}

.mobile-dropdown-menu.open {
  max-height: 72rem;
}

.mobile-dropdown-inner {
  background-color: #0a0a0a;
  margin-left: 1rem;
}

.mobile-dropdown-inner .mobile-nav-item {
  border-bottom-color: #1f1f1f;
}

.mobile-dropdown-inner .mobile-nav-item:last-child {
  border-bottom: none;
}

.mobile-dropdown-inner .mobile-nav-link {
  font-size: 1rem;
  padding: 0.875rem 1rem;
}

.mobile-nav-subitem-with-dropdown {
  border-bottom: none;
}

.mobile-nav-subitem-with-dropdown .mobile-dropdown-btn {
  padding: 0.875rem 1rem;
}

.mobile-subdropdown-menu {
  background-color: #050505;
}

.mobile-subdropdown-menu.open {
  max-height: 36rem;
}

.mobile-submenu {
  margin: 0 0 0.5rem 1rem;
  padding: 0.25rem 0 0.25rem 0.75rem;
  background-color: #050505;
}

.mobile-nav-grandchild {
  border-bottom: none;
}

.mobile-nav-grandchild .mobile-nav-link {
  min-height: 40px;
  padding: 0.625rem 0.75rem;
  color: #d4d4d4;
  font-size: 0.9375rem;
}

.mobile-dropdown-item {
  display: block;
  padding: 0.75rem 1rem;
  color: #fff;
  text-decoration: none;
  transition: all 0.2s;
  -webkit-tap-highlight-color: rgba(255, 208, 70, 0.2);
  touch-action: manipulation;
  min-height: 44px;
  display: flex;
  align-items: center;
}

.mobile-dropdown-item:hover,
.mobile-dropdown-item:focus-visible {
  background-color: #171717;
  color: #ffd046;
}

/* Ensure the menu toggle (hamburger/close button) stays above the overlay */
.mobile-controls {
  position: relative;
  z-index: 100;
}

.mobile-dropdown-item:focus-visible {
  outline: 2px solid #ffd046;
  outline-offset: -2px;
}

.mobile-dropdown-item-label {
  font-weight: 500;
  display: block;
}

.mobile-dropdown-item-desc {
  font-size: 0.875rem;
  color: #a3a3a3;
  margin-top: 0.125rem;
  display: block;
}

/* Icons */
.icon {
  display: inline-block;
  width: 1em;
  height: 1em;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
}

/* Mobile menu icon states */
#menu-icon {
  display: inline-block !important;
}

#close-icon {
  display: none !important;
}

.mobile-btn[aria-expanded="true"] #menu-icon {
  display: none !important;
}

.mobile-btn[aria-expanded="true"] #close-icon {
  display: inline-block !important;
}

/* Hide search button when mobile menu is open */
.mobile-controls.menu-open #search-btn-mobile {
  display: none !important;
}

/* Responsive Styles */
@media (min-width: 640px) {
  .header-container {
    padding: 0 2.5rem;
  }

  .logo-img {
    height: 6rem;
  }

  .logo-link img.custom-logo {
    height: 6rem !important;
    max-width: 420px !important;
  }

  .nav-container {
    padding: 0 1.5rem;
  }

  .search-panel-inner {
    padding: 0 1.5rem;
  }
}

@media (min-width: 1024px) {
  .header-container {
    padding: 0 2rem;
  }

  .nav-container {
    padding: 0 2rem;
  }

  .search-panel-inner {
    padding: 0 2rem;
  }

  .search-btn-desktop {
    display: flex;
  }

  .nav-list {
    display: flex;
  }

  .mobile-controls {
    display: none;
  }

  .mobile-menu {
    display: none !important;
  }
}

@media (max-width: 1023px) {
  .mobile-menu {
    display: block;
  }
}
