/* Para birimi seçici — SVG bayrak / EU, premium SaaS, dark/light */

.ms-currency-icons-sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  clip-path: inset(50%);
}

.ms-currency-select {
  position: relative;
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  z-index: 96;
}

/* Açık panel üst şerit dropdown'larının (z-index ~1080) üstünde kalsın */
.ms-currency-select.is-open {
  z-index: 1100;
}

/* Auth topbar: tema (40px) ve zil ile aynı görsel yükseklik (≤991px) */
@media (max-width: 991.98px) {
  .ms-topbar.ms-topbar-auth .ms-currency-select__btn {
    min-height: 40px;
  }
}

/* Üst bar aksiyonları paneli kırpmasın */
.ms-topbar .ms-topbar-auth-actions,
.ms-topbar .ms-topbar-guest-end.ms-header-actions,
.ms-topbar .ms-header-actions {
  overflow: visible;
}

.ms-currency-svg {
  display: block;
  flex-shrink: 0;
  border-radius: 3px;
  box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.06);
  shape-rendering: geometricPrecision;
}

.ms-currency-select__btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  min-height: 38px;
  border-radius: 12px;
  border: 1px solid rgba(0, 97, 242, 0.18);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(248, 250, 255, 0.94));
  color: #253046;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.02em;
  cursor: pointer;
  box-shadow:
    0 1px 2px rgba(10, 22, 50, 0.06),
    inset 0 1px 0 rgba(255, 255, 255, 0.65),
    0 6px 18px rgba(0, 97, 242, 0.08);
  transition:
    transform 0.22s cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 0.22s ease,
    border-color 0.2s ease,
    background 0.2s ease;
}

.ms-currency-select__btn:hover {
  transform: translateY(-1px);
  border-color: rgba(0, 97, 242, 0.38);
  box-shadow:
    0 6px 20px rgba(0, 97, 242, 0.14),
    inset 0 1px 0 rgba(255, 255, 255, 0.75);
}

