/* =========================================================
   Woo Wallet & Affiliate UI v3
   Compact responsive wallet + affiliate refinements
   ========================================================= */

:root{
  --wwap3-bg:#f6f8fb;
  --wwap3-card:#fff;
  --wwap3-soft:#f7f9fc;
  --wwap3-text:#171a21;
  --wwap3-muted:#6b7280;
  --wwap3-border:#e3e7ee;
  --wwap3-accent:#1f6feb;
  --wwap3-dark:#111827;
  --wwap3-success:#15803d;
  --wwap3-danger:#c2413a;
  --wwap3-radius:16px;
}

.wwap-shortcode-dashboard,
.woocommerce-MyAccount-content .woocommerce-myaccount-wallet-content{
  width:100%;
  max-width:1040px;
  min-width:0;
  margin-inline:auto;
}

.woocommerce-myaccount-wallet-content{
  border:1px solid var(--wwap3-border)!important;
  border-radius:18px!important;
  background:var(--wwap3-card)!important;
  box-shadow:0 10px 32px rgba(15,23,42,.055)!important;
  overflow:hidden!important;
}

/* Wallet navigation: no cut-off / no horizontal half-buttons */
.wwap-wallet-tabs{
  width:100%!important;
  margin:0!important;
  padding:10px!important;
  overflow:visible!important;
  background:#fff!important;
  border-bottom:1px solid var(--wwap3-border)!important;
}
.wwap-wallet-tabs ul{
  display:grid!important;
  grid-template-columns:repeat(auto-fit,minmax(124px,1fr))!important;
  gap:8px!important;
  width:100%!important;
  min-width:0!important;
  margin:0!important;
  padding:0!important;
}
.wwap-wallet-tabs li{min-width:0!important;width:auto!important;}
.wwap-wallet-tabs a{
  width:100%!important;
  min-height:52px!important;
  padding:8px 9px!important;
  display:flex!important;
  flex-direction:column!important;
  align-items:center!important;
  justify-content:center!important;
  gap:5px!important;
  border:1px solid transparent!important;
  border-radius:12px!important;
  background:#fff!important;
  color:#586174!important;
  font-size:12px!important;
  font-weight:650!important;
  line-height:1.15!important;
  text-align:center!important;
  white-space:normal!important;
}
.wwap-wallet-tabs a:hover,
.wwap-wallet-tabs li.active a{
  color:var(--wwap3-accent)!important;
  background:#f3f7ff!important;
  border-color:#dbe7fb!important;
}
.wwap-tab-icon{
  width:21px;
  height:21px;
  display:grid;
  place-items:center;
  flex:0 0 21px;
}
.wwap-tab-icon svg{
  width:20px;
  height:20px;
  fill:none;
  stroke:currentColor;
  stroke-width:1.8;
  stroke-linecap:round;
  stroke-linejoin:round;
}
.wwap-tab-label{display:block;min-width:0;overflow-wrap:anywhere;}

.wwap-wallet-topup,
.wwap-wallet-withdrawal-container,
.wwap-withdrawal-status-table-container,
.wwap-wallet-transfer,
.wwap-wallet-transactions,
.wwap-payment-details,
.wwap-affiliate-referrals-transfer-container{
  padding:22px!important;
  background:#fff!important;
}
.wwap-wallet-withdrawal-container + .wwap-withdrawal-status-table-container{
  border-top:1px solid var(--wwap3-border);
}

.wwap-section-heading{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:12px;
  margin:0 0 15px;
}
.wwap-section-heading h3,
.wwap-wallet-topup h3,
.wwap-wallet-withdrawal-container h3,
.wwap-withdrawal-status-table-container h3,
.wwap-wallet-transfer h3,
.wwap-wallet-transactions h3,
.wwap-payment-details h3{
  margin:0!important;
  color:var(--wwap3-text)!important;
  font-size:20px!important;
  font-weight:760!important;
  letter-spacing:-.015em;
}
.wwap-section-heading p{
  margin:4px 0 0!important;
  color:var(--wwap3-muted)!important;
  font-size:13px!important;
  line-height:1.45!important;
}

