/* WooCommerce Blocks — nadpisania motywu ifil */

.ifil-wc-page {
  padding-bottom: 0;
}

body.woocommerce-cart,
body.woocommerce-checkout,
.ifil-wc-page,
.ifil-wc-blocks {
  --ifil-wc-panel-radius: calc(var(--btn-radius) + 2px);
  --ifil-wc-panel-shadow: 0 4px 18px rgba(17, 17, 17, 0.04);
  --ifil-checkout-gap: 1rem;

  /* Spójne kolory WC Blocks = brand MGK */
  --wc-primary: var(--brand-primary-bg);
  --wc-primary-text: var(--on-primary);
  --wc-secondary: var(--dark-text);
  --wc-secondary-text: #ffffff;
  --wc-highlight: var(--brand-primary-bg);
  --wc-highlight-text: var(--on-primary);
  --wp-admin-theme-color: var(--brand-primary-bg);
  --wp-admin-theme-color--rgb: 92, 58, 18;
  --wp--preset--color--primary: var(--brand-primary-bg);
  --wp--preset--color--contrast: var(--dark-text);
  --wp--preset--color--base: #ffffff;
}

body.woocommerce-cart .wc-block-cart,
body.woocommerce-checkout .wc-block-checkout,
body.woocommerce-checkout .wp-block-woocommerce-checkout,
.ifil-wc-page .wc-block-cart,
.ifil-wc-page .wc-block-checkout,
.ifil-wc-page .wp-block-woocommerce-checkout,
.ifil-wc-blocks .wc-block-cart,
.ifil-wc-blocks .wc-block-checkout,
.ifil-wc-blocks .wp-block-woocommerce-checkout {
  width: 100%;
  min-width: 0;
  font-family: var(--font-body);
  color: var(--dark-text);
}

/* Tekst / linki / ceny — zawsze czytelne na białym */
body.woocommerce-cart .wc-block-components-product-name,
body.woocommerce-checkout .wc-block-components-product-name,
.ifil-wc-page .wc-block-components-product-name,
.ifil-wc-blocks .wc-block-components-product-name,
body.woocommerce-cart a.wc-block-components-product-name,
body.woocommerce-checkout a.wc-block-components-product-name,
.ifil-wc-page a.wc-block-components-product-name {
  color: var(--dark-text) !important;
  text-decoration: none !important;
}

body.woocommerce-cart .wc-block-components-product-price,
body.woocommerce-checkout .wc-block-components-product-price,
body.woocommerce-cart .wc-block-components-product-price *,
body.woocommerce-checkout .wc-block-components-product-price *,
body.woocommerce-cart .wc-block-formatted-money-amount,
body.woocommerce-checkout .wc-block-formatted-money-amount,
body.woocommerce-cart .wc-block-components-totals-item__value,
body.woocommerce-checkout .wc-block-components-totals-item__value,
body.woocommerce-cart .wc-block-components-totals-item__label,
body.woocommerce-checkout .wc-block-components-totals-item__label,
body.woocommerce-cart .wc-block-components-order-summary-item__individual-prices,
body.woocommerce-checkout .wc-block-components-order-summary-item__individual-prices,
.ifil-wc-page .wc-block-components-product-price,
.ifil-wc-page .wc-block-formatted-money-amount,
.ifil-wc-page .wc-block-components-totals-item__value,
.ifil-wc-page .wc-block-components-totals-item__label {
  color: var(--dark-text) !important;
}

body.woocommerce-cart .wc-block-components-checkout-step__title,
body.woocommerce-checkout .wc-block-components-checkout-step__title,
body.woocommerce-cart .wc-block-components-title,
body.woocommerce-checkout .wc-block-components-title,
.ifil-wc-page .wc-block-components-checkout-step__title,
.ifil-wc-page .wc-block-components-title {
  color: var(--dark-text) !important;
}

body.woocommerce-cart .wc-block-components-checkout-step__description,
body.woocommerce-checkout .wc-block-components-checkout-step__description,
body.woocommerce-cart .wc-block-components-product-metadata,
body.woocommerce-checkout .wc-block-components-product-metadata,
.ifil-wc-page .wc-block-components-checkout-step__description {
  color: #555 !important;
}

body.woocommerce-cart .wc-block-components-button:not(.wc-block-components-checkout-place-order-button):not(.wc-block-cart__submit-button):not(.is-style-primary),
body.woocommerce-checkout .wc-block-components-button:not(.wc-block-components-checkout-place-order-button):not(.wc-block-cart__submit-button):not(.is-style-primary),
.ifil-wc-page .wc-block-components-button.is-link,
body.woocommerce-cart .wc-block-components-button.is-link,
body.woocommerce-checkout .wc-block-components-button.is-link {
  color: var(--brand-primary-text) !important;
  background: transparent !important;
}

/* Primary CTA — nigdy białe na białym */
body.woocommerce-cart .wc-block-cart__submit-container .wc-block-components-button,
body.woocommerce-checkout .wc-block-checkout__actions .wc-block-components-button,
.ifil-wc-page .wc-block-cart__submit-container .wc-block-components-button,
.ifil-wc-page .wc-block-checkout__actions .wc-block-components-button {
  background: var(--brand-primary-bg) !important;
  background-color: var(--brand-primary-bg) !important;
  color: #ffffff !important;
}

body.woocommerce-cart .wc-block-cart__submit-container .wc-block-components-button *,
body.woocommerce-checkout .wc-block-checkout__actions .wc-block-components-button *,
.ifil-wc-page .wc-block-cart__submit-container .wc-block-components-button *,
.ifil-wc-page .wc-block-checkout__actions .wc-block-components-button * {
  color: #ffffff !important;
}

