/* Mobile Menu Styles - Scoped to header only */

/* Mobile toggle button styling */
.site-header .mobile-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 10px;
  z-index: 1001;
  position: relative;
  align-self: center;
}

.site-header .hamburger-box {
  width: 30px;
  height: 24px;
  display: inline-block;
  position: relative;
}

.site-header .hamburger-inner,
.site-header .hamburger-inner::before,
.site-header .hamburger-inner::after {
  width: 30px;
  height: 3px;
  background-color: #fff;
  border-radius: 4px;
  position: absolute;
  transition: transform 0.3s ease;
}

.site-header .hamburger-inner {
  display: block;
  top: 50%;
  margin-top: -2px;
}

.site-header .hamburger-inner::before,
.site-header .hamburger-inner::after {
  content: "";
  display: block;
}

.site-header .hamburger-inner::before {
  top: -10px;
}

.site-header .hamburger-inner::after {
  bottom: -10px;
}

/* Active state for hamburger */
.site-header .mobile-toggle.active .hamburger-inner {
  transform: rotate(45deg);
}

.site-header .mobile-toggle.active .hamburger-inner::before {
  top: 0;
  opacity: 0;
}

.site-header .mobile-toggle.active .hamburger-inner::after {
  bottom: 0;
  transform: rotate(-90deg);
}

/* Tablet and Mobile Layout */
@media (max-width: 968px) {
  .site-header .topbar {
    display: flex;
    flex-wrap: wrap;
    position: relative;
    align-items: center;
  }

  /* First layer: Logo and hamburger */
  .site-header .brand {
    order: 1;
    width: auto !important;
    flex: 0 0 auto;
    justify-content: flex-start !important;
  }

  .site-header .mobile-toggle {
    display: block;
    order: 2;
    margin-left: auto;
    flex: 0 0 auto;
  }

  /* Second layer: Action icons spread across */
  .site-header .action-icons {
    order: 3;
    width: 100% !important;
    flex-basis: 100%;
    margin-top: 10px;
    display: flex;
    justify-content: space-between !important;
    gap: 15px !important;
  }

  /* Third layer: Search bar spread across */
  .site-header .search-container {
    order: 4;
    width: 100%;
    flex-basis: 100%;
    margin-top: 10px;
  }

  .site-header .search-form {
    width: 100%;
  }

  .site-header .search-input {
    width: 100% !important;
  }

  /* Header actions wrapper */
  .site-header .header-actions {
    order: 3;
    width: 100%;
    flex-basis: 100%;
    display: flex;
    flex-direction: column;
    gap: 0;
  }

  /* Fourth layer: Nav dropdown */
  .site-header .main-nav {
    order: 5;
    width: 100%;
    flex-basis: 100%;
    margin-top: 10px;
  }

  .site-header .main-nav ul {
    display: none;
    flex-direction: column;
    width: 100%;
    background: var(--purple);
    background: linear-gradient(-120deg, #8a4ae2, #8b7a19);
    padding: 15px 0;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
  }

  .site-header .main-nav.active ul {
    display: flex;
  }

  .site-header .main-nav ul li {
    margin: 0;
    padding: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
  }

  .site-header .main-nav ul li:last-child {
    border-bottom: none;
  }

  .site-header .main-nav ul li a {
    display: block;
    padding: 12px 20px;
    width: 100%;
    color: #fff;
  }
}

/* Small mobile adjustments */
@media (max-width: 576px) {
  .site-header .topbar {
    flex-direction: row !important;
    flex-wrap: wrap;
  }

  .site-header .brand {
    width: auto !important;
    flex: 0 0 auto;
  }

  .site-header .mobile-toggle {
    order: 2;
    margin-left: auto;
  }

  .site-header .header-actions {
    order: 3;
    width: 100% !important;
    flex-basis: 100%;
    display: flex;
    flex-direction: column;
  }

  .site-header .action-icons {
    width: 100% !important;
    justify-content: space-between !important;
    gap: 15px !important;
    margin-top: 10px;
  }

  .site-header .search-container {
    width: 100%;
    margin-top: 10px;
  }

  .site-header .search-form {
    width: 100%;
  }

  .site-header .search-input {
    width: 100% !important;
  }
  
  .site-header .user-info span {
    display: inline;
  }
}