/* Layout */
.vga-mobile-header {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 999999;
  height: 60px;
}

/* WordPress Admin Bar adjustments */
.admin-bar .vga-mobile-header {
  top: 0px;
}

.vga-mobile-header-bg {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--color-dark-blue);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(255,255,255,0.2);
}

.vga-mobile-header-container {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  padding: 0 1rem;
}

.vga-mobile-logo img {
  height: 40px;
  width: auto;
  display: block;
}

/* Mobile Menu Toggle Button */
.vga-mobile-menu-toggle {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: 56px;
  height: 40px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  position: relative;
  overflow: visible;
  transition: transform 0.3s ease;
}

.vga-mobile-menu-toggle.active {
  transform: translateX(6px);
}

.vga-mobile-menu-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background-color: var(--color-white);
  margin: 2px 0;
  transition: all 0.3s ease;
  border-radius: 1px;
  position: relative;
  transform-origin: center;
}

.vga-mobile-menu-toggle.active span:nth-child(1) {
  transform: rotate(45deg) translate(0.5px, 8px);
}

.vga-mobile-menu-toggle.active span:nth-child(2) {
  opacity: 0;
}

.vga-mobile-menu-toggle.active span:nth-child(3) {
  transform: rotate(-45deg) translate(0.5px, -8px);
}

/* Mobile Navigation Menu */
.vga-mobile-nav {
  display: none;
  position: fixed;
  top: 60px;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 999998;
  overflow-y: auto;
  transform: translateY(-100%);
  transition: transform 0.3s ease;
  height: calc(100vh - 60px);
}

/* Prevent body scrolling when mobile menu is open */
body:has(.vga-mobile-nav.open) {
  overflow: hidden;
  position: fixed;
  width: 100%;
}

/* WordPress Admin Bar adjustments for mobile nav */
.admin-bar .vga-mobile-nav {
  top: 60px;
  height: calc(100vh - 60px);
}

.vga-mobile-nav.open {
  transform: translateX(0);
}

.vga-mobile-nav-bg {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--color-dark-blue);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}

.vga-mobile-nav-container {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow-y: auto;
}

.vga-mobile-nav-menu {
  margin-bottom: 1rem;
  overflow: visible;
}

.vga-mobile-menu-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.vga-mobile-menu-list > li {
  border-bottom: 1px solid rgba(255,255,255,0.1);
}

.vga-mobile-menu-list > li > a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--color-white);
  text-decoration: none;
  padding: 1rem 0;
  font-size: 1.1rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  transition: background 0.2s ease;
}

/* WordPress default menu classes */
.vga-mobile-menu-list .menu-item {
  border-bottom: 1px solid rgba(255,255,255,0.1);
}

.vga-mobile-menu-list .menu-item > a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--color-white);
  text-decoration: none;
  padding: 1rem 1rem;
  font-size: 1.1rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  transition: background 0.2s ease;
}

.vga-mobile-menu-caret {
  width: 24px;
  height: 24px;
  background-image: url("data:image/svg+xml,%3Csvg width='24' height='24' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M6 9L12 15L18 9' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  transition: transform 0.3s ease;
  margin-right: 1rem;
  display: inline-block;
}

.vga-mobile-menu-item-has-children.open .vga-mobile-menu-caret,
.vga-mobile-menu-list .menu-item-has-children.open .vga-mobile-menu-caret {
  transform: rotate(180deg);
}

.vga-mobile-menu-list .sub-menu {
  display: none;
  list-style: none;
  margin: 0;
  padding: 0;
  background: var(--color-white);
  margin-left: 0;
  border-radius: 0;
  position: relative;
  overflow: visible;
}

.vga-mobile-menu-list .menu-item-has-children.open .sub-menu {
  display: block !important;
}

/* Parent menu item when submenu is open */
.vga-mobile-menu-list .menu-item-has-children.open {
  background: var(--color-dark-blue);
  border-left: none;
}

.vga-mobile-menu-list .sub-menu li {
  border-bottom: none;
}

.vga-mobile-menu-list .sub-menu li:first-child {
  padding-top: 0.75rem;
}
.vga-mobile-menu-list .sub-menu li:last-child {
  border-bottom: none;
  padding-bottom: 0.75rem;
}

.vga-mobile-menu-list .sub-menu li a {
  display: block;
  color: var(--color-dark-blue);
  text-decoration: none;
  padding: 0.75rem 1rem;
  font-size: 1rem;
  font-weight: 400;
  text-transform: none;
  white-space: normal;
  word-wrap: break-word;
}

.vga-mobile-menu-list .sub-menu li a:hover {
  color: var(--color-dark-blue);
  background: none;
}

/* Mobile Search */
.vga-mobile-search {
  margin-top: 0.5rem;
  padding-top: 0.5rem;
  border-top: none;
}

.vga-mobile-search-form {
  display: flex;
  gap: 0;
}

.vga-mobile-search-field {
  flex: 1;
  padding: 1rem;
  border: 1px solid #ccc;
  border-radius: 0.15rem;
  background: transparent;
  color: var(--color-white);
  font-size: 1.1rem;
  outline: none;
}

.vga-mobile-search-field::placeholder {
  color: var(--color-white);
}

.vga-mobile-search-submit {
  display: none;
}

/* Mobile Menu Toggle */
.menu-toggle {
  display: none;
  background: none;
  border: none;
  padding: 0.5rem;
  cursor: pointer;
  z-index: 1001;
}

.menu-toggle span {
  display: block;
  width: 25px;
  height: 3px;
  background-color: #333;
  margin: 5px 0;
  transition: all 0.3s ease;
}

.menu-toggle.active span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}

