/* Material Icons Import */
@import url('https://fonts.googleapis.com/icon?family=Material+Icons');

/* Reset and Base Styles */
.nav-menu * {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* Main Menu Container */
.nav-menu {
  position: relative;
  width: 100%;
  background: #ffffff;
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  z-index: 1000;
  overflow: visible;
}

/* Ensure body doesn't clip dropdowns */
body {
  overflow-x: hidden;
  overflow-y: auto;
}

/* Desktop Header */
.nav-menu-desktop {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 2rem;
  height: 70px;
  position: relative;
  z-index: 1001;
}

/* Logo Section */
.nav-logo {
  flex-shrink: 0;
  position: relative;
  z-index: 10;
  margin-right: 2rem;
}

.nav-logo a {
  display: block;
  text-decoration: none;
}

.nav-logo img {
  height: 85px;
  width: 85px;
  border-radius: 50%;
  object-fit: cover;
  position: relative;
  top: 15px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Navigation Menu */
.nav-navigation {
  display: flex;
  align-items: center;
  height: 100%;
  flex: 1;
}

.nav-navigation-list {
  display: flex;
  list-style: none;
  gap: 2.5rem;
  height: 100%;
  align-items: center;
}

.nav-navigation-item {
  height: 100%;
  display: flex;
  align-items: center;
}

.nav-navigation-link {
  text-decoration: none;
  color: #000;
  font-size: 0.95rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  padding: 0.5rem 0;
  position: relative;
  transition: color 0.2s ease;
}

.nav-navigation-link:hover {
  color: #666;
}

.nav-navigation-link::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  width: 0;
  height: 2px;
  background: #000;
  transition: width 0.3s ease;
}

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

/* Right Section - Actions */
.nav-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-left: auto;
  position: relative;
  z-index: 997;
}

/* Language/Country Selectors */
.nav-selector {
  position: relative;
  z-index: 997;
}

/* Ensure no parent containers clip the dropdowns */
.nav-actions,
.nav-menu-desktop,
.nav-menu {
  overflow: visible !important;
}

.nav-selector-button {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0.375rem 0.5rem;
  border-radius: 4px;
  transition: background-color 0.2s ease;
}

.nav-selector-button:hover {
  background: rgba(0, 0, 0, 0.05);
}

.nav-flag {
  width: 20px;
  height: 15px;
  border-radius: 2px;
  position: relative;
  overflow: hidden;
}

.nav-flag img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 2px;
}

.nav-selector-text {
  font-size: 0.875rem;
  font-weight: 500;
  color: #000;
}

.nav-selector-icon {
  font-size: 16px;
  color: #666;
  transition: transform 0.2s ease;
}

.nav-selector.open .nav-selector-icon {
  transform: rotate(180deg);
}

/* Dropdown Menu */
.nav-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  background: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 6px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
  min-width: 160px;
  max-width: 300px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: all 0.25s ease;
  z-index: 99999;
  pointer-events: none;
}

.nav-selector.open .nav-dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  pointer-events: auto;
}

.nav-dropdown-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  text-decoration: none;
  color: #000;
  font-size: 0.875rem;
  transition: background-color 0.2s ease;
  border-radius: 4px;
  margin: 0.25rem;
}

.nav-dropdown-item:hover {
  background: rgba(0, 0, 0, 0.05);
}

.nav-dropdown-item:first-child {
  margin-top: 0.5rem;
}

.nav-dropdown-item:last-child {
  margin-bottom: 0.5rem;
}

.nav-dropdown-item.selected {
  background: rgba(0, 0, 0, 0.08);
  font-weight: 600;
}

/* Action Icons */
.nav-icon-button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: transparent;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  color: #000;
  transition: all 0.2s ease;
  position: relative;
}

.nav-icon-button:hover {
  background: rgba(0, 0, 0, 0.05);
}

.nav-icon-button .material-icons {
  font-size: 22px;
}

/* Cart Badge */
.nav-cart-badge {
  position: absolute;
  top: 4px;
  right: 4px;
  background: #000;
  color: #fff;
  border-radius: 50%;
  width: 16px;
  height: 16px;
  font-size: 10px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transform: scale(0);
  transition: all 0.2s ease;
}

.nav-cart-badge.has-items {
  opacity: 1;
  transform: scale(1);
}