body.woocommerce-cart .wc-block-components-text-input input,
body.woocommerce-checkout .wc-block-components-text-input input,
body.woocommerce-cart .wc-block-components-textarea textarea,
body.woocommerce-checkout .wc-block-components-textarea textarea,
body.woocommerce-cart .wc-blocks-components-select .components-combobox-control__input,
body.woocommerce-checkout .wc-blocks-components-select .components-combobox-control__input,
.ifil-wc-page .wc-block-components-text-input input,
.ifil-wc-page .wc-block-components-textarea textarea {
  color: var(--dark-text) !important;
  background: #fff !important;
}

body.woocommerce-cart .wc-block-components-text-input label,
body.woocommerce-checkout .wc-block-components-text-input label,
body.woocommerce-cart .wc-block-components-combobox label,
body.woocommerce-checkout .wc-block-components-combobox label,
.ifil-wc-page .wc-block-components-text-input label {
  color: #555 !important;
}

body.woocommerce-cart .wc-block-components-radio-control__label,
body.woocommerce-checkout .wc-block-components-radio-control__label,
body.woocommerce-cart .wc-block-components-radio-control__description,
body.woocommerce-checkout .wc-block-components-radio-control__description,
.ifil-wc-page .wc-block-components-radio-control__label {
  color: var(--dark-text) !important;
}

body.woocommerce-cart .wc-block-components-checkbox__label,
body.woocommerce-checkout .wc-block-components-checkbox__label,
.ifil-wc-page .wc-block-components-checkbox__label {
  color: var(--dark-text) !important;
}

/* ---------------------------------------------------------------- layout checkout (nie koszyk — zostawiamy layout WC) */
body.woocommerce-checkout .wc-block-components-sidebar-layout,
.ifil-wc-blocks--checkout .wc-block-components-sidebar-layout {
  display: flex !important;
  flex-wrap: wrap !important;
  gap: 1.5rem;
  align-items: flex-start;
  margin-bottom: 0 !important;
}

@media (min-width: 992px) {
  body.woocommerce-checkout .wc-block-components-main,
  .ifil-wc-blocks--checkout .wc-block-components-main {
    flex: 1 1 calc(65% - 0.75rem) !important;
    width: calc(65% - 0.75rem) !important;
    max-width: calc(65% - 0.75rem) !important;
    padding: 0 !important;
  }

  body.woocommerce-checkout .wc-block-components-sidebar,
  body.woocommerce-checkout .wc-block-checkout__sidebar,
  .ifil-wc-blocks--checkout .wc-block-components-sidebar {
    flex: 1 1 calc(35% - 0.75rem) !important;
    width: calc(35% - 0.75rem) !important;
    max-width: calc(35% - 0.75rem) !important;
    padding: 0 !important;
    display: block !important;
    visibility: visible !important;
  }
}

