/* ══════════════════════════════════════════════════════
   MetaHub Academy — Cart Page
   ══════════════════════════════════════════════════════ */

/* ── Nav cart badge (store page) ── */
.cart-nav-btn {
  position: relative;
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--text-2);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 7px;
  border-radius: 8px;
  transition: color .2s, background .2s;
  text-decoration: none;
}
.cart-nav-btn:hover { color: var(--gold); background: rgba(240,180,41,.1); }
.cart-badge {
  position: absolute;
  top: -3px; right: -5px;
  background: var(--gold);
  color: #000;
  font-size: 10px;
  font-weight: 800;
  min-width: 18px;
  height: 18px;
  border-radius: 9px;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  line-height: 1;
}

/* ── Buy Now button ── */
.btn-add-cart {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  cursor: pointer;
  font-family: inherit;
  transition: opacity .2s, transform .15s;
}
.btn-add-cart:hover  { opacity: .88; transform: translateY(-1px); }
.btn-add-cart:disabled { opacity: .5; cursor: default; transform: none; }

/* ══════════════════════════════════════════════════════
   CART PAGE
   ══════════════════════════════════════════════════════ */

.cart-page-section {
  background: var(--bg-2);
  min-height: 60vh;
  padding: 48px 0 80px;
}
.cart-page-container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ── Empty state ── */
.cart-page-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 80px 24px;
  text-align: center;
}
.cart-page-empty h3 {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text-1);
  margin: 0;
}
.cart-page-empty p {
  color: var(--text-3);
  margin: 0;
  max-width: 340px;
}

/* ── Two-column grid ── */
.cart-page-grid {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 32px;
  align-items: start;
}

/* ── Items column ── */
.cart-items-col { display: flex; flex-direction: column; gap: 16px; }
.cart-col-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}
.cart-col-header h2 {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-1);
  margin: 0;
}
.cart-clear-all {
  background: none;
  border: none;
  color: var(--text-3);
  font-size: .8rem;
  cursor: pointer;
  font-family: inherit;
  transition: color .2s;
  padding: 4px 8px;
}
.cart-clear-all:hover { color: #f87171; }

/* ── Cart item card ── */
.cart-page-item {
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 18px 20px;
  transition: border-color .2s;
}
.cart-page-item:hover { border-color: rgba(240,180,41,.25); }

.cpi-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}
.cpi-name {
  font-size: .95rem;
  font-weight: 600;
  color: var(--text-1);
  line-height: 1.35;
}
.cpi-unit {
  font-size: .8rem;
  color: var(--text-3);
}

.cpi-controls {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}
.cpi-qty-btn {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-2);
  color: var(--text-1);
  font-size: 1.1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color .2s, background .2s;
  line-height: 1;
}
.cpi-qty-btn:hover { border-color: var(--gold); background: rgba(240,180,41,.08); color: var(--gold); }
.cpi-qty-input {
  width: 46px;
  text-align: center;
  border: 1px solid var(--border);
  background: var(--bg-2);
  color: var(--text-1);
  border-radius: 8px;
  padding: 6px 4px;
  font-size: .9rem;
  font-family: inherit;
}

.cpi-right {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}
.cpi-subtotal {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--gold);
  min-width: 60px;
  text-align: right;
}
.cpi-remove {
  background: none;
  border: none;
  color: var(--text-3);
  cursor: pointer;
  padding: 6px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  transition: color .2s, background .2s;
}
.cpi-remove:hover { color: #f87171; background: rgba(248,113,113,.1); }

.cart-continue-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-3);
  font-size: .85rem;
  text-decoration: none;
  margin-top: 4px;
  transition: color .2s;
}
.cart-continue-link:hover { color: var(--gold); }

/* ── Summary column ── */
.cart-summary-col { display: flex; flex-direction: column; gap: 20px; }

.cart-summary-box {
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.cart-summary-box h3 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-1);
  margin: 0;
  text-transform: uppercase;
  letter-spacing: .05em;
}
.summary-rows {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}
.summary-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: .88rem;
  color: var(--text-2);
}
.summary-row-total {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-1);
  padding-top: 10px;
  border-top: 1px solid var(--border);
}
.summary-total-amt {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--gold);
}

/* ── Checkout buttons ── */
.checkout-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 15px 20px;
  border-radius: 14px;
  font-size: .92rem;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  border: none;
  transition: opacity .2s, transform .15s;
}
.checkout-btn:hover  { opacity: .9; transform: translateY(-1px); }
.checkout-btn:active { transform: translateY(0); }
.checkout-btn:disabled { opacity: .55; cursor: default; transform: none; }

