.mobile-lang-switcher {
  position: fixed;
  bottom: calc(var(--mobile-basket-bar-height, 56px) + 12px);
  left: 12px;
  z-index: 1070;
}

.mobile-lang-trigger {
  width: 44px;
  height: 44px;
  padding: 0;
  border-radius: 9999px;
  border: 1px solid rgba(0, 0, 0, 0.15);
  background: #fff;
  color: #111;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.12);
}

/* iOS Safari fix: force the language trigger to a non-native look + guarantee contrast */
@supports (-webkit-touch-callout: none) {

  .mobile-lang-trigger,
  .mobile-lang-trigger:link,
  .mobile-lang-trigger:visited,
  .mobile-lang-trigger:hover,
  .mobile-lang-trigger:active,
  .mobile-lang-trigger:focus,
  .mobile-lang-trigger:focus-visible {
    -webkit-appearance: none !important;
    appearance: none !important;

    /* critical: stop iOS from auto-tinting / blending */
    background: #fff !important;
    background-color: #fff !important;
    color: #111 !important;
    -webkit-text-fill-color: #111 !important;
    opacity: 1 !important;

    /* critical: prevent "transparent text" / weird compositing */
    -webkit-font-smoothing: antialiased !important;
    -webkit-transform: translateZ(0) !important;
    transform: translateZ(0) !important;
    -webkit-backface-visibility: hidden !important;
    backface-visibility: hidden !important;

    /* critical: iOS sometimes inherits blend/filter from parents */
    mix-blend-mode: normal !important;
    filter: none !important;
    -webkit-filter: none !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;

    /* ensure focus ring doesn't "white out" */
    outline-color: #111 !important;
    box-shadow: none !important;
  }

  /* if the trigger is a <button> or <a> containing text nodes */
  .mobile-lang-trigger * {
    color: #111 !important;
    -webkit-text-fill-color: #111 !important;
  }

  /* SVG must follow currentColor */
  .mobile-lang-trigger svg,
  .mobile-lang-trigger svg * {
    fill: currentColor !important;
    stroke: currentColor !important;
    opacity: 1 !important;
  }

  /* If the control is actually a <select> styled as a button */
  select.mobile-lang-trigger,
  .mobile-lang-trigger select {
    -webkit-appearance: none !important;
    appearance: none !important;
    background: #fff !important;
    background-color: #fff !important;
    color: #111 !important;
    -webkit-text-fill-color: #111 !important;
    opacity: 1 !important;
  }

  /* If iOS is applying "disabled" look due to accidental attribute/state */
  .mobile-lang-trigger[disabled],
  .mobile-lang-trigger[aria-disabled="true"] {
    opacity: 1 !important;
  }
}

.mobile-lang-icon {
  width: 20px;
  height: 20px;
  display: block;
  fill: currentColor;
}

.mobile-lang-menu {
  position: absolute;
  bottom: 48px;
  left: 0;
  display: none;
  padding: 8px;
  background: #fff;
  color: #111;
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
  gap: 6px;
  -webkit-text-fill-color: #111;
}

.mobile-lang-switcher.is-open .mobile-lang-menu {
  display: grid;
}

.mobile-lang-option {
  border: 1px solid rgba(0, 0, 0, 0.12);
  background: #fff;
  color: #111;
  border-radius: 10px;
  padding: 6px 10px;
  font-weight: 600;
  -webkit-text-fill-color: #111;
  -webkit-appearance: none;
}

.mobile-lang-option.is-active {
  border-color: rgba(0, 0, 0, 0.4);
  text-decoration: underline;
}

/* ===== iOS Safari language switcher readability fix ===== */
.mobile-lang-switcher .dropdown-menu,
.mobile-lang-switcher .dropdown-menu *,
.mobile-lang-switcher .menu-panel,
.mobile-lang-switcher .menu-panel *,
.mobile-lang-switcher .popover,
.mobile-lang-switcher .popover * {
  color: #111 !important;
  -webkit-text-fill-color: #111 !important;
}

.mobile-lang-switcher .dropdown-menu,
.mobile-lang-switcher .menu-panel,
.mobile-lang-switcher .popover,
.mobile-lang-switcher .mobile-lang-menu {
  background-color: #fff !important;
}

.mobile-lang-switcher a,
.mobile-lang-switcher button,
.mobile-lang-switcher .dropdown-item,
.mobile-lang-switcher .mobile-lang-option {
  color: #111 !important;
  -webkit-text-fill-color: #111 !important;
}

.mobile-lang-switcher a:hover,
.mobile-lang-switcher a:focus,
.mobile-lang-switcher .dropdown-item:hover,
.mobile-lang-switcher .dropdown-item:focus,
.mobile-lang-switcher .mobile-lang-option:hover,
.mobile-lang-switcher .mobile-lang-option:focus {
  color: #111 !important;
  -webkit-text-fill-color: #111 !important;
}

.mobile-lang-switcher select,
.mobile-lang-switcher select option {
  color: #111 !important;
  background-color: #fff !important;
  -webkit-text-fill-color: #111 !important;
}

.mobile-lang-switcher {
  mix-blend-mode: normal !important;
  filter: none !important;
  -webkit-filter: none !important;
  opacity: 1 !important;
}

.mobile-lang-switcher .dropdown-menu,
.mobile-lang-switcher .menu-panel,
.mobile-lang-switcher .popover,
.mobile-lang-switcher .mobile-lang-menu {
  z-index: 99999 !important;
}

body.debug-lang .mobile-lang-switcher {
  outline: 3px solid #f00 !important;
}

.mobile-lang-switcher,
.mobile-lang-switcher * {
  -webkit-text-fill-color: inherit;
}

.mobile-lang-menu,
.mobile-lang-option {
  opacity: 1;
  visibility: visible;
}

@media (min-width: 768px) {
  .mobile-lang-switcher {
    display: none;
  }
}

html[dir="rtl"] .mobile-lang-switcher {
  left: auto;
  right: 12px;
}

/* ===== iOS Safari fix for NEW header language switcher (.gsts-lang-summary) ===== */
@supports (-webkit-touch-callout: none) {
  /* iOS Safari: force visible text/icon for NEW language switcher */
  .gsts-header-lang .gsts-lang-summary,
  .gsts-header-lang .gsts-lang-summary * {
    background: #fff !important;
    background-color: #fff !important;
    color: #111 !important;
    -webkit-text-fill-color: #111 !important;
    opacity: 1 !important;
    visibility: visible !important;
    mix-blend-mode: normal !important;
    filter: none !important;
    -webkit-filter: none !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    text-shadow: none !important;
  }

  .gsts-header-lang .gsts-lang-summary {
    -webkit-appearance: none !important;
    appearance: none !important;
    -webkit-transform: translateZ(0) !important;
    transform: translateZ(0) !important;
    -webkit-backface-visibility: hidden !important;
    backface-visibility: hidden !important;
  }

  .gsts-header-lang .gsts-lang-summary svg,
  .gsts-header-lang .gsts-lang-summary svg * {
    fill: currentColor !important;
    stroke: currentColor !important;
    opacity: 1 !important;
  }
}
