/* SBS Shared Mobile Menu Overrides */

/* Ensure the off-canvas menu/backdrop participate in layout so class toggles work */
/* Unified hamburger styles - ALWAYS VISIBLE ON ALL DEVICES */
.hamburger {
  display: flex !important;
  flex-direction: column !important;
  gap: 4px !important;
  background: transparent !important;
  border: none !important;
  cursor: pointer;
  padding: 0.5rem;
  z-index: 10001 !important;
  align-items: center;
  justify-content: center;
  position: relative !important;
  opacity: 1 !important;
  visibility: visible !important;
  pointer-events: auto !important;
  width: auto !important;
  height: auto !important;
  min-width: 40px;
  min-height: 40px;
}

/* Support both span bars and Lucide icons */
.hamburger span {
  width: 25px;
  height: 3px;
  background: var(--primary-gold, #ffd700) !important;
  transition: all 0.3s ease;
  border-radius: 2px;
  display: block !important;
  opacity: 1 !important;
}

.hamburger i {
  color: var(--primary-gold, #ffd700) !important;
  width: 24px !important;
  height: 24px !important;
  display: block !important;
  stroke: currentColor !important;
  fill: none !important;
  stroke-width: 2 !important;
}

.hamburger.active span:nth-child(1) {
  transform: rotate(45deg) translate(8px, 8px);
}

.hamburger.active span:nth-child(2) {
  opacity: 0;
}

.hamburger.active span:nth-child(3) {
  transform: rotate(-45deg) translate(7px, -7px);
}

.mobile-menu {
  position: fixed;
  top: 0;
  right: -100%;
  width: min(320px, 80vw);
  height: 100vh;
  background: rgba(10, 10, 10, 0.95);
  border-left: 2px solid var(--primary-gold, #ffd700);
  box-shadow: -10px 0 30px rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(12px);
  z-index: 1000;
  transition: right 0.3s ease;
  overflow-y: auto;
  overflow-x: hidden;
  touch-action: pan-y;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  display: block !important;
}

.mobile-menu-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  z-index: 999;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
  display: block !important;
}

.mobile-menu-header {
  padding: 2rem 1.75rem 1.5rem;
  border-bottom: 1px solid rgba(255, 215, 0, 0.25);
  background: linear-gradient(135deg, rgba(255, 215, 0, 0.08), rgba(255, 215, 0, 0.02));
}

.mobile-menu-header .logo {
  font-family: 'Gagalin', var(--heading-font, inherit);
  font-size: 1.9rem;
  color: var(--primary-gold, #ffd700);
  text-decoration: none;
}

/* User Profile Styles */
.user-profile {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.user-avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(255, 215, 0, 0.15), rgba(255, 215, 0, 0.05));
  border: 2px solid var(--primary-gold, #ffd700);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  cursor: pointer;
  transition: transform 0.2s ease;
}

.user-avatar:hover {
  transform: scale(1.05);
}

.user-avatar .icon {
  width: 28px;
  height: 28px;
  color: var(--primary-gold, #ffd700);
  stroke-width: 2;
}

.user-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

.user-info {
  flex: 1;
  min-width: 0;
}

.user-name {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary, #ffffff);
  margin-bottom: 0.25rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-email {
  font-size: 0.85rem;
  color: rgba(255, 215, 0, 0.7);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mobile-menu-items {
  display: flex;
  flex-direction: column;
  padding: 1rem 0 calc(2rem + env(safe-area-inset-bottom, 0px));
  gap: 0.25rem;
  overflow-x: hidden;
  overscroll-behavior: contain;
  touch-action: pan-y;
}

/* Section Headers */
.menu-section-header {
  padding: 1.5rem 1.75rem 0.5rem;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 1.5px;
  color: rgba(255, 215, 0, 0.6);
  text-transform: uppercase;
}

.menu-section-header:first-child {
  padding-top: 1rem;
}

.mobile-menu-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.95rem 1.75rem;
  font-family: 'Inter', var(--body-font, inherit);
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary, #ffffff);
  text-decoration: none;
  background: transparent;
  border: none;
  width: 100%;
  text-align: left;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  border-left: 3px solid transparent;
  transition: all 0.2s ease;
}

.mobile-menu-item:hover,
.mobile-menu-item:focus-visible {
  color: #ffed4e;
  background: rgba(255, 215, 0, 0.12);
  border-left-color: var(--primary-gold, #ffd700);
  transform: none;
}

.mobile-menu-item:hover .icon,
.mobile-menu-item:focus-visible .icon {
  stroke-width: 2.5;
}

/* Menu Badge */
.menu-badge {
  margin-left: auto;
  background: var(--primary-gold, #ffd700);
  color: var(--primary-black, #000);
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.2rem 0.5rem;
  border-radius: 12px;
  min-width: 20px;
  text-align: center;
  animation: badgePulse 2s ease-in-out infinite;
}

@keyframes badgePulse {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(255, 215, 0, 0.4);
  }
  50% {
    box-shadow: 0 0 0 4px rgba(255, 215, 0, 0);
  }
}

.mobile-menu-item.btn-style {
  margin: 0.75rem 1.75rem 0;
  justify-content: center;
  border-radius: 8px;
  border-left-color: transparent;
  background: var(--primary-gold, #ffd700);
  color: var(--primary-black, #000);
  box-shadow: 0 10px 25px rgba(255, 215, 0, 0.25);
}

.mobile-menu-item.btn-style:hover,
.mobile-menu-item.btn-style:focus-visible {
  background: #ffed4e;
  color: #000;
  box-shadow: 0 12px 30px rgba(255, 215, 0, 0.35);
}

/* Active states */
.mobile-menu.active {
  right: 0;
}

.mobile-menu-backdrop.active {
  opacity: 1;
  visibility: visible;
}

/* Prevent body scroll when menu is open (paired with JS adding .menu-open) */
body.menu-open {
  overflow: hidden;
  position: fixed;
  inset: 0;
  width: 100%;
}

/* REMOVED OLD MOBILE-ONLY RULES - NOW ALWAYS USE BURGER MENU */

/* Keep logo visible always */
.nav-left .logo {
  display: flex !important;
}

/* Hide all nav links and buttons EXCEPT hamburger - use burger menu instead */
.nav-left .nav-link,
.nav-center .nav-links,
.nav-side--left,
.nav-right .nav-link,
.nav-right .btn-gold,
.nav-right .btn-outline,
.nav-side--right .nav-link,
.nav-side--right .btn-gold {
  display: none !important;
}

/* BUT ALWAYS SHOW THE HAMBURGER */
.nav-right .hamburger,
.hamburger {
  display: flex !important;
}

@media (max-width: 768px) {
  .nav-right,
  .nav-side--right {
    display: flex;
    align-items: center;
    gap: 0.75rem;
  }

  .cart-toggle,
  .hamburger {
    display: inline-flex;
    align-items: center;
  }
}