.checkout-paypal {
  background: linear-gradient(135deg, #f0b429, #e8a800);
  color: #000;
  box-shadow: 0 4px 20px rgba(240,180,41,.3);
}
.checkout-card {
  background: linear-gradient(135deg, #1a56db, #1e40af);
  color: #fff;
  box-shadow: 0 4px 20px rgba(26,86,219,.35);
  border: none !important;
}
.checkout-card:hover { opacity: .9; }

.card-brands-row {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
}
.card-brands-row svg { border-radius: 3px; }

.checkout-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-3);
  font-size: .75rem;
  text-transform: uppercase;
  letter-spacing: .08em;
}
.checkout-divider::before,
.checkout-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* ── Card checkout form ── */
.card-checkout-form {
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 24px;
  display: none;
  flex-direction: column;
  gap: 20px;
}
.card-checkout-form.visible { display: flex; }

/* ── Visual card preview ── */
.card-preview {
  border-radius: 18px;
  background: linear-gradient(135deg, #1c1f3a 0%, #0f2147 55%, #0a3060 100%);
  border: 1px solid rgba(240,180,41,.2);
  padding: 22px;
  color: #fff;
  position: relative;
  overflow: hidden;
  box-shadow: 0 12px 40px rgba(0,0,0,.35);
}
.card-preview::before {
  content: '';
  position: absolute;
  top: -50px; right: -50px;
  width: 180px; height: 180px;
  border-radius: 50%;
  background: rgba(240,180,41,.07);
}
.card-preview::after {
  content: '';
  position: absolute;
  bottom: -70px; left: -30px;
  width: 220px; height: 220px;
  border-radius: 50%;
  background: rgba(120,80,200,.07);
}
.card-preview-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 22px;
}
.card-chip { flex-shrink: 0; }
.card-preview-brand-txt {
  font-size: .95rem;
  font-weight: 800;
  letter-spacing: .14em;
  color: rgba(255,255,255,.85);
  text-transform: uppercase;
}
.card-preview-number {
  font-size: 1.1rem;
  font-weight: 600;
  letter-spacing: .22em;
  color: #fff;
  margin-bottom: 20px;
  font-family: 'Courier New', monospace;
}
.card-preview-bottom { display: flex; gap: 28px; }
.card-preview-label {
  font-size: .6rem;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: rgba(255,255,255,.45);
  margin-bottom: 4px;
}
.card-preview-value {
  font-size: .82rem;
  font-weight: 600;
  letter-spacing: .06em;
  color: #fff;
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 160px;
}

/* ── Card form fields ── */
.card-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.card-field-group {
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.card-field-group label {
  font-size: .72rem;
  font-weight: 700;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: .09em;
}
.card-field-group input,
.card-form input {
  width: 100%;
  padding: 13px 16px;
  border: 1.5px solid var(--border);
  background: var(--bg-2);
  color: var(--text-1);
  border-radius: 12px;
  font-size: .94rem;
  font-family: inherit;
  transition: border-color .2s, box-shadow .2s;
  outline: none;
  box-sizing: border-box;
}
.card-field-group input::placeholder { color: var(--text-3); opacity: .5; }
.card-field-group input:focus,
.card-form input:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(240,180,41,.12);
}
.card-input-wrap { position: relative; }
.card-input-wrap input { padding-right: 70px; }
.card-type-badge {
  position: absolute;
  right: 10px; top: 50%;
  transform: translateY(-50%);
  font-size: .65rem;
  font-weight: 800;
  letter-spacing: .05em;
  padding: 3px 7px;
  border-radius: 5px;
  pointer-events: none;
}
.card-field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.card-error {
  color: #f87171;
  font-size: .82rem;
  text-align: center;
  font-weight: 500;
  min-height: 0;
}
.card-secure-note {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  font-size: .73rem;
  color: var(--text-3);
  margin: 0;
}

