/*
 * Puntos Ya – Frontend Account Styles
 * Points history tab inside My Account page.
 */

/* ─── Variables (match theme) ───────────────────────────────────────────── */
:root {
  --pya-fe-orange:       #E85D04;
  --pya-fe-orange-dark:  #c44d03;
  --pya-fe-orange-muted: rgba(232, 93, 4, 0.08);
  --pya-fe-text:         #1a1a1a;
  --pya-fe-muted:        #6b6b6b;
  --pya-fe-border:       #e5e5e5;
  --pya-fe-bg:           #f8f8f8;
  --pya-fe-white:        #fff;
  --pya-fe-ease:         cubic-bezier(0.22, 1, 0.36, 1);
  --pya-fe-ease-spring:  cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ─── Price formatting everywhere ──────────────────────────────────────── */
.puntos-ya-price {
  font-weight: 700;
  color: var(--pya-fe-text);
}

.puntos-ya-price .pts-label {
  font-weight: 500;
  font-size: 0.85em;
  color: var(--pya-fe-orange);
  margin-left: 2px;
}

/* ─── Payment gateway fields in checkout ────────────────────────────────── */
.pya-checkout-info {
  background: var(--pya-fe-bg);
  border-radius: 10px;
  padding: 16px;
  margin-top: 8px;
}

.pya-checkout-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 0;
  font-size: 14px;
}

.pya-checkout-label {
  color: var(--pya-fe-muted);
  font-weight: 500;
}

.pya-checkout-value {
  font-weight: 700;
  color: var(--pya-fe-text);
}

.pya-balance { color: var(--pya-fe-orange); }

.pya-insufficient {
  background: #fdecea;
  color: #c62828;
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 13px;
  font-weight: 500;
  margin-top: 8px;
}

.pya-gw-notice {
  color: var(--pya-fe-muted);
  font-size: 14px;
  margin: 8px 0 0;
}

/* ─── Points History Panel ──────────────────────────────────────────────── */
.pya-account-points {
  padding-top: 8px;
  animation: pya-fe-slide-up .4s var(--pya-fe-ease);
}

/* No transactions */
.pya-no-transactions {
  text-align: center;
  color: var(--pya-fe-muted);
  font-size: 15px;
  padding: 32px;
  background: var(--pya-fe-bg);
  border-radius: 12px;
}

/* Table wrapper */
.pya-table-wrap {
  overflow-x: auto;
  border-radius: 14px;
  border: 1px solid var(--pya-fe-border);
  background: var(--pya-fe-white);
}

.pya-transactions-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.pya-transactions-table thead th {
  padding: 12px 16px;
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--pya-fe-muted);
  background: var(--pya-fe-bg);
  border-bottom: 1px solid var(--pya-fe-border);
  white-space: nowrap;
}

.pya-transactions-table tbody tr {
  border-bottom: 1px solid #f0f0f0;
  transition: background .15s;
}

.pya-transactions-table tbody tr:last-child {
  border-bottom: none;
}

.pya-transactions-table tbody tr:hover {
  background: var(--pya-fe-orange-muted);
}

.pya-transactions-table tbody td {
  padding: 14px 16px;
  color: var(--pya-fe-text);
  vertical-align: middle;
}

/* Column types */
.pya-col-date    { white-space: nowrap; color: var(--pya-fe-muted) !important; font-size: 13px; }
.pya-col-comment { font-size: 13px; color: var(--pya-fe-muted) !important; }
.pya-col-balance { font-weight: 600; white-space: nowrap; }

/* Order popup button */
.pya-order-popup-btn {
  background: none;
  border: none;
  padding: 0;
  color: var(--pya-fe-orange);
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  text-decoration: none;
  font-family: inherit;
}
.pya-order-popup-btn:hover { text-decoration: underline; }

/* Points +/- */
.pya-col-points {
  font-weight: 700;
  font-size: 15px;
}

.pya-credit { color: #2e7d32; }
.pya-debit  { color: #c62828; }

/* Type badge */
.pya-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .04em;
  white-space: nowrap;
}

.pya-badge--recharge          { background: rgba(46, 125, 50, .1);  color: #2e7d32; }
.pya-badge--purchase          { background: rgba(198, 40, 40, .1);  color: #c62828; }
.pya-badge--manual_adjustment { background: rgba(21, 101, 192, .1); color: #1565c0; }

/* Pagination */
.pya-pagination {
  display: flex;
  gap: 6px;
  justify-content: center;
  margin-top: 20px;
  flex-wrap: wrap;
}

.pya-page-btn {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  border: 1.5px solid var(--pya-fe-border);
  font-size: 13px;
  font-weight: 600;
  color: var(--pya-fe-text);
  text-decoration: none;
  transition: all .2s var(--pya-fe-ease);
}

.pya-page-btn:hover,
.pya-page-btn.is-active {
  background: var(--pya-fe-orange);
  border-color: var(--pya-fe-orange);
  color: #fff;
}

/* ─── Thank-you Points section ──────────────────────────────────────────── */
.pya-thankyou-points {
  background: var(--pya-fe-orange-muted);
  border: 1px solid rgba(232, 93, 4, .2);
  border-radius: 12px;
  padding: 20px 24px;
  margin: 24px 0;
}

.pya-thankyou-points h3 {
  font-size: 16px;
  font-weight: 700;
  color: var(--pya-fe-orange);
  margin: 0 0 8px;
}

.pya-thankyou-points p {
  font-size: 14px;
  color: var(--pya-fe-text);
  margin: 4px 0;
}

/* ─── "Mis datos" form: same-as-billing header styling ─────────────────── */
.puntos-ya-shipping-title-wrap {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.puntos-ya-same-billing-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 500;
  color: var(--pya-fe-muted);
  cursor: pointer;
}

.puntos-ya-same-billing-label input[type="checkbox"] {
  accent-color: var(--pya-fe-orange);
  width: 16px;
  height: 16px;
  cursor: pointer;
}

/* ─── Cursor / caret color for all editable fields ──────────────────────── */
input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
input[type="number"]:focus,
input[type="search"]:focus,
input[type="tel"]:focus,
input[type="url"]:focus,
textarea:focus,
select:focus {
  caret-color: var(--pya-fe-orange);
  outline-color: var(--pya-fe-orange);
}

/* ─── Checkout: hide country field + postcode ───────────────────────────── */
#billing_country_field.hidden,
#shipping_country_field.hidden,
.woocommerce-checkout .form-row.hidden {
  display: none !important;
}

/* ─── Animation ─────────────────────────────────────────────────────────── */
@keyframes pya-fe-slide-up {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ─── Responsive ────────────────────────────────────────────────────────── */
@media (max-width: 600px) {
  .pya-transactions-table thead th,
  .pya-transactions-table tbody td { padding: 10px 10px; font-size: 13px; }
  .pya-col-comment { display: none; }
}
