/* Language Switcher Container Positioning - Next to Cart Button */
#languageSwitcher {
  position: fixed;
  top: 30px;
  right: 180px; /* Positioned to the left of cart button */
  z-index: 200;
}

/* Legal pages - position on the right edge */
body[data-page] #languageSwitcher {
  right: 30px;
}

/* Language Switcher Styles - Matching Cart Button */
.language-switcher {
  position: relative;
  display: inline-block;
}

.language-switcher-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 14px 20px; /* Same as cart button */
  background: var(--sun-coral);
  color: white;
  border: 2px solid var(--sun-coral);
  border-radius: 0; /* Sharp corners like cart button */
  cursor: pointer;
  font-size: 16px;
  font-weight: 700;
  line-height: 1; /* Match cart button line height */
  letter-spacing: 0.5px;
  transition: all 0.3s ease;
  box-shadow: 0 4px 20px rgba(244, 162, 97, 0.4);
  min-width: 70px;
  height: 52px; /* Exact same height as cart button */
}

.language-switcher-btn:hover {
  background: var(--ocean-deep);
  color: white;
  border-color: var(--ocean-deep);
  box-shadow: 0 6px 30px rgba(0, 121, 140, 0.6);
}

.language-switcher-btn:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.language-flag {
  font-size: 1.3rem;
  line-height: 1;
}

.language-switcher-btn svg {
  color: currentColor;
  flex-shrink: 0;
}

.language-switcher-dropdown {
  position: absolute;
  top: calc(100% + 0.5rem);
  right: 0;
  min-width: 180px;
  background: var(--ocean-deep); /* Dark ocean background */
  border: 2px solid var(--sun-coral);
  border-radius: 0; /* Sharp corners to match theme */
  box-shadow: 0 4px 20px rgba(244, 162, 97, 0.3);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all 0.3s ease;
  z-index: 1000;
  overflow: hidden;
}

.language-switcher-dropdown.active {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.language-option {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 0.75rem;
  width: 100%;
  padding: 0.75rem 1rem;
  background: transparent;
  border: none;
  cursor: pointer;
  transition: background 0.15s ease;
}

.language-option .language-flag {
  font-size: 1.3rem;
}

.language-option .language-name {
  font-size: 0.875rem;
  color: #ffffff; /* White text */
  font-weight: 700;
}

.language-option:hover {
  background: rgba(255, 255, 255, 0.1); /* Light hover effect */
}

.language-option.active {
  background: var(--sun-coral);
  font-weight: 700;
}

.language-option.active .language-name {
  color: white;
  font-weight: 700;
}

.language-option:not(:last-child) {
  border-bottom: 1px solid rgba(255, 255, 255, 0.1); /* Subtle divider */
}

/* Responsive adjustments */
@media (max-width: 768px) {
  #languageSwitcher {
    top: 20px;
    right: 140px; /* Adjust for smaller cart button */
  }

  body[data-page] #languageSwitcher {
    right: 20px;
  }

  .language-switcher-btn {
    padding: 12px 16px;
    min-width: 65px;
    height: 48px; /* Match responsive cart button */
  }

  .language-flag {
    font-size: 1.2rem;
  }

  .language-switcher-dropdown {
    min-width: 150px;
  }

  .language-option {
    padding: 0.65rem 0.85rem;
  }

  .language-option .language-flag {
    font-size: 1.2rem;
  }

  .language-option .language-name {
    font-size: 0.8125rem;
  }
}

/* Small mobile phones */
@media (max-width: 600px) {
  #languageSwitcher {
    top: 20px;
    right: 120px;
  }

  body[data-page] #languageSwitcher {
    right: 15px;
  }

  .language-switcher-btn {
    padding: 10px 14px;
    gap: 0.3rem;
    min-width: 60px;
    height: 44px;
  }

  .language-flag {
    font-size: 1.1rem;
  }

  .language-switcher-dropdown {
    min-width: 140px;
  }
}

/* Extra small phones */
@media (max-width: 480px) {
  #languageSwitcher {
    top: 15px;
    right: 100px;
  }

  body[data-page] #languageSwitcher {
    right: 10px;
  }

  .language-switcher-btn {
    padding: 10px 12px;
    min-width: 55px;
    height: 42px;
  }

  .language-flag {
    font-size: 1rem;
  }

  .language-switcher-dropdown {
    min-width: 130px;
  }

  .language-option {
    padding: 0.6rem 0.75rem;
  }

  .language-option .language-flag {
    font-size: 1.1rem;
  }

  .language-option .language-name {
    font-size: 0.75rem;
  }
}

/* Dark mode support (maintains coral theme) */
@media (prefers-color-scheme: dark) {
  .language-switcher-btn {
    background: var(--sun-coral);
    border-color: var(--sun-coral);
    color: white;
  }

  .language-switcher-btn:hover {
    background: var(--ocean-deep);
    color: white;
    border-color: var(--ocean-deep);
  }

  .language-switcher-dropdown {
    background: #1f2937;
    border-color: var(--sun-coral);
  }

  .language-option {
    background: #1f2937;
    color: #f3f4f6;
  }

  .language-option:hover {
    background: #374151;
  }

  .language-option.active {
    background: var(--sun-coral);
    color: white;
  }

  .language-option:not(:last-child) {
    border-bottom-color: #374151;
  }
}