.ms-currency-select.is-open .ms-currency-select__btn {
  border-color: rgba(0, 97, 242, 0.45);
  box-shadow:
    0 0 0 3px rgba(0, 97, 242, 0.14),
    0 6px 22px rgba(0, 97, 242, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

.ms-currency-select__icon-slot {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 0;
  transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}

.ms-currency-select__icon-slot .ms-currency-svg {
  transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}

.ms-currency-select__btn:hover .ms-currency-select__icon-slot .ms-currency-svg {
  transform: scale(1.06);
}

.ms-currency-select__icon-slot--pulse .ms-currency-svg {
  animation: ms-cur-flag-pop 0.42s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes ms-cur-flag-pop {
  0% {
    transform: scale(1);
    filter: saturate(1);
  }
  45% {
    transform: scale(1.14);
    filter: saturate(1.15);
  }
  100% {
    transform: scale(1);
    filter: saturate(1);
  }
}

@media (prefers-reduced-motion: reduce) {
  .ms-currency-select__btn,
  .ms-currency-select__icon-slot,
  .ms-currency-select__icon-slot .ms-currency-svg,
  .ms-currency-select__opt,
  .ms-currency-select__opt-ico,
  .ms-currency-select__chev {
    transition: none !important;
    animation: none !important;
  }
  .ms-currency-select__btn:hover .ms-currency-select__icon-slot .ms-currency-svg {
    transform: none;
  }
}

.ms-currency-select__code {
  min-width: 2.05rem;
  text-align: left;
  letter-spacing: 0.06em;
}

.ms-currency-select__chev {
  opacity: 0.52;
  flex-shrink: 0;
  transition: transform 0.24s cubic-bezier(0.22, 1, 0.36, 1);
}

.ms-currency-select.is-open .ms-currency-select__chev {
  transform: rotate(180deg);
}

.ms-currency-select__panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  left: auto;
  width: max-content;
  min-width: 200px;
  max-width: min(296px, calc(100vw - 24px));
  padding: 7px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid rgba(15, 23, 42, 0.07);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  box-shadow:
    0 18px 48px rgba(15, 23, 42, 0.12),
    0 0 0 1px rgba(255, 255, 255, 0.65) inset;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  transition:
    opacity 0.22s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.22s cubic-bezier(0.22, 1, 0.36, 1),
    visibility 0.22s;
}

.ms-currency-select.is-open .ms-currency-select__panel {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

/*
 * JS viewport hizalaması: transform/scale kapatılır; taşma ve kesilme olmaz.
 */
.ms-currency-select--panel-fixed .ms-currency-select__panel {
  transform: none !important;
  transition: opacity 0.2s ease, visibility 0.2s ease;
  -webkit-overflow-scrolling: touch;
}

.ms-currency-select--panel-fixed.is-open .ms-currency-select__panel {
  transform: none !important;
}

@supports not (backdrop-filter: blur(1px)) {
  .ms-currency-select__panel {
    background: #fff;
  }
}

/* Satır: [ikon][kod ortada başlar][isim sağ] */
.ms-currency-select__opt {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  column-gap: 10px;
  width: 100%;
  text-align: left;
  padding: 10px 11px;
  margin: 0;
  border: 1px solid transparent;
  border-radius: 11px;
  background: transparent;
  color: #1e293b;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition:
    background 0.2s ease,
    border-color 0.2s ease,
    color 0.2s ease,
    box-shadow 0.22s ease,
    transform 0.2s ease;
}

.ms-currency-select__opt-ico {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 0;
}

.ms-currency-select__opt-ico .ms-currency-svg--opt {
  transition: transform 0.22s cubic-bezier(0.22, 1, 0.36, 1);
}

.ms-currency-select__opt:hover .ms-currency-select__opt-ico .ms-currency-svg--opt {
  transform: scale(1.08);
}

.ms-currency-select__opt-code {
  font-weight: 700;
  letter-spacing: 0.07em;
  font-size: 12px;
  color: #334155;
  justify-self: start;
}

.ms-currency-select__opt-name {
  font-weight: 500;
  font-size: 11px;
  color: rgba(30, 41, 59, 0.55);
  justify-self: end;
  text-align: right;
  max-width: min(9.5rem, 42vw);
  line-height: 1.35;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ms-currency-select__opt:hover {
  background: rgba(0, 97, 242, 0.07);
  border-color: rgba(0, 97, 242, 0.1);
  transform: translateX(2px);
}

.ms-currency-select__opt.is-active {
  background: linear-gradient(135deg, rgba(0, 97, 242, 0.16), rgba(105, 0, 199, 0.1));
  border-color: rgba(0, 97, 242, 0.28);
  color: #0b3f9f;
  box-shadow:
    0 0 0 3px rgba(0, 97, 242, 0.1),
    0 12px 28px rgba(0, 97, 242, 0.08);
}

.ms-currency-select__opt.is-active .ms-currency-select__opt-code {
  color: #073899;
}

.ms-currency-select__opt.is-active .ms-currency-select__opt-name {
  color: rgba(15, 60, 150, 0.78);
}

.ms-currency-select__loading {
  display: none;
  position: absolute;
  right: 8px;
  top: 50%;
  margin-top: -7px;
  width: 14px;
  height: 14px;
  border: 2px solid rgba(0, 97, 242, 0.25);
  border-top-color: #0061f2;
  border-radius: 50%;
  animation: ms-cur-spin 0.7s linear infinite;
  pointer-events: none;
}

.ms-currency-select.is-loading .ms-currency-select__loading {
  display: block;
}

.ms-currency-select.is-loading .ms-currency-select__chev {
  opacity: 0;
}

@keyframes ms-cur-spin {
  to {
    transform: rotate(360deg);
  }
}

.ms-money {
  display: inline;
  transition: opacity 0.15s ease;
}

.ms-money.ms-currency-updating {
  opacity: 0.55;
}

html.theme-dark .ms-currency-select__btn,
body.dark .ms-currency-select__btn {
  background: linear-gradient(180deg, rgba(34, 42, 58, 0.96), rgba(22, 28, 42, 0.99));
  color: #e8edf7;
  border-color: rgba(110, 167, 255, 0.22);
  box-shadow:
    0 6px 22px rgba(0, 0, 0, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

html.theme-dark .ms-currency-select__btn:hover,
body.dark .ms-currency-select__btn:hover {
  border-color: rgba(110, 167, 255, 0.38);
  box-shadow:
    0 10px 28px rgba(0, 0, 0, 0.45),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

html.theme-dark .ms-currency-select.is-open .ms-currency-select__btn,
body.dark .ms-currency-select.is-open .ms-currency-select__btn {
  border-color: rgba(110, 167, 255, 0.42);
  box-shadow:
    0 0 0 3px rgba(0, 97, 242, 0.18),
    0 8px 26px rgba(0, 0, 0, 0.45),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

html.theme-dark .ms-currency-svg,
body.dark .ms-currency-svg {
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.1);
}

html.theme-dark .ms-currency-select__panel,
body.dark .ms-currency-select__panel {
  background: rgba(24, 32, 48, 0.92);
  border-color: rgba(110, 167, 255, 0.14);
  box-shadow:
    0 22px 56px rgba(0, 0, 0, 0.55),
    0 0 0 1px rgba(255, 255, 255, 0.06) inset;
}

@supports not (backdrop-filter: blur(1px)) {
  html.theme-dark .ms-currency-select__panel,
  body.dark .ms-currency-select__panel {
    background: #1c2538;
  }
}

html.theme-dark .ms-currency-select__opt,
body.dark .ms-currency-select__opt {
  color: #e8edf7;
}

html.theme-dark .ms-currency-select__opt-code,
body.dark .ms-currency-select__opt-code {
  color: rgba(235, 242, 255, 0.95);
}

html.theme-dark .ms-currency-select__opt-name,
body.dark .ms-currency-select__opt-name {
  color: rgba(200, 210, 230, 0.55);
}

html.theme-dark .ms-currency-select__opt:hover,
body.dark .ms-currency-select__opt:hover {
  background: rgba(110, 167, 255, 0.1);
  border-color: rgba(110, 167, 255, 0.16);
}

/* Aktif — beyaz halo yok; marka mavisi ile sınırlı parlaklık */
html.theme-dark .ms-currency-select__opt.is-active,
body.dark .ms-currency-select__opt.is-active {
  background: linear-gradient(135deg, rgba(0, 97, 242, 0.34), rgba(105, 0, 199, 0.18));
  border-color: rgba(110, 167, 255, 0.35);
  color: #eef3ff;
  box-shadow:
    0 0 0 1px rgba(110, 167, 255, 0.25),
    0 14px 32px rgba(0, 0, 0, 0.4);
}

html.theme-dark .ms-currency-select__opt.is-active .ms-currency-select__opt-name,
body.dark .ms-currency-select__opt.is-active .ms-currency-select__opt-name {
  color: rgba(220, 230, 252, 0.78);
}

/* Compact — dar viewport; JS fixed konum + sağa hizalı fallback */
@media (max-width: 575.98px) {
  .ms-currency-select__btn {
    padding: 6px 9px;
    min-height: 36px;
    font-size: 12px;
    gap: 6px;
  }

  .ms-currency-select__icon-slot .ms-currency-svg,
  .ms-currency-select__opt-ico .ms-currency-svg--opt {
    width: 18px;
    height: 12.6px;
  }

  .ms-currency-select:not(.ms-currency-select--panel-fixed) .ms-currency-select__panel {
    right: 0;
    left: auto;
    transform: translateY(-6px);
    min-width: min(240px, calc(100vw - 16px));
    max-width: calc(100vw - 16px);
  }

  .ms-currency-select:not(.ms-currency-select--panel-fixed).is-open .ms-currency-select__panel {
    transform: translateY(0);
  }

  .ms-currency-select__opt-name {
    max-width: min(8.5rem, 38vw);
    font-size: 10px;
  }

  .ms-currency-select__opt {
    padding: 9px 9px;
    column-gap: 8px;
  }
}
