/* ─── Currency Switcher ──────────────────────────────────────────────────── */

#currency-switcher {
  position: relative;
  display: inline-block;
  font-family: inherit;
}

#currency-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: #fff;
  border: 1.5px solid #e0e0e0;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  color: #1a1a1a;
  cursor: pointer;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
  white-space: nowrap;
  user-select: none;
}

#currency-btn:hover {
  border-color: #aaa;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

#currency-btn:focus-visible {
  outline: 2px solid #4f46e5;
  outline-offset: 2px;
}

.currency-chevron {
  font-size: 0.75rem;
  color: #888;
  transition: transform 0.2s;
}

#currency-dropdown.open + #currency-btn .currency-chevron,
#currency-btn[aria-expanded="true"] .currency-chevron {
  transform: rotate(180deg);
}

/* ─── Dropdown Panel ─────────────────────────────────────────────────────── */

#currency-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 220px;
  background: #fff;
  border: 1.5px solid #e0e0e0;
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.12);
  overflow: hidden;
  z-index: 1000;

  /* Hidden by default */
  opacity: 0;
  transform: translateY(-6px) scale(0.98);
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease;
}

#currency-dropdown.open {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: all;
}

#currency-list {
  list-style: none;
  margin: 0;
  padding: 6px;
}

/* ─── Individual Options ─────────────────────────────────────────────────── */

.currency-option {
  display: grid;
  grid-template-columns: 28px 44px 1fr 24px;
  align-items: center;
  gap: 6px;
  padding: 10px 12px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s;
}

.currency-option:hover {
  background: #f5f5f5;
}

.currency-option.active {
  background: #eef2ff;
}

.currency-option.active .currency-code {
  color: #4f46e5;
}

.currency-flag {
  font-size: 1.15rem;
  line-height: 1;
}

.currency-code {
  font-weight: 700;
  font-size: 0.85rem;
  color: #1a1a1a;
  letter-spacing: 0.03em;
}

.currency-name {
  font-size: 0.82rem;
  color: #666;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.currency-symbol {
  font-size: 0.9rem;
  color: #999;
  text-align: right;
  font-weight: 600;
}

/* ─── Dark mode support ──────────────────────────────────────────────────── */

@media (prefers-color-scheme: dark) {
  #currency-btn {
    background: #1e1e1e;
    border-color: #333;
    color: #f0f0f0;
  }

  #currency-btn:hover {
    border-color: #555;
  }

  #currency-dropdown {
    background: #1e1e1e;
    border-color: #333;
    box-shadow: 0 8px 32px rgba(0,0,0,0.4);
  }

  .currency-option:hover {
    background: #2a2a2a;
  }

  .currency-option.active {
    background: #1e1b4b;
  }

  .currency-code {
    color: #f0f0f0;
  }

  .currency-name {
    color: #999;
  }
}