/* Indego Fresh Store v1.4.1 — requested compact checkout cards + desktop-only sticky summary.
 * Scoped to this theme's native WooCommerce classic checkout; responsive mobile order remains untouched.
 * This stylesheet loads after previous checkout styles so it reliably wins their !important spacing rules. */
@media (min-width: 1025px) {
  body:has(.idn-page form.checkout.woocommerce-checkout.idn-native-checkout) .idn-page form.checkout.woocommerce-checkout.idn-native-checkout > .idn-checkout-layout {
    column-gap: var(--idn-co-gap, 24px) !important;
    align-items: start !important;
    overflow: visible !important;
  }
  body:has(.idn-page form.checkout.woocommerce-checkout.idn-native-checkout) .idn-page form.checkout.woocommerce-checkout.idn-native-checkout .idn-checkout-left {
    gap: var(--idn-co-desktop-block-gap, 10px) !important;
  }
  body:has(.idn-page form.checkout.woocommerce-checkout.idn-native-checkout) .idn-page form.checkout.woocommerce-checkout.idn-native-checkout #customer_details > .col-2 {
    margin-top: var(--idn-co-desktop-block-gap, 10px) !important;
  }
  /* Padding on the visible cards (billing, shipping, delivery); not on individual field values. */
  body:has(.idn-page form.checkout.woocommerce-checkout.idn-native-checkout) .idn-page form.checkout.woocommerce-checkout.idn-native-checkout #customer_details .woocommerce-billing-fields,
  body:has(.idn-page form.checkout.woocommerce-checkout.idn-native-checkout) .idn-page form.checkout.woocommerce-checkout.idn-native-checkout #customer_details .woocommerce-shipping-fields,
  body:has(.idn-page form.checkout.woocommerce-checkout.idn-native-checkout) .idn-page form.checkout.woocommerce-checkout.idn-native-checkout #customer_details .woocommerce-additional-fields,
  body:has(.idn-page form.checkout.woocommerce-checkout.idn-native-checkout) .idn-page form.checkout.woocommerce-checkout.idn-native-checkout #idn-checkout-delivery {
    padding: var(--idn-co-desktop-card-pad, 12px) !important;
  }
  body:has(.idn-page form.checkout.woocommerce-checkout.idn-native-checkout) .idn-page form.checkout.woocommerce-checkout.idn-native-checkout #customer_details .woocommerce-billing-fields > h3,
  body:has(.idn-page form.checkout.woocommerce-checkout.idn-native-checkout) .idn-page form.checkout.woocommerce-checkout.idn-native-checkout #customer_details .woocommerce-shipping-fields > h3,
  body:has(.idn-page form.checkout.woocommerce-checkout.idn-native-checkout) .idn-page form.checkout.woocommerce-checkout.idn-native-checkout #customer_details .woocommerce-additional-fields > h3,
  body:has(.idn-page form.checkout.woocommerce-checkout.idn-native-checkout) .idn-page form.checkout.woocommerce-checkout.idn-native-checkout #idn-checkout-delivery h3 {
    margin: 0 0 var(--idn-co-desktop-heading-gap, 7px) !important;
    padding: 0 0 var(--idn-co-desktop-heading-gap, 7px) !important;
  }
  body.idn-checkout-compact:has(.idn-page form.checkout.woocommerce-checkout.idn-native-checkout) .idn-page form.checkout.woocommerce-checkout.idn-native-checkout #customer_details .woocommerce-billing-fields__field-wrapper {
    gap: var(--idn-co-desktop-field-gap, 7px) !important;
  }
  body:has(.idn-page form.checkout.woocommerce-checkout.idn-native-checkout) .idn-page form.checkout.woocommerce-checkout.idn-native-checkout #customer_details .form-row {
    margin-bottom: 5px !important;
  }
  body.idn-checkout-compact:has(.idn-page form.checkout.woocommerce-checkout.idn-native-checkout) .idn-page form.checkout.woocommerce-checkout.idn-native-checkout #customer_details .idn-co-three-field label {
    margin-bottom: 4px !important;
  }
  body.idn-checkout-compact:has(.idn-page form.checkout.woocommerce-checkout.idn-native-checkout) .idn-page form.checkout.woocommerce-checkout.idn-native-checkout #customer_details .idn-co-three-field input.input-text {
    min-height: 42px !important;
    padding: 8px 10px !important;
  }
  body:has(.idn-page form.checkout.woocommerce-checkout.idn-native-checkout) .idn-page form.checkout.woocommerce-checkout.idn-native-checkout #idn-checkout-delivery .idn-delivery-note {
    margin-bottom: 6px !important;
  }
  body:has(.idn-page form.checkout.woocommerce-checkout.idn-native-checkout) .idn-page form.checkout.woocommerce-checkout.idn-native-checkout #idn-delivery-methods li {
    padding: 7px 9px !important;
    margin-bottom: 6px !important;
  }
  /* Keep original WooCommerce totals, gateway information and the clickable place-order button. */
  body:has(.idn-page form.checkout.woocommerce-checkout.idn-native-checkout) .idn-page form.checkout.woocommerce-checkout.idn-native-checkout .idn-checkout-right #order_review_heading {
    padding: 10px var(--idn-co-desktop-summary-pad, 12px) 6px !important;
  }
  body:has(.idn-page form.checkout.woocommerce-checkout.idn-native-checkout) .idn-page form.checkout.woocommerce-checkout.idn-native-checkout .idn-checkout-right #order_review {
    padding: 0 var(--idn-co-desktop-summary-pad, 12px) 10px !important;
  }
  body:has(.idn-page form.checkout.woocommerce-checkout.idn-native-checkout) .idn-page form.checkout.woocommerce-checkout.idn-native-checkout .idn-checkout-right #order_review table.shop_table {
    margin: 0 0 9px !important;
  }
  body:has(.idn-page form.checkout.woocommerce-checkout.idn-native-checkout) .idn-page form.checkout.woocommerce-checkout.idn-native-checkout .idn-checkout-right #order_review table.shop_table th,
  body:has(.idn-page form.checkout.woocommerce-checkout.idn-native-checkout) .idn-page form.checkout.woocommerce-checkout.idn-native-checkout .idn-checkout-right #order_review table.shop_table td {
    padding: 5px 3px !important;
  }
  body:has(.idn-page form.checkout.woocommerce-checkout.idn-native-checkout) .idn-page form.checkout.woocommerce-checkout.idn-native-checkout .idn-checkout-right #order_review .idn-co-item-actions {
    margin-top: 5px !important;
  }
  body:has(.idn-page form.checkout.woocommerce-checkout.idn-native-checkout) .idn-page form.checkout.woocommerce-checkout.idn-native-checkout .idn-checkout-right #order_review #payment {
    margin-top: 6px !important;
    padding: 9px !important;
  }
  body:has(.idn-page form.checkout.woocommerce-checkout.idn-native-checkout) .idn-page form.checkout.woocommerce-checkout.idn-native-checkout .idn-checkout-right #order_review #payment .payment_box {
    padding: 9px !important;
    margin-top: 7px !important;
  }
  /* Earlier checkout-design.css forces position:relative !important on the right grid item.
     The later, equally/higher-specificity override makes it sticky in the normal grid row.
     Stay within the form, so the summary never overlaps the footer. */
  body:has(.idn-page form.checkout.woocommerce-checkout.idn-native-checkout) .idn-page form.checkout.woocommerce-checkout.idn-native-checkout > .idn-checkout-layout.idn-co-sticky-enabled > .idn-checkout-right {
    position: sticky !important;
    top: calc(var(--idn-co-sticky-top, 76px) + var(--wp-admin--admin-bar--height, 0px)) !important;
    align-self: start !important;
    height: max-content;
    max-height: calc(100vh - var(--idn-co-sticky-top, 76px) - var(--wp-admin--admin-bar--height, 0px) - 12px);
    max-height: calc(100dvh - var(--idn-co-sticky-top, 76px) - var(--wp-admin--admin-bar--height, 0px) - 12px);
    overflow-x: hidden;
    overflow-y: auto;
    scrollbar-width: thin;
    overscroll-behavior-y: contain;
  }
}
