.wc-block-components-address-form__country,
.wc-block-components-address-form__postcode,
.wc-block-components-address-form__postcode_address_1,
.woocommerce-checkout #billing_country_field,
.woocommerce-checkout #shipping_country_field,
.woocommerce-checkout #billing_postcode_field,
.woocommerce-checkout #shipping_postcode_field {
  display: none !important;
}

.cavimat-field-help {
  display: block;
  margin: 6px 0 18px;
  color: #5d5d5d;
  font-size: 12px;
  line-height: 1.4;
}

.cavimat-field-error {
  color: #b0000b;
  font-weight: 700;
}

.cavimat-company-hidden {
  display: none !important;
}

.cavimat-native-customer-type {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
  clip: rect(0 0 0 0) !important;
  clip-path: inset(50%) !important;
}

#cavimat-customer-choice {
  margin: 0 0 22px;
  padding: 20px;
  border: 2px solid #d7d7d7;
  border-radius: 10px;
  background: #fff;
}

#cavimat-customer-choice h3 { margin: 0 0 14px; font-size: 21px; }

.cavimat-choice-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.cavimat-choice-grid button {
  display: grid;
  grid-template-columns: auto 1fr;
  column-gap: 10px;
  align-items: center;
  min-height: 78px;
  padding: 13px 15px;
  border: 2px solid #d4d4d4;
  border-radius: 8px;
  background: #fafafa;
  color: #171717;
  text-align: left;
  cursor: pointer;
}

.cavimat-choice-grid button:hover,
.cavimat-choice-grid button.is-selected {
  border-color: #e10613;
  background: #fff4f5;
}

.cavimat-choice-icon { grid-row: 1 / 3; font-size: 27px; }
.cavimat-choice-grid strong { font-size: 16px; }
.cavimat-choice-grid small { color: #5d5d5d; font-size: 12px; }

body.cavimat-awaiting-customer-type .cavimat-gated-field,
body.cavimat-awaiting-customer-type .cavimat-gated-section,
body.cavimat-awaiting-customer-type #cavimat-checkout-location,
body.cavimat-awaiting-customer-type #cavimat-checkout-policy,
body.cavimat-awaiting-customer-type #cavimat-final-summary,
body.cavimat-awaiting-customer-type .wp-block-woocommerce-checkout-pickup-options-block,
body.cavimat-awaiting-customer-type .wp-block-woocommerce-checkout-billing-address-block,
body.cavimat-awaiting-customer-type .wp-block-woocommerce-checkout-shipping-method-block,
body.cavimat-awaiting-customer-type .wp-block-woocommerce-checkout-additional-fields-block,
body.cavimat-awaiting-customer-type .wp-block-woocommerce-checkout-order-note-block,
body.cavimat-awaiting-customer-type .wp-block-woocommerce-checkout-payment-block,
body.cavimat-awaiting-customer-type .wp-block-woocommerce-checkout-actions-block,
body.cavimat-awaiting-customer-type .wc-block-checkout__terms,
body.cavimat-awaiting-customer-type .wc-block-checkout__actions,
body.cavimat-awaiting-customer-type .wp-block-woocommerce-checkout-terms-block {
  display: none !important;
}

.cavimat-hidden-billing {
  display: none !important;
}

/* Etiquetas externas y controles cómodos en teléfono y computador. */
.woocommerce-checkout .wc-block-components-text-input {
  display: flex !important;
  flex-direction: column !important;
  gap: 6px;
}

.woocommerce-checkout .wc-block-components-text-input label {
  position: static !important;
  order: 1;
  width: auto !important;
  margin: 0 !important;
  padding: 0 !important;
  transform: none !important;
  color: #202020 !important;
  font-size: 14px !important;
  font-weight: 750 !important;
  line-height: 1.35 !important;
}

.woocommerce-checkout .wc-block-components-text-input input {
  order: 2;
  width: 100% !important;
  min-height: 48px !important;
  padding: 11px 12px !important;
  border: 1px solid #8a8a8a !important;
  border-radius: 7px !important;
  font-size: 16px !important;
  line-height: 1.2 !important;
}

.woocommerce-checkout .wc-block-components-select select,
.woocommerce-checkout select {
  min-height: 48px;
  font-size: 16px !important;
}

.cavimat-date-field,
.cavimat-date-field input {
  width: 100% !important;
  max-width: none !important;
}

.cavimat-pickup-programming {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid #dedede;
}

#cavimat-company-heading,
#cavimat-authorized-heading {
  margin: 22px 0 14px;
  padding: 13px 15px;
  border-left: 4px solid #e10613;
  background: #f7f7f5;
}