.wwap-wallet-summary{
  display:grid!important;
  grid-template-columns:minmax(0,1fr) minmax(0,1fr)!important;
  gap:12px!important;
  align-items:stretch!important;
}
.wwap-total-balance,
.wwap-topup-wallet{
  min-width:0!important;
  min-height:132px!important;
  padding:18px!important;
  border:1px solid var(--wwap3-border)!important;
  border-radius:15px!important;
  background:var(--wwap3-soft)!important;
  box-shadow:none!important;
}
.wwap-total-balance{
  display:flex!important;
  align-items:center!important;
  gap:14px!important;
}
.wwap-balance-icon{
  width:48px;
  height:48px;
  flex:0 0 48px;
  display:grid;
  place-items:center;
  border-radius:14px;
  background:#eaf2ff;
  color:var(--wwap3-accent);
}
.wwap-balance-icon svg{width:25px;height:25px;}
.wwap-balance-copy{min-width:0;}
.wallet-balance-text{
  margin:0 0 4px!important;
  color:var(--wwap3-muted)!important;
  font-size:12px!important;
  font-weight:600!important;
}
.wallet-balance{
  margin:0!important;
  color:var(--wwap3-accent)!important;
  font-size:clamp(27px,4vw,36px)!important;
  font-weight:800!important;
  letter-spacing:-.025em!important;
  line-height:1.05!important;
}
.wwap-card-label{
  margin:0 0 10px;
  color:#4b5563;
  font-size:12px;
  font-weight:700;
}
.wwap-topup-wallet{
  display:flex;
  flex-direction:column;
  justify-content:center;
}
.wwap-topup-wallet form{margin:0!important;}
.wallet-topup-input-submit-button{
  display:grid!important;
  grid-template-columns:minmax(0,1fr) auto!important;
  align-items:center!important;
  gap:9px!important;
  width:100%!important;
}

.woocommerce-myaccount-wallet-content input[type="text"],
.woocommerce-myaccount-wallet-content input[type="email"],
.woocommerce-myaccount-wallet-content input[type="number"],
.woocommerce-myaccount-wallet-content input[type="tel"],
.woocommerce-myaccount-wallet-content select,
.woocommerce-myaccount-wallet-content textarea{
  width:100%!important;
  max-width:100%!important;
  min-height:48px!important;
  margin:0!important;
  padding:11px 13px!important;
  border:1px solid #d8dee8!important;
  border-radius:12px!important;
  background:#fff!important;
  color:var(--wwap3-text)!important;
  font:inherit!important;
  font-size:14px!important;
  box-shadow:none!important;
  outline:none!important;
}
.woocommerce-myaccount-wallet-content textarea{min-height:110px!important;resize:vertical;}
.woocommerce-myaccount-wallet-content input:focus,
.woocommerce-myaccount-wallet-content select:focus,
.woocommerce-myaccount-wallet-content textarea:focus{
  border-color:#8bb7f5!important;
  box-shadow:0 0 0 3px rgba(31,111,235,.11)!important;
}
.woocommerce-myaccount-wallet-content input[type="submit"],
.woocommerce-myaccount-wallet-content button:not(.select2-selection__clear){
  min-height:48px!important;
  padding:11px 18px!important;
  border:0!important;
  border-radius:12px!important;
  background:var(--wwap3-dark)!important;
  color:#fff!important;
  font-size:14px!important;
  font-weight:700!important;
  line-height:1!important;
  box-shadow:none!important;
  cursor:pointer!important;
}
.woocommerce-myaccount-wallet-content input[type="submit"]:hover,
.woocommerce-myaccount-wallet-content button:not(.select2-selection__clear):hover{
  background:#050b18!important;
}

