/**
 * Checkout Form Mode: Hide
 * Province, City & Zip Code fields are hidden before and after district selection.
 */

/* Blocks: hide for ID country */
.wc-block-components-address-form[data-wm-country="id"]
  .wc-block-components-address-form__city,
.wc-block-components-address-form[data-wm-country="id"]
  .wc-block-components-address-form__state,
.wc-block-components-address-form[data-wm-country="id"]
  .wc-block-components-address-form__postcode {
  display: none !important;
}

/* Blocks: show fields when country is not Indonesia */
.wc-block-components-address-form[data-wm-country="non-id"]
  .wc-block-components-address-form__city,
.wc-block-components-address-form[data-wm-country="non-id"]
  .wc-block-components-address-form__state,
.wc-block-components-address-form[data-wm-country="non-id"]
  .wc-block-components-address-form__postcode {
  display: block !important;
}

/* Blocks: keep hidden after district selection (locked fields) */
.wc-block-components-address-form[data-wm-country="id"]
  .wc-block-components-text-input:has(input[readonly]),
.wc-block-components-address-form[data-wm-country="id"]
  .wc-block-components-address-form__state:has(
    .wc-blocks-components-select__select#shipping-state
  ) {
  display: none !important;
}

/* Blocks: keep hidden after district selection (locked fields) */
.wc-block-components-address-form[data-wm-country="non-id"]
  .wc-block-components-text-input:has(input[readonly]),
.wc-block-components-address-form[data-wm-country="non-id"]
  .wc-block-components-address-form__state:has(
    .wc-blocks-components-select__select#shipping-state
  ) {
  display: block !important;
}

/* Shortcode: hide for ID country */
body[data-wm-country-billing="id"] #billing_city_field,
body[data-wm-country-billing="id"] #billing_state_field,
body[data-wm-country-billing="id"] #billing_postcode_field,
body[data-wm-country-shipping="id"] #shipping_city_field,
body[data-wm-country-shipping="id"] #shipping_state_field,
body[data-wm-country-shipping="id"] #shipping_postcode_field {
  display: none !important;
}

/* Shortcode: keep hidden after district selection (locked fields) */
.woocommerce-checkout .form-row:has(input[readonly]),
.woocommerce-checkout .form-row:has(.select2-container.wm-select2-disabled) {
  display: none !important;
}

/* Shortcode: show fields when country is not Indonesia */
body[data-wm-country-billing="non-id"] #billing_city_field,
body[data-wm-country-billing="non-id"] #billing_state_field,
body[data-wm-country-billing="non-id"] #billing_postcode_field {
  display: block !important;
}

body[data-wm-country-shipping="non-id"] #shipping_city_field,
body[data-wm-country-shipping="non-id"] #shipping_state_field,
body[data-wm-country-shipping="non-id"] #shipping_postcode_field {
  display: block !important;
}
