/* ============================================
   Mobile Header & Menu – single source, no duplicate
   Theme: #121229, #7C3AED, Bricolage, THICCCBOI
   ============================================ */

/* ----- Bar (fixed top) ----- */
.mobile-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: #fff;
  border-bottom: 1px solid rgba(18, 18, 41, 0.06);
  transition: background 0.2s ease, box-shadow 0.2s ease;
}

body:has(.mobile-header) {
  padding-top: 64px;
}

.mobile-header.scrolled {
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 1px 16px rgba(18, 18, 41, 0.04);
}

.mobile-header-container {
  margin: 0 auto;
  padding: 0 1.25rem;
  max-width: 78rem;
}

.mobile-header-wrapper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 64px;
}

.mobile-logo {
  flex-shrink: 0;
}

.mobile-logo-link {
  display: inline-block;
  text-decoration: none;
}

.mobile-logo-img {
  display: block;
  height: 36px;
  width: auto;
  max-width: 180px;
  object-fit: contain;
  object-position: left center;
}

/* Hamburger */
.mobile-menu-toggle {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;
  border-radius: 10px;
  transition: background 0.2s ease;
}

.mobile-menu-toggle:hover {
  background: rgba(180, 130, 255, 0.1);
}

.mobile-menu-toggle:focus-visible {
  outline: 2px solid #7C3AED;
  outline-offset: 2px;
}

.hamburger-line {
  width: 20px;
  height: 2px;
  background: #121229;
  border-radius: 2px;
  display: block;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.mobile-menu-toggle.active .hamburger-line:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

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

.mobile-menu-toggle.active .hamburger-line:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* ----- Overlay: fade only, no layout shift ----- */
.mobile-menu-overlay {
  position: fixed;
  inset: 0;
  z-index: 1001;
  background: rgba(18, 18, 41, 0.35);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.35s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.35s step-end;
  pointer-events: none;
  overflow: hidden;
}

.mobile-menu-overlay.active {
  opacity: 1;
  visibility: visible;
  transition: opacity 0.35s cubic-bezier(0.4, 0, 0.2, 1), visibility 0s step-end;
  pointer-events: auto;
}

/* ----- Menu panel: right drawer, smooth slide ----- */
.mobile-menu-content {
  position: absolute;
  top: 0;
  right: 0;
  width: 100%;
  max-width: 300px;
  height: 100%;
  min-height: 100%;
  background: #fff;
  box-shadow: -8px 0 32px rgba(18, 18, 41, 0.08);
  display: flex;
  flex-direction: column;
  z-index: 1002;
  pointer-events: auto;
  transform: translateX(100%);
  transition: transform 0.35s cubic-bezier(0.32, 0.72, 0, 1);
  overflow: hidden;
}

.mobile-menu-overlay.active .mobile-menu-content {
  transform: translateX(0);
}

/* Panel top: logo + close */
.mobile-menu-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1rem 1rem;
  flex-shrink: 0;
  border-bottom: 1px solid rgba(18, 18, 41, 0.06);
  background: #fff;
}

.mobile-menu-logo {
  display: inline-block;
}

.mobile-menu-logo img {
  display: block;
  height: 32px;
  width: auto;
  max-width: 160px;
  object-fit: contain;
  object-position: left center;
}

.mobile-menu-close {
  width: 44px;
  height: 44px;
  padding: 0;
  border: none;
  background: transparent;
  color: #121229;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  transition: background 0.2s ease;
}

.mobile-menu-close:hover {
  background: rgba(180, 130, 255, 0.1);
}

.mobile-menu-close:focus-visible {
  outline: 2px solid #7C3AED;
  outline-offset: 2px;
}

/* ----- Nav: scrollable, CTA stays fixed at bottom ----- */
.mobile-nav {
  flex: 1;
  min-height: 0;
  padding: 1rem 1rem;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.mobile-nav-menu {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.mobile-nav-item {
  margin: 0;
  padding: 0;
}

.mobile-nav-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-width: 0;
  padding: 0.875rem 1rem;
  color: #121229;
  text-decoration: none;
  font-family: "THICCCBOI", sans-serif;
  font-size: 1rem;
  font-weight: 600;
  background: transparent;
  border: none;
  border-radius: 10px;
  text-align: left;
  cursor: pointer;
  gap: 0.5rem;
  box-sizing: border-box;
  transition: background 0.2s ease, color 0.2s ease;
}

.mobile-nav-link:hover {
  background: rgba(180, 130, 255, 0.08);
  color: #121229;
}

.mobile-nav-link span {
  flex: 1;
}

.mobile-dropdown-icon {
  flex-shrink: 0;
  color: #121229;
  opacity: 0.6;
  transition: transform 0.25s ease;
}

.mobile-dropdown-toggle.active .mobile-dropdown-icon {
  transform: rotate(180deg);
}

/* Dropdown submenu – smooth open/close */
.mobile-dropdown-menu {
  max-height: 0;
  overflow: hidden;
  list-style: none;
  margin: 0;
  padding: 0;
  background: rgba(180, 130, 255, 0.04);
  border-radius: 0 0 10px 10px;
  margin-top: -0.25rem;
  transition: max-height 0.35s cubic-bezier(0.32, 0.72, 0, 1);
}

.mobile-dropdown-menu.active {
  max-height: 320px;
}

.mobile-dropdown-item {
  margin: 0;
  padding: 0;
}

.mobile-dropdown-link {
  display: block;
  padding: 0.75rem 1.25rem 0.75rem 2rem;
  color: #444;
  text-decoration: none;
  font-family: "THICCCBOI", sans-serif;
  font-size: 0.9375rem;
  font-weight: 500;
  border-left: 3px solid transparent;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.mobile-dropdown-link:hover {
  color: #121229;
  background: rgba(180, 130, 255, 0.06);
  border-left-color: #7C3AED;
}

/* CTA at bottom – no overflow, always visible */
.mobile-menu-cta {
  flex-shrink: 0;
  padding: 1rem 1rem 1.25rem;
  padding-bottom: max(1.25rem, env(safe-area-inset-bottom));
  border-top: 1px solid rgba(18, 18, 41, 0.06);
  background: #fff;
}

.mobile-cta-button {
  display: block;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  padding: 0.875rem 1rem;
  box-sizing: border-box;
  background: #121229;
  color: #fff;
  text-align: center;
  text-decoration: none;
  font-family: "THICCCBOI", sans-serif;
  font-size: 0.9375rem;
  font-weight: 700;
  border-radius: 10px;
  border: none;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: background 0.2s ease;
}

.mobile-cta-button:hover {
  background: #1e1e3a;
}

@media (max-width: 380px) {
  .mobile-header-container {
    padding: 0 1rem;
  }
  .mobile-menu-content {
    max-width: 100%;
  }
  .mobile-nav,
  .mobile-menu-header,
  .mobile-menu-cta {
    padding-left: 1rem;
    padding-right: 1rem;
  }
}
