/* =========================================
   Magnaverso — Product Actions
   Arquivo: assets/css/product-actions.css

   Escopo:
   - Página individual de produto
   - Botão Adicionar ao carrinho
   - Calculadora de frete Infixs/Correios

   Objetivo:
   Isolar os botões .button.alt do WooCommerce/Infixs
   para impedir conflito com product.css e WooCommerce core.
   ========================================= */


/* =========================================
   1. ADD TO CART
   ========================================= */

body.single-product.woocommerce div.product.mgv-product form.cart,
body.single-product.woocommerce-page div.product.mgv-product form.cart,
body.single-product .woocommerce div.product.mgv-product form.cart,
body.single-product .woocommerce div.product.mgv-product .mgv-summary__cart form.cart{
  display: flex !important;
  align-items: center !important;
  flex-wrap: nowrap !important;
  gap: 8px !important;
  margin: 0 0 22px !important;
  padding: 0 !important;
}

body.single-product.woocommerce div.product.mgv-product form.cart .quantity,
body.single-product.woocommerce-page div.product.mgv-product form.cart .quantity,
body.single-product .woocommerce div.product.mgv-product form.cart .quantity,
body.single-product .woocommerce div.product.mgv-product .mgv-summary__cart form.cart .quantity{
  flex: 0 0 auto !important;
  margin: 0 !important;
  padding: 0 !important;
}

body.single-product.woocommerce div.product.mgv-product form.cart .quantity input.qty,
body.single-product.woocommerce-page div.product.mgv-product form.cart .quantity input.qty,
body.single-product .woocommerce div.product.mgv-product form.cart .quantity input.qty,
body.single-product .woocommerce div.product.mgv-product .mgv-summary__cart form.cart .quantity input.qty{
  width: 72px !important;
  height: 46px !important;
  min-height: 46px !important;
  max-height: 46px !important;
  margin: 0 !important;
  padding: 0 10px !important;
  border: 1px solid rgba(0,0,0,.32) !important;
  border-radius: 0 !important;
  background: #fff !important;
  box-shadow: none !important;
  color: #111 !important;
  font-family: var(--mgv-font-body, Arial, sans-serif) !important;
  font-size: 18px !important;
  font-weight: 500 !important;
  line-height: 46px !important;
  text-align: center !important;
  box-sizing: border-box !important;
}

