/* ===================================
   MOBILE SLIDE-IN MENU
   Modern burger menu with swipe gesture
   Date: 21 December 2025
   =================================== */

/* ===================================
   OVERLAY
   =================================== */
.mobile-menu-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  opacity: 0;
  visibility: hidden;
  z-index: 1100;
  transition: opacity 0.3s ease, visibility 0.3s ease;
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}

.mobile-menu-overlay.active {
  opacity: 1;
  visibility: visible;
}

/* ===================================
   SLIDE-IN PANEL
   =================================== */
.mobile-menu-panel {
  position: fixed;
  top: 0;
  right: -300px;
  width: 280px;
  max-width: 85vw;
  height: 100vh;
  height: calc(100dvh - 70px); /* Leave space for bottom nav */ /* Dynamic viewport height for mobile */
  background: linear-gradient(180deg, #1a1a1a 0%, #0d0d0d 100%);
  z-index: 1101;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  box-shadow: -5px 0 30px rgba(0, 0, 0, 0.5);
  overflow: hidden;
}

.mobile-menu-panel.active {
  transform: translateX(-300px);
}

/* Swipe indicator */
.mobile-menu-panel::before {
  content: '';
  position: absolute;
  left: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 4px;
  height: 60px;
  background: rgba(255, 99, 0, 0.3);
  border-radius: 4px;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.mobile-menu-panel.active::before {
  opacity: 1;
}

/* ===================================
   MENU HEADER
   =================================== */
.mobile-menu-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 15px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(0, 0, 0, 0.3);
}

.mobile-menu-logo {
  display: flex;
  align-items: center;
  gap: 0;
  color: #fff;
  font-size: 18px;
  font-weight: 600;
  text-decoration: none;
}

.mobile-menu-logo .smm {
  color: #ff6300;
}

.mobile-menu-logo .hub {
  color: #fff;
}

.mobile-menu-logo .com {
  color: #888;
  font-size: 14px;
}

.mobile-menu-close {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.1);
  border: none;
  border-radius: 50%;
  color: #fff;
  font-size: 20px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.mobile-menu-close:hover,
.mobile-menu-close:active {
  background: rgba(255, 99, 0, 0.3);
  color: #ff6300;
}

/* ===================================
   NAVIGATION ITEMS
   =================================== */
.mobile-menu-nav {
  /* flex: 1; - REMOVED to fix spacing */
  overflow-y: auto;
  padding: 10px 0;
  -webkit-overflow-scrolling: touch;
}

.mobile-menu-nav::-webkit-scrollbar {
  width: 3px;
}

.mobile-menu-nav::-webkit-scrollbar-track {
  background: transparent;
}

.mobile-menu-nav::-webkit-scrollbar-thumb {
  background: rgba(255, 99, 0, 0.3);
  border-radius: 3px;
}

.mobile-menu-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 20px;
  color: #fff;
  text-decoration: none;
  font-size: 15px;
  font-weight: 500;
  transition: all 0.2s ease;
  border-left: 3px solid transparent;
}

.mobile-menu-item:hover,
.mobile-menu-item:active {
  background: rgba(255, 99, 0, 0.1);
  color: #ff6300;
  border-left-color: #ff6300;
}

.mobile-menu-item.active {
  background: rgba(255, 99, 0, 0.15);
  color: #ff6300;
  border-left-color: #ff6300;
}

.mobile-menu-item i {
  width: 20px;
  text-align: center;
  font-size: 16px;
  opacity: 0.8;
}

.mobile-menu-item:hover i,
.mobile-menu-item.active i {
  opacity: 1;
}

/* Submenu arrow */
.mobile-menu-item .arrow {
  margin-left: auto;
  font-size: 12px;
  opacity: 0.5;
  transition: transform 0.2s ease;
}

.mobile-menu-item.expanded .arrow {
  transform: rotate(90deg);
}

/* Submenu */
.mobile-submenu {
  max-height: 0;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.3);
  transition: max-height 0.3s ease;
}

.mobile-submenu.active {
  max-height: 500px;
}

.mobile-submenu .mobile-menu-item {
  padding-left: 52px;
  font-size: 14px;
  border-left: none;
}

/* ===================================
   CART SECTION
   =================================== */
.mobile-menu-cart {
  padding: 15px 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(0, 0, 0, 0.3);
}

