/**
 * Override: Layout do frete idêntico ao famosinhosshop.com
 * - Página produto: ícone caminhão + badge "Frete grátis" (pill verde) + "Receba até [data]" + Taxa de envio riscada
 * - Checkout: linha Frete | valor com mesmo estilo
 */

/* Linha original de frete (React): oculta quando substituída pelo bloco customizado */
[data-frete-original="1"] {
  display: none !important;
}

/* ========== PÁGINA DE PRODUTO: bloco frete grátis (idêntico famosinhos) ========== */
.product-frete-block {
  display: flex !important;
  align-items: center !important;
  gap: 12px !important;
  padding-bottom: 12px !important;
  margin-bottom: 12px !important;
  border-bottom: 1px solid rgb(240, 240, 240) !important;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, sans-serif !important;
}

.product-badge.product-badge-frete {
  display: inline-flex !important;
  align-items: center !important;
  padding: 4px 10px !important;
  border-radius: 999px !important;
  font-size: 13px !important;
  font-weight: 600 !important;
  color: #27BF93 !important;
  background: #EDF7F5 !important;
}

.product-frete-block .product-frete-date {
  font-size: 12px !important;
  color: rgb(117, 117, 117) !important;
  font-weight: 400 !important;
}

.product-frete-block .product-frete-taxa {
  font-size: 12px !important;
  color: rgb(117, 117, 117) !important;
  font-weight: 400 !important;
}

.product-frete-block .product-frete-taxa span {
  text-decoration: line-through !important;
}

/* Layout base da linha de frete (idêntico ao HTML de referência) */
.checkout-summary-totals .checkout-summary-row,
.checkout-cart-summary .checkout-summary-row {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  padding-bottom: 12px !important;
  margin-bottom: 12px !important;
  border-bottom: 1px solid rgb(240, 240, 240) !important;
  font-size: 13px !important;
  color: rgb(34, 34, 34) !important;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, sans-serif !important;
}

.checkout-summary-totals .checkout-summary-row > *:last-child,
.checkout-cart-summary .checkout-summary-row > *:last-child {
  font-size: 13px !important;
  color: rgb(34, 34, 34) !important;
  font-weight: 500 !important;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, sans-serif !important;
}

/* Linha de resumo quando o frete é grátis */
.checkout-summary-row:has(.checkout-free) {
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 12px;
}

/* Label "Frete" vira badge "Frete grátis" (verde, pill) */
.checkout-summary-row:has(.checkout-free) > *:first-child {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #e8f5e9;
  color: #2e7d32;
  padding: 4px 10px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 14px;
}

.checkout-summary-row:has(.checkout-free) > *:first-child::after {
  content: " grátis";
}

/* Valor "R$ 0,00" ou "Grátis" em verde */
.checkout-summary-row .checkout-free {
  color: #2e7d32 !important;
  font-weight: 700 !important;
  background: transparent;
}

/* Bloco de frete no resumo: quando grátis, taxa original riscada */
.checkout-summary-totals .checkout-summary-row.checkout-frete-row .checkout-taxa-envio-original,
.checkout-summary-row:has(.checkout-free) + .checkout-summary-row span:last-child,
.checkout-shipping-section .checkout-summary-row:has(.checkout-free) ~ * .checkout-taxa-envio-valor {
  text-decoration: line-through !important;
  color: #999 !important;
  font-weight: 400;
}

/* Seção de frete no checkout: título + opção grátis com badge */
.checkout-shipping-price-free {
  color: #2e7d32 !important;
  font-weight: 700 !important;
  background: #e8f5e9;
  padding: 2px 8px;
  border-radius: 6px;
}

/* Cart: banner frete grátis (reforçar estilo do print) */
.cart-free-shipping-banner {
  background: #e8f5e9 !important;
  border-radius: 8px;
}

.cart-free-shipping-banner span {
  color: #2e7d32 !important;
  font-weight: 600 !important;
}

/* Resumo checkout: linha "Frete" com valor grátis - data de entrega em cinza ao lado do badge */
.checkout-summary-row:has(.checkout-free) .checkout-entrega-date {
  color: #666;
  font-size: 13px;
  font-weight: 400;
}

/* ========== PÁGINA PRODUTO: scroll até o final ========== */
html {
  overflow-x: hidden;
  overflow-y: scroll; /* força scroll no documento */
  -webkit-overflow-scrolling: touch;
  height: 100%;
}

body {
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  min-height: 100%;
  position: relative;
}

#root,
.container {
  overflow: visible !important;
  min-height: 100%;
}

.product-detail-page {
  overflow: visible !important;
  padding-bottom: 140px;
  min-height: auto;
}

/* Garantir que a galeria não impeça o scroll da página (só o horizontal da galeria) */
.product-gallery-wrap {
  touch-action: pan-y pinch-zoom;
}
