:root {
  --wns-checkout--section-gap: 32px;
  --wns-checkout--panel-padding: 20px;
  --wns-checkout--panel-border: 1px solid color-mix(
    in srgb,
    var(--wp--preset--color--secondary) 55%,
    transparent
  );
  --wns-checkout--panel-radius: 12px;
  --wns-checkout--panel-bg: color-mix(
    in srgb,
    var(--wp--preset--color--secondary) 5%,
    var(--wp--preset--color--black)
  );
}

.woocommerce-checkout > .wp-site-blocks > header {
  border-bottom: 1px solid color-mix(
    in srgb,
    var(--wp--preset--color--secondary) 30%,
    transparent
  );
  background:
    radial-gradient(
      circle at 50% 0,
      color-mix(in srgb, var(--wp--preset--color--primary) 18%, transparent),
      transparent 72%
    ),
    var(--wp--preset--color--black);
}

.woocommerce-checkout > .wp-site-blocks > header .wp-block-group.alignwide {
  box-sizing: border-box;
  justify-content: center;
  width: calc(100% - 40px);
  max-width: var(--wns--page--max-width);
  min-height: 126px;
  margin-inline: auto;
  padding: 12px 0 !important;
}

.woocommerce-checkout .wns-checkout-brand {
  margin: 0;
  line-height: 0;
}

.woocommerce-checkout .wns-checkout-brand a {
  display: block;
  border-radius: 8px;
}

.woocommerce-checkout .wns-checkout-brand img {
  display: block;
  width: auto;
  height: 102px;
  object-fit: contain;
}

.woocommerce-checkout .wns-checkout-brand a:hover img {
  filter: brightness(1.08);
}

.woocommerce-checkout .wns-checkout-brand a:focus-visible {
  outline: 2px solid var(--wp--preset--color--secondary);
  outline-offset: 5px;
}

.woocommerce-checkout .wp-block-woocommerce-checkout {
  box-sizing: border-box;
  width: 100%;
  max-width: var(--wns--page--max-width);
  margin-inline: auto;
  padding-inline: var(--wns--page--padding);
}

.woocommerce-checkout .wp-block-woocommerce-checkout *,
.woocommerce-checkout .wp-block-woocommerce-checkout *::before,
.woocommerce-checkout .wp-block-woocommerce-checkout *::after {
  box-sizing: border-box;
}

.woocommerce-checkout .wc-block-components-checkout-step__title,
.woocommerce-checkout .wc-block-components-checkout-order-summary__title-text {
  color: var(--wp--preset--color--secondary);
  font-family: var(--wp--preset--font-family--playfair-display);
  font-style: italic;
}

.woocommerce-checkout .wc-block-components-checkout-step {
  margin-bottom: var(--wns-checkout--section-gap);
}

.woocommerce-checkout .wc-block-checkout__sidebar,
.woocommerce-checkout .wc-block-components-radio-control-accordion-option,
.woocommerce-checkout .wc-block-checkout__shipping-method-option {
  border-color: var(--wp--preset--color--secondary);
  border-radius: var(--wns-checkout--panel-radius);
  background: var(--wns-checkout--panel-bg);
}

.woocommerce-checkout .wc-block-components-radio-control--highlight-checked::after {
  border-color: color-mix(
    in srgb,
    var(--wp--preset--color--secondary) 58%,
    transparent
  ) !important;
  border-radius: var(--wns-checkout--panel-radius);
}

.woocommerce-checkout
  .wc-block-components-radio-control--highlight-checked
  .wc-block-components-radio-control-accordion-option::after,
.woocommerce-checkout
  .wc-block-components-radio-control--highlight-checked
  .wc-block-components-radio-control__option::after {
  background: color-mix(
    in srgb,
    var(--wp--preset--color--secondary) 28%,
    transparent
  );
}

.woocommerce-checkout
  .wc-block-components-radio-control-accordion-option--checked-option-highlighted,
.woocommerce-checkout
  .wc-block-components-radio-control__option--checked-option-highlighted {
  background: color-mix(
    in srgb,
    var(--wp--preset--color--primary) 17%,
    var(--wp--preset--color--black)
  );
  box-shadow: inset 0 0 0 1.5px var(--wp--preset--color--secondary) !important;
}

