.s4h-checkout-order-summary-wrap {
  margin: 0 0 24px;
}

/* Cart: hide default Elementor/Woo table column — cards replace it */
body.s4h-order-cards--cart .woocommerce-cart-form,
body.s4h-order-cards--cart .e-cart__column-start,
body.s4h-order-cards--cart .cart_totals > h2,
body.s4h-order-cards--cart .cart_totals .shop_table,
body.s4h-order-cards--cart .wc-proceed-to-checkout,
body.s4h-order-cards--cart .e-cart-section.coupon {
  display: none !important;
}

body.s4h-order-cards--cart .e-cart__container {
  display: block !important;
}

body.s4h-order-cards--cart .e-cart__column-end,
body.s4h-order-cards--cart .e-cart-totals {
  width: 100% !important;
  max-width: 520px;
  margin: 0 auto;
  float: none !important;
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  padding: 0 !important;
}

body.s4h-order-cards--cart .cart-collaterals {
  width: 100% !important;
  float: none !important;
}

/* Cart: hide duplicate Elementor page headings — our summary has its own title */
body.s4h-order-cards--cart .elementor-element.elementor-widget-heading {
  display: none !important;
}

/* Collapse Elementor columns that only held the duplicate heading */
body.s4h-order-cards--cart
  .e-con.e-child:has(> .elementor-widget-heading):not(
    :has(.elementor-widget-woocommerce-cart)
  ) {
  display: none !important;
}

.s4h-order-summary {
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-width: 100%;
}

.s4h-order-summary__header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
}

.s4h-order-summary__grid {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.s4h-order-summary__col--main {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}

.s4h-order-summary__col--main .s4h-order-card {
  width: 100%;
  box-sizing: border-box;
}

.s4h-checkout-order-summary-wrap button.s4h-order-summary__clear {
  appearance: none;
  -webkit-appearance: none;
  display: inline-block;
  flex-shrink: 0;
  margin: 0;
  padding: 0;
  border: 0 !important;
  border-radius: 0 !important;
  outline: none;
  background: none !important;
  box-shadow: none !important;
  color: #667085;
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.4;
  letter-spacing: 0;
  text-align: right;
  text-decoration: underline;
  text-decoration-color: rgba(102, 112, 133, 0.45);
  text-underline-offset: 3px;
  text-transform: none;
  cursor: pointer;
  transition:
    color 0.15s ease,
    text-decoration-color 0.15s ease;
}

.s4h-checkout-order-summary-wrap button.s4h-order-summary__clear:hover,
.s4h-checkout-order-summary-wrap button.s4h-order-summary__clear:focus-visible {
  color: #d71920;
  text-decoration-color: rgba(215, 25, 32, 0.55);
}

body.s4h-order-cards--cart
  .s4h-checkout-order-summary-wrap
  h2.s4h-order-summary__title {
  margin: 0;
  flex: 1;
  min-width: 0;
  color: #101828 !important;
  font-family: inherit !important;
  font-size: 1.875rem !important;
  font-weight: 700 !important;
  line-height: 1.2 !important;
  letter-spacing: normal !important;
  word-spacing: normal !important;
}

.s4h-order-card {
  background: #fff;
  border: 1px solid #e8ebf0;
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(16, 24, 40, 0.06);
  padding: 18px 20px;
}

.s4h-order-card__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 0;
}

.s4h-order-card__line {
  display: flex;
  align-items: center;
  gap: 12px 16px;
  padding-bottom: 14px;
}

.s4h-order-card__remove {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex: 0 0 auto;
	align-self: center;
	box-sizing: border-box;
	width: 24px;
	height: 24px;
	margin: 0;
	padding: 0;
	border: 1px solid #e4e7ec;
	border-radius: 6px;
	background: #fff;
	color: #98a2b3;
	font-family: inherit;
	font-size: 1rem;
	font-weight: 400;
	line-height: 1;
	cursor: pointer;
	transition: color 0.15s ease, border-color 0.15s ease, background-color 0.15s ease;
}

.s4h-order-card__remove span {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	height: 100%;
	line-height: 1;
}

