/**
 * @author    Imaginis
 * @copyright 2026 Imaginis
 * @license   https://opensource.org/licenses/AFL-3.0 Academic Free License 3.0 (AFL-3.0)
 */
.imrb {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 1rem;
  padding: 10px 12px;
  background: #ffd300;
  border: 1px solid #ffd300;
  border-radius: 10px;
  color: #16224f;
  line-height: 1.25;
}
.imrb-title { flex: 1 1 auto; min-width: 0; font-size: 13px; font-weight: 700; }
.imrb-balance { display: flex; flex-direction: column; flex: 0 0 auto; white-space: nowrap; }
.imrb-label { font-size: 11px; }
.imrb-balance strong { font-size: 16px; }
.imrb a.imrb-link,
.imrb button.imrb-link {
  margin: 0;
  border: 0;
  line-height: 1.25;
  cursor: pointer;
  flex: 0 0 auto;
  padding: 8px 12px;
  background: #16224f;
  border-radius: var(--lvb-radius-sm, 8px);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}
.imrb a.imrb-link:hover,
.imrb button.imrb-link:hover { background: #282b95; color: #fff; }
.imrb .imrb-link:focus-visible { outline: 2px solid #16224f; outline-offset: 2px; }
.imrb button.imrb-link:disabled { opacity: .5; cursor: default; }
.imrb-error { grid-column: 1 / -1; font-size: 12px; font-weight: 600; color: #8c1d18; }
.imrb-error:empty { display: none; }
#reward_use .imrb-error { display: block; }

/* Checkout summary only; narrow column. */
.imrb.imrb--summary { display: none; }
body#checkout #js-checkout-summary .imrb.imrb--summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  column-gap: 8px;
  row-gap: 2px;
  width: 100%;
  clear: both;
  margin: 8px 0 4px;
  padding: 10px;
  border-radius: 12px;
  text-align: left;
  white-space: normal;
}
/* Title and balance on the left, the button on the right across both rows. */
.imrb--summary .imrb-title { grid-column: 1; grid-row: 1; font-size: 11px; white-space: nowrap; }
.imrb--summary .imrb-balance { grid-column: 1; grid-row: 2; }
.imrb--summary .imrb-balance strong { font-size: 15px; }
.imrb--summary button.imrb-link { grid-column: 2; grid-row: 1 / span 2; align-self: center; width: 106px; padding: 8px 4px; font-size: 11px; white-space: normal; text-align: center; }

/* Let the bar take its own full width row under the shipping line. */
body#checkout #js-checkout-summary .cart-summary-line:has(.imrb) {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
}
body#checkout #js-checkout-summary .cart-summary-line > .imrb { flex: 0 0 100%; }

/* "Points earned" messages of All-in-one Rewards. */
.reward_alert_message#loyalty,
.reward_alert_message#reward_loyalty,
.reward_alert_message#reward_use {
  background: #fff6cc;
  border-color: #ffd300;
  color: #16224f;
}
.reward_alert_message#reward_use a { color: #16224f; text-decoration: underline; }

/* Cart page: "use my rewards" and "points earned" form one card with a separator. */
.reward_alert_message#reward_use:has(+ #reward_loyalty:not([style*="display: none"])) {
  margin-bottom: 0 !important;
  border-bottom: 0;
  border-radius: 12px 12px 0 0;
}
.reward_alert_message#reward_use + .reward_alert_message#reward_loyalty {
  margin-top: 0 !important;
  border-top: 1px solid #ffd300;
  border-radius: 0 0 12px 12px;
}

/* Product page: bar and message form one box in two parts. */
.imrb--product:has(~ #loyalty:not([style*="display: none"])) {
  margin-bottom: 0;
  border-radius: 10px 10px 0 0;
}
.imrb--product ~ .reward_alert_message#loyalty {
  /* Cancels the 8px flex gap of .product-additional-info; the theme forces its own top margin. */
  margin-top: -8px !important;
  border-top: 0;
  border-radius: 0 0 10px 10px;
}