/* Mobile Menu Toggle */
.nav-mobile-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: transparent;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  color: #000;
  position: absolute;
  left: 2rem;
  top: 50%;
  transform: translateY(-50%);
  z-index: 20;
}

.nav-mobile-toggle .material-icons {
  font-size: 24px;
}

/* Mobile Slide Menu Backdrop */
.nav-mobile-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  z-index: 998;
}

.nav-mobile-backdrop.active {
  opacity: 1;
  visibility: visible;
}

.nav-mobile-header, .nav-mobile-selectors {
    display: none;
}

/* Mobile Styles */
@media (max-width: 768px) {
  .nav-menu-desktop {
    padding: 0 1rem 0 5rem;
    height: 60px;
    justify-content: flex-start;
  }
  
  .nav-logo {
    margin-right: 0;
    margin-left: 1rem;
  }
  
  .nav-logo img {
    height: 65px;
    width: 65px;
    top: 12px;
  }
  
  /* Show mobile selectors when on mobile/tablet */
  .nav-mobile-selectors {
    display: block;
    width: 100%;
  }
  
  .nav-navigation {
    position: fixed;
    top: 0;
    left: -80vw;
    width: 80vw;
    max-width: 320px;
    height: 100vh;
    background: #ffffff;
    box-shadow: 2px 0 15px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    z-index: 999;
    overflow-y: auto;
  }
  
  .nav-navigation.active {
    left: 0;
    flex-direction: column;
  }
  
  /* Mobile Menu Header */
  .nav-mobile-header {
    position: sticky;
    top: 0;
    display: flex;
    justify-content: flex-end;
    padding: 1rem 1rem 0.5rem 1rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    background: #ffffff;
    z-index: 10;
    width: 100%;
  }
  
  .nav-mobile-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: transparent;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    color: #000;
    transition: all 0.2s ease;
  }
  
  .nav-mobile-close:hover {
    background: rgba(0, 0, 0, 0.05);
  }
  
  .nav-mobile-close .material-icons {
    font-size: 24px;
  }
  
  /* Mobile Selectors */
  .nav-mobile-selectors {
    padding: 1rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    display: none;
  }
  
  .nav-mobile-selector {
    margin-bottom: 1rem;
    position: relative;
  }
  
  .nav-mobile-selector:last-child {
    margin-bottom: 0;
  }
  
  .nav-mobile-selector-button {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(0, 0, 0, 0.02);
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 6px;
    padding: 0.75rem 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
  }
  
  .nav-mobile-selector-button:hover {
    background: rgba(0, 0, 0, 0.05);
  }
  
  .nav-mobile-selector-current {
    display: flex;
    align-items: center;
    gap: 0.5rem;
  }
  
  .nav-mobile-selector-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.25rem;
  }
  
  .nav-mobile-selector-text {
    font-size: 0.875rem;
    font-weight: 500;
    color: #000;
  }
  
  .nav-mobile-selector-icon {
    font-size: 18px;
    color: #666;
    transition: transform 0.2s ease;
  }
  
  .nav-mobile-selector.open .nav-mobile-selector-icon {
    transform: rotate(180deg);
  }
  
  .nav-mobile-dropdown {
    position: absolute;
    top: calc(100% + 0.25rem);
    left: 0;
    right: 0;
    background: #ffffff;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 6px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: all 0.25s ease;
    z-index: 1000;
    pointer-events: none;
  }
  
  .nav-mobile-selector.open .nav-mobile-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
  }
  
  .nav-mobile-dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    text-decoration: none;
    color: #000;
    font-size: 0.875rem;
    transition: background-color 0.2s ease;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  }
  
  .nav-mobile-dropdown-item:last-child {
    border-bottom: none;
    border-radius: 0 0 6px 6px;
  }
  
  .nav-mobile-dropdown-item:first-child {
    border-radius: 6px 6px 0 0;
  }
  
  .nav-mobile-dropdown-item:hover {
    background: rgba(0, 0, 0, 0.05);
  }
  
  .nav-mobile-dropdown-item.selected {
    background: rgba(0, 0, 0, 0.08);
    font-weight: 600;
  }

  .nav-navigation-list {
    flex-direction: column;
    padding: 1rem 0;
    gap: 0;
    height: auto;
    width: 100%;
    text-align: left;
  }
  
  .nav-navigation-item {
    width: 100%;
    height: auto;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  }
  
  .nav-navigation-link {
    display: block;
    padding: 1.5rem 2rem;
    width: 100%;
    font-size: 1.1rem;
  }
  
  .nav-navigation-link::after {
    display: none;
  }
  
  .nav-mobile-toggle {
    display: flex;
  }
  
  .nav-actions {
    gap: 0.5rem;
    position: absolute;
    right: 1rem;
  }
  
  .nav-icon-button {
    width: 36px;
    height: 36px;
  }
  
  .nav-icon-button .material-icons {
    font-size: 20px;
  }
}

