/**
 * Coupon redemption — cart and checkout.
 */

.orient-coupon-redemption {
  --orient-coupon-accent: #417DBB;
  --orient-coupon-accent-soft: #eef4fb;
  --orient-coupon-border: #e4e4e4;
  --orient-coupon-text: #444;
  --orient-coupon-muted: #969696;
  border: 1px solid var(--orient-coupon-border);
  border-radius: 6px;
  padding: 16px;
  margin-top: 16px;
  background: #fff;
  box-sizing: border-box;
  container-type: inline-size;
}

.orient-coupon-redemption__heading {
  color: var(--orient-coupon-text);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.3;
  margin-bottom: 10px;
}

.orient-coupon-redemption__applied + .orient-coupon-redemption__entry {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--orient-coupon-border);
}

.orient-coupon-redemption__list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.orient-coupon-redemption__item {
  align-items: center;
  display: flex;
  gap: 10px;
  justify-content: space-between;
}

.orient-coupon-redemption__item + .orient-coupon-redemption__item {
  margin-top: 8px;
}

.orient-coupon-redemption__chip {
  align-items: center;
  background: var(--orient-coupon-accent-soft);
  border: 1px solid rgba(65, 125, 187, 0.18);
  border-radius: 6px;
  display: flex;
  flex: 1 1 auto;
  flex-wrap: wrap;
  gap: 6px 10px;
  min-height: 38px;
  padding: 8px 12px;
}

.orient-coupon-redemption__code {
  color: var(--orient-coupon-accent);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1.3;
  text-transform: uppercase;
}

.orient-coupon-redemption__promotion {
  color: var(--orient-coupon-text);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.3;
}

.orient-coupon-redemption__actions {
  flex: 0 0 auto;
}

.orient-coupon-redemption__row {
  align-items: stretch;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.orient-coupon-redemption__field {
  flex: 1 1 auto;
  min-width: 0;
  width: 100%;
}

.orient-coupon-redemption__field .form-item,
.orient-coupon-redemption__field .js-form-item {
  margin: 0;
  padding: 0;
}

.orient-coupon-redemption__field label,
.orient-coupon-redemption__field .form-item__label {
  clip: rect(1px, 1px, 1px, 1px);
  height: 1px;
  overflow: hidden;
  position: absolute;
  white-space: nowrap;
  width: 1px;
}

.orient-coupon-redemption__code-input,
.orient-coupon-redemption__field input[type="text"],
.orient-coupon-redemption__field input.form-text {
  border: 1px solid var(--orient-coupon-border);
  border-radius: 6px;
  box-sizing: border-box;
  color: var(--orient-coupon-text);
  display: block;
  font-size: 14px;
  height: 38px;
  line-height: 38px;
  margin: 0;
  max-width: 100%;
  padding: 0 12px;
  width: 100% !important;
}

.orient-coupon-redemption__code-input:focus,
.orient-coupon-redemption__field input[type="text"]:focus,
.orient-coupon-redemption__field input.form-text:focus {
  border-color: var(--orient-coupon-accent);
  box-shadow: 0 0 0 2px rgba(65, 125, 187, 0.15);
  outline: none;
}

.orient-coupon-redemption__submit {
  display: flex;
  flex: 0 0 auto;
  width: 100%;
}

.orient-coupon-redemption__apply,
.orient-coupon-redemption__submit input[type="submit"].orient-coupon-redemption__apply {
  background: var(--orient-coupon-accent);
  border: 0;
  border-radius: 6px;
  box-sizing: border-box;
  color: #fff;
  cursor: pointer;
  display: block;
  font-size: 13px;
  font-weight: 600;
  height: 38px;
  line-height: 38px;
  margin: 0;
  min-width: 0;
  padding: 0 16px;
  transition: background-color 0.2s ease, box-shadow 0.2s ease;
  white-space: nowrap;
  width: 100%;
}

.orient-coupon-redemption__apply:hover,
.orient-coupon-redemption__submit input[type="submit"].orient-coupon-redemption__apply:hover {
  background: #3569a0;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.08);
}

.orient-coupon-redemption__apply:disabled,
.orient-coupon-redemption__submit input[type="submit"].orient-coupon-redemption__apply:disabled {
  background: #a8c0d9;
  box-shadow: none;
  cursor: not-allowed;
  opacity: 0.85;
}

.orient-coupon-redemption__apply:disabled:hover,
.orient-coupon-redemption__submit input[type="submit"].orient-coupon-redemption__apply:disabled:hover {
  background: #a8c0d9;
  box-shadow: none;
}

/* Wide block: field and button on one row, vertically centered. */
@container (min-width: 280px) {
  .orient-coupon-redemption__row {
    align-items: center;
    flex-direction: row;
    flex-wrap: nowrap;
  }

  .orient-coupon-redemption__field {
    flex: 1 1 auto;
    width: auto;
  }

  .orient-coupon-redemption__submit {
    flex: 0 0 auto;
    width: auto;
  }

  .orient-coupon-redemption__apply,
  .orient-coupon-redemption__submit input[type="submit"].orient-coupon-redemption__apply {
    min-width: 88px;
    width: auto;
  }
}

.orient-coupon-redemption__remove,
.orient-coupon-redemption__actions input[type="submit"].orient-coupon-redemption__remove {
  background: transparent;
  border: 0;
  border-radius: 6px;
  color: #555;
  cursor: pointer;
  font-size: 28px;
  font-weight: 600;
  height: 36px;
  line-height: 32px;
  min-width: 36px;
  padding: 0;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.orient-coupon-redemption__remove:hover,
.orient-coupon-redemption__actions input[type="submit"].orient-coupon-redemption__remove:hover {
  background: #f0f0f0;
  color: #222;
}

.orient-coupon-redemption .messages,
#edit-coupon-redemption .orient-coupon-redemption__error {
  margin-top: 12px;
}

#edit-coupon-redemption .orient-coupon-redemption__error {
  align-items: flex-start;
  display: flex;
  gap: 8px;
  padding-right: 40px;
  position: relative;
}