/* Botão principal: seletor específico para vencer WooCommerce .button.alt */
body.single-product.woocommerce div.product.mgv-product form.cart button.single_add_to_cart_button,
body.single-product.woocommerce div.product.mgv-product form.cart button.button.single_add_to_cart_button,
body.single-product.woocommerce div.product.mgv-product form.cart button.button.alt.single_add_to_cart_button,
body.single-product.woocommerce div.product.mgv-product form.cart button[name="add-to-cart"],
body.single-product.woocommerce-page div.product.mgv-product form.cart button.single_add_to_cart_button,
body.single-product.woocommerce-page div.product.mgv-product form.cart button.button.single_add_to_cart_button,
body.single-product.woocommerce-page div.product.mgv-product form.cart button.button.alt.single_add_to_cart_button,
body.single-product.woocommerce-page div.product.mgv-product form.cart button[name="add-to-cart"],
body.single-product .woocommerce div.product.mgv-product form.cart button.single_add_to_cart_button,
body.single-product .woocommerce div.product.mgv-product form.cart button.button.single_add_to_cart_button,
body.single-product .woocommerce div.product.mgv-product form.cart button.button.alt.single_add_to_cart_button,
body.single-product .woocommerce div.product.mgv-product form.cart button[name="add-to-cart"],
body.single-product .woocommerce div.product.mgv-product .mgv-summary__cart form.cart button.single_add_to_cart_button,
body.single-product .woocommerce div.product.mgv-product .mgv-summary__cart form.cart button.button.alt.single_add_to_cart_button{
  appearance: none !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: auto !important;
  height: 46px !important;
  min-height: 46px !important;
  max-height: 46px !important;
  margin: 0 !important;
  padding: 0 24px !important;
  border: 1px solid rgba(255,255,255,.34) !important;
  border-radius: 5px !important;
  background-color: #0D544E !important;
  background-image: linear-gradient(180deg, #0FA3A6 0%, #0D544E 100%) !important;
  background: linear-gradient(180deg, #0FA3A6 0%, #0D544E 100%) !important;
  color: #FFE887 !important;
  box-shadow: -2px 2px 3px rgba(0,0,0,.34) !important;
  font-family: var(--mgv-font-body, Arial, sans-serif) !important;
  font-size: 16px !important;
  font-weight: 800 !important;
  line-height: 1 !important;
  letter-spacing: .01em !important;
  text-align: center !important;
  text-decoration: none !important;
  text-shadow: none !important;
  text-transform: none !important;
  white-space: nowrap !important;
  cursor: pointer !important;
  box-sizing: border-box !important;
}

body.single-product.woocommerce div.product.mgv-product form.cart button.single_add_to_cart_button:hover,
body.single-product.woocommerce div.product.mgv-product form.cart button.button.single_add_to_cart_button:hover,
body.single-product.woocommerce div.product.mgv-product form.cart button.button.alt.single_add_to_cart_button:hover,
body.single-product.woocommerce div.product.mgv-product form.cart button[name="add-to-cart"]:hover,
body.single-product.woocommerce-page div.product.mgv-product form.cart button.single_add_to_cart_button:hover,
body.single-product.woocommerce-page div.product.mgv-product form.cart button.button.single_add_to_cart_button:hover,
body.single-product.woocommerce-page div.product.mgv-product form.cart button.button.alt.single_add_to_cart_button:hover,
body.single-product.woocommerce-page div.product.mgv-product form.cart button[name="add-to-cart"]:hover,
body.single-product .woocommerce div.product.mgv-product form.cart button.single_add_to_cart_button:hover,
body.single-product .woocommerce div.product.mgv-product form.cart button.button.single_add_to_cart_button:hover,
body.single-product .woocommerce div.product.mgv-product form.cart button.button.alt.single_add_to_cart_button:hover,
body.single-product .woocommerce div.product.mgv-product form.cart button[name="add-to-cart"]:hover,
body.single-product .woocommerce div.product.mgv-product .mgv-summary__cart form.cart button.single_add_to_cart_button:hover,
body.single-product .woocommerce div.product.mgv-product .mgv-summary__cart form.cart button.button.alt.single_add_to_cart_button:hover{
  background-color: #0B6B63 !important;
  background-image: linear-gradient(180deg, #18B7BA 0%, #0B6B63 100%) !important;
  background: linear-gradient(180deg, #18B7BA 0%, #0B6B63 100%) !important;
  color: #FFE887 !important;
  box-shadow: -2px 3px 5px rgba(0,0,0,.40) !important;
}

body.single-product .woocommerce div.product.mgv-product form.cart button.single_add_to_cart_button:active,
body.single-product .woocommerce div.product.mgv-product form.cart button.button.alt.single_add_to_cart_button:active,
body.single-product .woocommerce div.product.mgv-product form.cart button[name="add-to-cart"]:active{
  transform: translateY(1px) !important;
}


/* =========================================
   2. FRETE / CEP — INFIXS CORREIOS
   ========================================= */

body.single-product .woocommerce div.product.mgv-product .infixs-correios-automatico-calculator{
  margin-top: 22px !important;
  padding: 0 !important;
  font-family: var(--mgv-font-body, Arial, sans-serif) !important;
}

body.single-product .woocommerce div.product.mgv-product .infixs-correios-automatico-title,
body.single-product .woocommerce div.product.mgv-product .infixs-correios-automatico-calculator > p:first-child{
  display: block !important;
  margin: 0 0 9px !important;
  padding: 0 !important;
  color: #111 !important;
  font-family: var(--mgv-font-body, Arial, sans-serif) !important;
  font-size: 16px !important;
  font-weight: 800 !important;
  line-height: 1.15 !important;
  text-transform: none !important;
  text-decoration: none !important;
}

/* Estrutura real do plugin */
body.single-product .woocommerce div.product.mgv-product .infixs-correios-automatico-calculate-box{
  display: flex !important;
  align-items: center !important;
  justify-content: flex-start !important;
  flex-wrap: nowrap !important;
  gap: 16px !important;
  margin: 0 !important;
  padding: 0 !important;
}

/* Wrapper do ícone + input: sem borda, para o ícone ficar fora do campo */
body.single-product .woocommerce div.product.mgv-product .infixs-correios-automatico-input-text{
  display: flex !important;
  align-items: center !important;
  flex: 0 1 248px !important;
  width: 248px !important;
  min-width: 210px !important;
  max-width: 248px !important;
  height: 46px !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  gap: 7px !important;
  box-sizing: border-box !important;
}

/* Ícone do frete: visível, fora do input */
body.single-product .woocommerce div.product.mgv-product .infixs-correios-automatico-input-text svg,
body.single-product .woocommerce div.product.mgv-product .infixs-correios-automatico-input-text i,
body.single-product .woocommerce div.product.mgv-product .infixs-correios-automatico-input-text img,
body.single-product .woocommerce div.product.mgv-product .infixs-correios-automatico-input-text [class*="icon"],
body.single-product .woocommerce div.product.mgv-product .infixs-correios-automatico-input-text [class*="Icon"]{
  position: static !important;
  display: inline-block !important;
  visibility: visible !important;
  flex: 0 0 28px !important;
  width: 28px !important;
  min-width: 28px !important;
  max-width: 28px !important;
  height: 28px !important;
  min-height: 28px !important;
  max-height: 28px !important;
  margin: 0 !important;
  padding: 0 !important;
  color: #111 !important;
  opacity: 1 !important;
  overflow: visible !important;
}

/* Input real do CEP */
body.single-product .woocommerce div.product.mgv-product .infixs-correios-automatico-input-text input,
body.single-product .woocommerce div.product.mgv-product .infixs-correios-automatico-input-text input[type="text"],
body.single-product .woocommerce div.product.mgv-product .infixs-correios-automatico-input-text input[type="tel"],
body.single-product .woocommerce div.product.mgv-product .infixs-correios-automatico-input-text input.input-text{
  display: block !important;
  flex: 1 1 auto !important;
  width: auto !important;
  min-width: 0 !important;
  height: 46px !important;
  min-height: 46px !important;
  max-height: 46px !important;
  margin: 0 !important;
  padding: 0 14px !important;
  border: 1px solid rgba(0,0,0,.28) !important;
  border-radius: 0 !important;
  background: #fff !important;
  background-image: none !important;
  box-shadow: none !important;
  color: #222 !important;
  font-family: var(--mgv-font-body, Arial, sans-serif) !important;
  font-size: 16px !important;
  font-weight: 400 !important;
  line-height: 46px !important;
  text-indent: 0 !important;
  box-sizing: border-box !important;
}

body.single-product .woocommerce div.product.mgv-product .infixs-correios-automatico-input-text input::placeholder{
  color: rgba(0,0,0,.48) !important;
  opacity: 1 !important;
}

/* Wrapper do botão */
body.single-product .woocommerce div.product.mgv-product .infixs-correios-automatico-postcode-button-box{
  display: flex !important;
  align-items: center !important;
  flex: 0 0 auto !important;
  width: auto !important;
  height: 46px !important;
  margin: 0 !important;
  padding: 0 !important;
}

/* Botão Calcular: o plugin usa <a class="button alt ..."> */
body.single-product.woocommerce div.product.mgv-product .infixs-correios-automatico-postcode-button-box a[name="infixs-correios-automatico-postcode"],
body.single-product.woocommerce div.product.mgv-product .infixs-correios-automatico-postcode-button-box a.infixs-correios-automatico-calculate-submit,
body.single-product.woocommerce div.product.mgv-product .infixs-correios-automatico-postcode-button-box a.infixs-correios-automatico-calculate-submit.button,
body.single-product.woocommerce div.product.mgv-product .infixs-correios-automatico-postcode-button-box a.infixs-correios-automatico-calculate-submit.button.alt,
body.single-product .woocommerce div.product.mgv-product .infixs-correios-automatico-postcode-button-box a[name="infixs-correios-automatico-postcode"],
body.single-product .woocommerce div.product.mgv-product .infixs-correios-automatico-postcode-button-box a.infixs-correios-automatico-calculate-submit,
body.single-product .woocommerce div.product.mgv-product .infixs-correios-automatico-postcode-button-box a.infixs-correios-automatico-calculate-submit.button,
body.single-product .woocommerce div.product.mgv-product .infixs-correios-automatico-postcode-button-box a.infixs-correios-automatico-calculate-submit.button.alt{
  appearance: none !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: auto !important;
  height: 46px !important;
  min-height: 46px !important;
  max-height: 46px !important;
  margin: 0 !important;
  padding: 0 22px !important;
  border: 1px solid rgba(255,255,255,.32) !important;
  border-radius: 5px !important;
  background-color: #429EA1 !important;
  background-image: linear-gradient(180deg, #5DB7BA 0%, #429EA1 100%) !important;
  background: linear-gradient(180deg, #5DB7BA 0%, #429EA1 100%) !important;
  color: #fff !important;
  box-shadow: -2px 2px 3px rgba(0,0,0,.25) !important;
  font-family: var(--mgv-font-body, Arial, sans-serif) !important;
  font-size: 15px !important;
  font-weight: 800 !important;
  line-height: 1 !important;
  text-align: center !important;
  text-decoration: none !important;
  text-shadow: none !important;
  text-transform: none !important;
  white-space: nowrap !important;
  cursor: pointer !important;
  box-sizing: border-box !important;
}

body.single-product.woocommerce div.product.mgv-product .infixs-correios-automatico-postcode-button-box a[name="infixs-correios-automatico-postcode"]:hover,
body.single-product.woocommerce div.product.mgv-product .infixs-correios-automatico-postcode-button-box a.infixs-correios-automatico-calculate-submit:hover,
body.single-product.woocommerce div.product.mgv-product .infixs-correios-automatico-postcode-button-box a.infixs-correios-automatico-calculate-submit.button:hover,
body.single-product.woocommerce div.product.mgv-product .infixs-correios-automatico-postcode-button-box a.infixs-correios-automatico-calculate-submit.button.alt:hover,
body.single-product .woocommerce div.product.mgv-product .infixs-correios-automatico-postcode-button-box a[name="infixs-correios-automatico-postcode"]:hover,
body.single-product .woocommerce div.product.mgv-product .infixs-correios-automatico-postcode-button-box a.infixs-correios-automatico-calculate-submit:hover,
body.single-product .woocommerce div.product.mgv-product .infixs-correios-automatico-postcode-button-box a.infixs-correios-automatico-calculate-submit.button:hover,
body.single-product .woocommerce div.product.mgv-product .infixs-correios-automatico-postcode-button-box a.infixs-correios-automatico-calculate-submit.button.alt:hover{
  background-color: #429EA1 !important;
  background-image: linear-gradient(180deg, #69C4C7 0%, #429EA1 100%) !important;
  background: linear-gradient(180deg, #69C4C7 0%, #429EA1 100%) !important;
  color: #fff !important;
  box-shadow: -2px 3px 5px rgba(0,0,0,.32) !important;
}

/* Link "Não sei meu CEP" */
body.single-product .woocommerce div.product.mgv-product .infixs-correios-automatico-calculator a[href*="buscacep"],
body.single-product .woocommerce div.product.mgv-product .infixs-correios-automatico-calculator a:not(.button):not(.infixs-correios-automatico-calculate-submit){
  display: inline-block !important;
  margin-top: 6px !important;
  color: #0D544E !important;
  font-family: var(--mgv-font-body, Arial, sans-serif) !important;
  font-size: 12px !important;
  line-height: 1.2 !important;
  text-decoration: underline !important;
  box-shadow: none !important;
  background: transparent !important;
}

@media (max-width: 575px){
  body.single-product.woocommerce div.product.mgv-product form.cart,
  body.single-product.woocommerce-page div.product.mgv-product form.cart,
  body.single-product .woocommerce div.product.mgv-product form.cart,
  body.single-product .woocommerce div.product.mgv-product .mgv-summary__cart form.cart{
    gap: 7px !important;
  }

  body.single-product.woocommerce div.product.mgv-product form.cart .quantity input.qty,
  body.single-product.woocommerce-page div.product.mgv-product form.cart .quantity input.qty,
  body.single-product .woocommerce div.product.mgv-product form.cart .quantity input.qty{
    width: 66px !important;
  }

  body.single-product.woocommerce div.product.mgv-product form.cart button.button.alt.single_add_to_cart_button,
  body.single-product.woocommerce-page div.product.mgv-product form.cart button.button.alt.single_add_to_cart_button,
  body.single-product .woocommerce div.product.mgv-product form.cart button.button.alt.single_add_to_cart_button,
  body.single-product .woocommerce div.product.mgv-product .mgv-summary__cart form.cart button.single_add_to_cart_button{
    flex: 1 1 auto !important;
    min-width: 0 !important;
    padding: 0 12px !important;
    font-size: 14px !important;
  }

  body.single-product .woocommerce div.product.mgv-product .infixs-correios-automatico-calculate-box{
    gap: 10px !important;
  }

  body.single-product .woocommerce div.product.mgv-product .infixs-correios-automatico-input-text{
    flex: 1 1 auto !important;
    width: auto !important;
    min-width: 0 !important;
    max-width: none !important;
    gap: 6px !important;
  }

  body.single-product .woocommerce div.product.mgv-product .infixs-correios-automatico-input-text svg,
  body.single-product .woocommerce div.product.mgv-product .infixs-correios-automatico-input-text i,
  body.single-product .woocommerce div.product.mgv-product .infixs-correios-automatico-input-text img,
  body.single-product .woocommerce div.product.mgv-product .infixs-correios-automatico-input-text [class*="icon"],
  body.single-product .woocommerce div.product.mgv-product .infixs-correios-automatico-input-text [class*="Icon"]{
    flex-basis: 24px !important;
    width: 24px !important;
    min-width: 24px !important;
    height: 24px !important;
  }

  body.single-product .woocommerce div.product.mgv-product .infixs-correios-automatico-postcode-button-box a.infixs-correios-automatico-calculate-submit,
  body.single-product .woocommerce div.product.mgv-product .infixs-correios-automatico-postcode-button-box a[name="infixs-correios-automatico-postcode"]{
    padding: 0 16px !important;
    font-size: 14px !important;
  }
}