.woocommerce-checkout .wc-block-components-radio-control__label,
.woocommerce-checkout .wc-block-components-radio-control__secondary-label {
  color: var(--wp--preset--color--foreground);
}

.woocommerce-checkout .wc-block-components-text-input input,
.woocommerce-checkout .wc-blocks-components-select__select,
.woocommerce-checkout .wc-block-components-combobox input {
  width: 100% !important;
  min-width: 0 !important;
  max-width: none !important;
}

.woocommerce-checkout .wc-blocks-components-select,
.woocommerce-checkout .wc-blocks-components-select__container,
.woocommerce-checkout .wc-block-components-country-input {
  width: 100%;
  min-width: 0;
  max-width: none;
}

.woocommerce-checkout .wc-blocks-components-select__container {
  overflow: hidden;
  border: 1px solid var(--wp--preset--color--secondary) !important;
  border-radius: var(--wns-checkout--panel-radius) !important;
  background: var(--wp--preset--color--black) !important;
  box-shadow: var(--wns-common--input-shadow) !important;
  transition:
    border-color 160ms ease,
    box-shadow 160ms ease;
}

.woocommerce-checkout .wc-blocks-components-select__container:focus-within {
  border-color: var(--wp--preset--color--primary) !important;
  box-shadow: var(--wns-common--input-focus-shadow) !important;
}

.woocommerce-checkout .wc-blocks-components-select__select {
  min-height: 58px !important;
  padding: 20px 48px 8px 14px !important;
  color: var(--wp--preset--color--secondary) !important;
  border: 0 !important;
  border-radius: 0 !important;
  background-color: var(--wp--preset--color--black) !important;
  background-image: none !important;
  box-shadow: none !important;
  font-family: var(--wp--preset--font-family--playfair-display) !important;
  font-size: 18px !important;
}

.woocommerce-checkout .wc-blocks-components-select__label {
  z-index: 1;
  left: 14px;
  color: color-mix(in srgb, var(--wp--preset--color--foreground) 78%, transparent) !important;
  font-family: var(--wp--preset--font-family--poltawski-nowy);
}

.woocommerce-checkout .wc-blocks-components-select__expand {
  z-index: 1;
  right: 14px;
  color: var(--wp--preset--color--secondary);
  fill: currentColor;
  pointer-events: none;
}

.woocommerce-checkout .wc-block-components-text-input.has-error input,
.woocommerce-checkout .wc-blocks-components-select__container.has-error,
.woocommerce-checkout [aria-invalid="true"].wc-blocks-components-select__select {
  border-color: #ff6b6b !important;
}

.woocommerce-checkout .wc-block-components-validation-error {
  margin-top: 6px;
  color: #ff8a8a;
  font-size: 14px;
  line-height: 1.4;
}

.woocommerce-checkout .wc-block-components-validation-error p {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  margin: 0;
}

.woocommerce-checkout .wc-block-components-checkbox__input,
.woocommerce-checkout .wc-block-components-radio-control__input {
  appearance: none;
  flex: 0 0 auto;
  width: 22px !important;
  height: 22px !important;
  min-height: 22px !important;
  margin: 0 10px 0 0 !important;
  padding: 0 !important;
  box-sizing: border-box;
  border: 2px solid color-mix(in srgb, var(--wp--preset--color--secondary) 72%, var(--wp--preset--color--foreground));
  background-color: var(--wp--preset--color--black);
  box-shadow: none !important;
  cursor: pointer;
  transition:
    border-color 160ms ease,
    background-color 160ms ease,
    box-shadow 160ms ease;
}

.woocommerce-checkout .wc-block-components-checkbox__input {
  border-radius: 5px;
  border-color: color-mix(in srgb, var(--wp--preset--color--secondary) 72%, var(--wp--preset--color--foreground)) !important;
  background-color: var(--wp--preset--color--black) !important;
}

.woocommerce-checkout .wc-block-components-checkbox__input:checked {
  border-color: var(--wp--preset--color--secondary) !important;
  background-color: var(--wp--preset--color--primary) !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath fill='none' stroke='%23fff' stroke-linecap='round' stroke-linejoin='round' stroke-width='2.4' d='m4 10 4 4 8-9'/%3E%3C/svg%3E") !important;
  background-position: center;
  background-repeat: no-repeat;
  background-size: 18px;
}

