/* FDI Carrinho/Checkout - ajustes finais de UX */

/* Remove cabeçalhos antigos/padrão das páginas de carrinho e checkout */
body.page-id-7 .entry-hero,
body.page-id-8 .entry-hero,
body.page-id-7 .entry-header,
body.page-id-8 .entry-header,
body.page-id-7 .page-header,
body.page-id-8 .page-header,
body.page-id-7 .entry-title,
body.page-id-8 .entry-title,
body.page-id-7 .kadence-breadcrumbs,
body.page-id-8 .kadence-breadcrumbs,
body.page-id-7 .woocommerce-breadcrumb,
body.page-id-8 .woocommerce-breadcrumb {
  display: none !important;
}

body.page-id-7 .content-area,
body.page-id-8 .content-area,
body.page-id-7 #primary,
body.page-id-8 #primary,
body.page-id-7 .site-main,
body.page-id-8 .site-main,
body.page-id-7 .entry-content-wrap,
body.page-id-8 .entry-content-wrap {
  padding-top: 0 !important;
  margin-top: 0 !important;
}

/* Ajusta espaçamento após header customizado */
body.page-id-7 .wp-block-woocommerce-cart,
body.page-id-8 .wp-block-woocommerce-checkout {
  margin-top: 26px !important;
}

/* Barra visual de etapas */
.fdi-checkout-steps {
  width: min(1240px, calc(100vw - 32px));
  margin: 26px auto -12px;
  padding: 18px 22px;
  border-radius: 24px;
  background: rgba(255,255,255,.94);
  border: 1px solid rgba(123,47,190,.10);
  box-shadow: 0 14px 38px rgba(61,26,110,.06);
  display: grid;
  grid-template-columns: repeat(3, minmax(0,1fr));
  gap: 12px;
  font-family: 'Nunito', sans-serif;
}

.fdi-checkout-step {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  color: #6C647D;
  font-weight: 800;
  font-size: .9rem;
}

.fdi-checkout-step b {
  width: 34px;
  height: 34px;
  min-width: 34px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(123,47,190,.10);
  color: #7B2FBE;
  font-weight: 950;
}

