/**
 * account.css — Estilos complementarios Mi Cuenta
 * LOTE P1-4 — CanaimaShop Venezuela
 *
 * Añade estilos que el SCSS compilado (main.css) no cubre:
 *  - Página CanaimaTokens (balance + tabla + paginación DS)
 *  - Stat card de tokens con link
 *  - Estado de pedido semántico (colores por status)
 *  - Mejoras mobile
 */

/* ============================================================
   CanaimaTokens — saldo y página
   ============================================================ */

.cs-account-tokens {
  display: grid;
  gap: 24px;
}

/* Bloque de saldo principal */
.cs-account-tokens__balance {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px 22px;
  border: 1px solid rgba(240, 172, 43, 0.25);
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(240, 172, 43, 0.09) 0%, rgba(255, 247, 221, 0.7) 100%);
}

.cs-account-tokens__balance .material-symbols-rounded {
  font-size: 36px;
  color: var(--accent-current, #f0ac2b);
  flex-shrink: 0;
  font-variation-settings: 'FILL' 1, 'wght' 500, 'GRAD' 0, 'opsz' 48;
}

.cs-account-tokens__count {
  display: block;
  font-size: clamp(28px, 4vw, 40px);
  font-weight: 800;
  color: #31261b;
  line-height: 1;
}

.cs-account-tokens__label {
  font-size: 15px;
  font-weight: 600;
  color: #7c5400;
}

.cs-account-tokens__equiv {
  margin: 6px 0 0;
  font-size: 14px;
  color: #6f6253;
}

/* Mensaje estado vacío */
.cs-account-tokens__empty {
  padding: 20px;
  text-align: center;
  color: #888;
  background: #fafafa;
  border: 1px dashed #ddd;
  border-radius: 14px;
}

/* Tabla del historial */
.cs-account-tokens .shop_table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.cs-account-tokens .shop_table thead th {
  padding: 10px 14px;
  background: #f7f4ee;
  color: #534535;
  font-weight: 700;
  text-align: left;
  border-bottom: 2px solid #ece7da;
}

.cs-account-tokens .shop_table tbody tr {
  border-bottom: 1px solid #f0ebe0;
}

.cs-account-tokens .shop_table tbody tr:hover {
  background: rgba(240, 172, 43, 0.04);
}

.cs-account-tokens .shop_table td {
  padding: 10px 14px;
  vertical-align: top;
  color: #444;
}

/* Indicador +/- tokens */
.cs-account-tokens .shop_table td:nth-child(3) {
  font-weight: 700;
}

/* Positivo = verde, negativo = rojo */
.cs-account-tokens .shop_table tr:has(td:nth-child(3):not(:empty)) td:nth-child(3) {
  color: #388e3c;
}

/* ============================================================
   Paginación DS — tokens historial
   ============================================================ */

.cs-tokens-pagination {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-top: 20px;
}

.cs-tokens-pagination a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 36px;
  padding: 0 10px;
  border-radius: 10px;
  border: 1px solid #e5ddd0;
  background: #fffdf9;
  font-size: 14px;
  font-weight: 600;
  color: #534535;
  text-decoration: none;
  transition: background 160ms ease, color 160ms ease, border-color 160ms ease;
}

.cs-tokens-pagination a:hover {
  background: rgba(240, 172, 43, 0.12);
  border-color: rgba(240, 172, 43, 0.35);
  color: #7c5400;
}

