:root {
  --color-pink: #ff48e9;
  --color-green: #62c481;
  --color-green-opacity-50: rgba(98, 196, 129, 0.5);
  --color-purple: #a734ef;
  --color-purple-opacity-25: rgba(167, 52, 239, 0.25);
  --color-dark-gray: #333333;
  --color-white: #ffffff;
  --color-black: #000000;
  --color-light-gray: #f5f5f5;
  --color-gray: #ccc;
  --color-blue: #2d60f6;
  --font-family-termina: "termina", sans-serif;
}

/* Country Switcher Styles */
.country-switcher {
  display: inline-flex;
  align-items: center;
  font-family: inherit;
  font-size: 14px;
  line-height: 1.4;
  color: #333;
}

.country-switcher__wrapper {
  display: flex;
  align-items: center;
  gap: 8px;
}

.country-switcher__label {
  color: #666;
  font-weight: 500;
}

.country-switcher__options {
  display: flex;
  gap: 4px;
}

.country-switcher__option {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px;
  text-decoration: none;
  color: #666;
  background: #f8f9fa;
  border: 1px solid #e9ecef;
  border-radius: 4px;
  transition: all 0.2s ease;
  font-size: 14px;
  line-height: 1;
  min-width: 40px;
  min-height: 40px;
}