.mobile-cart-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 15px;
  background: linear-gradient(135deg, rgba(255, 99, 0, 0.2), rgba(255, 99, 0, 0.1));
  border: 1px solid rgba(255, 99, 0, 0.3);
  border-radius: 10px;
  color: #fff;
  text-decoration: none;
  transition: all 0.2s ease;
}

.mobile-cart-link:hover,
.mobile-cart-link:active {
  background: linear-gradient(135deg, rgba(255, 99, 0, 0.3), rgba(255, 99, 0, 0.2));
  border-color: #ff6300;
  transform: scale(1.02);
}

.mobile-cart-icon {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 99, 0, 0.3);
  border-radius: 10px;
  font-size: 18px;
  color: #ff6300;
  position: relative;
}

.mobile-cart-badge {
  position: absolute;
  top: -5px;
  right: -5px;
  min-width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #ff6300;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  border-radius: 9px;
  padding: 0 4px;
}

.mobile-cart-info {
  /* flex: 1; - REMOVED to fix spacing */
}

.mobile-cart-label {
  font-size: 14px;
  font-weight: 600;
  color: #fff;
}

.mobile-cart-total {
  font-size: 12px;
  color: #ff6300;
  margin-top: 2px;
}

/* ===================================
   LANGUAGE SWITCHER
   =================================== */
.mobile-menu-footer {
  padding-bottom: 80px; /* Space for bottom nav */
  padding: 15px 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(0, 0, 0, 0.4);
}

.mobile-lang-switcher {
  display: flex;
  justify-content: center;
  gap: 0;
}

.mobile-lang-btn {
  padding: 8px 16px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.2s ease;
}

.mobile-lang-btn:hover {
  background: rgba(255, 99, 0, 0.2);
  border-color: rgba(255, 99, 0, 0.5);
  color: #ff6300;
}

.mobile-lang-btn.active {
  background: #ff6300;
  border-color: #ff6300;
  color: #fff;
}

/* ===================================
   BURGER BUTTON ANIMATION
   =================================== */
.navbar-toggler {
  position: relative;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  cursor: pointer;
  z-index: 1102;
  padding: 0;
}

