/* ============================================
   MOBILE FIRST NAVIGATION SYSTEM
   Modern, Responsive, Cutting-edge Design
============================================ */

:root {
  --primary-color: #2563eb;
  --primary-dark: #1d4ed8;
  --primary-light: #3b82f6;
  --secondary-color: #f1f5f9;
  --text-primary: #1e293b;
  --text-secondary: #64748b;
  --white: #ffffff;
  --border-radius: 12px;
  --border-radius-sm: 8px;
  --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-smooth: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ============================================
   RESET & BASE STYLES
============================================ */

* {
  box-sizing: border-box;
}

.primary-nav,
.secondary-nav {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  line-height: 1.5;
}

/* ============================================
   PRIMARY NAVIGATION (HAMBURGER MENU)
============================================ */

.primary-nav {
  position: relative;
  background: var(--white);
  box-shadow: var(--shadow-md);
  z-index: var(--z-nav);
}

.nav-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1200px;
  margin: 0 auto;
}

.nav-header {
  display: flex;
  align-items: center;
}

/* HAMBURGER BUTTON */
.hamburger {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: 44px;
  height: 44px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0px;
  border-radius: var(--border-radius-sm);
  transition: all var(--transition-fast);
  position: relative;
  overflow: hidden;
}

.hamburger:hover {
  background: var(--secondary-color);
  transform: scale(1.05);
}

.hamburger:active {
  transform: scale(0.95);
}

.hamburger-line {
  width: 22px;
  height: 2px;
  background: var(--text-primary);
  margin: 2px 0;
  transition: all var(--transition-smooth);
  border-radius: 2px;
  transform-origin: center;
}

/* HAMBURGER ANIMATION */
.hamburger.active .hamburger-line:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}

.hamburger.active .hamburger-line:nth-child(2) {
  opacity: 0;
  transform: translateX(-20px);
}

.hamburger.active .hamburger-line:nth-child(3) {
  transform: rotate(-45deg) translate(3px, -4px);
}

/* MOBILE MENU */

.nav-menu {
  position: fixed;
  top: 140px;
  left: -100%;
  width: 200px;
  height: 100vh;
  background: var(--white);
  box-shadow: var(--shadow-lg);
  transition: left var(--transition-smooth);
  z-index: 1001; /* FIXED: Higher than overlay */
  padding-top: 0px;
  overflow-y: auto;
}

.nav-menu.active {
  left: 0;
}

.nav-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.nav-item {
  margin: 0;
  border-bottom: 1px solid var(--secondary-color);
}

.nav-link {
  display: block;
  padding: 1.25rem 1.5rem;
  color: var(--text-primary);
  text-decoration: none;
  font-weight: 500;
  font-size: 1.1rem;
  transition: all var(--transition-fast);
  position: relative;
  overflow: hidden;
}

.nav-link::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, var(--primary-color), var(--primary-light));
  transition: width var(--transition-smooth);
  z-index: -1;
}

.nav-link:hover::before {
  width: 100%;
}

.nav-link:hover {
  color: var(--white);
  transform: translateX(8px);
}

.nav-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-smooth);
  z-index: 998;
  pointer-events: none;
}

.nav-overlay.active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

/* ============================================
   SECONDARY NAVIGATION (CATEGORY SLIDER)
============================================ */

.secondary-nav {
  background: var(--white);
  border-bottom: 1px solid var(--secondary-color);
  position: relative;
  overflow: hidden;
}

.category-slider-container {
  position: relative;
  max-width: 1200px;
  margin: 0 auto;
}

.category-slider {
  overflow: hidden;
  position: relative;
}

.category-track {
  display: flex;
  gap: 0rem;
  padding: 1 0rem;
  transition: transform var(--transition-smooth);
  will-change: transform;
}

.category-item {
  flex: 0 0 auto;
  min-width: 80px;
  text-align: center;
}

.category-link {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
  padding: 0.5rem 0.3rem;
  text-decoration: none;
  color: var(--text-secondary);
  border-radius: var(--border-radius);
  transition: all var(--transition-fast);
  position: relative;
  overflow: hidden;
}

.category-link::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
  opacity: 0;
  transition: opacity var(--transition-smooth);
  border-radius: var(--border-radius);
}

.category-link:hover::before {
  opacity: 0.1;
}

.category-link:hover {
  color: var(--primary-color);
  transform: translateY(-2px);
}

.category-link:active {
  transform: translateY(0);
}

.category-icon {
  position: relative;
  z-index: 1;
  transition: transform var(--transition-fast);
}

.category-link:hover .category-icon {
  transform: scale(1.1);
}

.category-icon svg {
  width: 28px;
  height: 28px;
/*   stroke: currentColor; */
}

.category-text {
  font-size: 0.75rem;
  font-weight: 500;
  white-space: nowrap;
  position: relative;
  z-index: 1;
}

/* SLIDER NAVIGATION BUTTONS */
.top-slider-nav {
  display: flex;
  justify-content: space-between;
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  transform: translateY(-50%);
  pointer-events: none;
  z-index: 10;
}

.top-slider-btn {
  width: 44px;
  height: 44px;
  background: var(--white);
  border: 3px solid var(--primary-color);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-fast);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
  pointer-events: auto;
  color: var(--primary-color);
  font-weight: bold;
}

