/* ===== Currency buy/sell desk (exchange.js) ===== */

:root {
  /* WhatsApp's brand green (#25D366) is ~2:1 against white text, so
     buttons use a darker shade that clears 4.5:1. */
  --wa: #0b7f4a;
  --wa-hover: #096b3e;
  --ex-buy: #0b7f4a;
  --ex-sell: #c2410c;
}

/* ---------- shared buttons ---------- */
.ex-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 36px;
  padding: 6px 14px;
  border-radius: 10px;
  border: none;
  font-family: 'Vazirmatn', sans-serif;
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  text-decoration: none;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
}
.ex-btn:hover { transform: translateY(-2px); filter: brightness(1.08); }
.ex-btn:focus-visible { outline: 3px solid var(--accent-light); outline-offset: 2px; }
.ex-btn--buy { background: var(--ex-buy); }
.ex-btn--sell { background: var(--ex-sell); }
.ex-btn--wa { background: var(--wa); }
.ex-btn--wa:hover { background: var(--wa-hover); }
.ex-btn--ghost {
  background: transparent;
  color: var(--text-primary);
  border: 1px solid var(--border-bright);
}
.ex-btn--lg { min-height: 50px; padding: 12px 24px; font-size: 15px; border-radius: 14px; }

.ex-flag { font-size: 20px; line-height: 1; }
.ex-flag-img { width: 22px; height: 22px; border-radius: 50%; }
.ex-chg { font-size: 12px; font-weight: 700; direction: ltr; unicode-bidi: isolate; white-space: nowrap; }
.ex-chg.up { color: var(--green); }
.ex-chg.down { color: var(--red); }
.ex-chg.flat { color: var(--text-muted); }
.ex-empty { padding: 24px; text-align: center; color: var(--text-secondary); font-size: 14px; }

/* ---------- floating WhatsApp button (all pages) ---------- */
.wa-float {
  position: fixed;
  left: 20px;
  bottom: 20px;
  z-index: 900;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 18px 12px 14px;
  border-radius: 999px;
  background: var(--wa);
  color: #fff;
  text-decoration: none;
  font-family: 'Vazirmatn', sans-serif;
  font-weight: 700;
  font-size: 14px;
  box-shadow: 0 10px 30px rgba(11, 127, 74, 0.45);
  transition: var(--transition);
  animation: wa-pulse 2.6s ease-out infinite;
}
.wa-float i { font-size: 26px; }
.wa-float:hover { background: var(--wa-hover); transform: translateY(-3px); }
@keyframes wa-pulse {
  0% { box-shadow: 0 0 0 0 rgba(11, 127, 74, 0.55), 0 10px 30px rgba(11, 127, 74, 0.45); }
  70% { box-shadow: 0 0 0 16px rgba(11, 127, 74, 0), 0 10px 30px rgba(11, 127, 74, 0.45); }
  100% { box-shadow: 0 0 0 0 rgba(11, 127, 74, 0), 0 10px 30px rgba(11, 127, 74, 0.45); }
}
@media (prefers-reduced-motion: reduce) {
  .wa-float { animation: none; }
}
@media (max-width: 640px) {
  .wa-float { left: 14px; bottom: 14px; padding: 13px; }
  .wa-float__txt { display: none; }
}

/* ---------- nav highlight ---------- */
.nav-btn.nav-exchange {
  color: #fff;
  background: linear-gradient(135deg, var(--ex-buy), #0e9f6e);
  border-color: transparent;
}
.nav-btn.nav-exchange:hover { color: #fff; }

/* ---------- currency card quick buttons (main.js) ---------- */
.card-trade {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 12px;
}
.card-trade .ex-btn { min-height: 34px; font-size: 12px; }

/* ---------- buy/sell column in the currency list (main.js) ---------- */
.price-list-table td.col-trade { white-space: nowrap; }
.price-list-table td.col-trade .ex-btn { min-height: 32px; padding: 4px 12px; font-size: 12px; }
.price-list-table td.col-trade .ex-btn + .ex-btn { margin-inline-start: 6px; }
@media (max-width: 768px) {
  .price-list-table td.col-trade .ex-btn { display: flex; width: 100%; min-height: 30px; padding: 3px 8px; }
  .price-list-table td.col-trade .ex-btn + .ex-btn { margin: 4px 0 0; }
}

/* ---------- home / currency page promo ---------- */
.ex-promo {
  margin: 32px 0;
  padding: 28px;
  border-radius: var(--radius);
  border: 1px solid rgba(11, 127, 74, 0.25);
  background:
    radial-gradient(1200px 300px at 100% 0%, rgba(11, 127, 74, 0.14), transparent 60%),
    radial-gradient(900px 300px at 0% 100%, rgba(99, 102, 241, 0.12), transparent 60%),
    var(--bg-card);
  box-shadow: var(--shadow);
}
.ex-promo__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
}
.ex-promo__head h2 { font-size: 1.45rem; line-height: 1.6; }
.ex-promo__head p { color: var(--text-secondary); font-size: 14px; margin-top: 4px; line-height: 1.9; }
.ex-promo__ctas { display: flex; flex-wrap: wrap; gap: 10px; }
.ex-promo__perks {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  margin-top: 18px;
  font-size: 13px;
  color: var(--text-secondary);
}
.ex-promo__perks span::before { content: '✓ '; color: var(--ex-buy); font-weight: 800; }

.ex-mini-board {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(195px, 1fr));
  gap: 14px;
}
.ex-mini {
  padding: 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-primary);
}
.ex-mini__name { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 14px; }
.ex-mini__name .ex-chg { margin-inline-start: auto; }
.ex-mini__rates {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 12px 0;
}
.ex-mini__rates small { display: block; font-size: 11px; color: var(--text-secondary); }
.ex-mini__rates b { font-size: 15px; }
.ex-mini__btns { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }

/* ---------- /exchange.html ---------- */
.ex-hero {
  position: relative;
  overflow: hidden;
  padding: 44px 32px;
  border-radius: var(--radius-lg);
  background:
    radial-gradient(800px 400px at 90% -10%, rgba(11, 127, 74, 0.35), transparent 60%),
    radial-gradient(700px 400px at -10% 110%, rgba(99, 102, 241, 0.35), transparent 60%),
    #0b1226;
  color: #f1f5f9;
  margin-bottom: 28px;
}
.ex-hero__badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  font-size: 13px;
  margin-bottom: 16px;
}
.ex-hero__badge .live-dot { margin: 0; }
.ex-hero h1 { font-size: clamp(1.6rem, 4vw, 2.5rem); line-height: 1.5; font-weight: 900; }
.ex-hero h1 em { font-style: normal; color: #4ade80; }
.ex-hero p { margin-top: 12px; max-width: 720px; line-height: 2; color: #cbd5e1; font-size: 15px; }
.ex-hero__ctas { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 24px; }
.ex-hero__ctas .ex-btn--ghost { color: #f1f5f9; border-color: rgba(255, 255, 255, 0.3); }
.ex-hero__trust {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 12px;
  margin-top: 30px;
}
.ex-hero__trust div {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.07);
  font-size: 13px;
  line-height: 1.6;
}
.ex-hero__trust i { font-size: 18px; color: #4ade80; }
.ex-hero__hours { margin-top: 18px; font-size: 13px; color: #cbd5e1; }

.ex-notice {
  margin-bottom: 20px;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  background: var(--gold-bg);
  border: 1px solid rgba(245, 158, 11, 0.4);
  font-size: 14px;
}

.ex-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}
@media (max-width: 1000px) {
  /* minmax(0, …), not plain 1fr: a 1fr track grows to fit the rate table's
     nowrap cells and pushes the page wider than the phone. */
  .ex-layout { grid-template-columns: minmax(0, 1fr); }
}

.ex-panel {
  padding: 24px;
  border-radius: var(--radius);
  background: var(--bg-card);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}
.ex-panel h2 { font-size: 1.2rem; margin-bottom: 6px; }
.ex-panel__sub { font-size: 13px; color: var(--text-secondary); margin-bottom: 18px; line-height: 1.9; }

/* rate table */
.ex-search {
  width: 100%;
  margin-bottom: 14px;
  padding: 11px 14px;
  border-radius: 12px;
  border: 1px solid var(--border-bright);
  background: var(--bg-primary);
  color: var(--text-primary);
  font-family: 'Vazirmatn', sans-serif;
  font-size: 14px;
}
.ex-table-wrap { overflow-x: auto; max-height: 640px; overflow-y: auto; border-radius: 12px; border: 1px solid var(--border); }
.ex-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.ex-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--bg-secondary);
  padding: 12px 10px;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-secondary);
  text-align: right;
  white-space: nowrap;
}
.ex-table td, .ex-table tbody th { padding: 10px; border-top: 1px solid var(--border); text-align: right; font-weight: 400; }
.ex-table tbody tr:hover { background: var(--bg-card-hover); }
.ex-cur { display: flex; align-items: center; gap: 10px; }
.ex-cur b { display: block; font-size: 14px; }
.ex-cur small { font-size: 11px; color: var(--text-muted); }
.ex-num { font-weight: 700; white-space: nowrap; }
.ex-actions { white-space: nowrap; }
.ex-actions .ex-btn { min-height: 32px; padding: 4px 12px; font-size: 12px; }
@media (max-width: 640px) {
  .ex-hide-sm { display: none; }
  .ex-table { font-size: 13px; }
  .ex-actions { display: flex; flex-direction: column; gap: 6px; }
}