/* ---------------------------------------------------------------- lewa kolumna — tylko kroki, bez nadrzędnego boxa */
body.woocommerce-checkout .wc-block-components-main > .wc-block-components-form,
body.woocommerce-checkout .wc-block-components-main > .wp-block-woocommerce-checkout-fields-block,
.ifil-wc-page .wc-block-components-main > .wc-block-components-form,
.ifil-wc-page .wc-block-components-main > .wp-block-woocommerce-checkout-fields-block,
.ifil-wc-blocks .wc-block-components-main > .wc-block-components-form,
.ifil-wc-blocks .wc-block-components-main > .wp-block-woocommerce-checkout-fields-block {
  padding: 0 !important;
  border: none !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

body.woocommerce-checkout .wc-block-checkout__form,
.ifil-wc-page .wc-block-checkout__form,
.ifil-wc-blocks .wc-block-checkout__form,
body.woocommerce-checkout .wp-block-woocommerce-checkout-fields-block,
.ifil-wc-page .wp-block-woocommerce-checkout-fields-block,
.ifil-wc-blocks .wp-block-woocommerce-checkout-fields-block {
  display: flex !important;
  flex-direction: column !important;
  gap: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
}

/* Wyzeruj domyślne marginesy WC — odstępy tylko między boxami kroków */
body.woocommerce-checkout .wc-block-checkout__form > *,
.ifil-wc-page .wc-block-checkout__form > *,
.ifil-wc-blocks .wc-block-checkout__form > *,
body.woocommerce-checkout .wp-block-woocommerce-checkout-fields-block > *,
.ifil-wc-page .wp-block-woocommerce-checkout-fields-block > *,
.ifil-wc-blocks .wp-block-woocommerce-checkout-fields-block > * {
  margin: 0 !important;
}

body.woocommerce-checkout .wp-block-woocommerce-checkout-fields-block > [class*="wp-block-woocommerce-checkout"],
.ifil-wc-page .wp-block-woocommerce-checkout-fields-block > [class*="wp-block-woocommerce-checkout"],
.ifil-wc-blocks .wp-block-woocommerce-checkout-fields-block > [class*="wp-block-woocommerce-checkout"] {
  margin: 0 !important;
  padding: 0 !important;
  border: none !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

/* Brak odstępu nad Contact Information — ukryj separator / pusty express payment */
body.woocommerce-checkout .wc-block-components-express-payment-continue-rule,
.ifil-wc-page .wc-block-components-express-payment-continue-rule,
.ifil-wc-blocks .wc-block-components-express-payment-continue-rule {
  display: none !important;
  margin: 0 !important;
  padding: 0 !important;
  height: 0 !important;
  overflow: hidden !important;
}

body.woocommerce-checkout .wp-block-woocommerce-checkout-express-payment-block:empty,
body.woocommerce-checkout .wp-block-woocommerce-checkout-express-payment-block:not(:has(.wc-block-components-express-payment)),
.ifil-wc-page .wp-block-woocommerce-checkout-express-payment-block:empty,
.ifil-wc-blocks .wp-block-woocommerce-checkout-express-payment-block:empty {
  display: none !important;
  margin: 0 !important;
  padding: 0 !important;
  height: 0 !important;
}

body.woocommerce-checkout .wp-block-woocommerce-checkout-contact-information-block,
.ifil-wc-page .wp-block-woocommerce-checkout-contact-information-block,
.ifil-wc-blocks .wp-block-woocommerce-checkout-contact-information-block {
  margin-top: 0 !important;
  padding-top: 0 !important;
}

/* Równy odstęp Y między Contact / Billing / Payment */
body.woocommerce-checkout .wc-block-components-main .wc-block-components-checkout-step,
.ifil-wc-page .wc-block-components-main .wc-block-components-checkout-step,
.ifil-wc-blocks .wc-block-components-main .wc-block-components-checkout-step {
  margin: 0 0 var(--ifil-checkout-gap) !important;
  padding: 1.25rem !important;
  border: 1px solid var(--panel-border) !important;
  border-radius: var(--ifil-wc-panel-radius) !important;
  background: #fff !important;
  box-shadow: var(--ifil-wc-panel-shadow) !important;
}

body.woocommerce-checkout .wc-block-components-main .wc-block-components-checkout-step:last-child,
.ifil-wc-page .wc-block-components-main .wc-block-components-checkout-step:last-child,
.ifil-wc-blocks .wc-block-components-main .wc-block-components-checkout-step:last-child {
  margin-bottom: 0 !important;
}

/* Gdy box jest w wrapperze bloku WP — odstęp na wrapperze, nie podwójnie na stepie */
body.woocommerce-checkout .wp-block-woocommerce-checkout-fields-block > [class*="wp-block-woocommerce-checkout"]:has(.wc-block-components-checkout-step),
.ifil-wc-page .wp-block-woocommerce-checkout-fields-block > [class*="wp-block-woocommerce-checkout"]:has(.wc-block-components-checkout-step),
.ifil-wc-blocks .wp-block-woocommerce-checkout-fields-block > [class*="wp-block-woocommerce-checkout"]:has(.wc-block-components-checkout-step) {
  margin: 0 0 var(--ifil-checkout-gap) !important;
}

body.woocommerce-checkout .wp-block-woocommerce-checkout-fields-block > [class*="wp-block-woocommerce-checkout"]:has(.wc-block-components-checkout-step) .wc-block-components-checkout-step,
.ifil-wc-page .wp-block-woocommerce-checkout-fields-block > [class*="wp-block-woocommerce-checkout"]:has(.wc-block-components-checkout-step) .wc-block-components-checkout-step,
.ifil-wc-blocks .wp-block-woocommerce-checkout-fields-block > [class*="wp-block-woocommerce-checkout"]:has(.wc-block-components-checkout-step) .wc-block-components-checkout-step {
  margin-bottom: 0 !important;
}

body.woocommerce-checkout .wp-block-woocommerce-checkout-fields-block > [class*="wp-block-woocommerce-checkout"]:has(.wc-block-components-checkout-step):last-child,
.ifil-wc-page .wp-block-woocommerce-checkout-fields-block > [class*="wp-block-woocommerce-checkout"]:has(.wc-block-components-checkout-step):last-child,
.ifil-wc-blocks .wp-block-woocommerce-checkout-fields-block > [class*="wp-block-woocommerce-checkout"]:has(.wc-block-components-checkout-step):last-child {
  margin-bottom: 0 !important;
}

body.woocommerce-checkout .wc-block-components-checkout-step__title,
.ifil-wc-page .wc-block-components-checkout-step__title,
.ifil-wc-blocks .wc-block-components-checkout-step__title {
  margin: 0 0 0.75rem !important;
  font-family: var(--font-heading) !important;
  font-size: 1rem !important;
  font-weight: 600 !important;
  letter-spacing: 0.04em !important;
  text-transform: uppercase !important;
  color: var(--brand-primary-text) !important;
}

body.woocommerce-checkout .wc-block-components-checkout-step__heading-container,
.ifil-wc-page .wc-block-components-checkout-step__heading-container,
.ifil-wc-blocks .wc-block-components-checkout-step__heading-container {
  margin-bottom: 0.75rem !important;
  gap: 0.5rem !important;
}

body.woocommerce-checkout .wc-block-components-checkout-step__description,
.ifil-wc-page .wc-block-components-checkout-step__description {
  color: #666 !important;
  font-size: 0.875rem !important;
  margin: 0 0 0.75rem !important;
}

/* ---------------------------------------------------------------- order summary — sidebar */
body.woocommerce-checkout .wc-block-components-sidebar,
body.woocommerce-checkout .wc-block-checkout__sidebar,
.ifil-wc-page .wc-block-components-sidebar,
.ifil-wc-blocks .wc-block-components-sidebar {
  padding: 1.25rem !important;
  border: 1px solid var(--panel-border) !important;
  border-radius: var(--ifil-wc-panel-radius) !important;
  background: #fff !important;
  box-shadow: var(--ifil-wc-panel-shadow) !important;
}

body.woocommerce-checkout .wc-block-components-sidebar .wp-block-woocommerce-checkout-totals-block,
body.woocommerce-checkout .wc-block-components-sidebar .wp-block-woocommerce-checkout-order-summary-block,
.ifil-wc-page .wc-block-components-sidebar .wp-block-woocommerce-checkout-totals-block,
.ifil-wc-page .wc-block-components-sidebar .wp-block-woocommerce-checkout-order-summary-block,
.ifil-wc-blocks .wc-block-components-sidebar .wp-block-woocommerce-checkout-totals-block,
.ifil-wc-blocks .wc-block-components-sidebar .wp-block-woocommerce-checkout-order-summary-block {
  padding: 0 !important;
  border: none !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

body.woocommerce-checkout .wc-block-components-sidebar .checkout-order-summary-block-fill-wrapper,
.ifil-wc-page .wc-block-components-sidebar .checkout-order-summary-block-fill-wrapper {
  display: block !important;
  overflow: visible !important;
  width: 100% !important;
}

body.woocommerce-checkout .wc-block-components-sidebar .wp-block-woocommerce-checkout-order-summary-totals-block,
.ifil-wc-page .wc-block-components-sidebar .wp-block-woocommerce-checkout-order-summary-totals-block,
.ifil-wc-blocks .wc-block-components-sidebar .wp-block-woocommerce-checkout-order-summary-totals-block {
  margin-top: 0.75rem !important;
  padding: 0.75rem 0 0 !important;
  border-top: 1px solid var(--panel-border) !important;
}

body.woocommerce-checkout .wc-block-components-sidebar .wc-block-components-totals-wrapper,
.ifil-wc-page .wc-block-components-sidebar .wc-block-components-totals-wrapper,
.ifil-wc-blocks .wc-block-components-sidebar .wc-block-components-totals-wrapper {
  padding: 0 !important;
  margin: 0 !important;
  border: none !important;
}

body.woocommerce-checkout .wc-block-components-sidebar .wc-block-components-totals-wrapper.slot-wrapper > * > *,
.ifil-wc-page .wc-block-components-sidebar .wc-block-components-totals-wrapper.slot-wrapper > * > *,
.ifil-wc-blocks .wc-block-components-sidebar .wc-block-components-totals-wrapper.slot-wrapper > * > * {
  padding: 0 !important;
}

body.woocommerce-checkout .wc-block-components-sidebar .wc-block-components-totals-coupon,
.ifil-wc-page .wc-block-components-sidebar .wc-block-components-totals-coupon,
.ifil-wc-blocks .wc-block-components-sidebar .wc-block-components-totals-coupon {
  padding: 0 !important;
  margin: 0 !important;
}

body.woocommerce-checkout .wc-block-components-sidebar .wc-block-components-totals-coupon .wc-block-components-panel__button,
.ifil-wc-page .wc-block-components-sidebar .wc-block-components-totals-coupon .wc-block-components-panel__button,
.ifil-wc-blocks .wc-block-components-sidebar .wc-block-components-totals-coupon .wc-block-components-panel__button {
  padding: 0 0 0.375rem !important;
  margin: 0 !important;
}

body.woocommerce-checkout .wc-block-components-sidebar .wc-block-components-totals-coupon__content,
.ifil-wc-page .wc-block-components-sidebar .wc-block-components-totals-coupon__content,
.ifil-wc-blocks .wc-block-components-sidebar .wc-block-components-totals-coupon__content {
  gap: 0.375rem !important;
}

body.woocommerce-checkout .wc-block-components-sidebar .wc-block-components-totals-coupon__form,
.ifil-wc-page .wc-block-components-sidebar .wc-block-components-totals-coupon__form,
.ifil-wc-blocks .wc-block-components-sidebar .wc-block-components-totals-coupon__form {
  gap: 0.5rem !important;
  margin: 0 !important;
}

body.woocommerce-checkout .wc-block-components-sidebar .wc-block-components-totals-item,
.ifil-wc-page .wc-block-components-sidebar .wc-block-components-totals-item,
.ifil-wc-blocks .wc-block-components-sidebar .wc-block-components-totals-item {
  padding: 0.5rem 0 !important;
  margin: 0 !important;
}

body.woocommerce-checkout .wc-block-components-sidebar .wc-block-components-totals-footer-item,
.ifil-wc-page .wc-block-components-sidebar .wc-block-components-totals-footer-item,
.ifil-wc-blocks .wc-block-components-sidebar .wc-block-components-totals-footer-item {
  padding: 0.5rem 0 0 !important;
  margin: 0 !important;
}

body.woocommerce-checkout .wp-block-woocommerce-checkout-order-summary-block .wc-block-components-checkout-order-summary__content,
.ifil-wc-page .wp-block-woocommerce-checkout-order-summary-block .wc-block-components-checkout-order-summary__content,
.ifil-wc-blocks .wp-block-woocommerce-checkout-order-summary-block .wc-block-components-checkout-order-summary__content {
  display: block !important;
  border-bottom: none !important;
}

body.woocommerce-checkout .wc-block-components-sidebar .wc-block-components-checkout-order-summary__title,
.ifil-wc-page .wc-block-components-sidebar .wc-block-components-checkout-order-summary__title,
.ifil-wc-blocks .wc-block-components-sidebar .wc-block-components-checkout-order-summary__title {
  display: flex !important;
  align-items: center !important;
  justify-content: flex-start !important;
  width: 100% !important;
  border: none !important;
  padding: 0 0 0.75rem !important;
  margin: 0 !important;
  text-align: left !important;
}

body.woocommerce-checkout .wc-block-components-sidebar .wc-block-components-checkout-order-summary__title-text,
.ifil-wc-page .wc-block-components-sidebar .wc-block-components-checkout-order-summary__title-text,
.ifil-wc-blocks .wc-block-components-sidebar .wc-block-components-checkout-order-summary__title-text {
  flex: 0 1 auto !important;
  margin: 0 !important;
  padding: 0 !important;
  text-align: left !important;
}

@media (min-width: 992px) {
  body.woocommerce-checkout .wc-block-components-sidebar .wc-block-components-checkout-order-summary__title,
  .ifil-wc-page .wc-block-components-sidebar .wc-block-components-checkout-order-summary__title {
    cursor: default !important;
    pointer-events: none !important;
  }

  body.woocommerce-checkout .wc-block-components-sidebar .wc-block-components-checkout-order-summary__title-icon,
  body.woocommerce-checkout .wc-block-components-sidebar .wc-block-components-checkout-order-summary__title-price,
  .ifil-wc-page .wc-block-components-sidebar .wc-block-components-checkout-order-summary__title-icon,
  .ifil-wc-page .wc-block-components-sidebar .wc-block-components-checkout-order-summary__title-price {
    display: none !important;
  }
}

body.woocommerce-checkout .wc-block-components-order-summary,
.ifil-wc-page .wc-block-components-order-summary,
.ifil-wc-blocks .wc-block-components-order-summary {
  padding: 0 !important;
}

body.woocommerce-checkout .wc-block-components-order-summary .wc-block-components-order-summary__content,
.ifil-wc-page .wc-block-components-order-summary .wc-block-components-order-summary__content,
.ifil-wc-blocks .wc-block-components-order-summary .wc-block-components-order-summary__content {
  display: block !important;
  width: 100% !important;
}

body.woocommerce-checkout .wc-block-components-order-summary .wc-block-components-order-summary-item,
.ifil-wc-page .wc-block-components-order-summary .wc-block-components-order-summary-item,
.ifil-wc-blocks .wc-block-components-order-summary .wc-block-components-order-summary-item {
  display: flex !important;
  align-items: flex-start !important;
  width: 100% !important;
  min-width: 0 !important;
}

body.woocommerce-checkout .wc-block-components-order-summary-item__image,
.ifil-wc-page .wc-block-components-order-summary-item__image,
.ifil-wc-blocks .wc-block-components-order-summary-item__image {
  flex: 0 0 48px !important;
  margin-top: 0 !important;
  padding-bottom: 0 !important;
}

body.woocommerce-checkout .wc-block-components-order-summary-item__description,
.ifil-wc-page .wc-block-components-order-summary-item__description,
.ifil-wc-blocks .wc-block-components-order-summary-item__description {
  flex: 1 1 auto !important;
  min-width: 0 !important;
  padding: 0 0.5rem 0.5rem 0.75rem !important;
}

body.woocommerce-checkout .wc-block-components-order-summary-item__total-price,
.ifil-wc-page .wc-block-components-order-summary-item__total-price,
.ifil-wc-blocks .wc-block-components-order-summary-item__total-price {
  flex: 0 0 auto !important;
  margin-left: auto !important;
  padding: 0 0 0.5rem !important;
  text-align: right !important;
  white-space: nowrap !important;
}

body.woocommerce-checkout .wc-block-components-order-summary .wc-block-components-order-summary-item,
.ifil-wc-page .wc-block-components-order-summary .wc-block-components-order-summary-item,
.ifil-wc-blocks .wc-block-components-order-summary .wc-block-components-order-summary-item {
  padding-bottom: 0.5rem !important;
}

body.woocommerce-checkout .wc-block-components-order-summary .wc-block-components-totals-item,
.ifil-wc-page .wc-block-components-order-summary .wc-block-components-totals-item,
.ifil-wc-blocks .wc-block-components-order-summary .wc-block-components-totals-item {
  display: flex !important;
  flex-wrap: nowrap !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 0.75rem !important;
  width: 100% !important;
  box-sizing: border-box !important;
}

body.woocommerce-checkout .wc-block-components-order-summary .wc-block-components-totals-item__label,
.ifil-wc-page .wc-block-components-order-summary .wc-block-components-totals-item__label,
.ifil-wc-blocks .wc-block-components-order-summary .wc-block-components-totals-item__label {
  flex: 1 1 auto !important;
  min-width: 0 !important;
}

body.woocommerce-checkout .wc-block-components-order-summary .wc-block-components-totals-item__value,
.ifil-wc-page .wc-block-components-order-summary .wc-block-components-totals-item__value,
.ifil-wc-blocks .wc-block-components-order-summary .wc-block-components-totals-item__value {
  flex: 0 0 auto !important;
  margin-left: auto !important;
  text-align: right !important;
  white-space: nowrap !important;
}

body.woocommerce-checkout .wc-block-components-order-summary .wc-block-components-panel__button,
body.woocommerce-checkout .wc-block-components-checkout-order-summary__title-text,
.ifil-wc-page .wc-block-components-order-summary .wc-block-components-panel__button {
  font-family: var(--font-heading) !important;
  font-size: 0.9375rem !important;
  font-weight: 600 !important;
  color: var(--dark-text) !important;
}

body.woocommerce-checkout .wc-block-components-order-summary-item__description,
body.woocommerce-checkout .wc-block-components-order-summary-item__quantity,
body.woocommerce-checkout .wc-block-components-product-name,
.ifil-wc-page .wc-block-components-product-name {
  color: var(--dark-text) !important;
  font-size: 0.875rem !important;
}

body.woocommerce-checkout .wc-block-components-order-summary-item__total-price,
body.woocommerce-checkout .wc-block-components-formatted-money-amount,
.ifil-wc-page .wc-block-components-formatted-money-amount {
  color: var(--dark-text) !important;
  font-weight: 600 !important;
}

body.woocommerce-checkout .wc-block-components-order-summary .wc-block-components-totals-item,
body.woocommerce-checkout .wc-block-components-order-summary .wc-block-components-panel,
.ifil-wc-page .wc-block-components-order-summary .wc-block-components-totals-item {
  border-color: var(--panel-border) !important;
}

body.woocommerce-checkout .wc-block-components-totals-footer-item,
.ifil-wc-page .wc-block-components-totals-footer-item {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 0.75rem !important;
  padding: 0.5rem 0 0 !important;
  margin: 0 !important;
  border-top: 1px solid var(--panel-border) !important;
  font-size: 1rem !important;
  font-weight: 700 !important;
}

body.woocommerce-checkout .wc-block-components-totals-footer-item .wc-block-components-formatted-money-amount,
.ifil-wc-page .wc-block-components-totals-footer-item .wc-block-components-formatted-money-amount {
  color: var(--brand-primary-text) !important;
  font-size: 1.125rem !important;
}

/* ---------------------------------------------------------------- terms / GDPR + place order */
body.woocommerce-checkout .wp-block-woocommerce-checkout-terms-block,
body.woocommerce-checkout .wc-block-checkout__terms,
.ifil-wc-page .wp-block-woocommerce-checkout-terms-block,
.ifil-wc-page .wc-block-checkout__terms,
.ifil-wc-blocks .wp-block-woocommerce-checkout-terms-block,
.ifil-wc-blocks .wc-block-checkout__terms {
  display: block !important;
  margin: 0 0 1rem !important;
  padding: 0 !important;
  line-height: 1.5 !important;
}

body.woocommerce-checkout .wc-block-checkout__terms.wc-block-checkout__terms--with-separator,
.ifil-wc-page .wc-block-checkout__terms.wc-block-checkout__terms--with-separator,
.ifil-wc-blocks .wc-block-checkout__terms.wc-block-checkout__terms--with-separator {
  margin-top: 0 !important;
  padding-top: 1rem !important;
  border-top: 1px solid var(--panel-border) !important;
}

body.woocommerce-checkout .wp-block-woocommerce-checkout-actions-block,
body.woocommerce-checkout .wc-block-checkout__actions,
.ifil-wc-page .wp-block-woocommerce-checkout-actions-block,
.ifil-wc-page .wc-block-checkout__actions,
.ifil-wc-blocks .wp-block-woocommerce-checkout-actions-block,
.ifil-wc-blocks .wc-block-checkout__actions {
  display: block !important;
  margin: 0 !important;
  padding: 0 !important;
}

body.woocommerce-checkout .wc-block-components-checkout-place-order-button,
.ifil-wc-page .wc-block-components-checkout-place-order-button,
.ifil-wc-blocks .wc-block-components-checkout-place-order-button {
  margin-top: 0 !important;
}

/* ---------------------------------------------------------------- buttons */
body.woocommerce-cart .wc-block-cart__submit-button.wc-block-components-button,
body.woocommerce-checkout .wc-block-components-checkout-place-order-button.wc-block-components-button,
.ifil-wc-page .wc-block-cart__submit-button.wc-block-components-button,
.ifil-wc-page .wc-block-components-checkout-place-order-button.wc-block-components-button,
.ifil-wc-blocks .wc-block-cart__submit-button.wc-block-components-button,
.ifil-wc-blocks .wc-block-components-checkout-place-order-button.wc-block-components-button,
body.woocommerce-cart .wc-block-cart__submit-button.wp-element-button,
body.woocommerce-checkout .wc-block-components-checkout-place-order-button.wp-element-button,
.ifil-wc-page .wc-block-cart__submit-button.wp-element-button,
.ifil-wc-page .wc-block-components-checkout-place-order-button.wp-element-button {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  position: relative !important;
  isolation: isolate;
  overflow: hidden;
  width: 100%;
  min-height: 52px !important;
  height: auto !important;
  padding: 0 1.5rem !important;
  border: none !important;
  border-radius: var(--btn-radius) !important;
  background: var(--brand-primary-bg) !important;
  background-color: var(--brand-primary-bg) !important;
  background-image: none !important;
  color: #ffffff !important;
  font-family: var(--font-body) !important;
  font-size: 0.9375rem !important;
  font-weight: 600 !important;
  line-height: 1.2 !important;
  text-align: center !important;
  text-decoration: none !important;
  box-shadow: var(--btn-primary-shadow) !important;
  transition: transform 0.45s var(--btn-ease), box-shadow 0.45s var(--btn-ease), background-color 0.3s ease !important;
}

body.woocommerce-cart .wc-block-cart__submit-button.wc-block-components-button .wc-block-components-button__text,
body.woocommerce-checkout .wc-block-components-checkout-place-order-button .wc-block-components-button__text,
.ifil-wc-page .wc-block-cart__submit-button .wc-block-components-button__text,
.ifil-wc-page .wc-block-components-checkout-place-order-button .wc-block-components-button__text {
  display: inline !important;
  margin: 0 !important;
  padding: 0 !important;
  line-height: inherit !important;
  color: #ffffff !important;
}

body.woocommerce-cart .wc-block-cart__submit-button.wc-block-components-button *,
body.woocommerce-checkout .wc-block-components-checkout-place-order-button * {
  color: #ffffff !important;
}

body.woocommerce-cart .wc-block-cart__submit-button.wc-block-components-button:hover,
body.woocommerce-cart .wc-block-cart__submit-button.wc-block-components-button:focus,
body.woocommerce-checkout .wc-block-components-checkout-place-order-button.wc-block-components-button:hover,
body.woocommerce-checkout .wc-block-components-checkout-place-order-button.wc-block-components-button:focus,
.ifil-wc-page .wc-block-cart__submit-button.wc-block-components-button:hover,
.ifil-wc-page .wc-block-cart__submit-button.wc-block-components-button:focus,
.ifil-wc-page .wc-block-components-checkout-place-order-button.wc-block-components-button:hover,
.ifil-wc-page .wc-block-components-checkout-place-order-button.wc-block-components-button:focus,
.ifil-wc-blocks .wc-block-cart__submit-button.wc-block-components-button:hover,
.ifil-wc-blocks .wc-block-cart__submit-button.wc-block-components-button:focus,
.ifil-wc-blocks .wc-block-components-checkout-place-order-button.wc-block-components-button:hover,
.ifil-wc-blocks .wc-block-components-checkout-place-order-button.wc-block-components-button:focus {
  color: #ffffff !important;
  background: var(--btn-primary-bg-hov) !important;
  background-color: var(--btn-primary-bg-hov) !important;
  background-image: none !important;
  transform: translateY(-1px);
  box-shadow: var(--btn-primary-shadow-hover) !important;
}

body.woocommerce-cart .wc-block-components-totals-coupon__button.wc-block-components-button,
body.woocommerce-checkout .wc-block-components-totals-coupon__button.wc-block-components-button,
.ifil-wc-page .wc-block-components-totals-coupon__button.wc-block-components-button {
  min-height: 48px !important;
  padding: 0.75rem 1.125rem !important;
  border: 2px solid var(--brand-primary-bg) !important;
  border-radius: var(--btn-radius) !important;
  background: transparent !important;
  color: var(--brand-primary-text) !important;
  font-weight: 600 !important;
  box-shadow: none !important;
}

/* ---------------------------------------------------------------- inputs + select — floating labels (domyślne WC Blocks) */
body.woocommerce-checkout .wc-block-components-totals-coupon__form .wc-block-components-text-input,
body.woocommerce-cart .wc-block-components-totals-coupon__form .wc-block-components-text-input,
.ifil-wc-page .wc-block-components-totals-coupon__form .wc-block-components-text-input,
.ifil-wc-blocks .wc-block-components-totals-coupon__form .wc-block-components-text-input {
  margin-top: 0 !important;
  margin-bottom: 0 !important;
}

body.woocommerce-cart .wc-block-components-text-input label,
body.woocommerce-checkout .wc-block-components-text-input label,
.ifil-wc-page .wc-block-components-text-input label,
.ifil-wc-blocks .wc-block-components-text-input label {
  color: #666 !important;
  font-size: 0.9375rem !important;
  font-weight: 400 !important;
}

body.woocommerce-cart .wc-block-components-text-input.is-active label,
body.woocommerce-checkout .wc-block-components-text-input.is-active label,
.ifil-wc-page .wc-block-components-text-input.is-active label,
.ifil-wc-blocks .wc-block-components-text-input.is-active label {
  color: #666 !important;
  font-size: 0.8125rem !important;
}

body.woocommerce-cart .wc-block-components-text-input input,
body.woocommerce-checkout .wc-block-components-text-input input,
.ifil-wc-page .wc-block-components-text-input input,
.ifil-wc-blocks .wc-block-components-text-input input {
  height: 50px !important;
  min-height: 50px !important;
  padding: 16px 12px !important;
  border: 1px solid var(--field-border) !important;
  border-radius: var(--field-radius) !important;
  background: var(--field-bg) !important;
  color: var(--field-text) !important;
  font-family: var(--font-body) !important;
  font-size: 0.9375rem !important;
  line-height: 25px !important;
  box-shadow: none !important;
}

body.woocommerce-cart .wc-block-components-text-input.is-active input,
body.woocommerce-checkout .wc-block-components-text-input.is-active input,
.ifil-wc-page .wc-block-components-text-input.is-active input,
.ifil-wc-blocks .wc-block-components-text-input.is-active input {
  padding: 24px 11px 8px !important;
}

body.woocommerce-cart .wc-block-components-text-input input:focus,
body.woocommerce-checkout .wc-block-components-text-input input:focus,
body.woocommerce-checkout .wc-block-components-text-input.is-active input:focus,
.ifil-wc-page .wc-block-components-text-input input:focus,
.ifil-wc-blocks .wc-block-components-text-input input:focus {
  border-color: var(--brand-primary-bg) !important;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand-primary-bg) 18%, transparent) !important;
  outline: none !important;
}

body.woocommerce-checkout .wc-block-components-text-input.is-active input:focus,
.ifil-wc-blocks .wc-block-components-text-input.is-active input:focus {
  padding-top: 24px !important;
  padding-left: 11px !important;
}

body.woocommerce-checkout .wc-block-components-textarea textarea,
.ifil-wc-page .wc-block-components-textarea textarea {
  min-height: 96px !important;
  padding: 0.75rem 1rem !important;
  border: 1px solid var(--field-border) !important;
  border-radius: var(--field-radius) !important;
  background: var(--field-bg) !important;
  color: var(--field-text) !important;
  font-family: var(--font-body) !important;
  font-size: 0.9375rem !important;
  box-shadow: none !important;
}

body.woocommerce-checkout .wc-block-components-textarea textarea:focus,
.ifil-wc-page .wc-block-components-textarea textarea:focus {
  border-color: var(--brand-primary-bg) !important;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand-primary-bg) 18%, transparent) !important;
  outline: none !important;
}

