/*
 * Adsrek Pay — Redesign v1.6
 * P2P symmetric GIVE / RECEIVE cards.
 * UI only.
 */

/* Main exchange row becomes true 50 / arrow / 50 layout.
   Search button no longer steals width from the receive side. */
.page-p2p .p2-pick-grid{
  display:grid!important;
  grid-template-columns:minmax(0,1fr) 46px minmax(0,1fr)!important;
  grid-template-areas:
    "give swap receive"
    ". . search"!important;
  gap:10px 12px!important;
  align-items:stretch!important;
}
.page-p2p .p2-side--give{grid-area:give!important}
.page-p2p .p2-arrow--swap{grid-area:swap!important}
.page-p2p .p2-side--receive{grid-area:receive!important}
.page-p2p .p2-btn--search{grid-area:search!important}

/* Both sides are now identical visual cards */
.page-p2p .p2-side{
  min-width:0!important;
  min-height:116px!important;
  padding:11px!important;
  border:1px solid var(--rd-border)!important;
  border-radius:15px!important;
  background:color-mix(in srgb,var(--rd-surface) 90%,var(--rd-bg-soft))!important;
  display:flex!important;
  flex-direction:column!important;
}
.page-p2p .p2-pick-title{
  height:23px!important;
  margin:0 0 8px!important;
  display:flex!important;
  align-items:center!important;
  gap:7px!important;
  font-size:10px!important;
  font-weight:900!important;
  letter-spacing:.055em!important;
  color:var(--rd-muted)!important;
  text-transform:uppercase!important;
}
.page-p2p .p2-pick-title > span{
  width:22px!important;
  height:22px!important;
  min-width:22px!important;
  display:inline-flex!important;
  align-items:center!important;
  justify-content:center!important;
  border-radius:8px!important;
  background:var(--rd-primary-soft)!important;
  color:var(--rd-primary)!important;
  font-size:9px!important;
}

/* Identical internal 2-column structure on both sides */
.page-p2p .p2-side-combo{
  flex:1!important;
  display:grid!important;
  grid-template-columns:minmax(0,1fr) 126px!important;
  gap:8px!important;
  align-items:stretch!important;
}
.page-p2p .p2-selector,
.page-p2p .p2-search-amount,
.page-p2p .p2-receive-estimate{
  min-height:62px!important;
  height:62px!important;
  box-sizing:border-box!important;
  border-radius:12px!important;
}
.page-p2p .p2-selector{
  width:100%!important;
  min-width:0!important;
}
.page-p2p .p2-search-amount{
  width:126px!important;
  min-width:126px!important;
}
.page-p2p .p2-receive-estimate{
  width:126px!important;
  min-width:126px!important;
  padding:8px 10px!important;
}
.page-p2p .p2-receive-estimate b{
  font-size:10px!important;
  line-height:1.25!important;
}
.page-p2p .p2-receive-estimate small{
  font-size:8.5px!important;
  line-height:1.35!important;
}

/* Hint belongs to the left card, but must not make it taller */
.page-p2p .p2-side__amount-hint{
  height:13px!important;
  min-height:13px!important;
  margin:4px 2px 0!important;
  justify-content:flex-end!important;
  overflow:hidden!important;
  white-space:nowrap!important;
  text-overflow:ellipsis!important;
}

/* Receive side has no hint in markup: reserve the same space */
.page-p2p .p2-side--receive:after{
  content:"";
  display:block;
  height:13px;
  min-height:13px;
  margin-top:4px;
}

/* Arrow exactly between the equal cards */
.page-p2p .p2-arrow--swap{
  align-self:center!important;
  justify-self:center!important;
  width:42px!important;
  height:42px!important;
  min-width:42px!important;
  min-height:42px!important;
  margin:30px 0 0!important;
  border-radius:12px!important;
}

/* Search is a separate action below, so receive card keeps full width */
.page-p2p .p2-btn--search{
  justify-self:end!important;
  width:170px!important;
  min-height:42px!important;
  height:42px!important;
  margin:0!important;
  border-radius:11px!important;
}

/* Slightly clearer selected-card hover */
.page-p2p .p2-side:hover{
  border-color:color-mix(in srgb,var(--rd-primary) 35%,var(--rd-border))!important;
}
html[data-theme="dark"] .page-p2p .p2-side{
  background:#142338!important;
  border-color:#2d425b!important;
}
html[data-theme="dark"] .page-p2p .p2-side:hover{
  border-color:#425d7c!important;
}