.woocommerce-checkout .wc-block-components-checkbox__mark {
  color: var(--wp--preset--color--foreground) !important;
  pointer-events: none;
}

.woocommerce-checkout .wc-block-components-radio-control__input {
  border-radius: 50%;
}

.woocommerce-checkout .wc-block-components-radio-control__input:checked {
  border-color: var(--wp--preset--color--secondary);
  background:
    radial-gradient(circle, var(--wp--preset--color--secondary) 0 38%, transparent 42%),
    var(--wp--preset--color--black);
}

.woocommerce-checkout .wc-block-components-checkbox__input:hover,
.woocommerce-checkout .wc-block-components-radio-control__input:hover {
  border-color: var(--wp--preset--color--secondary);
}

.woocommerce-checkout .wc-block-components-checkbox__input:focus-visible,
.woocommerce-checkout .wc-block-components-radio-control__input:focus-visible {
  outline: 2px solid var(--wp--preset--color--secondary);
  outline-offset: 3px;
}

.woocommerce-checkout .wc-block-components-radio-control__option,
.woocommerce-checkout .wc-block-components-checkbox {
  transition:
    border-color 160ms ease,
    background-color 160ms ease;
}

.woocommerce-checkout .wc-block-components-radio-control__option:has(.wc-block-components-radio-control__input:checked),
.woocommerce-checkout .wc-block-components-checkbox:has(.wc-block-components-checkbox__input:checked) {
  border-color: color-mix(in srgb, var(--wp--preset--color--secondary) 70%, transparent);
  background-color: color-mix(in srgb, var(--wp--preset--color--secondary) 7%, transparent);
}

.woocommerce-checkout .wc-block-components-checkbox__label,
.woocommerce-checkout .wc-block-components-radio-control__label {
  cursor: pointer;
}

.woocommerce-checkout .wc-block-components-radio-control-accordion-content {
  padding: 16px;
  color: color-mix(in srgb, var(--wp--preset--color--foreground) 84%, transparent);
  border-top: 1px solid color-mix(in srgb, var(--wp--preset--color--secondary) 24%, transparent);
  font-family: var(--wp--preset--font-family--poltawski-nowy);
  line-height: 1.5;
}

.woocommerce-checkout .wc-block-checkout__terms {
  padding-top: 22px;
  border-top-color: color-mix(
    in srgb,
    var(--wp--preset--color--secondary) 30%,
    transparent
  );
  color: color-mix(
    in srgb,
    var(--wp--preset--color--foreground) 84%,
    transparent
  );
  line-height: 1.55;
}

.woocommerce-checkout .wc-block-checkout__terms a,
.woocommerce-checkout .wc-block-components-checkout-return-to-cart-button {
  color: var(--wp--preset--color--secondary);
  font-family: var(--wp--preset--font-family--poltawski-nowy);
  text-decoration-color: color-mix(
    in srgb,
    var(--wp--preset--color--secondary) 65%,
    transparent
  );
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
}

.woocommerce-checkout .wc-block-checkout__terms a:hover,
.woocommerce-checkout .wc-block-components-checkout-return-to-cart-button:hover {
  color: var(--wp--preset--color--primary);
}

.woocommerce-checkout .wc-block-checkout__terms a:focus-visible,
.woocommerce-checkout .wc-block-components-checkout-return-to-cart-button:focus-visible {
  border-radius: 3px;
  outline: 2px solid var(--wp--preset--color--secondary);
  outline-offset: 3px;
}

.woocommerce-checkout .wc-block-components-radio-control-accordion-content > :first-child {
  margin-top: 0;
}

.woocommerce-checkout .wc-block-components-radio-control-accordion-content > :last-child {
  margin-bottom: 0;
}

.woocommerce-checkout .wc-block-components-checkout-place-order-button__text {
  text-align: center;
}

.woocommerce-checkout .wc-block-components-checkout-place-order-button {
  border: var(--wns-btn-border);
  border-radius: var(--wns-btn-radius);
  background: var(--wns-btn-bg-color);
  color: var(--wns-btn-color);
  font-family: var(--wns-btn-font-family);
  font-size: var(--wns-btn-font-size);
  font-weight: var(--wns-btn-font-weight);
}

