/**
 * Mobile Bottom Navigation Styles
 *
 * @package FastTheme
 * @since 1.0.0
 */

/* Mobile Bottom Nav Container */
.mobile-bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background-color: var(--nav-bg, #ffffff);
  border-top: 1px solid var(--nav-border, #e5e7eb);
  z-index: 50;
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.05);
  padding: 4px 0 calc(4px + env(safe-area-inset-bottom)); /* Safe area for iOS notch */
}

/* Mobile Nav Container */
.mobile-nav-container {
  display: flex;
  justify-content: space-around;
  align-items: center;
  max-width: 100%;
  margin: 0 auto;
  padding: 0 8px;
}

/* Mobile Nav Item - Regular Button */
.mobile-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 6px 12px;
  background: transparent;
  border: none;
  color: var(--nav-inactive, #6b7280);
  cursor: pointer;
  transition: all 0.2s ease;
  min-width: 60px;
  position: relative;
  outline: none;
  -webkit-tap-highlight-color: transparent;
}

.mobile-nav-item:hover {
  color: var(--nav-active, #2563eb);
}

.mobile-nav-item.active {
  color: var(--nav-active, #2563eb);
}

.mobile-nav-item.mobile-nav-item-highlight {
  color: var(--nav-active, #2563eb);
  font-weight: 600;
}

/* Mobile Nav Item - Special/Elevated Button */
.mobile-nav-item.mobile-nav-item-special {
  background-color: var(--nav-special-bg, #2563eb);
  color: var(--nav-special-text, #ffffff);
  border-radius: 9999px; /* Fully rounded */
  padding: 8px 14px;
  transform: translateY(-12px); /* Elevated */
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
  min-width: 64px;
  min-height: 64px;
}

.mobile-nav-item.mobile-nav-item-special:hover {
  background-color: var(--nav-special-bg, #2563eb);
  filter: brightness(0.9);
  transform: translateY(-12px) scale(1.05);
}

.mobile-nav-item.mobile-nav-item-special:active {
  transform: translateY(-12px) scale(0.95);
}

/* Icon Wrapper */
.mobile-nav-icon-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
}

/* Icon */
.mobile-nav-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
}

.mobile-nav-icon svg {
  width: 24px;
  height: 24px;
  stroke-width: 2px;
}

.mobile-nav-item-special .mobile-nav-icon svg {
  width: 26px;
  height: 26px;
  stroke-width: 2.5px;
}

/* Label */
.mobile-nav-label {
  font-size: 11px;
  font-weight: 500;
  line-height: 1;
  white-space: nowrap;
  user-select: none;
}

.mobile-nav-item-special .mobile-nav-label {
  font-size: 12px;
  font-weight: 600;
}

/* Badge */
.mobile-nav-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  background-color: #ef4444; /* Red badge */
  color: #ffffff;
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
  padding: 2px 5px;
  border-radius: 9999px;
  min-width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  border: 2px solid var(--nav-bg, #ffffff);
}

.mobile-nav-item-special .mobile-nav-badge {
  top: -2px;
  right: -2px;
}

/* Mobile Filters Sidebar */
@media (max-width: 767px) {
  .shop-filters-sidebar {
    display: none;
  }

  /* Show filters when inside fast-drawer */
  fast-drawer .shop-filters-sidebar {
    display: block !important;
  }

  .shop-filters-sidebar.mobile-visible {
    display: block;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #ffffff;
    z-index: 100;
    overflow-y: auto;
    padding: 20px;
    animation: slideInFromLeft 0.3s ease-out;
  }

  body.filters-open {
    overflow: hidden;
  }
}

@keyframes slideInFromLeft {
  from {
    transform: translateX(-100%);
  }
  to {
    transform: translateX(0);
  }
}

/* Desktop - Hide by default */
@media (min-width: 768px) {
  .mobile-bottom-nav.md\:hidden {
    display: none;
  }
}

/* Tablet Adjustments */
@media (min-width: 640px) and (max-width: 767px) {
  .mobile-nav-container {
    padding: 0 20px;
  }

  .mobile-nav-item {
    padding: 8px 16px;
    min-width: 70px;
  }

  .mobile-nav-label {
    font-size: 12px;
  }

  .mobile-nav-icon svg {
    width: 26px;
    height: 26px;
  }
}

/* Accessibility - Focus States */
.mobile-nav-item:focus-visible {
  outline: 2px solid var(--nav-active, #2563eb);
  outline-offset: 2px;
  border-radius: 8px;
}

/* Dark Mode Support (Optional) */
@media (prefers-color-scheme: dark) {
  .mobile-bottom-nav {
    --nav-bg: #1f2937;
    --nav-border: #374151;
    --nav-inactive: #9ca3af;
    --nav-active: #60a5fa;
  }

  .mobile-nav-badge {
    background-color: #ef4444;
  }
}

/* Safe Area Insets for Modern Mobile Devices */
@supports (padding: max(0px)) {
  .mobile-bottom-nav {
    padding-bottom: max(4px, env(safe-area-inset-bottom));
  }
}

/* Animation for Nav Appearance */
@keyframes slideUp {
  from {
    transform: translateY(100%);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.mobile-bottom-nav {
  animation: slideUp 0.3s ease-out;
}

/* Prevent Text Selection on Buttons */
.mobile-nav-item * {
  user-select: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
}

/* Touch Optimization */
.mobile-nav-item {
  -webkit-touch-callout: none;
  touch-action: manipulation;
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
  .mobile-bottom-nav {
    border-top-width: 2px;
  }

  .mobile-nav-item {
    font-weight: 600;
  }

  .mobile-nav-badge {
    border-width: 3px;
    font-weight: 800;
  }
}

/* Reduce Motion */
@media (prefers-reduced-motion: reduce) {
  .mobile-bottom-nav,
  .mobile-nav-item,
  .mobile-nav-item-special {
    animation: none;
    transition: none;
  }
}