body.woocommerce-checkout .wc-blocks-components-select .wc-blocks-components-select__label,
.ifil-wc-page .wc-blocks-components-select .wc-blocks-components-select__label,
.ifil-wc-blocks .wc-blocks-components-select .wc-blocks-components-select__label {
  color: #666 !important;
  font-size: 0.8125rem !important;
  font-weight: 500 !important;
}

body.woocommerce-checkout .wc-block-components-country-input,
body.woocommerce-checkout .wc-block-components-state-input,
body.woocommerce-checkout .wc-block-components-select-input,
.ifil-wc-page .wc-blocks-components-select {
  width: 100%;
}

body.woocommerce-checkout .wc-blocks-components-select .wc-blocks-components-select__container,
.ifil-wc-page .wc-blocks-components-select .wc-blocks-components-select__container {
  background: transparent !important;
}

body.woocommerce-checkout .wc-blocks-components-select .wc-blocks-components-select__select,
.ifil-wc-page .wc-blocks-components-select .wc-blocks-components-select__select {
  appearance: none !important;
  width: 100% !important;
  height: 50px !important;
  min-height: 50px !important;
  padding: 16px 2.75rem 0 12px !important;
  border: 1px solid var(--field-border) !important;
  border-radius: var(--field-radius) !important;
  background-color: var(--field-bg) !important;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--field-text) 50%),
    linear-gradient(135deg, var(--field-text) 50%, transparent 50%) !important;
  background-position: calc(100% - 1.25rem) calc(50% + 4px), calc(100% - 0.875rem) calc(50% + 4px) !important;
  background-size: 6px 6px, 6px 6px !important;
  background-repeat: no-repeat !important;
  color: var(--field-text) !important;
  font-family: var(--font-body) !important;
  font-size: 0.9375rem !important;
  line-height: 25px !important;
  box-shadow: none !important;
}