/* ── Spin animation ── */
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Crypto checkout button ── */
.checkout-crypto {
  background: linear-gradient(135deg, #f7931a, #e07208);
  color: #000;
  box-shadow: 0 4px 20px rgba(247,147,26,.35);
  border: none !important;
}
.checkout-crypto:hover { opacity: .9; }

.crypto-coins-row {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}
.crypto-pill {
  font-size: .6rem;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 4px;
  letter-spacing: .04em;
}
.btc-pill  { background: rgba(0,0,0,.2); color: #000; }
.eth-pill  { background: rgba(0,0,0,.2); color: #000; }
.usdt-pill { background: rgba(0,0,0,.2); color: #000; }
.bnb-pill  { background: rgba(0,0,0,.2); color: #000; }

/* ── Crypto checkout form ── */
.crypto-checkout-form {
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 24px;
  display: none;
  flex-direction: column;
  gap: 20px;
}
.crypto-checkout-form.visible { display: flex; }

.crypto-header {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: .9rem;
  font-weight: 700;
  color: var(--text-1);
  text-transform: uppercase;
  letter-spacing: .06em;
}

/* ── Coin grid ── */
.crypto-coin-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.crypto-coin-btn {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  border: 1.5px solid var(--border);
  border-radius: 14px;
  background: var(--bg-2);
  cursor: pointer;
  font-family: inherit;
  text-align: left;
  width: 100%;
  transition: border-color .2s, background .2s, box-shadow .2s;
}
.crypto-coin-btn:hover {
  border-color: rgba(240,180,41,.35);
  background: rgba(240,180,41,.05);
}
.crypto-coin-btn.active {
  border-color: var(--gold);
  background: rgba(240,180,41,.08);
  box-shadow: 0 0 0 3px rgba(240,180,41,.1);
}
.crypto-coin-btn.active .coin-check { opacity: 1; }
.coin-logo {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(0,0,0,.2);
}
.coin-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}
.crypto-coin-name {
  font-size: .9rem;
  font-weight: 700;
  color: var(--text-1);
  line-height: 1;
}
.crypto-coin-full {
  font-size: .72rem;
  font-weight: 500;
  color: var(--text-3);
  line-height: 1;
}
.coin-check {
  opacity: 0;
  flex-shrink: 0;
  transition: opacity .2s;
}

/* ── QR code ── */
.crypto-qr-wrap {
  display: flex;
  justify-content: center;
  padding: 10px 0 4px;
}
.crypto-qr-img {
  width: 160px;
  height: 160px;
  border-radius: 12px;
  border: 3px solid var(--gold);
  display: block;
}

/* ── Address panel ── */
.crypto-address-panel {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.crypto-selected-info {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: var(--bg-2);
  border-radius: 12px;
  border: 1px solid var(--border);
}
.crypto-selected-label {
  font-size: .88rem;
  font-weight: 700;
  color: var(--text-1);
}
.crypto-send-amount {
  font-size: .82rem;
  color: var(--text-3);
}
.crypto-send-amount strong { color: var(--gold); font-size: 1rem; font-weight: 800; }

.crypto-address-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-2);
  border: 1.5px solid var(--border);
  border-radius: 12px;
  padding: 12px 14px;
}
.crypto-address-text {
  flex: 1;
  font-family: 'Courier New', monospace;
  font-size: .75rem;
  color: var(--text-1);
  word-break: break-all;
  line-height: 1.45;
}
.crypto-copy-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-shrink: 0;
  background: rgba(240,180,41,.12);
  border: 1px solid rgba(240,180,41,.3);
  color: var(--gold);
  border-radius: 8px;
  padding: 7px 12px;
  font-size: .75rem;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  transition: background .2s;
}
.crypto-copy-btn:hover { background: rgba(240,180,41,.22); }

.crypto-steps {
  margin: 0;
  padding: 12px 16px;
  background: var(--bg-2);
  border-radius: 12px;
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 7px;
  list-style: none;
  counter-reset: steps;
}
.crypto-steps li {
  font-size: .8rem;
  color: var(--text-3);
  line-height: 1.4;
  display: flex;
  align-items: flex-start;
  gap: 8px;
  counter-increment: steps;
}
.crypto-steps li::before {
  content: counter(steps);
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  border-radius: 50%;
  background: rgba(240,180,41,.15);
  color: var(--gold);
  font-size: .65rem;
  font-weight: 800;
  flex-shrink: 0;
  margin-top: 1px;
}
.crypto-steps li strong { color: var(--text-2); }

/* ── Responsive ── */
@media (max-width: 860px) {
  .cart-page-grid {
    grid-template-columns: 1fr;
  }
  .cart-summary-col { order: -1; }
}
@media (max-width: 560px) {
  .cart-page-item {
    flex-wrap: wrap;
    gap: 12px;
  }
  .cpi-controls { order: 3; }
  .cpi-right    { order: 2; margin-left: auto; }
  .crypto-coin-grid { grid-template-columns: repeat(3, 1fr); }
  .crypto-coins-row { display: none; }
}