.orient-coupon-redemption__error-dismiss {
  background: transparent;
  border: 0;
  border-radius: 6px;
  color: inherit;
  cursor: pointer;
  flex: 0 0 auto;
  font-size: 22px;
  font-weight: 600;
  height: 28px;
  line-height: 24px;
  min-width: 28px;
  opacity: 0.75;
  padding: 0;
  position: absolute;
  right: 8px;
  top: 8px;
  transition: background-color 0.2s ease, opacity 0.2s ease;
}

.orient-coupon-redemption__error-dismiss:hover {
  background: rgba(0, 0, 0, 0.06);
  opacity: 1;
}

#cart .cart-content__right .orient-coupon-redemption,
.region-checkout-products .orient-coupon-redemption {
  width: 100%;
}

/* Checkout: coupon pane is a direct form child, match other step blocks. */
.region-content form.commerce-checkout-flow-multistep-default #edit-coupon-redemption,
.region-content form.order-checkout-step-order_information #edit-coupon-redemption {
  box-sizing: border-box;
  /* Fallback: asset_injector limits shipping/payment boxes to 755px. */
  max-width: 755px;
  width: 60%;
}

.region-content form.commerce-checkout-flow-multistep-default #edit-coupon-redemption-form,
.region-content form.order-checkout-step-order_information #edit-coupon-redemption-form {
  box-sizing: border-box;
  max-width: 100%;
}

.region-content form.commerce-checkout-flow-multistep-default #edit-coupon-redemption .orient-coupon-redemption,
.region-content form.order-checkout-step-order_information #edit-coupon-redemption .orient-coupon-redemption {
  box-sizing: border-box;
  margin-top: 0;
  max-width: 100%;
  width: 100%;
}

@media (max-width: 1200px) {
  .region-content form.commerce-checkout-flow-multistep-default #edit-coupon-redemption,
  .region-content form.order-checkout-step-order_information #edit-coupon-redemption {
    max-width: 100%;
    width: 100%;
  }
}
