/* Loyalty "points you'll earn" rows.
 *
 * Two surfaces, one look: the Blocks cart/checkout order summary and the
 * theme's side cart. Deliberately quieter than the money around it - this is
 * a reward, not a total, and it must never be mistaken for one.
 */

.pl-loyalty-summary {
  /* 16px sides matches .wc-block-components-totals-item, so the row lines up
   * with Subtotal/Delivery/Total instead of running to the card's edge. */
  padding: 12px 16px 16px;
  border-top: 1px solid rgba(0, 0, 0, 0.1);
}

.pl-loyalty-summary__row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.pl-loyalty-summary__label {
  font-size: 0.875em;
}

.pl-loyalty-summary__value {
  white-space: nowrap;
}

.pl-loyalty-summary__note {
  margin: 4px 0 0;
  font-size: 0.75em;
  opacity: 0.7;
}

/* Side cart note. It is the last thing before the checkout button, so it has
 * to carry the gap the points row above it gives up. */
.cart-drawer__points-note {
  margin: 2px 0 14px;
  font-size: 0.75rem;
  line-height: 1.35;
  opacity: 0.7;
}

.cart-drawer__points-note[hidden] {
  display: none;
}

/* With a note under it the points row hands its gap down, the same way the
 * subtotal hands its gap to the points row. */
.cart-drawer__points:has(+ .cart-drawer__points-note:not([hidden])) {
  margin-bottom: 0;
}

/* Side cart – matches .cart-drawer__subtotal's flex row, one step quieter.
 * The points row reads as a continuation of the subtotal, so it sits tight
 * under it and carries the gap down to the checkout button itself. */
.cart-drawer__subtotal:has(+ .cart-drawer__points:not([hidden])) {
  margin-bottom: 0;
}

.cart-drawer__points {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-top: 2px;
  margin-bottom: 14px;
  font-size: 0.875rem;
}

.cart-drawer__points-value {
  white-space: nowrap;
}

.cart-drawer__points[hidden] {
  display: none;
}

/* Side cart – the member discount already applied to this cart. Reads as a
 * reduction, so it carries the store's positive accent rather than the muted
 * tone used for the points line. */
.cart-drawer__discount {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-top: 6px;
  font-size: 0.875rem;
}

.cart-drawer__discount-value {
  font-weight: 700;
  white-space: nowrap;
}

.cart-drawer__discount[hidden] {
  display: none;
}

/* ───── Coupons in the checkout's "Add coupons" panel ─────
 * One tap applies a coupon the member already holds. The alternative on a
 * phone is leaving checkout to copy a code out of the Rewards page, which is
 * where mobile orders get abandoned. The list is portalled in under the
 * "Enter code" row, so it is read as a shortcut past that field. */
.pl-loyalty-coupons {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid rgba(0, 0, 0, 0.1);
}

.pl-loyalty-coupons__title {
  margin: 0 0 8px;
  font-size: 0.875em;
  font-weight: 600;
}

.pl-loyalty-coupons__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Full-width rows rather than a scrolling strip of chips: a thumb scrolls the
 * page vertically, so anything parked off to the side goes unseen. */
.pl-loyalty-coupon {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
  border: 1px dashed rgba(0, 0, 0, 0.2);
  border-radius: 8px;
}

.pl-loyalty-coupon__body {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.pl-loyalty-coupon__code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.8125em;
  font-weight: 700;
  letter-spacing: 0.02em;
  word-break: break-all;
}

.pl-loyalty-coupon__meta {
  font-size: 0.75em;
  opacity: 0.7;
}

/* 44px tall - sized for a thumb, not a mouse pointer. */
.pl-loyalty-coupon__apply {
  flex: 0 0 auto;
  min-height: 44px;
  min-width: 84px;
  padding: 0 14px;
  border: 1px solid currentColor;
  border-radius: 999px;
  background: transparent;
  color: inherit;
  font-family: inherit;
  font-size: 0.8125em;
  font-weight: 600;
  line-height: 1.2;
  cursor: pointer;
}

/* The theme paints every button dark on hover; keep this one an outline so it
 * reads as secondary to Place Order. */
.pl-loyalty-coupon__apply:hover,
.pl-loyalty-coupon__apply:focus {
  background: transparent;
  color: inherit;
  border-color: currentColor;
}

.pl-loyalty-coupon__apply:disabled {
  opacity: 0.5;
  cursor: default;
}

.pl-loyalty-coupons__error {
  margin: 8px 0 0;
  font-size: 0.8125em;
  color: #991b1b;
}

/* Signed-out shoppers see what the cart earns, with the catch behind an info
 * button: the points are real, they just need an account to land in. A button
 * rather than a hover tooltip, because a thumb cannot hover. */
.pl-loyalty-summary__info {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  margin-left: 6px;
  padding: 0;
  border: 1px solid currentColor;
  border-radius: 50%;
  background: transparent;
  color: inherit;
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 11px;
  font-style: italic;
  line-height: 1;
  opacity: 0.6;
  cursor: pointer;
  vertical-align: middle;
}

.pl-loyalty-summary__info:hover,
.pl-loyalty-summary__info:focus,
.pl-loyalty-summary__info[aria-expanded="true"] {
  background: transparent;
  color: inherit;
  opacity: 1;
}

.pl-loyalty-summary__hint {
  display: block;
  margin: 6px 0 0;
  font-size: 0.75em;
  line-height: 1.4;
  opacity: 0.85;
}

a.pl-loyalty-summary__hint {
  text-decoration: underline;
}
