/* ===================================================================
   MOBILE MENU STYLES - V2.0
   Multi-level mobile navigation menu
   ===================================================================
   
   Version: 2.0
   Last Updated: January 2026
   Used by: All sites with mobile navigation
   
   Dependencies:
   - Requires mobile-menu-v2.0.js for functionality
   - Uses site CSS variables for colors (#f94520, etc.)
   
   Features:
   - Slide-in menu from left
   - Multi-level navigation (4 levels deep)
   - Smooth transitions and animations
   - Dynamic height reduction for long menus
   - Bottom utility bar (Home, Contact, Account, Cart)
   - Font consistency (inherits from site)
   
   =================================================================== */

/* Mobile Menu Container */
.sl-mobile-menu {
  position: fixed;
  top: 0;
  left: -100%;
  width: 85vw;
  max-width: 400px;
  height: 100vh;
  height: 100dvh;
  /* iOS: Use dynamic viewport height */
  background: white;
  z-index: 10000;
  transition: left 0.3s ease;
  box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
  overflow: hidden;
}

.sl-mobile-menu.active {
  left: 0;
}

/* Mobile Menu Overlay */
.sl-menu-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 9999;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.sl-menu-overlay.active {
  opacity: 1;
  visibility: visible;
}

/* Menu Level Container */
.sl-menu-level {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: white;
  transform: translateX(100%);
  transition: transform 0.3s ease;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.sl-menu-level.sl-level-active {
  transform: translateX(0);
}

.sl-menu-level.sl-level-prev {
  transform: translateX(-30%);
}

/* Level Header */
.sl-level-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px;
  border-bottom: 1px solid #e0e0e0;
  background: #f9f9f9;
  flex-shrink: 0;
  min-height: 60px;
}

.sl-menu-title {
  flex: 1;
  margin: 0;
  padding: 4px 10px 0 10px;
  font-size: 18px;
  font-weight: bold;
  font-family: inherit;
  color: #252525;
  text-transform: uppercase;
  line-height: 1.2;
  text-align: center;
  align-self: center;
}

.sl-menu-close {
  background: none;
  border: none;
  font-size: 32px !important;
  font-family: inherit;
  line-height: 1;
  cursor: pointer;
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #252525;
  transition: color 0.2s ease;
  flex-shrink: 0;
  align-self: center;
}

.sl-menu-close:hover {
  color: #f94520;
  font-size: 32px !important;
}

/* Menu Items Container */
.sl-menu-items {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  /* iOS smooth scrolling */
  padding: 10px 0;
  min-height: 0;
  /* Firefox flexbox fix */
}

/* Dynamic height reduction for long menus */
.sl-menu-items.sl-menu-compact-20 .sl-menu-link {
  padding: 12px 20px;
  /* 20% reduction from 15px */
}

.sl-menu-items.sl-menu-compact-40 .sl-menu-link {
  padding: 9px 20px;
  /* 40% reduction from 15px */
}

/* Loading State */
.sl-menu-loading {
  padding: 20px;
  text-align: center;
  color: #666;
  font-style: italic;
  font-family: inherit;
}

/* Hide platform's broken mobile menu */
#main_nav_dropdown {
  display: none !important;
}

/* Only show mobile menu when navigation is wrapped (mobile view) */
@media only screen and (min-width: 768px) {

  header:not(.nav-wrapped) .sl-mobile-menu,
  header:not(.nav-wrapped) .sl-menu-overlay {
    display: none !important;
  }
}

/* Menu Item Styles */
.sl-menu-item {
  border-bottom: 1px solid #f0f0f0;
}

.sl-menu-item:last-child {
  border-bottom: none;
}

.sl-menu-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 15px 20px;
  width: 100%;
  background: none;
  border: none;
  text-align: left;
  cursor: pointer;
  color: #252525;
  font-size: 16px;
  font-weight: 500;
  font-family: inherit;
  text-decoration: none;
  text-transform: uppercase;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.sl-menu-link:hover,
.sl-menu-link:focus {
  background-color: #f9f9f9;
  color: #f94520;
  outline: none;
}

.sl-menu-label {
  flex: 1;
}

.sl-menu-arrow {
  font-size: 24px;
  font-weight: bold;
  color: #999;
  transition: color 0.2s ease;
}

.sl-menu-link:hover .sl-menu-arrow,
.sl-menu-link:focus .sl-menu-arrow {
  color: #f94520;
}

/* Parent link (View All) styling */
.sl-parent-link {
  background-color: #f9f9f9;
  border-bottom: 2px solid #e0e0e0;
}

.sl-parent-link .sl-menu-link {
  font-weight: 700;
  color: #f94520;
}

.sl-parent-link .sl-menu-link:hover {
  background-color: #efefef;
}

/* Back button */
.sl-menu-back {
  background: none;
  border: none;
  font-size: 32px !important;
  font-family: inherit;
  line-height: 1;
  cursor: pointer;
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #252525;
  transition: color 0.2s ease;
  flex-shrink: 0;
  align-self: center;
}

.sl-menu-back:hover {
  color: #f94520;
  font-size: 32px !important;
}

/* Smooth scrolling for menu items */
.sl-menu-items {
  -webkit-overflow-scrolling: touch;
}

/* Touch feedback for mobile */
@media (hover: none) {
  .sl-menu-link:active {
    background-color: #efefef;
  }
}

/* Mobile Menu Utility Bar (Fixed Bottom) */
.sl-menu-utility-bar {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 60px;
  background: #252525;
  display: flex;
  align-items: stretch;
  justify-content: space-around;
  border-top: 1px solid #000;
  z-index: 100;
  flex-shrink: 0;
}

.sl-utility-item {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  border-right: 1px solid #404040;
  position: relative;
}

.sl-utility-item:last-child {
  border-right: none;
}

.sl-utility-item a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  color: #ffffff;
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.sl-utility-item a:hover,
.sl-utility-item a:focus {
  font-size: 14px !important;
  background-color: #404040;
  color: #f94520;
}

.sl-utility-item a:active {
  background-color: #1a1a1a;
}

/* Cart Icon Styling */
.sl-cart-icon {
  position: relative;
  display: inline-block;
  width: 28px;
  height: 28px;
}

.sl-cart-icon::before {
  content: "🛒";
  font-size: 24px;
  display: block;
  line-height: 1;
}

.sl-cart-count {
  position: absolute;
  top: -6px;
  right: -6px;
  background: #f94520;
  color: white;
  font-size: 11px;
  font-weight: 700;
  min-width: 18px;
  height: 18px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  line-height: 1;
}

/* Adjust menu items container to not overlap with utility bar */
.sl-menu-items {
  padding-bottom: 70px !important;
  /* Add space for utility bar */
}

/* Hide utility items when not applicable (controlled by JS) */
.sl-utility-item.hidden {
  display: none;
}

/* ===================================================================
   END: MOBILE MENU STYLES
   =================================================================== */