.s4h-checkout-order-summary-wrap button.s4h-order-card__remove,
.s4h-checkout-order-summary-wrap button.s4h-order-card__remove:focus,
.s4h-checkout-order-summary-wrap button.s4h-order-card__remove:active {
	box-sizing: border-box !important;
	width: 24px !important;
	height: 24px !important;
	min-width: 24px !important;
	min-height: 24px !important;
	padding: 0 !important;
	border: 1px solid #e4e7ec !important;
	border-radius: 6px !important;
	background: #fff !important;
	box-shadow: none !important;
	outline: none;
	color: #98a2b3 !important;
}

.s4h-checkout-order-summary-wrap button.s4h-order-card__remove:hover,
.s4h-checkout-order-summary-wrap button.s4h-order-card__remove:focus-visible {
	border-color: #d0d5dd !important;
	background: #f9fafb !important;
	box-shadow: none !important;
	color: #667085 !important;
}

.s4h-order-card__product {
	flex: 1 1 auto;
	min-width: 0;
	display: flex;
	flex-direction: column;
	gap: 2px;
}

.s4h-order-card__product-name {
	color: #2f80c8;
	font-size: 0.95rem;
	font-weight: 600;
	line-height: 1.35;
}

.s4h-order-card__product-discount {
	display: block;
	color: #027a48;
	font-size: 0.78rem;
	font-weight: 500;
	line-height: 1.35;
}

.s4h-order-card__unit-price {
  flex: 0 0 auto;
  color: #475467;
  font-size: 0.95rem;
  font-weight: 500;
  white-space: nowrap;
}

.s4h-order-card--product .s4h-qty-stepper {
  flex: 0 0 auto;
}

.s4h-order-card__row + .s4h-order-card__row {
  border-top: 1px solid #eef1f6;
}

.s4h-order-card__label {
	color: #101828;
	font-size: 0.95rem;
	font-weight: 700;
}

.s4h-order-card__label-note {
	display: block;
	margin-top: 2px;
	color: #667085;
	font-size: 0.78rem;
	font-weight: 500;
	line-height: 1.35;
}

.s4h-order-card__value {
	color: #475467;
	font-size: 0.95rem;
	text-align: right;
}

.s4h-order-card__value--discount {
	color: #027a48;
	font-weight: 600;
}

.s4h-order-card__row--discount {
	align-items: flex-start;
}

.s4h-order-card__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 0;
  padding-top: 14px;
  border-top: 1px solid #eef1f6;
}

.s4h-order-card__footer-label {
  color: #1d4f91;
  font-size: 0.95rem;
  font-weight: 700;
}

.s4h-order-card__footer-value {
  color: #1d4f91;
  font-size: 1.05rem;
  font-weight: 700;
}

.s4h-qty-stepper {
  display: inline-flex;
  align-items: stretch;
  border: 1px solid #d0d5dd;
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
}

.s4h-qty-stepper__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 0;
  background: #fff;
  color: #344054;
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
}

.s4h-checkout-order-summary-wrap button.s4h-qty-stepper__btn,
.s4h-checkout-order-summary-wrap button.s4h-qty-stepper__btn:hover,
.s4h-checkout-order-summary-wrap button.s4h-qty-stepper__btn:focus,
.s4h-checkout-order-summary-wrap button.s4h-qty-stepper__btn:focus-visible,
.s4h-checkout-order-summary-wrap button.s4h-qty-stepper__btn:active {
  background: #fff !important;
  color: #344054 !important;
  border: 0 !important;
  box-shadow: none !important;
}

.s4h-checkout-order-summary-wrap button.s4h-qty-stepper__btn:hover,
.s4h-checkout-order-summary-wrap button.s4h-qty-stepper__btn:focus-visible {
  background: #f9fafb !important;
  color: #101828 !important;
}

.s4h-checkout-order-summary-wrap .s4h-qty-stepper__btn[data-s4h-qty-minus] {
  border-radius: 8px 0 0 8px !important;
}

