/* ============================================================
   WebDealz - Slim top bar + currency selector
   (assets/css/wd-currency.css)

   Loaded after style.css / wd-refresh.css / wd-home.css.
   Not scoped to body.home: the bar and selector are site-wide.
   Palette: navy #0B1F42, blue #0866F5, yellow #FFB800, orange #FF6B00
   ============================================================ */

.wd-topbar {
  position: relative;
  z-index: 1040;
  padding: 0;
  border-bottom: 0;
  background:
    radial-gradient(120% 200% at 100% 0%, rgba(8, 102, 245, .28), transparent 52%),
    linear-gradient(90deg, #0B1F42 0%, #14315f 52%, #0B1F42 100%);
  color: rgba(255, 255, 255, .82);
  font-size: .78rem;
  line-height: 1.2;
}
.wd-topbar::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--wd-primary) 0%, var(--wd-primary-light) 55%, var(--wd-orange) 100%);
  opacity: .95;
}

.wd-topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 38px;
  padding-top: .3rem;
  padding-bottom: .3rem;
}

.wd-topbar-left {
  display: flex;
  align-items: center;
  min-width: 0;
}
.wd-topbar .tb {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  white-space: nowrap;
  color: rgba(255, 255, 255, .78);
  padding: 0 .95rem;
  border-right: 1px solid rgba(255, 255, 255, .12);
}
.wd-topbar .tb:first-child { padding-left: 0; }
.wd-topbar .tb:last-child { border-right: 0; }
.wd-topbar .tb i { color: var(--wd-yellow); font-size: .85rem; }

.wd-topbar-right {
  display: flex;
  align-items: center;
  gap: .85rem;
  margin-left: auto;
}
.wd-topbar-note {
  display: inline-flex;
  align-items: center;
  gap: .38rem;
  color: rgba(255, 255, 255, .7);
  white-space: nowrap;
}
.wd-topbar-note i { color: var(--wd-primary-light); }
.wd-topbar-note strong { color: #fff; font-weight: 700; letter-spacing: .02em; }

/* ---------------- Currency dropdown ---------------- */
.wd-curr { position: relative; }

.wd-curr-btn {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  padding: .32rem .7rem .32rem .62rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, .22);
  background: rgba(255, 255, 255, .08);
  color: #fff;
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .02em;
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease, box-shadow .15s ease;
}
.wd-curr-btn:hover,
.wd-curr-btn:focus-visible {
  background: rgba(255, 255, 255, .16);
  border-color: rgba(255, 255, 255, .45);
  box-shadow: 0 0 0 3px rgba(8, 102, 245, .28);
  outline: none;
}
.wd-curr-btn .wd-curr-globe { color: var(--wd-primary-light); font-size: .85rem; }
.wd-curr-btn .wd-curr-caret { font-size: .58rem; opacity: .7; transition: transform .18s ease; }
.wd-curr.is-open .wd-curr-btn .wd-curr-caret { transform: rotate(180deg); }
.wd-curr-btn .wd-curr-code { letter-spacing: .05em; }

.wd-curr-menu {
  position: absolute;
  right: 0;
  top: calc(100% + .55rem);
  z-index: 3000;
  width: 326px;
  max-width: calc(100vw - 1.5rem);
  background: #fff;
  color: var(--wd-text);
  border: 1px solid var(--wd-border);
  border-radius: 16px;
  box-shadow: var(--wd-shadow-lg);
  overflow: hidden;
}
.wd-curr-menu[hidden] { display: none; }

.wd-curr-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: .5rem;
  padding: .8rem .9rem .5rem;
  font-weight: 700;
  font-size: .84rem;
  color: var(--wd-heading);
}
.wd-curr-head small { font-weight: 500; font-size: .7rem; color: var(--wd-muted); }

.wd-curr-search {
  display: flex;
  align-items: center;
  gap: .5rem;
  margin: 0 .75rem .5rem;
  padding: .45rem .65rem;
  border: 1px solid var(--wd-border);
  border-radius: 10px;
  background: var(--wd-bg-soft);
  transition: border-color .15s ease, background .15s ease;
}
.wd-curr-search:focus-within { border-color: var(--wd-primary); background: #fff; }
.wd-curr-search i { color: var(--wd-muted); font-size: .85rem; }
.wd-curr-search input {
  border: 0;
  outline: none;
  background: transparent;
  width: 100%;
  font-size: .84rem;
  color: var(--wd-heading);
}

.wd-curr-list {
  list-style: none;
  margin: 0;
  padding: .35rem;
  max-height: 330px;
  overflow-y: auto;
  overscroll-behavior: contain;
}
.wd-curr-item {
  display: flex;
  align-items: center;
  gap: .6rem;
  padding: .5rem .6rem;
  border-radius: 9px;
  text-decoration: none;
  color: var(--wd-text);
  font-size: .84rem;
  transition: background .12s ease, color .12s ease;
}
.wd-curr-item:hover { background: var(--wd-bg-soft); color: var(--wd-navy); }
.wd-curr-item.is-active {
  background: var(--wd-primary-soft);
  color: var(--wd-primary-dark);
  font-weight: 700;
}
.wd-curr-item-symbol {
  flex: 0 0 auto;
  width: 1.7rem;
  text-align: center;
  font-weight: 700;
  color: var(--wd-navy);
}
.wd-curr-item.is-active .wd-curr-item-symbol { color: var(--wd-primary); }
.wd-curr-item-name {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.wd-curr-item-code {
  flex: 0 0 auto;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .03em;
  color: var(--wd-muted);
}
.wd-curr-empty {
  padding: .9rem .7rem;
  text-align: center;
  font-size: .8rem;
  color: var(--wd-muted);
}

/* ---------------- Responsive ---------------- */
@media (max-width: 767.98px) {
  .wd-topbar .tb-hide-sm { display: none !important; }
  .wd-topbar-inner { min-height: 34px; }
}
@media (max-width: 575.98px) {
  .wd-topbar-left { display: none; }
  .wd-topbar-right { gap: .5rem; width: 100%; justify-content: flex-end; }
  .wd-curr { position: static; }
  .wd-curr-menu {
    left: .6rem;
    right: .6rem;
    width: auto;
    max-width: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .wd-curr-btn, .wd-curr-btn .wd-curr-caret { transition: none; }
}
