/* =========================================================
   PÁGINA "PAGAMENTOS" — A Minha Conta
   ========================================================= */

/* Ícone à esquerda do texto, em qualquer botão pt-payment-btn */
.pt-btn-ico {
  flex-shrink: 0;
  margin-right: 6px;
  vertical-align: -2px;
}

/* =========================================================
   ESTADO "Aguarda confirmação" (pagamento reclamado pelo cliente,
   ainda por confirmar pelo admin)
   ========================================================= */
.pt-payment-card--aguarda_confirmacao {
  border-left-color: #b26a00;
  background: #fffaf0;
}

.pt-payment-badge--aguarda_confirmacao {
  background: #fdf0dc;
  color: #b26a00;
}

/* =========================================================
   TOOLBAR — filtro + botão "Efetuar Pagamento"
   ========================================================= */
.pt-payments-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 20px;
}

.pt-payments-toolbar .pt-payments-filter {
  margin-bottom: 0;
}

/* =========================================================
   SELEÇÃO DE ENCOMENDAS PARA PAGAMENTO
   ========================================================= */
.pt-payment-card__select {
  display: none;
  align-items: center;
}

#pt-pay-form.is-selecting .pt-payment-card__select {
  display: flex;
}

.pt-payment-card__select input[type="checkbox"] {
  width: 20px;
  height: 20px;
}

.pt-pay-summary[hidden] {
  display: none;
}

.pt-pay-summary {
  position: sticky;
  bottom: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 16px;
  padding: 14px 18px;
  background: #1a1a1a;
  color: #fff;
  border-radius: 8px;
  box-shadow: 0 -4px 16px rgba(0,0,0,.12);
}

.pt-pay-summary__text {
  font-size: 14px;
}

.pt-pay-summary #pt-pay-total {
  color: #ff6b00;
}

.pt-pay-summary #pt-pay-submit:disabled {
  opacity: .5;
  cursor: default;
}

/* =========================================================
   PAINEL DE CONFIRMAÇÃO (depois de submeter "Efetuar Pagamento")
   ========================================================= */
.pt-pay-confirmation {
  margin-bottom: 24px;
  padding: 18px 20px;
  background: #f0f9f2;
  border: 1px solid #bfe3c8;
  border-radius: 8px;
}

.pt-pay-confirmation h3 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 8px;
  color: #2a9d5c;
}

.pt-pay-confirmation__total {
  font-size: 16px;
}

.pt-pay-confirmation__bank {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px dashed #bfe3c8;
}

.pt-pay-confirmation__bank p {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0 0 6px;
}

.pt-pay-confirmation__bank ul {
  margin: 0 0 8px;
  padding-left: 20px;
}

/* =========================================================
   PAINEL — mini-cartões de resumo ("Painel" em A Minha Conta)
   ========================================================= */
.pt-dashboard-panels {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
  margin-top: 20px;
}

.pt-dashboard-panel {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 18px;
  background: #fff;
  border: 1px solid #ececec;
  border-radius: 10px;
}

.pt-dashboard-panel__icon {
  color: #ff6b00;
}

.pt-dashboard-panel__icon .pt-btn-ico {
  width: 22px;
  height: 22px;
  margin-right: 0;
}

.pt-dashboard-panel__title {
  margin: 0;
  font-size: 15px;
}

.pt-dashboard-panel__desc {
  margin: 0;
  font-size: 13px;
  color: #777;
  flex: 1;
}

.pt-dashboard-panel__btn {
  align-self: flex-start;
  margin-top: 4px;
}

/* =========================================================
   ITEM DA ENCOMENDA (Ver Encomenda) — imagem, ref, botão "Ver"
   ========================================================= */
.pt-order-item__row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.pt-order-item__img img {
  width: 56px;
  height: 56px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid #eee;
}

.pt-order-item__info {
  flex: 1;
  min-width: 0;
}

.pt-order-item__sku {
  font-size: 12px;
  color: #888;
  margin-top: 2px;
}

.pt-order-item__qty {
  font-size: 13px;
  color: #555;
  margin-top: 2px;
}

.pt-order-item__view {
  flex-shrink: 0;
}

/* =========================================================
   CORES DO ESTADO DA ENCOMENDA — lista "Encomendas" (A Minha Conta)
   ========================================================= */
.woocommerce-orders-table__row--status-pending .woocommerce-orders-table__cell-order-status,
.woocommerce-orders-table__row--status-on-hold .woocommerce-orders-table__cell-order-status {
  color: #b26a00;
  font-weight: 700;
}

.woocommerce-orders-table__row--status-processing .woocommerce-orders-table__cell-order-status {
  color: var(--lts-primary);
  font-weight: 700;
}

.woocommerce-orders-table__row--status-completed .woocommerce-orders-table__cell-order-status {
  color: #2a9d5c;
  font-weight: 700;
}

.woocommerce-orders-table__row--status-cancelled .woocommerce-orders-table__cell-order-status,
.woocommerce-orders-table__row--status-failed .woocommerce-orders-table__cell-order-status {
  color: #C43B46;
  font-weight: 700;
}

.woocommerce-orders-table__row--status-refunded .woocommerce-orders-table__cell-order-status {
  color: #888;
  font-weight: 700;
}

.pt-payments-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
}

.pt-payments-filter__item {
  display: inline-flex;
  align-items: center;
  padding: 8px 14px;
  border: 1px solid #e0e0e0;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  color: #555;
  text-decoration: none;
  transition: border-color .15s, color .15s, background-color .15s;
}