.country-switcher__option:hover {
  background: #e9ecef;
  color: #333;
  text-decoration: none;
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.country-switcher__option--active {
  background: var(--color-green-opacity-50);
  color: white;
  border-color: var(--color-green);
}

.country-switcher__option--active:hover {
  background: #005a87;
  border-color: #005a87;
  color: white;
}

.country-switcher__option--loading {
  opacity: 0.7;
  pointer-events: none;
}

.country-switcher__flag {
  width: 32px;
  height: auto;
  object-fit: contain;
  border-radius: 2px;
  aspect-ratio: 3 / 2;
}

/* Vertical layout */
.country-switcher--vertical .country-switcher__wrapper {
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
}

.country-switcher--vertical .country-switcher__options {
  flex-direction: column;
  gap: 4px;
  width: 100%;
}

.country-switcher--vertical .country-switcher__option {
  justify-content: flex-start;
  width: 100%;
}

/* Dropdown Styles */
.country-switcher-dropdown {
  position: relative;
  display: inline-block;
  font-family: inherit;
}

.country-switcher-dropdown__trigger {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 12px;
  background: #f8f9fa;
  border: 1px solid #e9ecef;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 14px;
  line-height: 1;
  color: #333;
  min-width: 60px;
  min-height: 40px;
}

.country-switcher-dropdown__trigger:hover {
  background: #e9ecef;
  border-color: #dee2e6;
}

.country-switcher-dropdown--open .country-switcher-dropdown__trigger {
  background: var(--color-green);
  color: white;
  border-color: var(--color-green);
}

.country-switcher-dropdown__flag {
  width: 24px;
  height: auto;
  object-fit: contain;
  border-radius: 2px;
  aspect-ratio: 3 / 2;
}

.country-switcher-dropdown__text {
  font-weight: 500;
  flex: 1;
}

.country-switcher-dropdown__arrow {
  width: 12px;
  height: 8px;
  transition: transform 0.2s ease;
  opacity: 0.6;
}

.country-switcher-dropdown--open .country-switcher-dropdown__arrow {
  transform: rotate(180deg);
}

.country-switcher-dropdown__menu {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: white;
  border: 1px solid #e9ecef;
  border-radius: 4px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: all 0.2s ease;
  z-index: 1000;
  min-width: 180px;
}

.country-switcher-dropdown--open .country-switcher-dropdown__menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.country-switcher-dropdown__option {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 12px 16px;
  text-decoration: none;
  color: #333;
  transition: all 0.15s ease;
  border-bottom: 1px solid #f8f9fa;
  min-height: 40px;
}

.country-switcher-dropdown__option:last-child {
  border-bottom: none;
}

.country-switcher-dropdown__option:hover {
  background: #f8f9fa;
  color: var(--color-green);
  text-decoration: none;
}

.country-switcher-dropdown__option--active {
  background: #e3f2fd;
  color: var(--color-green);
}

.country-switcher-dropdown__option--active:hover {
  background: #bbdefb;
}

.country-switcher-dropdown__check {
  width: 16px;
  height: 16px;
  color: #28a745;
  opacity: 0.8;
}

/* Responsive Design */
@media (max-width: 768px) {
  .country-switcher {
    font-size: 13px;
  }

  .country-switcher__option {
    padding: 6px;
    min-width: 40px;
    min-height: 40px;
  }

  .country-switcher__flag {
    width: 28px;
    aspect-ratio: 3 / 2;
  }

  .country-switcher-dropdown__trigger {
    padding: 6px 10px;
    min-width: 50px;
    min-height: 36px;
  }

  .country-switcher-dropdown__flag {
    width: 20px;
    aspect-ratio: 3 / 2;
  }

  .country-switcher-dropdown__menu {
    min-width: 120px;
  }

  .country-switcher-dropdown__option {
    padding: 10px 14px;
    min-height: 40px;
  }
}

/* Dark theme support */
.dark .country-switcher {
  color: #f8f9fa;
}

.dark .country-switcher__label {
  color: #adb5bd;
}

.dark .country-switcher__option {
  background: #343a40;
  border-color: #495057;
  color: #adb5bd;
}

.dark .country-switcher__option:hover {
  background: #495057;
  color: #f8f9fa;
}

.dark .country-switcher__option--active {
  background: var(--color-green-opacity-50);
  border-color: var(--color-green-opacity-50);
  color: white;
}

.dark .country-switcher-dropdown__trigger {
  background: #343a40;
  border-color: #495057;
  color: #f8f9fa;
}

.dark .country-switcher-dropdown__trigger:hover {
  background: #495057;
  border-color: #6c757d;
}

.dark .country-switcher-dropdown__menu {
  background: #343a40;
  border-color: #495057;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.dark .country-switcher-dropdown__option {
  color: #adb5bd;
  border-bottom-color: #495057;
}

.dark .country-switcher-dropdown__option:hover {
  background: #495057;
  color: #f8f9fa;
}

.dark .country-switcher-dropdown__option--active {
  background: rgba(0, 124, 186, 0.2);
  color: var(--color-green);
}

.dark .country-switcher-dropdown__option--active:hover {
  background: rgba(0, 124, 186, 0.3);
}

/* Animation for loading state */
@keyframes country-switcher-loading {
  0% {
    opacity: 0.5;
  }
  50% {
    opacity: 0.8;
  }
  100% {
    opacity: 0.5;
  }
}

.country-switcher__option--loading {
  animation: country-switcher-loading 1.5s ease-in-out infinite;
}

/* Focus styles for accessibility */
.country-switcher__option:focus,
.country-switcher-dropdown__trigger:focus,
.country-switcher-dropdown__option:focus {
  outline: 2px solid var(--color-green);
  outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  .country-switcher__option {
    border-width: 2px;
  }

  .country-switcher__option--active {
    background: #000;
    color: #fff;
    border-color: #000;
  }

  .country-switcher-dropdown__trigger,
  .country-switcher-dropdown__menu {
    border-width: 2px;
  }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
  .country-switcher__option,
  .country-switcher-dropdown__trigger,
  .country-switcher-dropdown__menu,
  .country-switcher-dropdown__arrow {
    transition: none;
  }

  .country-switcher__option--loading {
    animation: none;
    opacity: 0.7;
  }
}

.menu-item-country-switcher {
  padding: 1em 5%;
}

/* Menu-specific Country Switcher Styles */
#menu-new-mega-menu .country-switcher {
  display: inline-flex;
  align-items: center;
  margin: 0;
}

#menu-new-mega-menu .country-switcher__wrapper {
  display: flex;
  align-items: center;
  gap: 4px;
}

#menu-new-mega-menu .country-switcher__options {
  display: flex;
  gap: 6px;
}

#menu-new-mega-menu .country-switcher__option {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  margin: 0;
  width: 64px;
  height: 64px;
  min-width: 64px;
  min-height: 64px;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 4px;
  transition: all 0.2s ease;
  text-decoration: none;
}

#menu-new-mega-menu .country-switcher__option:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.3);
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

#menu-new-mega-menu .country-switcher__option--active {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.4);
}

#menu-new-mega-menu .country-switcher__option--active:hover {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.5);
}

#menu-new-mega-menu .country-switcher__flag {
  width: 40px;
  height: auto;
  object-fit: contain;
  border-radius: 2px;
  aspect-ratio: 3 / 2;
}

/* Responsive adjustments for menu */
@media (max-width: 768px) {
  #menu-new-mega-menu .country-switcher__option {
    width: 48px;
    height: 48px;
    min-width: 48px;
    min-height: 48px;
  }

  #menu-new-mega-menu .country-switcher__flag {
    width: 32px;
  }
}

/* End of Country Switcher Styles */