@media (max-width: 780px) {
  .woocommerce-checkout {
    overflow-x: hidden;
  }

  .woocommerce-checkout .wp-block-woocommerce-store-notices {
    box-sizing: border-box;
    width: calc(100% - 40px);
    max-width: calc(100% - 40px);
    margin-inline: 20px;
  }

  .woocommerce-checkout .wc-block-components-notice-banner {
    align-items: flex-start;
    width: 100%;
    min-width: 0;
    padding: 14px 16px;
  }

  .woocommerce-checkout .wc-block-components-notice-banner__content {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 10px;
    min-width: 0;
    overflow-wrap: anywhere;
  }

  .woocommerce-checkout .wc-block-components-notice-banner .button {
    float: none;
    justify-self: start;
    margin: 0;
    white-space: normal;
  }

  .woocommerce-checkout > .wp-site-blocks > header .wp-block-group.alignwide {
    width: calc(100% - 32px);
    min-height: 104px;
    padding-block: 8px !important;
  }

  .woocommerce-checkout .wns-checkout-brand img {
    height: 84px;
  }

  .woocommerce-checkout .wp-block-woocommerce-checkout {
    width: calc(100vw - 40px) !important;
    max-width: calc(100vw - 40px) !important;
    margin-inline: 20px !important;
    padding-inline: 0;
    overflow-x: clip;
  }

  .woocommerce-checkout .wc-block-components-sidebar-layout {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
  }

  .woocommerce-checkout .wc-block-components-sidebar-layout > *,
  .woocommerce-checkout .wc-block-components-checkout-step,
  .woocommerce-checkout .wc-block-components-checkout-step__container,
  .woocommerce-checkout .wc-block-components-checkout-step__content,
  .woocommerce-checkout .wc-block-components-checkout-order-summary,
  .woocommerce-checkout .wc-block-components-checkout-order-summary__content,
  .woocommerce-checkout .wc-block-components-order-summary,
  .woocommerce-checkout .wc-block-components-order-summary-item {
    box-sizing: border-box;
    min-width: 0 !important;
    max-width: 100% !important;
  }

  .woocommerce-checkout .wc-block-checkout__sidebar {
    overflow: hidden;
  }

  .woocommerce-checkout .wc-block-checkout__main,
  .woocommerce-checkout .wc-block-checkout__sidebar,
  .woocommerce-checkout .wc-block-components-main,
  .woocommerce-checkout .wc-block-components-sidebar {
    float: none !important;
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  .woocommerce-checkout .wc-block-components-address-form {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    width: 100%;
    min-width: 0;
  }

  .woocommerce-checkout .wc-block-components-address-form > *,
  .woocommerce-checkout .wc-block-components-address-form__first_name,
  .woocommerce-checkout .wc-block-components-address-form__last_name,
  .woocommerce-checkout .wc-block-components-address-form__city,
  .woocommerce-checkout .wc-block-components-address-form__postcode,
  .woocommerce-checkout .wc-block-components-address-form__country {
    grid-column: 1 / -1 !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
  }

  .woocommerce-checkout .wc-block-components-text-input,
  .woocommerce-checkout .wc-block-components-combobox,
  .woocommerce-checkout .wc-block-components-country-input,
  .woocommerce-checkout .wc-blocks-components-select,
  .woocommerce-checkout .wc-blocks-components-select__container {
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
  }

  .woocommerce-checkout .wc-block-checkout__shipping-option {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    width: 100%;
  }

  .woocommerce-checkout .wc-block-checkout__shipping-method-option {
    width: auto !important;
    min-width: 0 !important;
    padding: 12px 8px;
  }

  .woocommerce-checkout .wc-block-checkout__shipping-method-container {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
    width: 100% !important;
    min-width: 0;
  }

  .woocommerce-checkout .wc-block-checkout__shipping-method-option-title-wrapper {
    justify-content: center;
    min-width: 0;
  }

  .woocommerce-checkout .wc-block-checkout__shipping-method-option-title {
    font-size: 14px;
    line-height: 1.25;
    text-align: center;
    white-space: normal;
  }

  .woocommerce-checkout .wc-block-checkout__actions_row {
    display: grid;
    gap: 16px;
  }

  .woocommerce-checkout .wc-block-components-checkout-place-order-button {
    width: 100%;
  }
}