body.woocommerce-checkout .wc-blocks-components-select .wc-blocks-components-select__select:focus,
.ifil-wc-page .wc-blocks-components-select .wc-blocks-components-select__select:focus {
  border-color: var(--brand-primary-bg) !important;
  padding-left: 11px !important;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand-primary-bg) 18%, transparent) !important;
  outline: none !important;
}

body.woocommerce-checkout .wc-blocks-components-select .wc-blocks-components-select__expand,
.ifil-wc-page .wc-blocks-components-select .wc-blocks-components-select__expand {
  display: none !important;
}

/* ---------------------------------------------------------------- shipping / payment */
body.woocommerce-checkout .wc-block-components-radio-control__option,
.ifil-wc-page .wc-block-components-radio-control__option {
  padding: 0.875rem 1rem !important;
  margin-bottom: 0.5rem !important;
  border: 1px solid var(--panel-border) !important;
  border-radius: var(--field-radius) !important;
  background: #fff !important;
}

body.woocommerce-checkout .wc-block-components-radio-control__option-checked,
body.woocommerce-checkout .wc-block-components-radio-control__option:hover,
.ifil-wc-page .wc-block-components-radio-control__option-checked {
  border-color: rgba(92, 58, 18, 0.4) !important;
  box-shadow: 0 0 0 1px rgba(92, 58, 18, 0.1);
}