#cavimat-company-heading strong,
#cavimat-company-heading small,
#cavimat-authorized-heading strong,
#cavimat-authorized-heading small {
  display: block;
}

#cavimat-company-heading strong,
#cavimat-authorized-heading strong {
  margin-bottom: 3px;
  font-size: 15px;
}

#cavimat-company-heading small,
#cavimat-authorized-heading small {
  color: #606060;
  font-size: 12px;
}

.cavimat-expired-option {
  display: none !important;
}

#cavimat-policy-acceptance {
  margin-top: 16px;
  padding-top: 15px;
  border-top: 1px solid #d7b7ba;
}

#cavimat-policy-acceptance .wc-block-components-checkbox {
  margin: 0;
  padding: 13px;
  border: 2px solid #e10613;
  border-radius: 7px;
  background: #fff;
}

#cavimat-final-summary dl { margin: 12px 0; }
#cavimat-final-summary dl div {
  display: grid;
  grid-template-columns: 150px 1fr;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid #ddd;
}
#cavimat-final-summary dt { font-weight: 800; }
#cavimat-final-summary dd { margin: 0; }
#cavimat-final-summary > p { margin: 12px 0 0; font-weight: 700; }

.cavimat-create-account {
  margin: 24px 0;
  padding: 20px;
  border: 1px solid #ddd;
  border-left: 5px solid #e10613;
  border-radius: 8px;
  background: #f7f7f5;
}

#cavimat-mobile-summary-toggle {
  display: none;
}

.cavimat-checkout-callout {
  margin: 0 0 26px;
  padding: 20px;
  border: 1px solid #dedede;
  border-left: 5px solid #e10613;
  border-radius: 9px;
  background: #f7f7f5;
  color: #191919;
}

.cavimat-callout-kicker {
  display: block;
  margin-bottom: 5px;
  color: #e10613;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.cavimat-checkout-callout h3 {
  margin: 0 0 10px;
  font-size: 20px;
  line-height: 1.2;
}

