/* MERCADAO DAS TINTAS - PAGINA DE PRODUTO (todos os produtos) - v2
   Carregado pelo layout.tpl so quando template == 'product'.
   Apenas aparencia: nao altera variacoes, quantidade, botao Comprar nem frete. */

/* =========================================================
   BLOCO DE PRECO
   Ordem final: De -> Por -> parcelamento -> preco no Pix -> selo
   ========================================================= */
body.template-product .price-container {
  display: flex !important;
  flex-direction: column;
  align-items: center;            /* celular: centralizado, como o tema */
  margin: 4px 0 6px;
}
/* "desmonta" as caixas internas do tema para poder reordenar os itens */
body.template-product .price-container > .mb-4,
body.template-product .price-container .js-product-payments-container { display: contents !important; }

/* --- De / Por --- */
body.template-product .price-container > .mb-4 > span:nth-of-type(2) { order: 1; }  /* De (preco antigo) */
body.template-product .price-container > .mb-4 > span:nth-of-type(1) { order: 2; }  /* Por (preco atual) */

body.template-product #compare_price_display {
  margin: 0 0 2px;
  color: #9aa0b5;
  font-size: 15px;
  line-height: 1.3;
}
body.template-product #compare_price_display::before {
  content: "De: ";
  display: inline-block;          /* evita que o "De:" fique riscado */
  margin-right: 4px;
  text-decoration: none;
}
body.template-product #price_display {
  color: #252772;
  font-size: 26px;
  font-weight: 700;
  line-height: 1.2;
}
/* "Por:" so aparece quando existe preco antigo (promocao) */
body.template-product .price-container:has(#compare_price_display:not([style*="none"])) #price_display::before {
  content: "Por: ";
  color: #9aa0b5;
  font-size: 15px;
  font-weight: 400;
}

/* --- Parcelamento (com icone de cartao) --- */
body.template-product .price-container .js-max-installments-container {
  order: 3;
  width: 100%;
  margin: 14px 0 0 !important;
  padding: 14px 0 0;
  border-top: 1px solid #e4e6f1;
  text-align: inherit;
}
body.template-product .price-container .product-installments {
  display: flex !important;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 4px;
  color: #3d3f55 !important;
  font-size: 15px;
  line-height: 1.4;
}
body.template-product .price-container .product-installments::before {
  content: "";
  flex: 0 0 auto;
  width: 26px;
  height: 18px;
  margin-right: 6px;
  background: no-repeat center / contain url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 26 18'%3E%3Crect x='1' y='1' width='24' height='16' rx='3' fill='none' stroke='%23252772' stroke-width='1.8'/%3E%3Crect x='1' y='5' width='24' height='3' fill='%23252772'/%3E%3Crect x='4' y='11' width='7' height='2' rx='1' fill='%23ff742b'/%3E%3C/svg%3E");
}
body.template-product .price-container .product-installment-amount,
body.template-product .price-container .product-installment-value { color: #252772; font-weight: 800; }

/* "Ver mais detalhes" vira "Mais formas de pagamento" */
body.template-product #btn-installments {
  order: 4;
  display: inline-block;
  margin: 6px 0 0;
  font-size: 0 !important;
  text-decoration: none !important;
  cursor: pointer;
}
body.template-product #btn-installments::after {
  content: "Mais formas de pagamento";
  color: #252772;
  font-size: 14px;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* --- Preco no Pix em destaque --- */
body.template-product .price-container .payment-discount-price-product-container {
  order: 5;
  display: flex !important;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 4px 6px;
  width: 100%;
  margin: 14px 0 0 !important;
  padding: 16px 0 0;
  border-top: 1px solid #e4e6f1;
  color: #252772 !important;
  font-size: 16px !important;
  font-weight: 700;
  line-height: 1.2;
}
/* selo "%" laranja */
body.template-product .price-container .payment-discount-price-product-container::before {
  content: "%";
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  margin-right: 6px;
  border-radius: 50%;
  background: #ff742b;
  color: #fff;
  font-size: 18px;
  font-weight: 800;
}
body.template-product .price-container .payment-discount-price-product {
  color: #ff742b;
  font-size: 36px;
  font-weight: 800;
  letter-spacing: -0.5px;
  line-height: 1;
}
body.template-product .price-container .js-payment-discount-name-product { font-weight: 800; }

