.currency-switch {
  --ink: #203149;
  --muted: #44505d;
  --selected: #dce3e9;
  align-self: center;
  margin-inline: .5rem 1.5rem;
  font-family: inherit;
}
.currency-trigger, .currency-row {
  cursor: pointer;
  font-family: inherit;
  display: flex;
  align-items: center;
  gap: .5rem;
}
/* Quiet by design: a 36 px outlined pill inside a 48 px tap target, so the control stays secondary to the menu. */
.currency-trigger {
  position: relative;
  isolation: isolate;
  min-height: 48px;
  padding: 0 .75rem;
  gap: .375rem;
  border: 0;
  background: transparent;
  color: white;
  font-size: .875rem;
  font-weight: 500;
}
.currency-trigger::before {
  content: '';
  position: absolute;
  z-index: -1;
  inset-block: 6px;
  inset-inline: 0;
  border: 1px solid currentColor;
  border-radius: 99px;
  opacity: .4;
  transition: opacity .15s, background-color .15s;
}
.currency-trigger img { width: 20px; height: 20px; }
.currency-trigger > span { font-size: .75rem; opacity: .7; transition: transform .2s; }
.currency-trigger:hover::before { background: color-mix(in srgb, currentColor 14%, transparent); opacity: .6; }
.currency-trigger:focus-visible { outline: none; }
.currency-trigger:focus-visible::before { outline: 2px solid currentColor; outline-offset: 2px; opacity: .9; }
.currency-trigger[data-pointer-focus]:focus-visible::before { outline: none; opacity: .4; }
.currency-trigger:active { transform: scale(.96); }
.currency-trigger:not([data-active="AED"])::before { opacity: .75; }
.currency-trigger[aria-expanded="true"] > span { transform: rotate(180deg); }
#currency-panel {
  box-sizing: border-box;
  position: fixed;
  inset: var(--currency-top) auto auto var(--currency-left);
  margin: 0;
  width: 312px;
  max-width: 100%;
  max-height: calc(100dvh - var(--currency-top) - 8px);
  padding: 1rem;
  color: var(--ink);
  background: white;
  border: 0;
  border-radius: 20px;
  box-shadow: 0 16px 40px rgba(32,49,73,.2);
  text-align: start;
}
#currency-panel[open] { animation: currency-enter .3s cubic-bezier(.2,.9,.3,1.1); }
#currency-panel::backdrop { background: transparent; }
#currency-panel h2 {
  width: auto;
  padding: 0;
  font-family: inherit;
  font-size: .875rem;
  font-weight: 500;
  letter-spacing: .08em;
  text-transform: uppercase;
  margin: 0 .5rem .5rem;
}
.currency-row {
  min-height: 56px;
  width: 100%;
  padding: .5rem;
  border-radius: 12px;
  border: 0;
  background: white;
  color: var(--ink);
  text-align: start;
}
.currency-row strong, .currency-row small { display: block; }
.currency-row strong { font-size: 1rem; font-weight: 500; }
.currency-row small { color: var(--muted); font-size: .875rem; }
.currency-row:hover { background: #f1f0ee; }
.currency-row:active { transform: scale(.985); }
.currency-row[value="AED"] { border: 1px solid var(--selected); }
.currency-row[aria-checked="true"] { background: var(--selected); }
.currency-row[aria-checked="true"]::after { content: '✓'; margin-inline-start: auto; }
.currency-row:focus-visible { outline: 2px solid var(--ink); outline-offset: -2px; }
@keyframes currency-enter { from { opacity: 0; transform: translateY(12px); } }
@media (max-width: 1024px) {
  body > header:has(.currency-switch) {
    height: auto;
    padding-block: 0;
  }
  .menu-wrapper:has(> .currency-switch) {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    align-items: center;
    column-gap: 12px;
    padding: 11px 16px;
  }
  .menu-wrapper:has(> .currency-switch) > .logo { display: contents; }
  .menu-wrapper:has(> .currency-switch) > .logo > a {
    grid-area: 1 / 1;
    justify-self: start;
    margin-inline: 0;
  }
  .menu-wrapper:has(> .currency-switch) .hamburger-icon {
    grid-area: 1 / 3;
    min-width: 48px;
    min-height: 48px;
    padding: 0;
  }
  .menu-wrapper:has(> .currency-switch) > .navigation-main-menu {
    grid-area: 2 / 1 / auto / -1;
  }
  .currency-switch { grid-area: 1 / 2; margin: 0; }
  .currency-switch .currency-trigger[data-active] { color: var(--main-text-color); }
  header:has(#dropdown:checked) .currency-trigger[data-active] { color: white; }
}
@media (max-width: 700px) {
  #currency-panel {
    inset: auto 0 0;
    width: 100%;
    max-height: 90dvh;
    border-radius: 28px 28px 0 0;
    padding-bottom: max(1rem, env(safe-area-inset-bottom));
  }
  #currency-panel::before { content: ''; display: block; margin: 0 auto 1rem; width: 40px; height: 4px; border-radius: 4px; background: var(--selected); }
  #currency-panel::backdrop { background: rgba(239,237,235,.74); }
  #currency-panel[open] { animation-duration: .38s; }
}
@media (prefers-reduced-motion: reduce) {
  #currency-panel[open] { animation: none; }
}