.s4h-checkout-order-summary-wrap .s4h-qty-stepper__btn[data-s4h-qty-plus] {
	border-radius: 0 8px 8px 0 !important;
}

.s4h-checkout-order-summary-wrap button.s4h-qty-stepper__btn:disabled,
.s4h-checkout-order-summary-wrap button.s4h-qty-stepper__btn:disabled:hover,
.s4h-checkout-order-summary-wrap button.s4h-qty-stepper__btn:disabled:focus,
.s4h-checkout-order-summary-wrap button.s4h-qty-stepper__btn:disabled:focus-visible,
.s4h-checkout-order-summary-wrap button.s4h-qty-stepper__btn:disabled:active {
	color: #d0d5dd !important;
	background: #f9fafb !important;
	cursor: not-allowed !important;
}

.s4h-qty-stepper__value {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  min-height: 36px;
  padding: 0 8px;
  border-left: 1px solid #d0d5dd;
  border-right: 1px solid #d0d5dd;
  color: #101828;
  font-size: 0.95rem;
  font-weight: 600;
  text-align: center;
}

.s4h-order-card--donation {
  width: 100%;
  padding: 0 !important;
  overflow: hidden;
  border: 1px solid #e8ebf0 !important;
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(16, 24, 40, 0.06);
  background: #fff;
  box-sizing: border-box;
}

.s4h-order-card--donation.is-open {
  border: 1px solid #d0d5dd !important;
  box-shadow: 0 8px 24px rgba(16, 24, 40, 0.06) !important;
  background: #fff;
}

.s4h-donation-toggle {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  box-sizing: border-box;
  padding: 18px 20px;
  border: 0;
  border-radius: 12px;
  background: #fff;
  color: #101828;
  font-size: 1rem;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  box-shadow: none;
}

.s4h-order-card--donation.is-open .s4h-donation-toggle {
  border-radius: 0;
}

.s4h-checkout-order-summary-wrap button.s4h-donation-toggle {
  appearance: none;
  -webkit-appearance: none;
  margin: 0;
  background: #fff !important;
  color: #101828 !important;
  border-color: transparent !important;
  box-shadow: none !important;
}

.s4h-checkout-order-summary-wrap button.s4h-donation-toggle:hover,
.s4h-checkout-order-summary-wrap button.s4h-donation-toggle:focus,
.s4h-checkout-order-summary-wrap button.s4h-donation-toggle:focus-visible,
.s4h-checkout-order-summary-wrap button.s4h-donation-toggle:active {
  background: #f9fafb !important;
  color: #101828 !important;
  border-color: transparent !important;
  box-shadow: none !important;
}

.s4h-donation-toggle__icon {
  position: relative;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  box-sizing: border-box;
  width: 28px;
  height: 28px;
  border: 1px solid #5bc0de;
  border-radius: 999px;
  color: transparent;
  font-size: 0;
  line-height: 0;
  background: #5bc0de;
}

.s4h-donation-toggle__icon::before,
.s4h-donation-toggle__icon::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  background: #fff;
  border-radius: 1px;
  transform: translate(-50%, -50%);
}

.s4h-donation-toggle[aria-expanded="false"] .s4h-donation-toggle__icon::before {
  width: 10px;
  height: 2px;
}

.s4h-donation-toggle[aria-expanded="false"] .s4h-donation-toggle__icon::after {
  width: 2px;
  height: 10px;
}

.s4h-donation-toggle[aria-expanded="true"] .s4h-donation-toggle__icon::after {
  display: none;
}

.s4h-donation-toggle[aria-expanded="true"] .s4h-donation-toggle__icon::before {
  width: 10px;
  height: 2px;
}

.s4h-donation-toggle__text {
  flex: 1;
  color: #5bc0de;
}

.s4h-donation-toggle__chevron {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  color: #5bc0de;
}

.s4h-donation-toggle__chevron svg {
  display: block;
  transform: rotate(0deg);
  transform-origin: center center;
  transition: transform 0.3s ease;
}

.s4h-donation-toggle[aria-expanded="true"] .s4h-donation-toggle__chevron svg {
  transform: rotate(180deg);
}

