/* Structural rules only. Visual styling remains in the existing inline product markup. */
body.single-product:not(.postid-21) form.variations_form:not(:has(.llw-product-notice)):has(.ymdp-daily-pricing) .woocommerce-variation-description:has(> .ymdp-daily-pricing) {
  display: block !important;
  order: 3 !important;
  width: 100% !important;
  margin-top: 16px !important;
  padding: 16px !important;
}

body.single-product:not(.postid-21) form.variations_form:not(:has(.llw-product-notice)):has(.ymdp-daily-pricing) .woocommerce-variation-description > .ymdp-daily-pricing {
  display: block !important;
}

body.single-product:not(.postid-21) form.variations_form:not(:has(.llw-product-notice)):has(.ymdp-daily-pricing) .ymdp-daily-pricing > * {
  order: initial !important;
}

/* The theme boxes the first two description rows separately. Keep a single
   shared container around the complete daily-pricing block instead. */
body.single-product form.variations_form:has(.ymdp-daily-pricing) .ymdp-daily-pricing > div:first-child,
body.single-product form.variations_form:has(.ymdp-daily-pricing) .ymdp-daily-pricing > div:nth-child(2) {
  background: transparent !important;
  border: 0 !important;
  border-radius: 0 !important;
  padding: 0 !important;
}

body.single-product form.variations_form:has(.ymdp-daily-pricing) .ymdp-daily-pricing > div:first-child {
  margin: 0 0 7px !important;
}

body.single-product form.variations_form:has(.ymdp-daily-pricing) .ymdp-daily-pricing > div:nth-child(2) {
  margin: 0 !important;
}

body.single-product form.variations_form:has(.ymdp-daily-pricing) .ymdp-daily-pricing > div:nth-child(3) {
  margin: 7px 0 0 !important;
}

body.single-product form.variations_form:has(.llw-product-notice):has(.ymdp-daily-pricing) .single_variation_wrap {
  display: grid !important;
  grid-template-columns: minmax(110px, 116px) minmax(0, 1fr) !important;
  column-gap: 16px !important;
  row-gap: 16px !important;
  align-items: stretch !important;
}

body.single-product form.variations_form:has(.llw-product-notice):has(.ymdp-daily-pricing) .woocommerce-variation.single_variation,
body.single-product form.variations_form:has(.llw-product-notice):has(.ymdp-daily-pricing) .woocommerce-variation-add-to-cart {
  display: contents !important;
}

body.single-product form.variations_form:has(.llw-product-notice):has(.ymdp-daily-pricing) .woocommerce-variation-price {
  display: block !important;
  grid-column: 1 / -1 !important;
  grid-row: 1 !important;
  margin: 0 !important;
}

body.single-product form.variations_form:has(.llw-product-notice):has(.ymdp-daily-pricing) .quantity {
  grid-column: 1 !important;
  grid-row: 2 !important;
  margin: 0 !important;
}

body.single-product form.variations_form:has(.llw-product-notice):has(.ymdp-daily-pricing) .single_add_to_cart_button {
  grid-column: 2 !important;
  grid-row: 2 !important;
  box-sizing: border-box !important;
  min-width: 0 !important;
  width: 100% !important;
  max-width: 100% !important;
  margin: 0 !important;
  white-space: normal !important;
  overflow-wrap: anywhere !important;
}

body.single-product form.variations_form:has(.llw-product-notice):has(.ymdp-daily-pricing) .woocommerce-variation-description:has(> .ymdp-daily-pricing) {
  display: block !important;
  grid-column: 1 / -1 !important;
  grid-row: 3 !important;
  width: 100% !important;
  margin: 0 !important;
  padding: 16px !important;
}

body.single-product form.variations_form:has(.llw-product-notice):has(.ymdp-daily-pricing) .woocommerce-variation-description > .ymdp-daily-pricing {
  display: block !important;
}

body.single-product form.variations_form:has(.llw-product-notice):has(.ymdp-daily-pricing) .ymdp-daily-pricing > * {
  order: initial !important;
}

body.single-product form.variations_form:has(.llw-product-notice):has(.ymdp-daily-pricing) .llw-product-notice {
  grid-column: 1 / -1 !important;
  grid-row: 4 !important;
  margin: 0 !important;
}

@media (max-width: 767px) {
  body.single-product form.variations_form:has(.llw-product-notice):has(.ymdp-daily-pricing) .single_variation_wrap {
    grid-template-columns: 72px minmax(0, 1fr) !important;
    column-gap: 12px !important;
  }
}

/* Remove the theme's decorative rule above the Joint Care price. */
body.single-product.postid-27 form.variations_form .single_variation_wrap::before {
  content: none !important;
  display: none !important;
  height: 0 !important;
  border: 0 !important;
}

/* Only the 120-tablet Joint Care variation participates in the loyalty
   program. Remove the empty notice shell for the other pack sizes. */
body.single-product.postid-27 form.variations_form:has([class~="60-tabletki"].thwvsf-selected) .llw-product-notice,
body.single-product.postid-27 form.variations_form:has([class~="300-tabletki"].thwvsf-selected) .llw-product-notice {
  display: none !important;
  width: 0 !important;
  height: 0 !important;
  min-height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
}

@media (min-width: 768px) {
  /* Products with at least three variations use two choices per row. The
     existing product grid then sizes the purchase column like other products. */
  html body.single-product.woocommerce div.product .elementor-add-to-cart form.variations_form.cart:has(.ymdp-daily-pricing):has(.thwvsf-wrapper-ul > .thwvsf-wrapper-item-li:nth-child(3)) {
    grid-template-columns: fit-content(190px) minmax(0, 1fr) !important;
  }

  body.single-product form.variations_form:has(.thwvsf-wrapper-ul > .thwvsf-wrapper-item-li:nth-child(3)) .thwvsf-wrapper-ul {
    display: grid !important;
    grid-template-columns: repeat(2, max-content) !important;
    justify-content: start !important;
    align-items: start !important;
  }

  body.single-product form.variations_form:has(.ymdp-daily-pricing):has(.thwvsf-wrapper-ul > .thwvsf-wrapper-item-li:nth-child(3)) .single_add_to_cart_button {
    white-space: nowrap !important;
    overflow-wrap: normal !important;
  }

  /* Match the quantity-to-button spacing of the other products without
     changing the surrounding Joint Care layout. */
  body.single-product.postid-27 form.variations_form:has(.ymdp-daily-pricing) .single_variation_wrap {
    grid-template-columns: 58px minmax(0, 1fr) !important;
    column-gap: 24px !important;
  }

  body.single-product.postid-27 form.variations_form:has(.ymdp-daily-pricing) .single_add_to_cart_button {
    justify-self: start !important;
    width: calc(100% - 50px) !important;
    max-width: calc(100% - 50px) !important;
  }
}