/* order form */
.ex-form { position: sticky; top: 90px; }
@media (max-width: 1000px) { .ex-form { position: static; } }
.ex-seg {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  padding: 5px;
  border-radius: 14px;
  background: var(--bg-secondary);
  margin-bottom: 16px;
}
.ex-seg button {
  min-height: 42px;
  border: none;
  border-radius: 10px;
  background: transparent;
  color: var(--text-secondary);
  font-family: 'Vazirmatn', sans-serif;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
}
.ex-seg button.active { color: #fff; }
.ex-seg button[data-side-toggle="buy"].active { background: var(--ex-buy); }
.ex-seg button[data-side-toggle="sell"].active { background: var(--ex-sell); }
.ex-seg--sm { margin-bottom: 10px; }
.ex-seg--sm button { min-height: 34px; font-size: 12px; }
.ex-seg--sm button.active { background: var(--accent); }

.ex-field { margin-bottom: 14px; }
.ex-field > label, .ex-field > .ex-label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; }
.ex-field input[type="text"], .ex-field input[type="tel"], .ex-field input[type="number"],
.ex-field select, .ex-field textarea {
  width: 100%;
  padding: 11px 14px;
  border-radius: 12px;
  border: 1px solid var(--border-bright);
  background: var(--bg-primary);
  color: var(--text-primary);
  font-family: 'Vazirmatn', sans-serif;
  font-size: 15px;
}
.ex-field textarea { min-height: 70px; resize: vertical; }
.ex-field input:focus, .ex-field select:focus, .ex-field textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.ex-amount { position: relative; }
.ex-amount input { padding-left: 90px; }
.ex-amount__unit {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 12px;
  color: var(--text-secondary);
  max-width: 80px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ex-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.ex-chips button {
  padding: 5px 12px;
  border-radius: 999px;
  border: 1px solid var(--border-bright);
  background: transparent;
  color: var(--text-secondary);
  font-family: 'Vazirmatn', sans-serif;
  font-size: 12px;
  cursor: pointer;
}
.ex-chips button:hover { color: var(--text-primary); border-color: var(--accent); }
.ex-rate-now { font-size: 12px; color: var(--text-secondary); margin-top: 8px; }

.ex-est {
  margin: 4px 0 16px;
  padding: 14px 16px;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(11, 127, 74, 0.12), rgba(99, 102, 241, 0.1));
  border: 1px dashed rgba(11, 127, 74, 0.4);
}
.ex-est small { display: block; font-size: 12px; color: var(--text-secondary); }
.ex-est b { font-size: 1.4rem; font-weight: 900; }
.ex-est b span { font-size: 13px; font-weight: 600; color: var(--text-secondary); }
.ex-est__muted { color: var(--text-muted); font-size: 13px; }

.ex-radios { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.ex-radios label {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--border-bright);
  font-size: 13px;
  cursor: pointer;
}
.ex-radios label:has(input:checked) { border-color: var(--ex-buy); background: rgba(11, 127, 74, 0.08); }
.ex-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media (max-width: 480px) {
  .ex-radios, .ex-row { grid-template-columns: 1fr; }
}
.ex-error {
  margin-bottom: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--red-bg);
  color: var(--red);
  font-size: 13px;
}
.ex-submit { width: 100%; }
.ex-submit i { font-size: 20px; }
.ex-fine { margin-top: 12px; font-size: 12px; color: var(--text-muted); line-height: 1.9; }

/* steps / features / faq */
.ex-section { margin-top: 36px; }
.ex-section > h2 { font-size: 1.35rem; margin-bottom: 18px; }
.ex-steps, .ex-features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}
.ex-step, .ex-feature {
  padding: 20px;
  border-radius: var(--radius);
  background: var(--bg-card);
  border: 1px solid var(--border);
}
.ex-step__n {
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-weight: 800;
  margin-bottom: 12px;
}
.ex-feature i { font-size: 24px; color: var(--ex-buy); margin-bottom: 12px; display: block; }
.ex-step h3, .ex-feature h3 { font-size: 15px; margin-bottom: 6px; }
.ex-step p, .ex-feature p { font-size: 13px; color: var(--text-secondary); line-height: 1.9; }

.ex-faq details {
  padding: 16px 18px;
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  border: 1px solid var(--border);
  margin-bottom: 10px;
}
.ex-faq summary { cursor: pointer; font-weight: 700; font-size: 14px; }
.ex-faq details p { margin-top: 10px; font-size: 13px; color: var(--text-secondary); line-height: 2; }

.ex-final {
  margin-top: 36px;
  padding: 32px;
  border-radius: var(--radius);
  text-align: center;
  background: linear-gradient(135deg, var(--ex-buy), #0e9f6e);
  color: #fff;
}
.ex-final h2 { font-size: 1.4rem; margin-bottom: 8px; }
.ex-final p { opacity: 0.9; margin-bottom: 18px; font-size: 14px; }
.ex-final .ex-btn { background: #fff; color: var(--wa); }

@media (max-width: 640px) {
  .ex-hero { padding: 30px 18px; border-radius: var(--radius); }
  .ex-panel, .ex-promo { padding: 18px; }
}