.s4h-donation-panel {
  padding: 16px 20px 20px;
  background: #fff;
  border: 0;
  border-top: 1px solid #eef1f6;
  border-radius: 0;
  box-shadow: none;
}

.s4h-donation-panel__text {
  margin: 0 0 16px;
  color: #667085;
  font-size: 0.92rem;
  line-height: 1.5;
}

.s4h-donation-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 14px;
}

.s4h-checkout-order-summary-wrap button.s4h-donation-preset {
  appearance: none;
  -webkit-appearance: none;
  min-width: 72px;
  padding: 10px 16px;
  border: 1px solid #5bc0de !important;
  border-radius: 8px !important;
  background: #fff !important;
  box-shadow: none !important;
  color: #5bc0de !important;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.2;
  text-align: center;
  text-transform: none;
  cursor: pointer;
}

.s4h-checkout-order-summary-wrap button.s4h-donation-preset:hover,
.s4h-checkout-order-summary-wrap button.s4h-donation-preset:focus,
.s4h-checkout-order-summary-wrap button.s4h-donation-preset:focus-visible {
  background: #5bc0de !important;
  border-color: #5bc0de !important;
  color: #fff !important;
  box-shadow: none !important;
}

.s4h-checkout-order-summary-wrap button.s4h-donation-preset.is-active,
.s4h-checkout-order-summary-wrap button.s4h-donation-preset.is-active:hover,
.s4h-checkout-order-summary-wrap button.s4h-donation-preset.is-active:focus,
.s4h-checkout-order-summary-wrap
  button.s4h-donation-preset.is-active:focus-visible {
  background: #5bc0de !important;
  border-color: #5bc0de !important;
  color: #fff !important;
  box-shadow: none !important;
}

.s4h-donation-custom {
  display: flex;
  align-items: stretch;
  border: 1px solid #5bc0de;
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
}

.s4h-donation-custom__currency {
  display: inline-flex;
  align-items: center;
  padding: 0 14px;
  color: #667085;
  font-size: 0.95rem;
  font-weight: 600;
  background: #f9fafb;
  border: 0;
  border-right: 1px solid #d0d5dd;
  border-radius: 0;
}

.s4h-donation-custom__input {
  flex: 1;
  min-width: 0;
  height: 44px;
  padding: 0 14px;
  border: 0;
  border-radius: 0;
  outline: none;
  background: #fff;
  color: #101828;
  font-size: 0.95rem;
}

.s4h-checkout-order-summary-wrap .s4h-donation-custom__input,
.s4h-checkout-order-summary-wrap .s4h-donation-custom__input:hover,
.s4h-checkout-order-summary-wrap .s4h-donation-custom__input:focus,
.s4h-checkout-order-summary-wrap .s4h-donation-custom__input:focus-visible {
  border: 0 !important;
  border-radius: 0 !important;
  outline: none !important;
  box-shadow: none !important;
  background: #fff !important;
  color: #101828 !important;
}

.s4h-donation-error {
  margin: 10px 0 0;
  color: #667085;
  font-size: 0.875rem;
}

.s4h-order-card__section-title {
  margin: 0 0 8px;
  color: #d71920;
  font-size: 1.35rem;
  font-weight: 700;
}

.s4h-order-card__label--with-info {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.s4h-order-card__info {
  position: relative;
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
}

.s4h-checkout-order-summary-wrap button.s4h-order-card__info-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  margin: 0;
  padding: 0;
  border: 0 !important;
  border-radius: 999px;
  background: transparent !important;
  color: #667085 !important;
  box-shadow: none !important;
  cursor: help;
}

.s4h-checkout-order-summary-wrap button.s4h-order-card__info-btn:hover,
.s4h-checkout-order-summary-wrap button.s4h-order-card__info-btn:focus,
.s4h-checkout-order-summary-wrap button.s4h-order-card__info-btn:focus-visible {
  background: #f2f4f7 !important;
  color: #344054 !important;
  box-shadow: none !important;
}

.s4h-order-card__info-btn svg {
  display: block;
}

