/* Mobile Bottom Navigation V2 Styles - Floating Pill Design */
.mobile-bottom-nav {
  display: none;
  position: fixed;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  width: calc(100% - 32px);
  max-width: 500px;
  background: var(--sc-mobile-bottom-nav-v2-root-bg, var(--primary-background-color));
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2), 0 2px 8px rgba(0, 0, 0, 0.1);
  z-index: 1000;
  padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
  flex-direction: row;
  justify-content: space-around;
  align-items: center;
  border-radius: 14px 14px 0 0;
  border: 1px solid var(--sc-mobile-bottom-nav-v2-root-border, var(--primary-brand-color));
  overflow: hidden;
}

.mobile-bottom-nav::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--sc-mobile-bottom-nav-v2-root-before-bg, var(--primary-background-color));
  border-radius: 14px 14px 0 0;
  z-index: 0;
}

.mobile-bottom-nav::after {
  content: '';
  position: absolute;
  top: 4px;
  left: 50%;
  transform: translateX(-50%);
  width: 24px;
  height: 2px;
  background: var(--sc-mobile-bottom-nav-v2-root-after-bg, var(--footer-text-color));
  border-radius: 2px;
  opacity: 0.3;
  z-index: 1;
}

.mobile-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  color: var(--sc-mobile-bottom-nav-v2-mobile-nav-item-text, var(--primary-brand-color));
  text-decoration: none;
  padding: 4px 6px;
  border-radius: 10px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  flex: 1;
  min-width: 0;
  z-index: 2;
  background: var(--sc-mobile-bottom-nav-v2-mobile-nav-item-bg, transparent);
}

.mobile-nav-item::before {
  content: '';
  position: absolute;
  bottom: -12px;
  left: 50%;
  transform: translateX(-50%) scaleX(0);
  width: 4px;
  height: 4px;
  background: var(--sc-mobile-bottom-nav-v2-mobile-nav-item-before-bg, var(--primary-brand-color));
  border-radius: 50%;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease;
  opacity: 0;
}

.mobile-nav-item:hover,
.mobile-nav-item:active,
.mobile-nav-item.active {
  color: var(--sc-mobile-bottom-nav-v2-mobile-nav-item-hover-text, var(--primary-brand-color));
}

.mobile-nav-item:hover::after,
.mobile-nav-item:active::after,
.mobile-nav-item.active::after {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--sc-mobile-bottom-nav-v2-mobile-nav-item-after-hover-bg, var(--primary-brand-color));
  border-radius: 10px;
  opacity: 0.1;
  pointer-events: none;
}

.mobile-nav-item:hover::before,
.mobile-nav-item:active::before,
.mobile-nav-item.active::before {
  transform: translateX(-50%) scaleX(1);
  opacity: 1;
}

.mobile-nav-item i {
  font-size: 16px;
  margin-bottom: 0;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  z-index: 1;
}

.mobile-nav-item:hover i,
.mobile-nav-item:active i,
.mobile-nav-item.active i {
  color: var(--sc-mobile-bottom-nav-v2-mobile-nav-item-icon-hover-text, var(--primary-brand-color));
  transform: translateY(-2px);
}

.mobile-nav-item span:not(.mobile-cart-count):not(.mobile-favorite-count) {
  font-size: 8px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
  position: relative;
  z-index: 1;
  transition: color 0.3s ease;
}

.mobile-nav-item:hover span:not(.mobile-cart-count):not(.mobile-favorite-count),
.mobile-nav-item:active span:not(.mobile-cart-count):not(.mobile-favorite-count),
.mobile-nav-item.active span:not(.mobile-cart-count):not(.mobile-favorite-count) {
  color: var(--sc-mobile-bottom-nav-v2-mobile-nav-item-text-hover-text, var(--primary-brand-color));
}

.mobile-cart-count {
  position: absolute;
  top: 0;
  right: 4px;
  background: var(--sc-mobile-bottom-nav-v2-mobile-cart-count-bg, var(--primary-brand-color));
  color: var(--sc-mobile-bottom-nav-v2-mobile-cart-count-text, var(--primary-button-text-color));
  border-radius: 8px;
  min-width: 16px;
  height: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 8px;
  font-weight: 700;
  padding: 0 3px;
  border: 1.5px solid var(--sc-mobile-bottom-nav-v2-mobile-cart-count-border, var(--primary-background-color));
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
  z-index: 3;
}

.mobile-favorite-count {
  position: absolute;
  top: 0;
  right: 4px;
  background: var(--sc-mobile-bottom-nav-v2-mobile-favorite-count-bg, var(--heart-icon-filled-color));
  color: var(--sc-mobile-bottom-nav-v2-mobile-favorite-count-text, var(--primary-button-text-color));
  border-radius: 8px;
  min-width: 16px;
  height: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 8px;
  font-weight: 700;
  padding: 0 3px;
  border: 1.5px solid var(--sc-mobile-bottom-nav-v2-mobile-favorite-count-border, var(--primary-background-color));
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
  z-index: 3;
}

/* Mobile Responsive */
@media (max-width: 768px) {
  .mobile-bottom-nav {
    display: flex !important; /* Show mobile bottom nav on mobile by default */
  }
  
  /* Hide mobile nav when fixed action bar is not visible */
  .mobile-bottom-nav.hide-when-fixed-bar-hidden {
    display: none !important;
  }
  
  /* Show mobile nav when fixed action bar is visible */
  .mobile-bottom-nav.show-with-fixed-bar {
    display: flex !important;
    transition: opacity 0.3s ease, transform 0.3s ease;
  }
}

/* Hide mobile nav initially when fixed action bar is not visible (for desktop/non-mobile) */
.mobile-bottom-nav.hide-when-fixed-bar-hidden {
  display: none;
}

/* Show mobile nav when fixed action bar is visible (for desktop/non-mobile) */
.mobile-bottom-nav.show-with-fixed-bar {
  display: flex;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

@media (max-width: 480px) {
  .mobile-bottom-nav {
    bottom: 0px;
    width: calc(100% - 16px);
    border-radius: 12px 12px 0 0;
  }
}

/* RTL Support */
[dir="rtl"] .mobile-bottom-nav {
  left: auto;
  right: 50%;
  transform: translateX(50%);
}

[dir="rtl"] .mobile-cart-count {
  right: auto;
  left: 4px;
}

[dir="rtl"] .mobile-favorite-count {
  right: auto;
  left: 4px;
}