.wwap-wallet-transfer form,
.wwap-payment-details form,
.wwap-wallet-withdrawal-form-container,
.wwap-affiliate-referrals-transfer-form-container{
  display:grid!important;
  gap:11px!important;
  width:100%!important;
  padding:16px!important;
  background:var(--wwap3-soft)!important;
  border:1px solid var(--wwap3-border)!important;
  border-radius:15px!important;
}
.wwap-wallet-transfer form{
  grid-template-columns:minmax(140px,.7fr) minmax(220px,1.2fr) auto!important;
  align-items:end!important;
}
.wwap-wallet-withdrawal-form-content{
  display:grid!important;
  grid-template-columns:minmax(0,1fr) auto!important;
  gap:10px!important;
  align-items:start!important;
}
.wwap-wallet-minimum-withdrawal-limit-info{
  margin-top:7px!important;
  color:var(--wwap3-muted)!important;
  font-size:12px!important;
}

/* Tables */
.wwap-wallet-table,
.wwap-withdrawal-requests-status-table{
  width:100%!important;
  min-width:0!important;
  border:1px solid var(--wwap3-border)!important;
  border-radius:13px!important;
  border-collapse:separate!important;
  border-spacing:0!important;
  overflow:hidden!important;
  background:#fff!important;
}
.wwap-wallet-table th,
.wwap-wallet-table td,
.wwap-withdrawal-requests-status-table th,
.wwap-withdrawal-requests-status-table td{
  padding:12px 13px!important;
  border:0!important;
  border-bottom:1px solid #edf0f4!important;
  text-align:left!important;
  vertical-align:middle!important;
  font-size:12px!important;
  line-height:1.4!important;
}
.wwap-wallet-table th,
.wwap-withdrawal-requests-status-table th{
  background:#f8fafc!important;
  color:#667085!important;
  font-weight:700!important;
}
.wwap-wallet-table tr:last-child td,
.wwap-withdrawal-requests-status-table tr:last-child td{border-bottom:0!important;}
.wwap-transaction-type,
.wwap-withdrawal-state{
  display:inline-flex;
  align-items:center;
  min-height:25px;
  padding:4px 8px;
  border-radius:999px;
  font-size:11px;
  font-weight:750;
  background:#eef2f7;
  color:#475467;
}
.wwap-transaction-type.is-credit,
.wwap-withdrawal-state.status-1{background:#e9f8ef;color:#14733e;}
.wwap-transaction-type.is-debit,
.wwap-withdrawal-state.status-2{background:#fff0ee;color:#b33a32;}
.wwap-withdrawal-state.status-0{background:#fff7df;color:#8a6200;}

/* Compact balance card */
.wwap-wallet-shortcode{
  width:auto!important;
  min-width:220px!important;
  padding:13px 14px!important;
  border:1px solid var(--wwap3-border)!important;
  border-radius:14px!important;
  background:#fff!important;
  box-shadow:0 5px 18px rgba(15,23,42,.04)!important;
}
.wwap-wallet-shortcode-icon{background:#eef4ff!important;color:var(--wwap3-accent)!important;}
.wwap-wallet-shortcode-label{font-size:12px!important;color:var(--wwap3-muted)!important;}
.wwap-wallet-shortcode-amount{font-size:17px!important;color:var(--wwap3-accent)!important;font-weight:800!important;}

/* Keep affiliate/refund screens compact and consistent */
.wwap-affiliate-dashboard,
.wwap-refund-request-container{
  border-color:var(--wwap3-border)!important;
  border-radius:18px!important;
  box-shadow:0 10px 32px rgba(15,23,42,.055)!important;
}
.wwap-affiliate-dashboard-tab-content,
.wwap-refund-request-container{padding:20px!important;}

@media (max-width:900px){
  .wwap-wallet-transfer form{grid-template-columns:1fr 1fr!important;}
  .wwap-wallet-transfer form input[type="submit"]{grid-column:1/-1!important;width:100%!important;}
}

@media (max-width:767px){
  .wwap-shortcode-dashboard,
  .woocommerce-MyAccount-content .woocommerce-myaccount-wallet-content{
    max-width:none!important;
    margin:0!important;
  }
  .woocommerce-myaccount-wallet-content{
    border-radius:14px!important;
    box-shadow:none!important;
  }
  .wwap-wallet-tabs{padding:8px!important;}
  .wwap-wallet-tabs ul{
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
    gap:6px!important;
  }
  .wwap-wallet-tabs a{
    min-height:50px!important;
    padding:7px 6px!important;
    border-radius:10px!important;
    font-size:11.5px!important;
  }
  .wwap-tab-icon,.wwap-tab-icon svg{width:18px;height:18px;}

  .wwap-wallet-topup,
  .wwap-wallet-withdrawal-container,
  .wwap-withdrawal-status-table-container,
  .wwap-wallet-transfer,
  .wwap-wallet-transactions,
  .wwap-payment-details,
  .wwap-affiliate-referrals-transfer-container,
  .wwap-affiliate-dashboard-tab-content,
  .wwap-refund-request-container{padding:14px!important;}

  .wwap-section-heading{margin-bottom:11px!important;}
  .wwap-section-heading h3,
  .wwap-wallet-topup h3,
  .wwap-wallet-withdrawal-container h3,
  .wwap-withdrawal-status-table-container h3,
  .wwap-wallet-transfer h3,
  .wwap-wallet-transactions h3,
  .wwap-payment-details h3{font-size:18px!important;}
  .wwap-section-heading p{font-size:12px!important;}

  .wwap-wallet-summary{grid-template-columns:1fr!important;gap:9px!important;}
  .wwap-total-balance,.wwap-topup-wallet{min-height:0!important;padding:14px!important;border-radius:13px!important;}
  .wwap-total-balance{gap:11px!important;}
  .wwap-balance-icon{width:42px;height:42px;flex-basis:42px;border-radius:12px;}
  .wwap-balance-icon svg{width:22px;height:22px;}
  .wallet-balance{font-size:28px!important;}

  .wallet-topup-input-submit-button,
  .wwap-wallet-transfer form,
  .wwap-wallet-withdrawal-form-content{
    display:grid!important;
    grid-template-columns:1fr!important;
    gap:8px!important;
  }
  .wallet-topup-input-submit-button > *,
  .wwap-wallet-transfer form > *,
  .wwap-wallet-withdrawal-form-content > *,
  .wwap-payment-update input{width:100%!important;max-width:100%!important;}

  .woocommerce-myaccount-wallet-content input[type="text"],
  .woocommerce-myaccount-wallet-content input[type="email"],
  .woocommerce-myaccount-wallet-content input[type="number"],
  .woocommerce-myaccount-wallet-content input[type="tel"],
  .woocommerce-myaccount-wallet-content select,
  .woocommerce-myaccount-wallet-content textarea,
  .woocommerce-myaccount-wallet-content input[type="submit"]{
    min-height:46px!important;
    font-size:14px!important;
  }

  /* Turn wallet/withdrawal tables into readable mobile cards. */
  .wwap-wallet-table,
  .wwap-wallet-table tbody,
  .wwap-wallet-table tr,
  .wwap-wallet-table td,
  .wwap-withdrawal-requests-status-table,
  .wwap-withdrawal-requests-status-table tbody,
  .wwap-withdrawal-requests-status-table tr,
  .wwap-withdrawal-requests-status-table td{
    display:block!important;
    width:100%!important;
    min-width:0!important;
  }
  .wwap-wallet-table thead,
  .wwap-withdrawal-requests-status-table thead{display:none!important;}
  .wwap-wallet-table,
  .wwap-withdrawal-requests-status-table{border:0!important;background:transparent!important;overflow:visible!important;}
  .wwap-wallet-table tbody,
  .wwap-withdrawal-requests-status-table tbody{display:grid!important;gap:9px!important;}
  .wwap-wallet-table tr,
  .wwap-withdrawal-requests-status-table tr{
    padding:5px 12px!important;
    border:1px solid var(--wwap3-border)!important;
    border-radius:12px!important;
    background:#fff!important;
  }
  .wwap-wallet-table td,
  .wwap-withdrawal-requests-status-table td{
    display:grid!important;
    grid-template-columns:minmax(94px,.8fr) minmax(0,1.2fr)!important;
    gap:10px!important;
    align-items:start!important;
    padding:9px 0!important;
    border-bottom:1px solid #edf0f4!important;
    text-align:right!important;
    overflow-wrap:anywhere!important;
  }
  .wwap-wallet-table td:last-child,
  .wwap-withdrawal-requests-status-table td:last-child{border-bottom:0!important;}
  .wwap-wallet-table td::before,
  .wwap-withdrawal-requests-status-table td::before{
    content:attr(data-title);
    color:#7b8494;
    font-size:11px;
    font-weight:700;
    text-align:left;
  }
  .wwap-wallet-table td[colspan],
  .wwap-withdrawal-requests-status-table td[colspan]{display:block!important;text-align:center!important;}
  .wwap-wallet-table td[colspan]::before,
  .wwap-withdrawal-requests-status-table td[colspan]::before{display:none!important;}

  .wwap-wallet-shortcode{width:100%!important;min-width:0!important;}
}

@media (max-width:390px){
  .wwap-wallet-tabs a{font-size:11px!important;}
  .wwap-wallet-tabs ul{gap:5px!important;}
  .wwap-wallet-topup,
  .wwap-wallet-withdrawal-container,
  .wwap-withdrawal-status-table-container,
  .wwap-wallet-transfer,
  .wwap-wallet-transactions,
  .wwap-payment-details{padding:12px!important;}
}

/* Affiliate-to-wallet table: readable cards on phones instead of horizontal overflow. */
@media (max-width:767px){
  .wwap-affiliate-referrals-transfer-container .wwap-account-table,
  .wwap-affiliate-referrals-transfer-container .wwap-account-table tbody,
  .wwap-affiliate-referrals-transfer-container .wwap-account-table tr,
  .wwap-affiliate-referrals-transfer-container .wwap-account-table td{
    display:block!important;
    width:100%!important;
    min-width:0!important;
  }
  .wwap-affiliate-referrals-transfer-container .wwap-account-table thead{display:none!important;}
  .wwap-affiliate-referrals-transfer-container .wwap-account-table{border:0!important;background:transparent!important;}
  .wwap-affiliate-referrals-transfer-container .wwap-account-table tbody{display:grid!important;gap:9px!important;}
  .wwap-affiliate-referrals-transfer-container .wwap-account-table tr{
    padding:5px 12px!important;
    border:1px solid var(--wwap3-border)!important;
    border-radius:12px!important;
    background:#fff!important;
  }
  .wwap-affiliate-referrals-transfer-container .wwap-account-table td{
    display:grid!important;
    grid-template-columns:minmax(92px,.8fr) minmax(0,1.2fr)!important;
    gap:10px!important;
    align-items:start!important;
    padding:9px 0!important;
    border-bottom:1px solid #edf0f4!important;
    text-align:right!important;
    overflow-wrap:anywhere!important;
  }
  .wwap-affiliate-referrals-transfer-container .wwap-account-table td:last-child{border-bottom:0!important;}
  .wwap-affiliate-referrals-transfer-container .wwap-account-table td::before{
    content:attr(data-title);
    color:#7b8494;
    font-size:11px;
    font-weight:700;
    text-align:left;
  }
  .wwap-affiliate-referrals-transfer-container .wwap-account-table input[type="checkbox"]{justify-self:end;}
  .wwap-profile-title-container{display:flex!important;flex-direction:column!important;align-items:stretch!important;gap:10px!important;}
  .wwap-transfer-affiliate-referrals-btn{width:100%!important;}
}