.top-slider-btn:hover {
  background: var(--primary-color);
  border-color: var(--primary-dark);
  color: var(--white);
  transform: scale(1.15);
  box-shadow: 0 6px 20px rgba(37, 99, 235, 0.4);
}

.top-slider-btn:active {
  transform: scale(1.05);
}

.top-slider-btn.disabled {
  opacity: 0.4;
  cursor: not-allowed;
  pointer-events: none;
  background: var(--secondary-color);
  border-color: var(--text-secondary);
  color: var(--text-secondary);
  box-shadow: var(--shadow-sm);
}

.top-slider-btn.prev {
  margin-left: -11px;
}

.top-slider-btn.next {
  margin-right: -11px;
}


.nav-action-items {
  border-top: 2px solid var(--secondary-color);
}

.nav-action-item {
  margin: 0;
  border-bottom: 1px solid var(--secondary-color);
}

.nav-action-link {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.5rem;
  color: var(--text-primary);
  text-decoration: none;
  font-weight: 500;
  font-size: 1rem;
  transition: all var(--transition-fast);
  position: relative;
  overflow: hidden;
}

.nav-action-link::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, var(--primary-color), var(--primary-light));
  transition: width var(--transition-smooth);
  z-index: -1;
}

.nav-action-link:hover::before {
  width: 100%;
}

.nav-action-link:hover {
  color: var(--white);
  transform: translateX(8px);
}

.nav-action-icon {
  width: 20px;
  height: 20px;
  position: relative;
}

.nav-action-text {
  flex: 1;
}

.nav-cart-count {
  background: var(--primary-color);
  color: var(--white);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.25rem 0.5rem;
  border-radius: 12px;
  min-width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  margin-left: auto;
}

@media (max-width: 767px) {
  .header-actions .account-btn,
  .header-actions .cart-btn {
    display: none;
  }
  
  .header-actions .search-btn {
    display: flex; /* Keep search visible */
  }
}

/* ============================================
   DESKTOP STYLES (768px and up)
============================================ */

@media (min-width: 1000px) {

  .header-actions .account-btn,
  .header-actions .cart-btn,
  .header-actions .search-btn {
    display: flex;
  }

  .nav-action-items {
    display: none;
  }
  
  /* PRIMARY NAVIGATION - DESKTOP */
  .hamburger {
    display: none;
  }
  
  .nav-menu {
    position: static;
    width: auto;
    height: auto;
    background: transparent;
    box-shadow: none;
    padding-top: 0;
    overflow: visible;
  }
  
  .nav-list {
    display: flex;
    gap: 0.5rem;
  }
  
  .nav-item {
    margin: 0;
    border-bottom: none;
  }
  
  .nav-link {
    padding: 0.75rem 1.25rem;
    font-size: 1rem;
    border-radius: var(--border-radius);
    position: relative;
    background: transparent;
  }
  
  .nav-link::before {
    border-radius: var(--border-radius);
  }
  
  .nav-link:hover {
    transform: translateY(-2px);
  }
  
  /* SECONDARY NAVIGATION - DESKTOP */
  .category-track {
    justify-content: center;
    flex-wrap: nowrap;
    gap: 0rem;
    padding: 1 0rem;
  }
  
  .category-item {
    min-width: 100px;
  }
  
  .category-link {
    padding: 0.5rem 0.3rem;
  }
  
  .top-slider-nav {
    display: none; /* Hide slider buttons on desktop when all items fit */
  }

}

/* ============================================
   LARGE DESKTOP STYLES (1024px and up)
============================================ */

@media (min-width: 1024px) {
  .nav-container {
    padding: 0;
  }
  
  .nav-link {
    padding: 1rem 1.5rem;
    font-size: 1.1rem;
  }
  
  .category-track {
    gap: 0rem;
  }
  
  .category-item {
    min-width: 100px;
  }
  
  .category-link {
    padding: 0.5rem 0.3rem;
  }
  
  .category-icon svg {
    width: 28px;
    height: 28px;
  }
  
  .category-text {
    font-size: 0.75rem;
  }
}

/* ============================================
   ACCESSIBILITY & FOCUS STYLES
============================================ */

.hamburger:focus,
.nav-link:focus,
.category-link:focus,
.top-slider-btn:focus {
  outline: 2px solid var(--primary-color);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ============================================
   LOADING STATES & ANIMATIONS
============================================ */

@keyframes slideInFromLeft {
  from {
    opacity: 0;
    transform: translateX(-20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.nav-item {
  animation: slideInFromLeft 0.3s ease-out forwards;
}

.nav-item:nth-child(1) { animation-delay: 0.1s; }
.nav-item:nth-child(2) { animation-delay: 0.15s; }
.nav-item:nth-child(3) { animation-delay: 0.2s; }
.nav-item:nth-child(4) { animation-delay: 0.25s; }
.nav-item:nth-child(5) { animation-delay: 0.3s; }

.category-item {
  animation: slideInFromLeft 0.4s ease-out forwards;
}

.category-item:nth-child(1) { animation-delay: 0.1s; }
.category-item:nth-child(2) { animation-delay: 0.15s; }
.category-item:nth-child(3) { animation-delay: 0.2s; }
.category-item:nth-child(4) { animation-delay: 0.25s; }
.category-item:nth-child(5) { animation-delay: 0.3s; }