.cavimat-checkout-callout p { margin: 0 0 6px; }
.cavimat-checkout-callout small { color: #626262; }
.cavimat-checkout-callout ul { margin: 10px 0 0 20px; padding: 0; }
.cavimat-checkout-callout li { margin: 5px 0; }

.cavimat-location-callout {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 20px;
  align-items: center;
}

.cavimat-map-actions { display: grid; gap: 8px; min-width: 218px; }
.cavimat-map-actions a {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 8px 13px;
  border: 1px solid #d7d7d7;
  border-radius: 7px;
  background: #fff;
  color: #171717;
  font-size: 13px;
  font-weight: 800;
  text-decoration: none;
}
.cavimat-map-actions a:hover { border-color: #e10613; color: #e10613; }
.cavimat-map-actions img { width: 25px; height: 25px; object-fit: contain; }

.wc-block-checkout__additional-fields .wc-block-components-checkbox,
.wp-block-woocommerce-checkout-additional-fields-block .wc-block-components-checkbox {
  padding: 15px;
  border: 2px solid #e10613;
  border-radius: 8px;
  background: #fff6f7;
}

@media (max-width: 680px) {
  .woocommerce-checkout .wc-block-checkout,
  .woocommerce-checkout .wp-block-woocommerce-checkout {
    display: block !important;
  }

  .woocommerce-checkout .wc-block-components-checkout-step,
  .woocommerce-checkout .wc-block-components-text-input,
  .woocommerce-checkout .wc-block-components-select,
  .woocommerce-checkout .wc-block-checkout__main,
  .woocommerce-checkout .wc-block-checkout__sidebar {
    width: 100% !important;
    max-width: none !important;
  }

  #cavimat-customer-choice { padding: 16px; }
  .cavimat-location-callout { grid-template-columns: 1fr; }
  .cavimat-map-actions { min-width: 0; }
  .cavimat-map-actions a { min-height: 48px; font-size: 14px; }
  .cavimat-choice-grid { grid-template-columns: 1fr; }
  .cavimat-choice-grid button { min-height: 72px; }
  #cavimat-final-summary dl div { grid-template-columns: 1fr; gap: 2px; }

  #cavimat-mobile-summary-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    width: 100%;
    min-height: 58px;
    margin: 0 0 10px;
    padding: 10px 12px;
    border: 1px solid #d0d0d0;
    border-radius: 8px;
    background: #fff;
    color: #171717;
    text-align: left;
  }

  #cavimat-mobile-summary-toggle span,
  #cavimat-mobile-summary-toggle strong,
  #cavimat-mobile-summary-toggle small { display: block; }
  #cavimat-mobile-summary-toggle small { margin-top: 2px; color: #606060; }
  #cavimat-mobile-summary-toggle b { white-space: nowrap; }

  .cavimat-summary-collapsed > :not(#cavimat-mobile-summary-toggle) {
    display: none !important;
  }

  .woocommerce-checkout .wp-block-woocommerce-checkout-actions-block,
  .woocommerce-checkout .wc-block-checkout__actions {
    position: sticky;
    bottom: 0;
    z-index: 30;
    margin: 0 -12px;
    padding: 12px;
    border-top: 1px solid #ddd;
    background: rgba(255, 255, 255, .97);
    box-shadow: 0 -4px 15px rgba(0, 0, 0, .08);
  }

  .woocommerce-checkout .wc-block-components-checkout-place-order-button {
    min-height: 50px;
    font-size: 16px;
    font-weight: 850;
  }

  .woocommerce-checkout .cavimat-whatsapp,
  .woocommerce-checkout [class*="whatsapp" i] {
    bottom: 78px !important;
  }
}

.cavimat-auto-region { display: none !important; }
#cavimat-region-display { display: grid; gap: 4px; margin: 2px 0 14px; padding: 11px 13px; border: 1px solid #cfd8dc; border-radius: 7px; background: #f5f8f9; color: #222; }
#cavimat-region-display strong { font-size: 13px; }
#cavimat-region-display span { font-size: 15px; }
#cavimat-region-display[hidden], #cavimat-phone-area[hidden] { display: none !important; }
#cavimat-phone-area { display: grid; gap: 6px; margin: 4px 0 12px; }
#cavimat-phone-area label { font-size: 13px; font-weight: 750; }
#cavimat-phone-area select { width: 100%; min-height: 48px; padding: 9px 12px; border: 1px solid #b6b6b6; border-radius: 7px; background: #fff; font-size: 16px; }
.woocommerce-checkout .wc-block-components-validation-error { margin: 5px 0 10px !important; }
@media (max-width: 680px) { .woocommerce-checkout .wc-block-components-form .wc-block-components-form { display: block !important; } }

#cavimat-customer-choice { order: -10; }
.cavimat-searchable-commune { position: relative; }
.cavimat-commune-search { width: 100%; min-height: 48px; font-size: 16px; }
.cavimat-commune-results { position: absolute; z-index: 100; top: 100%; left: 0; right: 0; max-height: 240px; overflow-y: auto; border: 1px solid #8a8a8a; border-radius: 7px; background: #fff; box-shadow: 0 8px 20px rgba(0,0,0,.14); }
.cavimat-commune-results[hidden] { display: none; }
.cavimat-commune-results button { display: block; width: 100%; min-height: 44px; padding: 9px 12px; border: 0; background: #fff; text-align: left; font-size: 15px; cursor: pointer; }
.cavimat-commune-results button:hover, .cavimat-commune-results button:focus { background: #fff4f5; }
#cavimat-cart-weight { display: grid; gap: 7px; margin: 12px 0; padding: 14px; border: 2px solid #e10613; border-radius: 8px; background: #fff4f5; color: #1a1a1a; font-size: 15px; }
#cavimat-cart-weight .cavimat-load-heading { margin-bottom: 2px; font-size: 13px; letter-spacing: .03em; text-transform: uppercase; }
#cavimat-cart-weight > div { display: flex; justify-content: space-between; gap: 12px; }
#cavimat-cart-weight strong { font-weight: 800; }
#cavimat-cart-weight span { font-weight: 900; text-align: right; }
#cavimat-cart-weight .cavimat-volume-note { color: #555; font-size: 12px; line-height: 1.35; }
.woocommerce-cart .wc-block-components-product-details__peso-de-la-carga,
.woocommerce-checkout .wc-block-components-product-details__peso-de-la-carga,
.woocommerce-cart .cavimat-duplicate-weight,
.woocommerce-checkout .cavimat-duplicate-weight { display: none !important; }
.woocommerce-cart .cavimat-block-cart-weight { display: none; }

/* El cupón se ofrece en el último paso del checkout. */
.woocommerce-cart .wp-block-woocommerce-cart-order-summary-coupon-form-block,
.woocommerce-cart .wc-block-components-totals-coupon { display: none !important; }
.cavimat-inline-error { display: block; margin: 4px 0 10px; color: #b00020; font-size: 13px; font-weight: 700; }
.cavimat-inline-error[hidden] { display: none; }