.cs-tokens-pagination a.is-current {
  background: var(--accent-current, #f0ac2b);
  border-color: var(--accent-current, #f0ac2b);
  color: #fff;
  pointer-events: none;
}

/* ============================================================
   Stat card de tokens (dashboard)
   ============================================================ */

.cs-account-stat--tokens .material-symbols-rounded {
  color: var(--accent-current, #f0ac2b);
}

.cs-account-stat__link {
  text-decoration: none;
  color: inherit;
}

.cs-account-stat__link:hover {
  color: var(--accent-current, #f0ac2b);
  text-decoration: underline;
}

/* ============================================================
   Estado de pedido — colores semánticos
   ============================================================ */

.cs-account-order-card__status[data-status="completed"],
.cs-account-order-card__status--completed {
  background: #ecf8ef;
  color: #1b5e20;
}

.cs-account-order-card__status[data-status="processing"],
.cs-account-order-card__status--processing {
  background: #e3f2fd;
  color: #0d47a1;
}

.cs-account-order-card__status[data-status="on-hold"],
.cs-account-order-card__status--on-hold {
  background: #fff8e1;
  color: #e65100;
}

.cs-account-order-card__status[data-status="cancelled"],
.cs-account-order-card__status--cancelled {
  background: #fdf0ec;
  color: #7a271a;
}

.cs-account-order-card__status[data-status="refunded"],
.cs-account-order-card__status--refunded {
  background: #f3e5f5;
  color: #4a148c;
}

.cs-account-order-card__status[data-status="pending"],
.cs-account-order-card__status--pending {
  background: #f5f5f5;
  color: #555;
}

/* Tabla de pedidos — status column */
.woocommerce-orders-table__cell-order-status {
  font-weight: 600;
}

/* ============================================================
   WhatsApp tracking block — .cs-wa-track
   (view-order page + thank you page)
   ============================================================ */

.cs-wa-track {
  margin-top: 24px;
}

.cs-wa-track__inner {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px 22px;
  border-radius: 14px;
  border: 1px solid #b7e8c4;
  background: linear-gradient(135deg, #f0fbf3 0%, #e8f8ed 100%);
  flex-wrap: wrap;
}

.cs-wa-track__icon {
  font-size: 32px;
  color: #25d366;
  flex-shrink: 0;
  font-variation-settings: 'FILL' 1, 'wght' 400, 'GRAD' 0, 'opsz' 48;
}

.cs-wa-track__body {
  flex: 1;
  min-width: 0;
}

.cs-wa-track__heading {
  margin: 0 0 4px;
  font-size: 15px;
  font-weight: 700;
  color: #1b5e31;
}

.cs-wa-track__text {
  margin: 0;
  font-size: 13px;
  color: #3a7a50;
}

.cs-wa-track__btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 18px;
  background: #25d366;
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
  border-radius: 10px;
  border: none;
  transition: background 160ms ease, box-shadow 160ms ease;
  white-space: nowrap;
  flex-shrink: 0;
}

.cs-wa-track__btn:hover,
.cs-wa-track__btn:focus-visible {
  background: #1ebe5b;
  box-shadow: 0 4px 12px rgba(37, 211, 102, 0.35);
  color: #fff;
  text-decoration: none;
}

.cs-wa-track__btn:focus-visible {
  outline: 3px solid #25d366;
  outline-offset: 2px;
}

/* Thank you page variant — slightly more prominent */
.cs-wa-track--thankyou .cs-wa-track__inner {
  padding: 22px 26px;
}

.cs-wa-track--thankyou .cs-wa-track__heading {
  font-size: 16px;
}

/* Mobile */
@media (max-width: 640px) {
  .cs-wa-track__inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .cs-wa-track__btn {
    width: 100%;
    justify-content: center;
    padding: 12px 16px;
    font-size: 15px;
  }
}

/* ============================================================
   Auth — Trust panel (.cs-auth-trust) + hints
   Aparece en /mi-cuenta/ cuando no está logueado (form-login.php)
   ============================================================ */

.cs-auth-trust {
  margin-top: 32px;
  padding: 26px 28px;
  border-radius: 24px;
  border: 1px solid rgba(240, 172, 43, 0.2);
  background: linear-gradient(135deg, rgba(255, 250, 235, 0.95) 0%, rgba(255, 253, 249, 0.98) 100%);
  box-shadow: 0 8px 28px rgba(86, 64, 27, 0.06);
  max-width: calc(760px * 2 + 24px); /* matches #customer_login max-width */
  margin-inline: auto;
}

.cs-auth-trust__list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 18px 24px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.cs-auth-trust__item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.cs-auth-trust__icon {
  flex-shrink: 0;
  font-size: 22px;
  color: var(--accent-current, #f0ac2b);
  font-variation-settings: 'FILL' 1, 'wght' 400, 'GRAD' 0, 'opsz' 24;
  margin-top: 2px;
}

.cs-auth-trust__item strong {
  display: block;
  font-size: 14px;
  font-weight: 700;
  color: #31261b;
  line-height: 1.3;
}

.cs-auth-trust__item p {
  margin: 3px 0 0;
  font-size: 13px;
  color: #6f6253;
  line-height: 1.5;
}

/* Hint text inside register form */
.cs-auth-hint {
  font-size: 14px;
  color: #6f6253;
  line-height: 1.6;
  margin: 0;
}

/* Lost password / reset password page — same card styling as login form */
.woocommerce-account:not(.logged-in) .woocommerce-ResetPassword {
  max-width: 520px;
  margin-inline: auto;
}

/* WooCommerce notices — DS override */
body.page-account.woocommerce-account:not(.logged-in) .woocommerce-notices-wrapper .woocommerce-message,
body.page-account.woocommerce-account:not(.logged-in) .woocommerce-notices-wrapper .woocommerce-error,
body.page-account.woocommerce-account:not(.logged-in) .woocommerce-notices-wrapper .woocommerce-info {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 18px;
  border-radius: 14px;
  font-size: 14px;
  font-weight: 600;
  border-left: none;
  list-style: none;
}

body.page-account.woocommerce-account:not(.logged-in) .woocommerce-notices-wrapper .woocommerce-message {
  background: #ecf8ef;
  color: #1b5e20;
}

body.page-account.woocommerce-account:not(.logged-in) .woocommerce-notices-wrapper .woocommerce-error {
  background: #fdf0ec;
  color: #7a271a;
}

body.page-account.woocommerce-account:not(.logged-in) .woocommerce-notices-wrapper .woocommerce-info {
  background: #e3f2fd;
  color: #0d47a1;
}

/* Mobile */
@media (max-width: 640px) {
  .cs-auth-trust {
    padding: 20px 18px;
    margin-top: 24px;
  }

  .cs-auth-trust__list {
    grid-template-columns: 1fr;
    gap: 14px;
  }
}

/* ============================================================
   Mobile responsive
   ============================================================ */

@media (max-width: 768px) {
  .cs-account-tokens .shop_table thead {
    display: none;
  }

  .cs-account-tokens .shop_table tbody tr {
    display: block;
    padding: 12px 0;
    border-bottom: 1px solid #f0ebe0;
  }

  .cs-account-tokens .shop_table td {
    display: flex;
    justify-content: space-between;
    padding: 4px 0;
    font-size: 13px;
  }

  .cs-account-tokens .shop_table td::before {
    content: attr(data-title);
    font-weight: 700;
    color: #534535;
    flex-shrink: 0;
    margin-right: 8px;
  }

  .cs-account-tokens__balance {
    flex-direction: column;
    text-align: center;
  }

  .cs-tokens-pagination {
    justify-content: center;
  }
}

@media (max-width: 480px) {
  .cs-account-tokens__count {
    font-size: 32px;
  }
}