.navbar-toggler .burger-icon {
  width: 24px;
  height: 18px;
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.navbar-toggler .burger-line {
  width: 100%;
  height: 2px;
  background: #fff;
  border-radius: 2px;
  transition: all 0.3s ease;
}

.navbar-toggler.active .burger-line:nth-child(1) {
  transform: translateY(8px) rotate(45deg);
}

.navbar-toggler.active .burger-line:nth-child(2) {
  opacity: 0;
  transform: translateX(10px);
}

.navbar-toggler.active .burger-line:nth-child(3) {
  transform: translateY(-8px) rotate(-45deg);
}

/* ===================================
   HIDE DEFAULT BOOTSTRAP COLLAPSE
   =================================== */
@media (max-width: 991px) {
  .navbar-collapse {
    display: none !important;
  }
  
  /* Hide old mobile-top-actions */
  .mobile-top-actions {
    display: none !important;
  }
}

/* ===================================
   TOUCH FEEDBACK
   =================================== */
.mobile-menu-item:active,
.mobile-cart-link:active,
.mobile-lang-btn:active,
.mobile-menu-close:active {
  transform: scale(0.98);
}

/* ===================================
   ANIMATIONS
   =================================== */
@keyframes slideIn {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(-300px);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* Staggered animation for menu items */
.mobile-menu-panel.active .mobile-menu-item {
  animation: menuItemIn 0.3s ease forwards;
  opacity: 0;
}

@keyframes menuItemIn {
  from {
    opacity: 0;
    transform: translateX(20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.mobile-menu-panel.active .mobile-menu-item:nth-child(1) { animation-delay: 0.05s; }
.mobile-menu-panel.active .mobile-menu-item:nth-child(2) { animation-delay: 0.1s; }
.mobile-menu-panel.active .mobile-menu-item:nth-child(3) { animation-delay: 0.15s; }
.mobile-menu-panel.active .mobile-menu-item:nth-child(4) { animation-delay: 0.2s; }
.mobile-menu-panel.active .mobile-menu-item:nth-child(5) { animation-delay: 0.25s; }
.mobile-menu-panel.active .mobile-menu-item:nth-child(6) { animation-delay: 0.3s; }
.mobile-menu-panel.active .mobile-menu-item:nth-child(7) { animation-delay: 0.35s; }
.mobile-menu-panel.active .mobile-menu-item:nth-child(8) { animation-delay: 0.4s; }

/* ===================================
   SAFE AREA (iPhone notch)
   =================================== */
@supports (padding-top: env(safe-area-inset-top)) {
  .mobile-menu-header {
    padding-top: calc(15px + env(safe-area-inset-top));
  }
  
  .mobile-menu-footer {
  padding-bottom: 80px; /* Space for bottom nav */
    padding-bottom: calc(15px + env(safe-area-inset-bottom));
  }
}


/* Header actions with lang switcher */
.mobile-header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.mobile-lang-mini {
  display: flex;
  gap: 4px;
}

.mobile-lang-mini a {
  padding: 4px 8px;
  font-size: 11px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.6);
  text-decoration: none;
  border-radius: 4px;
  transition: all 0.2s ease;
}

.mobile-lang-mini a:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
}

.mobile-lang-mini a.active {
  color: #ff6300;
  background: rgba(255, 99, 0, 0.2);
}

/* ===================================
   FIXES 21.12.2024
   =================================== */

/* Языковой переключатель в навигации */
.mobile-lang-row {
  display: flex;
  justify-content: center;
  gap: 0;
  padding: 12px 20px;
  background: rgba(255, 99, 0, 0.1);
  border-radius: 8px;
  margin: 10px 15px;
}

.mobile-lang-item {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.7);
  text-decoration: none;
  border-radius: 6px;
  transition: all 0.2s ease;
}

.mobile-lang-item:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
}

.mobile-lang-item.active {
  color: #ff6300;
  background: rgba(255, 99, 0, 0.2);
}

.mobile-lang-item .lang-flag {
  font-size: 14px;
}

/* Разделитель */
.mobile-menu-divider {
  height: 1px;
  background: rgba(255, 255, 255, 0.1);
  margin: 8px 20px;
}

/* Уменьшить отступы в пунктах меню */
.mobile-menu-item {
  padding: 10px 20px;
}

/* Убрать лишние стили header actions (языки перенесены) */
.mobile-header-actions {
  display: none;
}

/* Корзина - уменьшить отступы */
.mobile-menu-cart {
  padding: 10px 15px;
  margin-top: auto;
}

/* Панель - убрать ограничение высоты для bottom nav */
.mobile-menu-panel {
  height: 100vh;
  height: 100dvh;
  padding-bottom: 70px; /* Space for bottom nav */
  box-sizing: border-box;
}

/* ===================================
   ACCORDION MENU - 21.12.2024
   =================================== */

/* Accordion контейнер */
.mobile-menu-accordion {
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

/* Toggle кнопка */
.mobile-menu-accordion .accordion-toggle {
  display: flex;
  align-items: center;
  width: 100%;
  padding: 12px 20px;
  color: #eee;
  text-decoration: none;
  font-size: 1rem;
  background: transparent;
  border: none;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.mobile-menu-accordion .accordion-toggle:hover {
  background-color: rgba(255, 255, 255, 0.05);
}

.mobile-menu-accordion .accordion-toggle i:first-child {
  margin-right: 12px;
  font-size: 1.1rem;
  color: #ff6300;
}

.mobile-menu-accordion .accordion-toggle span {
  flex: 1;
}

/* Стрелка */
.accordion-arrow {
  font-size: 0.9rem;
  color: #888;
  transition: transform 0.3s ease;
}

.mobile-menu-accordion.open .accordion-arrow {
  transform: rotate(180deg);
  color: #ff6300;
}

/* Контент (скрыт по умолчанию) */
.accordion-content {
  max-height: 0;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.2);
  transition: max-height 0.3s ease-out;
}

.mobile-menu-accordion.open .accordion-content {
  max-height: 500px; /* Достаточно для всех соц. сетей */
}

/* Пункты подменю */
.mobile-submenu-item {
  display: block;
  padding: 10px 20px 10px 52px;
  color: #ccc;
  text-decoration: none;
  font-size: 0.95rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  transition: all 0.2s ease;
}

.mobile-submenu-item:last-child {
  border-bottom: none;
}

.mobile-submenu-item:hover {
  background: rgba(255, 99, 0, 0.1);
  color: #ff6300;
  padding-left: 56px;
}

/* Убрать margin-top у корзины */
.mobile-menu-cart {
  margin-top: 0;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}