body.woocommerce-checkout .wc-block-components-radio-control__input:checked,
.ifil-wc-page .wc-block-components-radio-control__input:checked {
  accent-color: var(--brand-primary-bg);
}

/* ---------------------------------------------------------------- cart — layout domyślny WC Blocks (bez custom grid/flex) */
body.woocommerce-cart .wc-block-components-sidebar,
.ifil-wc-blocks--cart .wc-block-components-sidebar {
  padding: 1.25rem !important;
  border: 1px solid var(--panel-border) !important;
  border-radius: var(--ifil-wc-panel-radius) !important;
  background: #fff !important;
  box-shadow: var(--ifil-wc-panel-shadow) !important;
}

/* Checkout sidebar — nie pod nawigacją */
@media (min-width: 992px) {
  body.woocommerce-checkout .wc-block-components-sidebar,
  body.woocommerce-checkout .wc-block-checkout__sidebar,
  .ifil-wc-blocks--checkout .wc-block-components-sidebar {
    position: sticky !important;
    top: calc(var(--ifil-header-offset, 7rem) + 1.25rem) !important;
    align-self: start !important;
  }
}

body.woocommerce-cart .wc-block-components-quantity-selector,
.ifil-wc-blocks--cart .wc-block-components-quantity-selector {
  border: 1px solid rgba(92, 58, 18, 0.28) !important;
  border-radius: var(--btn-radius) !important;
  overflow: hidden;
}

body.woocommerce-cart .wc-block-components-quantity-selector__button,
.ifil-wc-blocks--cart .wc-block-components-quantity-selector__button {
  background: rgba(92, 58, 18, 0.1) !important;
  color: var(--brand-primary-text) !important;
}

body.woocommerce-cart .wc-block-components-notice-banner,
body.woocommerce-checkout .wc-block-components-notice-banner,
.ifil-wc-page .wc-block-components-notice-banner {
  border-radius: var(--field-radius) !important;
}

.ifil-cart-footer .btn {
  min-height: 48px;
  padding-top: 0.75rem;
  padding-bottom: 0.75rem;
}

@media (max-width: 991px) {
  body.woocommerce-checkout .wc-block-components-main,
  body.woocommerce-checkout .wc-block-components-sidebar,
  .ifil-wc-blocks--checkout .wc-block-components-main,
  .ifil-wc-blocks--checkout .wc-block-components-sidebar {
    width: 100% !important;
    max-width: 100% !important;
    flex: 1 1 100% !important;
  }
}