.fdi-checkout-step.is-active b {
  background: linear-gradient(135deg, #7B2FBE 0%, #9C52DE 100%);
  color: #FFFFFF;
  box-shadow: 0 10px 24px rgba(123,47,190,.22);
}

.fdi-checkout-step.is-active {
  color: #3D1A6E;
}

/* Corrige checkbox/radio gigante e desalinhado */
body.page-id-7 input[type="checkbox"],
body.page-id-7 input[type="radio"],
body.page-id-8 input[type="checkbox"],
body.page-id-8 input[type="radio"],
body.page-id-7 .wc-block-components-checkbox .wc-block-components-checkbox__input[type="checkbox"],
body.page-id-8 .wc-block-components-checkbox .wc-block-components-checkbox__input[type="checkbox"],
body.page-id-7 .wc-block-components-radio-control__input,
body.page-id-8 .wc-block-components-radio-control__input {
  width: 18px !important;
  height: 18px !important;
  min-width: 18px !important;
  min-height: 18px !important;
  max-width: 18px !important;
  max-height: 18px !important;
  padding: 0 !important;
  margin: 0 10px 0 0 !important;
  border-radius: 5px !important;
  border: 1.5px solid rgba(123,47,190,.32) !important;
  box-shadow: none !important;
  flex: 0 0 18px !important;
  vertical-align: middle !important;
}

body.page-id-7 input[type="radio"],
body.page-id-8 input[type="radio"],
body.page-id-7 .wc-block-components-radio-control__input,
body.page-id-8 .wc-block-components-radio-control__input {
  border-radius: 999px !important;
}

body.page-id-7 input[type="checkbox"]:checked,
body.page-id-8 input[type="checkbox"]:checked,
body.page-id-7 input[type="radio"]:checked,
body.page-id-8 input[type="radio"]:checked {
  accent-color: #7B2FBE !important;
}

body.page-id-7 .wc-block-components-checkbox,
body.page-id-8 .wc-block-components-checkbox,
body.page-id-7 .wc-block-components-radio-control__option,
body.page-id-8 .wc-block-components-radio-control__option {
  align-items: center !important;
  min-height: 46px !important;
  gap: 10px !important;
}

body.page-id-7 .wc-block-components-checkbox__label,
body.page-id-8 .wc-block-components-checkbox__label,
body.page-id-7 .wc-block-components-radio-control__label,
body.page-id-8 .wc-block-components-radio-control__label {
  color: #514963 !important;
  line-height: 1.45 !important;
}

/* Opções de entrega com card mais bonito */
body.page-id-8 .wc-block-components-radio-control,
body.page-id-7 .wc-block-components-radio-control {
  border-radius: 20px !important;
  overflow: hidden !important;
  border: 1px solid rgba(123,47,190,.13) !important;
  background: #FFFFFF !important;
}

body.page-id-8 .wc-block-components-radio-control__option,
body.page-id-7 .wc-block-components-radio-control__option {
  padding: 14px 16px !important;
  border-bottom: 1px solid rgba(123,47,190,.10) !important;
}

body.page-id-8 .wc-block-components-radio-control__option:last-child,
body.page-id-7 .wc-block-components-radio-control__option:last-child {
  border-bottom: 0 !important;
}

/* Corrige campo Número e campos lado a lado apagados/cortados */
body.page-id-8 .wc-block-components-address-form,
body.page-id-8 .wc-block-components-text-input,
body.page-id-8 .wc-block-components-state-input,
body.page-id-8 .wc-block-components-country-input,
body.page-id-8 .wc-block-components-combobox,
body.page-id-8 .wc-block-components-form .wc-block-components-text-input {
  min-width: 0 !important;
  overflow: visible !important;
}

body.page-id-8 .wc-block-components-text-input input,
body.page-id-8 .wc-block-components-combobox input,
body.page-id-8 input[type="text"],
body.page-id-8 input[type="tel"],
body.page-id-8 input[type="email"] {
  width: 100% !important;
  min-width: 0 !important;
  max-width: 100% !important;
  padding-left: 16px !important;
  padding-right: 16px !important;
  text-overflow: ellipsis !important;
}

body.page-id-8 .wc-block-components-text-input label,
body.page-id-8 .wc-block-components-combobox label {
  max-width: calc(100% - 20px) !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
}

body.page-id-8 .wc-block-components-validation-error,
body.page-id-7 .wc-block-components-validation-error {
  color: #C62828 !important;
  font-size: .86rem !important;
  line-height: 1.4 !important;
  margin-top: 6px !important;
}

/* Campo WhatsApp injetado */
.fdi-whatsapp-field {
  margin: 18px 0 0;
  padding: 18px;
  border-radius: 20px;
  background: linear-gradient(180deg, #FAF7FF 0%, #FFFFFF 100%);
  border: 1px solid rgba(123,47,190,.12);
}

.fdi-whatsapp-field label {
  display: block;
  margin: 0 0 8px;
  color: #3D1A6E !important;
  font-weight: 900 !important;
}

.fdi-whatsapp-field input {
  width: 100% !important;
  min-height: 48px !important;
  border-radius: 16px !important;
  border: 1px solid rgba(123,47,190,.16) !important;
  padding: 0 16px !important;
  color: #3D1A6E !important;
}

.fdi-whatsapp-field small {
  display: block;
  margin-top: 7px;
  color: #776C8D;
  line-height: 1.45;
}

/* Microcopy de confiança */
.fdi-checkout-trust-note {
  margin: 14px 0 0;
  padding: 14px 16px;
  border-radius: 18px;
  background: rgba(123,47,190,.06);
  color: #514963;
  font-size: .9rem;
  line-height: 1.55;
}

.fdi-checkout-trust-note strong {
  color: #3D1A6E;
}

/* Evita estouro horizontal em opções e resumos */
body.page-id-7 .wc-block-components-radio-control,
body.page-id-8 .wc-block-components-radio-control,
body.page-id-7 .wc-block-components-panel,
body.page-id-8 .wc-block-components-panel,
body.page-id-7 .wc-block-components-order-summary,
body.page-id-8 .wc-block-components-order-summary,
body.page-id-7 .wc-block-components-totals-wrapper,
body.page-id-8 .wc-block-components-totals-wrapper {
  max-width: 100% !important;
  overflow-x: hidden !important;
}

@media (max-width: 680px) {
  .fdi-checkout-steps {
    width: calc(100vw - 20px);
    grid-template-columns: 1fr;
    margin-top: 18px;
    padding: 14px;
  }

  .fdi-checkout-step {
    font-size: .84rem;
  }

  body.page-id-8 .wc-block-components-radio-control__option,
  body.page-id-7 .wc-block-components-radio-control__option {
    padding: 12px !important;
  }
}