.menu-toggle.active span:nth-child(3) {
  transform: rotate(-45deg) translate(7px, -7px);
}

/* Mobile Extra Section */
.mobile-extra {
  display: none;
}

/* ===================================
   MEDIA QUERIES - TABLET BREAKPOINT (1080px)
   =================================== */

@media screen and (max-width: 1080px) {
  /* WordPress Admin Bar adjustments */
  .admin-bar .vga-mobile-header {
    top: 0px;
  }
  
  .admin-bar .vga-mobile-nav {
    top: 60px;
    height: calc(100vh - 60px);
  }
  
  /* Show mobile header, hide desktop header */
  .vga-mobile-header {
    display: block;
  }
  
  .vga-mobile-nav {
    display: block;
  }
  
  .vga-hero-header {
    display: none !important;
  }
  
  /* Remove body padding - handle spacing in hero section instead */
  body {
    padding-top: 0;
  }
  
  .main-navigation {
    position: fixed;
    top: 60px;
    right: -100%;
    width: 100%;
    height: calc(100vh - 60px);
    background: var(--color-white);
    transition: right 0.3s ease;
    overflow-y: auto;
    flex-direction: column;
    align-items: flex-start;
    z-index: 999999;
  }
  
  /* WordPress Admin Bar adjustments for main navigation */
  .admin-bar .main-navigation {
    top: 92px;
    height: calc(100vh - 92px);
  }
  
  .admin-bar .vga-mobile-nav-container {
    max-height: calc(100vh - 92px);
  }

  .main-navigation.toggled {
    right: 0;
  }

  .menu-toggle {
    display: block;
  }

  .nav-menu {
    display: flex;
    flex-direction: column !important;
    gap: 0;
    width: 100%;
    padding: 1rem 0;
  }

  .nav-menu > li {
    width: 100%;
    margin: 0;
    border-bottom: 1px solid #eee;
  }

  .nav-menu > li > a {
    width: 100%;
    padding: 1rem 2rem;
  }

  .nav-menu > li.menu-item-has-children > a::after {
    content: '';
    width: 24px;
    height: 24px;
    background-image: url("data:image/svg+xml,%3Csvg width='24' height='24' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M6 9L12 15L18 9' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    margin-left: 0.5rem;
    margin-right: 1rem;
    float: right;
    transition: transform 0.2s;
    display: inline-block;
  }

  .nav-menu > li.menu-item-has-children.toggled > a::after {
    content: '';
    width: 24px;
    height: 24px;
    background-image: url("data:image/svg+xml,%3Csvg width='24' height='24' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M6 9L12 15L18 9' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    margin-left: 0.5rem;
    margin-right: 1rem;
    float: right;
    transform: rotate(180deg);
    display: inline-block;
  }

  .nav-menu > li.menu-item-has-children > .sub-menu {
    display: none;
    position: static !important;
    width: 100%;
    box-shadow: none;
    padding: 0;
    background: #f9f9f9;
    margin: 0;
  }

  .nav-menu > li.menu-item-has-children.toggled > .sub-menu {
    display: block !important;
  }

  .sub-menu li a {
    padding: 1rem 2.5rem;
    border-bottom: 1px solid #eee;
    background: #f9f9f9;
    width: 100%;
  }
  
  /* Override for mobile menu submenu links */
  .vga-mobile-menu-list .sub-menu li a {
    color: #003366;
    border-bottom: none;
    background: none;
    padding: 0.75rem 1rem;
  }
  
  .vga-mobile-menu-list .sub-menu li a:hover {
    color: #003366;
    background: none;
  }

  .nav-menu > li:hover > .sub-menu,
  .nav-menu > li:focus-within > .sub-menu {
    display: none !important;
  }

  /* Hero nav mobile adjustments */
  .vga-hero-nav-menu {
    margin-left: 0;
    gap: 0;
  }
  
  /* Ensure mobile navigation submenus work properly */
  .vga-mobile-nav {
    overflow-y: auto;
  }
  
  .vga-mobile-nav-container {
    overflow-y: auto;
    max-height: calc(100vh - 60px);
  }
  
  .vga-mobile-menu-list {
    overflow: visible;
  }
  
  .vga-mobile-menu-item,
  .vga-mobile-menu-list .menu-item {
    overflow: visible;
  }
  
  .vga-mobile-menu-list .sub-menu {
    position: static !important;
    display: none;
    width: 100%;
    margin-bottom: 0.5rem;
  }
  
  .vga-mobile-menu-list .menu-item-has-children.open .sub-menu {
    display: block !important;
  }
  
  /* Mobile Extra Section */
  .mobile-extra {
    display: block;
    padding: 2rem 1rem 1rem 1rem;
    border-top: 1px solid #eee;
    background: var(--color-white);
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    z-index: 1001;
  }

  .mobile-extra .header-links {
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1rem;
    align-items: flex-start;
  }

  .mobile-extra .header-link {
    font-size: 1rem;
  }
  
  /* Hero Header Responsive Styles */
  .vga-hero-header {
    height: 80px;
  }
  
  .vga-hero-header-container {
    flex-direction: column;
    gap: 1rem;
    max-width: 1000px;
  }
  
  .vga-hero-logo img {
    height: 80px;
  }
  
  .vga-hero-logo-nav {
    flex-direction: column;
    gap: 1rem;
  }
}
