/*
 * My Account › Orders — one type size across the table + invoice PDF link.
 * Enqueued by custom/my-account-orders.php on the account page only, after
 * custom/style.css (handle elimstat-main).
 *
 * Every rule is scoped to body.woocommerce-account table.my_account_orders so
 * product, cart and checkout price styling is untouched.
 */

/* ---- One size for every cell ------------------------------------------ */
.woocommerce-account table.my_account_orders {
  font-size: 1em;
}

.woocommerce-account table.my_account_orders th,
.woocommerce-account table.my_account_orders td {
  font-size: 1em;
  line-height: 1.5;
  vertical-align: middle;
}

/*
 * style.css sets `span.woocommerce-Price-amount.amount { font-size: xx-large }`
 * (and `.amount { font-size: 2rem }` on handhelds) for product prices; in the
 * orders table that made the Total column 32px next to 12px text.
 */
.woocommerce-account table.my_account_orders .woocommerce-Price-amount,
.woocommerce-account table.my_account_orders .woocommerce-Price-amount.amount,
.woocommerce-account table.my_account_orders .amount {
  font-size: 1em;
  font-weight: inherit;
  line-height: inherit;
}

.woocommerce-account table.my_account_orders .button {
  font-size: 1em;
  line-height: 1.5;
  padding: 0.4em 1em;
  margin: 0;
}

/* ---- Order number + invoice PDF link ---------------------------------- */
.woocommerce-account table.my_account_orders .elimstat-order-cell {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.15em;
  max-width: 100%;
}

.woocommerce-account table.my_account_orders .elimstat-order-number {
  display: inline-block;
  font-weight: 600;
  white-space: nowrap;
}

.woocommerce-account table.my_account_orders .elimstat-order-pdf {
  display: inline-flex;
  align-items: center;
  gap: 0.35em;
  font-size: 1em;
  font-weight: 400;
  line-height: 1.5;
  text-decoration: none;
  white-space: nowrap;
}

.woocommerce-account table.my_account_orders .elimstat-order-pdf:hover,
.woocommerce-account table.my_account_orders .elimstat-order-pdf:focus {
  text-decoration: underline;
}

.woocommerce-account table.my_account_orders .elimstat-order-pdf__icon {
  width: 1em;
  height: 1em;
  flex: none;
}

/*
 * Handheld: Storefront's stacked table hides `tbody th`, which is the order
 * number cell — rows lost their identifier and the PDF link with it. Show it
 * like the other labelled cells: label on the left, number + PDF link on the
 * right, wrapping onto a second line only when the phone is too narrow.
 */
@media (max-width: 767px) {
  .woocommerce-account table.shop_table_responsive.my_account_orders tbody th.woocommerce-orders-table__cell-order-number {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 0 1em;
    clear: both;
    text-align: right;
    background: transparent;
    padding: 8px;
  }

  .woocommerce-account table.shop_table_responsive.my_account_orders tbody th.woocommerce-orders-table__cell-order-number::before {
    content: attr(data-title) ":";
    flex: none;
    font-weight: 600;
  }

  .woocommerce-account table.my_account_orders .elimstat-order-cell {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: flex-end;
    align-items: baseline;
    gap: 0.15em 0.75em;
  }
}

@media (max-width: 480px) {
  .woocommerce-account table.shop_table_responsive.my_account_orders tbody th.woocommerce-orders-table__cell-order-number {
    padding: 5px 0;
  }
}