/* Keep the footer directly below the symmetric block */
.page-p2p .p2-filter-footer{
  margin-top:7px!important;
}

/* Tablet: still keep both sides equal until space really gets tight */
@media(max-width:1180px){
  .page-p2p .p2-pick-grid{
    grid-template-columns:minmax(0,1fr) 44px minmax(0,1fr)!important;
    grid-template-areas:
      "give swap receive"
      ". . search"!important;
  }
  .page-p2p .p2-side-combo{
    grid-template-columns:minmax(0,1fr) 112px!important;
  }
  .page-p2p .p2-search-amount,
  .page-p2p .p2-receive-estimate{
    width:112px!important;
    min-width:112px!important;
  }
  .page-p2p .p2-btn--search{
    grid-column:auto!important;
  }
}

/* Mobile: stack logically: give → swap → receive → search */
@media(max-width:760px){
  .page-p2p .p2-pick-grid{
    grid-template-columns:1fr!important;
    grid-template-areas:
      "give"
      "swap"
      "receive"
      "search"!important;
    gap:10px!important;
  }
  .page-p2p .p2-side{
    min-height:auto!important;
  }
  .page-p2p .p2-side-combo{
    grid-template-columns:minmax(0,1fr) 116px!important;
  }
  .page-p2p .p2-search-amount,
  .page-p2p .p2-receive-estimate{
    width:116px!important;
    min-width:116px!important;
  }
  .page-p2p .p2-arrow--swap{
    margin:0 auto!important;
  }
  .page-p2p .p2-btn--search{
    width:100%!important;
    justify-self:stretch!important;
  }
}
@media(max-width:500px){
  .page-p2p .p2-side-combo{
    grid-template-columns:1fr!important;
  }
  .page-p2p .p2-search-amount,
  .page-p2p .p2-receive-estimate{
    width:100%!important;
    min-width:0!important;
  }
}

/* v16: reserve real space for the direct P2P swap button */
.page-p2p .p2-pick-grid.p2-pick-grid--direct{
  grid-template-columns:minmax(0,1fr) 118px minmax(0,1fr)!important;
  column-gap:14px!important;
}
.page-p2p .p2-arrow--swap.p2-arrow--direct{
  width:108px!important;
  min-width:108px!important;
  max-width:108px!important;
  height:44px!important;
  margin:0!important;
  align-self:center!important;
  justify-self:center!important;
  box-sizing:border-box!important;
  overflow:hidden!important;
}
@media(max-width:1180px) and (min-width:761px){
  .page-p2p .p2-pick-grid.p2-pick-grid--direct{
    grid-template-columns:minmax(0,1fr) 108px minmax(0,1fr)!important;
    column-gap:10px!important;
  }
  .page-p2p .p2-arrow--swap.p2-arrow--direct{
    width:98px!important;
    min-width:98px!important;
    max-width:98px!important;
    padding:0 8px!important;
    gap:6px!important;
  }
  .page-p2p .p2-arrow--swap.p2-arrow--direct small{
    font-size:8px!important;
  }
}
@media(max-width:760px){
  .page-p2p .p2-pick-grid.p2-pick-grid--direct{
    grid-template-columns:1fr!important;
  }
  .page-p2p .p2-arrow--swap.p2-arrow--direct{
    width:100%!important;
    min-width:0!important;
    max-width:none!important;
  }
}


/* P2P selector chevron refinement */
.page-p2p .p2-selector__chevron{
  width:34px!important;
  height:34px!important;
  min-width:34px!important;
  border-radius:10px!important;
  display:inline-flex!important;
  align-items:center!important;
  justify-content:center!important;
  background:linear-gradient(180deg,rgba(12,30,50,.94),rgba(8,21,37,.94))!important;
  border:1px solid rgba(118,188,238,.22)!important;
  color:#bfe8ff!important;
  font-size:13px!important;
  line-height:1!important;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.04),0 8px 18px rgba(0,0,0,.12)!important;
}
.page-p2p .p2-selector:hover .p2-selector__chevron{
  border-color:rgba(118,188,238,.38)!important;
  color:#e7f7ff!important;
}
html[data-theme="light"] body.page-p2p .p2-selector__chevron,
body.page-p2p.light .p2-selector__chevron{
  background:linear-gradient(180deg,#ffffff,#eef5ff)!important;
  border:1px solid rgba(23,105,232,.14)!important;
  color:#1769e8!important;
  box-shadow:0 6px 16px rgba(23,105,232,.08)!important;
}