@media (max-width: 480px) {
  .nav-menu-desktop {
    padding: 0 0.75rem 0 4rem;
    height: 56px;
  }
  
  .nav-logo img {
    height: 55px;
    width: 55px;
    top: 8px;
  }
  
  .nav-actions {
    gap: 0.25rem;
  }
  
  .nav-selector {
    display: none;
  }
  
  /* Show mobile selectors when desktop ones are hidden */
  .nav-mobile-selectors {
    display: block;
  }
  
  .nav-icon-button {
    width: 32px;
    height: 32px;
  }
  
  .nav-icon-button .material-icons {
    font-size: 18px;
  }
  
  .nav-mobile-toggle {
    left: 1rem;
  }
}

/* Focus States for Accessibility */
.nav-selector-button:focus,
.nav-icon-button:focus,
.nav-mobile-toggle:focus,
.nav-mobile-close:focus,
.nav-navigation-link:focus,
.nav-mobile-selector-button:focus,
.nav-mobile-dropdown-item:focus {
  outline: 2px solid rgba(0, 123, 255, 0.5);
  outline-offset: 2px;
}

/* Checkout Logo Centering */
.nav-logo-checkout {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 10;
  flex-shrink: 0;
}

.nav-logo-checkout a {
  display: block;
  text-decoration: none;
}

.nav-logo-checkout img {
  height: 85px;
  width: 85px;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Desktop Checkout Logo */
@media (min-width: 769px) {
  .nav-logo-checkout {
    position: absolute;
    left: 50%;
    top: 73%;
    transform: translate(-50%, -50%);
  }
}

/* Mobile Checkout Logo */
@media (max-width: 768px) {
  .nav-logo-checkout {
    position: absolute;
    left: 50%;
    top: 65%;
    transform: translate(-50%, -50%);
  }
  
  .nav-logo-checkout img {
    height: 65px;
    width: 65px;
  }
}

@media (max-width: 480px) {
  .nav-logo-checkout img {
    height: 55px;
    width: 55px;
  }
}

/* Upgrade Banner Styles */
.nav-banner {
  padding: 10px 0;
  background-color: #f5f5f5;
  border-bottom: 1px solid #e0e0e0;
  width: 100%;
}

.nav-banner .container {
  position: relative;
  padding: 0 40px;
  max-width: 1440px;
  margin: 0 auto;
}

.nav-banner-close {
  position: absolute;
  top: 0;
  right: 10px;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 24px;
  color: #333;
  padding: 0;
  line-height: 1;
  z-index: 10;
  transition: color 0.2s ease;
}

.nav-banner-close:hover {
  color: #000;
}

.nav-banner-close .material-icons {
  font-size: 24px;
}

.nav-banner-link {
  text-decoration: none;
  color: inherit;
  font-size: 18px;
  font-weight: 500;
  display: block;
  text-align: center;
  transition: color 0.2s ease;
}

.nav-banner-link:hover {
  color: #666;
}

/* Mobile Banner Styles */
@media (max-width: 768px) {
  .nav-banner {
    padding: 16px 0;
  }
  
  .nav-banner .container {
    padding: 0 30px;
  }
  
  .nav-banner-link {
    font-size: 16px;
  }
  
  .nav-banner-close {
    font-size: 20px;
  }
  
  .nav-banner-close .material-icons {
    font-size: 20px;
  }
}

@media (max-width: 480px) {
  .nav-banner {
    padding: 12px 0;
  }
  
  .nav-banner .container {
    padding: 0 20px;
  }
  
  .nav-banner-link {
    font-size: 14px;
  }
}