/* Customer-facing discount presentation; pricing and eligibility stay unchanged. */
#view-cart .cart-card,
#view-cart .summary-card,
#view-checkout .summary-card {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
#view-cart .item-price.item-price--promo {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  min-width: 0;
}
#view-cart .item-price--promo .item-promo-prices {
  display: flex;
  align-items: baseline;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}
#view-cart .item-price--promo .item-unit-price {
  font-size: 12px;
  font-weight: 400;
  color: #6e6e73;
}
#view-cart .item-price--promo .item-line-total-old,
#view-cart .summary-item__price-old,
#view-checkout .summary-item__price-old {
  margin: 0;
  font-size: 13px;
  font-weight: 400;
  color: #86868b;
  text-decoration-thickness: 1px;
}
#view-cart .item-price--promo .item-line-total-discount {
  font-size: 20px;
  font-weight: 650;
  letter-spacing: -0.03em;
  color: #1d1d1f;
  white-space: nowrap;
}
#view-cart .item-discount-badge,
#view-cart .summary-item__discount,
#view-checkout .summary-item__discount,
#mini-cart-sidebar .item-discount-badge,
#mini-cart-sidebar-chat .item-discount-badge {
  display: block;
  background: none;
  border: 0;
  border-radius: 0;
  padding: 0;
  margin: 0;
  color: #18804a;
  font-size: 13px;
  line-height: 1.4;
  font-weight: 600;
}
#view-cart .summary-item__pricing,
#view-checkout .summary-item__pricing {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  text-align: right;
}
#view-cart .summary-item__pricing .summary-item__price,
#view-checkout .summary-item__pricing .summary-item__price {
  display: flex;
  align-items: baseline;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
}
#view-cart .summary-row-discount,
#view-checkout .summary-row-discount {
  color: #18804a;
  font-weight: 500;
}
#view-cart .summary-row-discount > span,
#view-checkout .summary-row-discount > span {
  color: inherit;
}
/* One field for entry, sign-in, or the applied code. */
:is(#view-cart, #view-checkout) .discount-box { display: block; }
:is(#view-cart, #view-checkout) .discount-field {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 46px;
  padding: 4px 8px 4px 12px;
  border: 1px solid #e0e3e8;
  border-radius: 12px;
  background: #fafafb;
  box-sizing: border-box;
  transition: border-color 140ms ease, box-shadow 140ms ease;
}
:is(#view-cart, #view-checkout) .discount-field:focus-within {
  border-color: #007aff;
  box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.1);
}
:is(#view-cart, #view-checkout) .discount-field > .discount-row {
  display: flex;
  flex: 1;
  min-width: 0;
  flex-wrap: nowrap;
  gap: 8px;
}
:is(#view-cart, #view-checkout) .discount-field-icon {
  display: flex;
  flex: 0 0 18px;
  color: #8a9099;
}
:is(#view-cart, #view-checkout) .discount-field-icon svg { width: 18px; height: 18px; }
:is(#view-cart, #view-checkout) .discount-field .discount-input {
  flex: 1;
  width: 100%;
  min-width: 0;
  height: 36px !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0;
  background: transparent !important;
  box-shadow: none;
  color: #1d1d1f;
  font: 400 14px/1.4 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif !important;
}
:is(#view-cart, #view-checkout) .discount-field .discount-input:focus { outline: none; box-shadow: none; }
:is(#view-cart, #view-checkout) .discount-field .discount-input::placeholder { color: #7d838c; }
:is(#view-cart, #view-checkout) .discount-field .discount-apply {
  display: flex;
  flex: 0 0 32px;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 32px;
  height: 36px !important;
  padding: 0 !important;
  border: 0;
  border-radius: 8px;
  background: transparent;
  box-shadow: none;
  color: #007aff;
  font-size: 0;
}
/* Let the arrow meet the field's inner edges without clipping the admin menu. */
:is(#view-cart, #view-checkout) .discount-field .discount-apply:not(.is-login-required) {
  flex-basis: 44px;
  width: 44px;
  height: 44px !important;
  margin: -4px -8px -4px 0;
  border-radius: 0 11px 11px 0;
}
:is(#view-cart, #view-checkout) .discount-field .discount-apply::after {
  content: '';
  display: block;
  flex: 0 0 18px;
  width: 18px;
  height: 18px;
  background: currentColor;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12h14m-6-6 6 6-6 6'/%3E%3C/svg%3E") center / contain no-repeat;
}
:is(#view-cart, #view-checkout) .discount-field .discount-apply:hover { background: #edf3fc; }
:is(#view-cart, #view-checkout) .discount-field .discount-apply.has-code:not(.is-login-required) {
  background: #007aff;
  color: #fff;
}
:is(#view-cart, #view-checkout) .discount-field .discount-apply.has-code:not(.is-login-required):is(:hover, :focus-visible):not(:disabled) {
  background: #0066d6;
}
:is(#view-cart, #view-checkout) .discount-field .discount-apply:disabled { opacity: 0.4; cursor: wait; }
:is(#view-cart, #view-checkout) .discount-field .discount-row:has(.is-login-required) > :not(.discount-apply) { display: none; }
:is(#view-cart, #view-checkout) .discount-field .discount-apply.is-login-required {
  flex: 1;
  width: 100%;
  justify-content: flex-start;
  color: #59616d;
  font: 400 14px/1.4 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  white-space: normal;
  text-align: left;
}
:is(#view-cart, #view-checkout) .discount-field .discount-apply.is-login-required::before {
  content: '';
  flex: 0 0 18px;
  width: 18px;
  height: 18px;
  background: #8a9099;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 3h8l10 10-8 8L3 11Z'/%3E%3Ccircle cx='7.5' cy='7.5' r='1'/%3E%3C/svg%3E") center / contain no-repeat;
}
:is(#view-cart, #view-checkout) .discount-field .discount-apply.is-login-required::after { margin-left: auto; color: #8a9099; }
:is(#view-cart, #view-checkout) .discount-field:has(.is-login-required) { cursor: pointer; }
:is(#view-cart, #view-checkout) .discount-field:has(.is-login-required):hover { border-color: #b6c7e0; background: #f5f8fc; }
#view-cart .discount-field .summary-mode-btn {
  flex: 0 0 30px;
  width: 30px;
  height: 32px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  box-shadow: none;
  color: #7d838c;
}
#view-cart .discount-field .summary-mode-btn:hover { color: #007aff; background: #edf3fc; }
:is(#view-cart, #view-checkout) .discount-field > .discount-meta { display: none; }
:is(#view-cart, #view-checkout) .has-applied-discount .discount-field > .discount-row { display: none; }
:is(#view-cart, #view-checkout) .has-applied-discount .discount-field > .discount-meta:not([hidden]) {
  display: flex;
  flex: 1;
  min-width: 0;
}
:is(#view-cart, #view-checkout) .discount-field .discount-pill {
  display: flex;
  width: 100%;
  gap: 8px;
  min-height: 36px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  font-size: 14px;
  font-weight: 600;
}
:is(#view-cart, #view-checkout) .discount-field .discount-pill-text {
  white-space: normal;
  overflow-wrap: anywhere;
  color: #1d1d1f;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  letter-spacing: 0.02em;
}
:is(#view-cart, #view-checkout) .discount-field .discount-pill-close { width: 32px; height: 32px; margin-left: auto; }
:is(#view-cart, #view-checkout) .discount-field button:focus-visible { outline: 2px solid #007aff; outline-offset: -2px; }
:is(#view-cart, #view-checkout) .discount-error:not([hidden]) { margin-top: 8px; font-weight: 400; }
@media (max-width: 900px) {
  #view-cart .cart-items .cart-item { row-gap: 12px; }
  #view-cart .item-price.item-price--promo {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas: "unit prices" "offer offer";
    gap: 4px 10px;
    padding-top: 0;
    align-items: baseline;
  }
  #view-cart .item-price--promo .item-unit-price { grid-area: unit; justify-self: start; }
  #view-cart .item-price--promo .item-promo-prices { grid-area: prices; }
  #view-cart .item-price--promo .item-discount-badge { grid-area: offer; justify-self: end; }
  #view-cart .item-price--promo .item-line-total-discount { font-size: 18px; }
}
@media (max-width: 420px) {
  #view-cart .item-price--promo .item-promo-prices { gap: 6px; }
  #view-cart .item-price--promo .item-line-total-old { font-size: 11px; }
  #view-cart .item-price--promo .item-line-total-discount { font-size: 17px; }
}