.s4h-order-card__info-tooltip {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  z-index: 20;
  width: max-content;
  max-width: 220px;
  padding: 8px 10px;
  border-radius: 8px;
  background: #101828;
  color: #fff;
  font-size: 0.75rem;
  font-weight: 500;
  line-height: 1.4;
  text-align: center;
  white-space: normal;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transform: translateX(-50%) translateY(4px);
  transition:
    opacity 0.15s ease,
    transform 0.15s ease,
    visibility 0.15s ease;
}

.s4h-order-card__info-tooltip::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  border: 5px solid transparent;
  border-top-color: #101828;
  transform: translateX(-50%);
}

.s4h-order-card__info:hover .s4h-order-card__info-tooltip,
.s4h-order-card__info:focus-within .s4h-order-card__info-tooltip {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

.s4h-order-card__grand-total {
  margin-top: 12px;
  padding-top: 14px;
  border-top: 1px solid #eef1f6;
}

.s4h-order-card__grand-total-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.s4h-order-card__grand-label {
  color: #1d4f91;
  font-size: 1rem;
  font-weight: 700;
}

.s4h-order-card__grand-value {
  color: #d71920;
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.1;
}

.s4h-order-card__vat-note {
  margin: 4px 0 0;
  color: #98a2b3;
  font-size: 0.8rem;
}

.s4h-order-card__cta,
.s4h-order-card__cta--link {
  display: block;
  width: 100%;
  margin-top: 18px;
  padding: 16px 20px;
  border: 0;
  border-radius: 10px;
  background: linear-gradient(180deg, #ef3340 0%, #d71920 100%);
  color: #fff !important;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.3;
  text-align: center;
  text-decoration: none !important;
  cursor: pointer;
  box-shadow: 0 10px 20px rgba(215, 25, 32, 0.22);
}

.s4h-order-card__cta:hover,
.s4h-order-card__cta--link:hover {
  background: linear-gradient(180deg, #f04450 0%, #c4151c 100%);
  color: #fff !important;
}

.s4h-order-card__secure {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 14px 0 0;
  color: #98a2b3;
  font-size: 0.82rem;
}

.s4h-order-card__secure-icon {
  display: inline-flex;
  color: #d71920;
}

.s4h-order-summary.is-loading {
  opacity: 0.65;
  pointer-events: none;
}

@media (max-width: 767px) {
  .s4h-order-summary__header {
    align-items: flex-start;
  }

  .s4h-checkout-order-summary-wrap button.s4h-order-summary__clear {
    font-size: 0.8125rem;
  }

  .s4h-order-card__line {
    gap: 8px 10px;
  }

  .s4h-order-card__product-name {
    font-size: 0.875rem;
  }

  .s4h-order-card__unit-price {
    font-size: 0.875rem;
  }

  .s4h-order-card__grand-value {
    font-size: 1.3rem;
  }
}

/* Desktop: same centered layout as mobile, slightly wider + more breathing room */
@media (min-width: 768px) {
  body.s4h-order-cards--cart
    .e-con.e-child:has(.elementor-widget-woocommerce-cart) {
    width: 100% !important;
    max-width: 1080px;
    margin-inline: auto;
  }

  body.s4h-order-cards--cart .e-cart__column-end,
  body.s4h-order-cards--cart .e-cart-totals {
    max-width: 1080px;
  }

  .s4h-order-summary__grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(300px, 380px);
    gap: 24px;
    align-items: start;
  }

  .s4h-order-summary__col--aside {
    position: sticky;
    top: 32px;
  }

  .s4h-order-summary__col--aside .s4h-order-card {
    width: 100%;
    box-sizing: border-box;
  }

  .s4h-checkout-order-summary-wrap {
    margin-bottom: 32px;
  }

  .s4h-order-summary {
    gap: 20px;
  }

  .s4h-order-card {
    padding: 22px 24px;
  }

  .s4h-order-card__row {
    padding: 12px 0;
  }

  .s4h-order-card__grand-value {
    font-size: 1.6rem;
  }

  .s4h-order-card__cta,
  .s4h-order-card__cta--link {
    padding: 18px 24px;
  }
}