/* "5% de desconto pagando com Pix" logo abaixo do preco no Pix */
body.template-product .price-container .js-product-discount-container {
  order: 6;
  margin: 6px 0 0 !important;
  color: #6b7088 !important;
  font-size: 14px !important;
}
body.template-product .price-container .js-product-discount-container .text-accent {
  color: #ff742b !important;
  font-weight: 800;
}

/* desktop: alinhado a esquerda */
@media (min-width: 768px) {
  body.template-product .price-container { align-items: flex-start; }
  body.template-product .price-container .product-installments,
  body.template-product .price-container .payment-discount-price-product-container { justify-content: flex-start; }
}

/* =========================================================
   VARIACOES (dentro de uma caixa)
   ========================================================= */
body.template-product #product_form .js-product-variants {
  margin: 0 0 18px !important;
  padding: 18px 18px 8px;
  border: 1px solid #e4e6f1;
  border-radius: 14px;
  background: #fff;
}
body.template-product #product_form .js-product-variants .form-label {
  margin-bottom: 8px;
  color: #6b7088;
  font-size: 14px;
}
body.template-product #product_form .js-insta-variation-label { color: #252772; font-weight: 800; }

body.template-product #product_form .btn-variant:not(.btn-variant-color) {
  min-height: 42px;
  margin: 0 8px 10px 0;
  padding: 9px 18px;
  border: 1.5px solid #d9dcea;
  border-radius: 10px;
  background: #fff;
  color: #252772;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.3;
  transition: border-color 0.15s ease, background 0.15s ease;
}
body.template-product #product_form .btn-variant:not(.btn-variant-color):hover { border-color: #252772; }
body.template-product #product_form .btn-variant.selected:not(.btn-variant-color) {
  border-color: #ff742b;
  background: #fff4ee;
  box-shadow: inset 0 0 0 1px #ff742b;
  font-weight: 800;
}

/* =========================================================
   QUANTIDADE + BOTAO COMPRAR
   ========================================================= */
body.template-product #product_form .form-quantity-product { border-radius: 12px; }

body.template-product #product_form .btn-add-to-cart {
  background-color: #ff742b !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='9' cy='21' r='1.5'/%3E%3Ccircle cx='19' cy='21' r='1.5'/%3E%3Cpath d='M1 1h4l2.7 13.4a2 2 0 0 0 2 1.6h9.7a2 2 0 0 0 2-1.6L23 6H6'/%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important;
  background-size: 22px 22px !important;
  background-position: calc(50% - 72px) center !important;
  border-color: #ff742b !important;
  color: #fff !important;
  border-radius: 12px;
  font-size: 17px;
  font-weight: 800;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  box-shadow: 0 10px 22px rgba(255, 116, 43, 0.28);
  transition: background-color 0.15s ease, transform 0.15s ease;
}
body.template-product #product_form .btn-add-to-cart:hover {
  background-color: #f0611a !important;
  border-color: #f0611a !important;
  transform: translateY(-1px);
}
body.template-product #product_form .js-addtocart-placeholder {
  background: #ff742b !important;
  border-color: #ff742b !important;
  color: #fff !important;
  border-radius: 12px;
  font-weight: 800;
}
/* sem estoque: discreto */
body.template-product #product_form .btn-add-to-cart:disabled,
body.template-product #product_form .btn-add-to-cart.nostock {
  background-color: #c9ccda !important;
  background-image: none !important;
  border-color: #c9ccda !important;
  box-shadow: none;
  transform: none;
}

/* =========================================================
   FRETE
   ========================================================= */
body.template-product #product-shipping-container {
  background: #fff;
  border: 1px solid #e4e6f1;
  border-radius: 14px;
  padding: 18px 18px 10px;
}
body.template-product #product-shipping-container .form-label {
  color: #252772;
  font-size: 15px;
  font-weight: 800;
  margin-bottom: 8px;
}
body.template-product #product-shipping-container .js-shipping-input { border-radius: 10px; }
body.template-product #product-shipping-container .js-calculate-shipping-wording {
  color: #ff742b !important;
  font-weight: 800;
  text-decoration: none !important;
}
body.template-product #product-shipping-container .js-shipping-zipcode-help { color: #6b7088 !important; }
