/* PAC.CO storefront currency selector (2026-10-08, v1.0.0).
 * Display-only conversion UI: "THB / EN" button in .nav-actions + dropdown
 * (Search, 14 supported countries, Language footer). Scoped under
 * .pacco-currency so it can never restyle page HTML. */

.pacco-currency {
  position: relative;
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  /* Breathing room so neighbouring header badges can never touch the pill. */
  margin-right: 4px;
}

.pacco-currency .pc-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  /* Merchant request: no pill outline — plain text button, not a circle. */
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: #111;
  padding: 7px 10px;
  transition: background-color .18s ease;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.02em;
  cursor: pointer;
  line-height: 1;
  white-space: nowrap;
}

/* Hover / open: a soft translucent pill, so it reads on the white bar and
 * over the hero image alike. Colour is inherited so white labels stay white. */
.pacco-currency .pc-btn:hover,
.pacco-currency .pc-btn[aria-expanded="true"] {
  background: rgba(120, 120, 128, .09);
}

.pacco-currency .pc-btn:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 2px;
}

.pacco-currency .pc-btn .pc-sep {
  opacity: 0.45;
  font-weight: 400;
}

.pacco-currency .pc-btn .pc-lang {
  font-weight: 600;
}

.pacco-currency .pc-panel {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: max(280px, 22vw);
  max-width: 78vw;
  background: #fff;
  color: #111;
  border: 1px solid #e3e7ec;
  border-radius: 16px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.18);
  z-index: 900;
  overflow: hidden;
  text-align: left;
}

.pacco-currency .pc-panel[hidden] {
  display: none;
}

/* Smooth open (2026-10-08): a soft fade + rise + settle each time the panel
 * unhides. Entry `animation` (not transition) restarts automatically when
 * the hidden attribute is removed, so no JS changes were needed. Close stays
 * instant. transform-origin keeps the motion anchored to the button. */
@keyframes pc-panel-in {
  from {
    opacity: 0;
    transform: translateY(-8px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.pacco-currency .pc-panel {
  transform-origin: top right;
  animation: pc-panel-in 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

.pacco-currency .pc-search {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 14px 10px;
  color: #5b6675;
}

.pacco-currency .pc-search input {
  border: 0;
  outline: 0;
  flex: 1 1 auto;
  min-width: 0;
  font-size: 13px;
  font-weight: 600;
  color: #111;
  background: transparent;
  padding: 2px 0;
}

.pacco-currency .pc-search input::placeholder {
  color: #8a94a0;
  font-weight: 500;
}

.pacco-currency .pc-list {
  max-height: 320px;
  overflow-y: auto;
  padding: 2px 6px 6px;
}

.pacco-currency .pc-opt {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  border: 0;
  background: transparent;
  padding: 9px 10px;
  border-radius: 10px;
  font-size: 13px;
  cursor: pointer;
  color: #1e2733;
  text-align: left;
}

.pacco-currency .pc-opt:hover {
  background: #f2f4f7;
}

.pacco-currency .pc-opt[data-selected="1"] {
  background: #f2f4f7;
  font-weight: 800;
}

.pacco-currency .pc-country {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 500;
}

.pacco-currency .pc-opt[data-selected="1"] .pc-country {
  font-weight: 800;
}

.pacco-currency .pc-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid #eef1f4;
  padding: 11px 16px;
  font-size: 13px;
  color: #5b6675;
}

.pacco-currency .pc-foot-lang {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 700;
  color: #1e2733;
}

.pacco-currency .pc-foot-lang button {
  border: 0;
  background: transparent;
  padding: 2px 4px;
  font: inherit;
  font-weight: 600;
  color: #8a94a0;
  cursor: pointer;
}

.pacco-currency .pc-foot-lang button[data-on="1"] {
  color: #111;
  font-weight: 800;
}

.pacco-currency .pc-foot-lang button {
  border-radius: 999px;
  transition: color .18s ease, background-color .18s ease;
}

.pacco-currency .pc-foot-lang button:hover {
  color: #111;
  background: #f2f4f7;
}

.pacco-currency .pc-foot-lang .pc-lang-sep {
  color: #d7dce3;
  font-weight: 400;
}

.pacco-currency .pc-note {
  padding: 0 16px 12px;
  font-size: 11px;
  color: #8a94a0;
}

/* "Shown in X · Charged in USD" honesty note under the order totals. */
.pacco-fx-note {
  margin-top: 8px;
  font-size: 11.5px;
  font-weight: 600;
  color: #8a94a0;
  text-align: right;
}

@media (max-width: 480px) {
  .pacco-currency .pc-btn {
    padding: 6px 8px;
    font-size: 11px;
  }

  .pacco-currency .pc-panel {
    position: fixed;
    top: 64px;
    left: 12px;
    right: 12px;
    width: auto;
    max-width: none;
    transform-origin: top center;
  }

  .pacco-currency .pc-list {
    max-height: 52vh;
  }
}

@media (prefers-reduced-motion: reduce) {
  .pacco-currency .pc-btn,
  .pacco-currency .pc-opt,
  .pacco-currency .pc-panel {
    transition: none;
    animation: none;
  }
}
