/*
Theme Name: Anfarmag Central de Negócios
Theme URI: https://centraldenegocios.anfarmag.org.br
Author: Accio Tech
Description: Tema da Central de Negócios Anfarmag (catálogo + cotação RFQ).
Version: 0.5.3
Requires at least: 6.4
Tested up to: 6.7
Requires PHP: 8.1
Text Domain: anfarmag-cn
*/

/*
 * Logo — trava pelo src (funciona mesmo se header.php antigo estiver no ar).
 * WooCommerce reseta img { height:auto; max-width:100% } e explode a logo na /loja/.
 */
header a img[src*="logo-central-negocios"],
footer a img[src*="logo-central-negocios"],
header img.anfarmag-site-logo,
footer img.anfarmag-site-logo,
.anfarmag-site-logo {
  display: block !important;
  height: 28px !important;
  width: auto !important;
  max-width: 120px !important;
  max-height: 28px !important;
  object-fit: contain !important;
}
@media (min-width: 768px) {
  header a img[src*="logo-central-negocios"],
  footer a img[src*="logo-central-negocios"],
  header img.anfarmag-site-logo,
  footer img.anfarmag-site-logo,
  .anfarmag-site-logo {
    height: 32px !important;
    max-width: 140px !important;
    max-height: 32px !important;
  }
}
footer a img[src*="logo-central-negocios"],
footer img.anfarmag-site-logo--footer,
.anfarmag-site-logo--footer {
  height: 36px !important;
  max-width: 150px !important;
  max-height: 36px !important;
}
@media (min-width: 768px) {
  footer a img[src*="logo-central-negocios"],
  footer img.anfarmag-site-logo--footer,
  .anfarmag-site-logo--footer {
    height: 40px !important;
    max-width: 168px !important;
    max-height: 40px !important;
  }
}

/* Cards de produto — área de imagem sempre 200px (home, clube, compras coletivas) */
.anfarmag-product-card-media {
  display: block;
  height: 200px !important;
  overflow: hidden;
}
.anfarmag-product-card-media img {
  width: 100% !important;
  height: 100% !important;
  max-height: 100% !important;
  object-fit: contain !important;
}

/* Estilos complementares — layout principal via Tailwind CDN */
.woocommerce-message,
.woocommerce-info,
.woocommerce-error {
  max-width: 80rem;
  margin: 1rem auto;
  padding: 0.75rem 1rem;
  border-radius: 0.5rem;
  font-size: 0.875rem;
}
.woocommerce-message { background: #ecfdf5; color: #065f46; border: 1px solid #a7f3d0; }
.woocommerce-info { background: #eff6ff; color: #1e40af; border: 1px solid #bfdbfe; }
.woocommerce-error { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; list-style: none; }

.scrollbar-none::-webkit-scrollbar { display: none; }
.scrollbar-none { -ms-overflow-style: none; scrollbar-width: none; }

/* Drawer cart */
.anfarmag-cart-drawer[aria-hidden="false"] { pointer-events: auto; }
.anfarmag-cart-panel { will-change: transform; }

/* Botão WC single add to cart alinhado ao tema */
.single_add_to_cart_button.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.375rem;
  background: #0b3b82 !important;
  color: #fff !important;
  border-radius: 0.5rem;
  font-weight: 600;
  font-size: 0.875rem;
  padding: 0.75rem 1.25rem;
  border: 0;
}
.single_add_to_cart_button.button:hover {
  background: #1e3a8a !important;
}

/* Esconde "Ver cotação" / View cart do WooCommerce */
a.added_to_cart,
a.added_to_cart.wc-forward,
.woocommerce-message a.button.wc-forward {
  display: none !important;
}

.anfarmag-qty-input::-webkit-outer-spin-button,
.anfarmag-qty-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

/* Paginação Woo padrão escondida quando usamos a custom */
.woocommerce-pagination { display: none; }

.anfarmag-pagination a { text-decoration: none; }

/* Preço De / Por — visual único (simple, variável e após selecionar variação) */
.anfarmag-price-de-por {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.15rem;
}
.anfarmag-price-de {
  color: #94a3b8;
  text-decoration: line-through;
  font-weight: 400;
  font-size: 0.875rem;
  line-height: 1.25;
}
.anfarmag-price-por {
  display: inline-flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.35rem;
  color: #005cba;
  font-weight: 800;
}
.anfarmag-price-por-label {
  color: #00265c;
  font-size: 0.875rem;
  font-weight: 600;
}
.anfarmag-price-por-value,
.anfarmag-price-only {
  color: #005cba;
  font-weight: 800;
}

/* Single: Por em destaque */
.anfarmag-single-price .anfarmag-price-de {
  font-size: 0.875rem;
}
.anfarmag-single-price .anfarmag-price-por-label {
  font-size: 0.9375rem;
  font-weight: 600;
  color: #00265c;
}
.anfarmag-single-price .anfarmag-price-por-value,
.anfarmag-single-price .anfarmag-price-only {
  font-size: 2rem;
  line-height: 2.25rem;
  letter-spacing: -0.025em;
}

/* Card / modal: compacto */
.anfarmag-card-price .anfarmag-price-de {
  font-size: 0.75rem;
}
.anfarmag-card-price .anfarmag-price-por-label {
  font-size: 0.75rem;
}
.anfarmag-card-price .anfarmag-price-por-value,
.anfarmag-card-price .anfarmag-price-only {
  font-size: 0.875rem;
  font-weight: 700;
}