.pt-payments-filter__item:hover {
  border-color: var(--lts-primary);
  color: var(--lts-primary);
}

.pt-payments-filter__item.is-active {
  background: var(--lts-primary);
  border-color: var(--lts-primary);
  color: #fff;
}

.pt-payment-card {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
  padding: 16px;
  margin-bottom: 12px;
  background: #fff;
  border: 1px solid #ececec;
  border-left: 4px solid #ddd;
  border-radius: 8px;
}

.pt-payment-card--pendente {
  border-left-color: var(--lts-primary);
}

.pt-payment-card--atraso {
  border-left-color: #C43B46;
  background: #fff8f8;
}

.pt-payment-card--pago {
  border-left-color: #2a9d5c;
}

.pt-payment-card__main {
  flex: 1;
  min-width: 200px;
}

.pt-payment-card__order {
  font-size: 15px;
  font-weight: 700;
  color: #111;
}

.pt-payment-card__date {
  font-size: 13px;
  font-weight: 400;
  color: #999;
  margin-left: 8px;
}

.pt-payment-card__term {
  font-size: 14px;
  color: #555;
  margin-top: 4px;
}

.pt-payment-card__due {
  font-size: 13px;
  color: #777;
  margin-top: 2px;
}

.pt-payment-card--atraso .pt-payment-card__due {
  color: #C43B46;
  font-weight: 700;
}

.pt-payment-badge {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.pt-payment-badge--pendente {
  background: color-mix(in srgb, var(--lts-primary) 12%, #fff);
  color: var(--lts-primary);
}

.pt-payment-badge--atraso {
  background: #fbe4e5;
  color: #C43B46;
}

.pt-payment-badge--pago {
  background: #e5f4ea;
  color: #2a9d5c;
}

.pt-payment-card__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.pt-payment-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 38px;
  padding: 0 14px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}

.pt-payment-btn--primary {
  background: var(--lts-primary);
  color: #fff !important;
  border: none;
}

.pt-payment-btn--primary:hover {
  filter: brightness(.95);
}

.pt-payment-btn--disabled {
  color: #aaa;
  background: #f5f5f5;
  cursor: default;
}

.pt-payments-empty {
  text-align: center;
  padding: 32px 16px;
  color: #888;
  background: #fafafa;
  border: 1px dashed #ddd;
  border-radius: 10px;
}

.pt-payments-pagination {
  margin-top: 20px;
  display: flex;
  justify-content: center;
  gap: 6px;
}

.pt-payments-pagination .page-numbers {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  height: 34px;
  padding: 0 8px;
  border: 1px solid #e0e0e0;
  border-radius: 6px;
  text-decoration: none;
  color: #555;
  font-size: 13px;
}

.pt-payments-pagination .page-numbers.current {
  background: var(--lts-primary);
  border-color: var(--lts-primary);
  color: #fff;
}

/* =========================================================
   VER ENCOMENDA — cartões separados: produtos / totais
   ========================================================= */
.pt-order-boxes {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin-bottom: 24px;
}

.pt-order-box {
  background: #fff;
  border: 1px solid #ececec;
  border-radius: 10px;
  padding: 20px 22px;
  overflow: hidden;
}

.pt-order-box table {
  width: 100%;
  border-collapse: collapse;
}

.pt-order-box th,
.pt-order-box td {
  border: none;
  padding: 12px 4px;
}

/* Linhas a separar dentro de cada cartão (menos a última) */
.pt-order-box--items tbody tr:not(:last-child) td,
.pt-order-box--totals tbody tr:not(:last-child) th,
.pt-order-box--totals tbody tr:not(:last-child) td {
  border-bottom: 1px solid #f0f0f0;
}

.pt-order-box--items thead th {
  border-bottom: 2px solid #eee;
  font-size: 13px;
  color: #888;
  text-transform: uppercase;
  letter-spacing: .02em;
}

/* Hover subtil por linha, só para estilo */
.pt-order-box--items tbody tr:hover td {
  background-color: #f7f7f8;
}

.pt-order-box--totals tbody tr:last-child th,
.pt-order-box--totals tbody tr:last-child td {
  font-size: 16px;
  font-weight: 700;
}

/* =========================================================
   MOBILE — Painel, Pagamentos, Encomendas
   Esta folha ainda não tinha nenhuma regra pensada para ecrãs
   estreitos; os componentes abaixo dependiam só do flex-wrap
   genérico, que nem sempre chega num telemóvel.
   ========================================================= */
@media (max-width: 600px) {
  .pt-dashboard-panels {
    grid-template-columns: 1fr;
  }

  .pt-payments-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .pt-payments-toolbar #pt-pay-toggle {
    width: 100%;
    justify-content: center;
  }

  .pt-payment-card {
    padding: 14px;
  }

  .pt-payment-card__actions {
    width: 100%;
  }

  .pt-payment-card__actions .pt-payment-btn {
    flex: 1;
  }

  .pt-pay-summary {
    flex-direction: column;
    align-items: stretch;
    text-align: center;
  }

  .pt-pay-summary #pt-pay-submit {
    width: 100%;
    justify-content: center;
  }

  .pt-order-item__row {
    flex-wrap: wrap;
  }

  .pt-order-item__view {
    margin-top: 8px;
  }

  .pt-order-box {
    padding: 16px;
  }
}
