/* ================== Polish Product — Caltech Agro ==================
   Layer de polimento para as páginas individuais de produtos.
   Cobre os padrões: biobox, acadian, azon e 50+ páginas similares.
   Carregado via menu.php em todas as páginas. Aplica apenas onde as
   classes de produto existem — inerte em outras páginas.
===================================================================== */

/* ===== 0. Body polish só quando a página tem produto ===== */
body:has(.banner + .content),
body:has(.banner + section.content),
body:has(> header > img),
body:has(main > .intro),
body:has(main > .product) {
  font-family: 'Inter', 'Segoe UI', Arial, sans-serif !important;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  color: var(--pol-ink) !important;
  background-color: #ffffff !important;
  margin: 0;
}

/* ===== 1. Banner de produto ===== */
.banner {
  width: 100%;
  height: 62vh !important;
  min-height: 420px;
  max-height: 620px;
  overflow: hidden !important;
  position: relative !important;
  background-color: #081d08;
}

.banner img {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  display: block;
  animation: productBannerZoom 28s ease-in-out infinite alternate;
}

.banner::after {
  content: '';
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(8, 24, 8, 0.35) 0%, rgba(8, 24, 8, 0) 35%, rgba(8, 24, 8, 0) 70%, rgba(8, 24, 8, 0.55) 100%);
  pointer-events: none;
}

.banner::before {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(139, 195, 74, 0.5), transparent);
  z-index: 2;
}

@keyframes productBannerZoom {
  0% { transform: scale(1.02); }
  100% { transform: scale(1.08); }
}

/* Variante: página com <header><img></header> (azon, etc) */
body > header:has(> img:only-child),
main > header:has(> img:only-child) {
  display: block;
  width: 100%;
  height: 62vh;
  min-height: 420px;
  max-height: 620px;
  overflow: hidden;
  position: relative;
  background-color: #081d08;
  margin: 0;
  padding: 0;
}

body > header > img:only-child,
main > header > img:only-child {
  width: 100% !important;
  height: 100% !important;
  max-height: 100% !important;
  min-height: 100% !important;
  object-fit: cover !important;
  display: block !important;
}

/* ===== 2. Content wrapper ===== */
.content,
main:not(:has(.product)) {
  max-width: 960px !important;
  margin: 0 auto !important;
  padding: 100px 40px !important;
  text-align: center;
}

/* ===== 3. Title imagem (quando produto usa imagem como título) ===== */
.titulo-imagen,
.intro img,
.text-content h1 img,
.text-content h2 img,
.description h1 img,
.description h2 img,
.product-intro h1 img,
.product-intro h2 img {
  max-width: 320px !important;
  width: auto !important;
  height: auto !important;
  margin: 0 auto 36px !important;
  display: block !important;
  filter: drop-shadow(0 10px 24px rgba(0, 60, 0, 0.18));
}

.text-content h1,
.text-content h2,
.description h1,
.product-intro h1 {
  text-align: center !important;
}

.intro {
  text-align: center;
  padding: 80px 40px 20px;
}

/* ===== 4. Descripción / Text content ===== */
.description,
.text-content,
.usage-instructions {
  text-align: center !important;
  margin: 0 auto 56px !important;
  max-width: 780px;
}

.description h2,
.text-content h2,
.product-details h2,
.usage-instructions h2,
.product .right h2 {
  font-family: 'Fraunces', 'Playfair Display', Georgia, serif !important;
  font-weight: 400 !important;
  font-size: clamp(1.8rem, 2vw + 1rem, 2.6rem) !important;
  line-height: 1.15 !important;
  letter-spacing: -0.015em !important;
  color: var(--pol-ink) !important;
  margin: 0 0 22px !important;
  position: relative;
  display: inline-block;
}

.description h2::before,
.text-content h2::before,
.product-details h2::before,
.usage-instructions h2::before {
  content: '';
  display: block;
  margin: 0 auto 18px;
  width: 40px;
  height: 2px;
  background: var(--pol-green);
}

.product .right h2::before { display: none; }

.description p,
.text-content p,
.usage-instructions p,
.product .right p {
  font-family: 'Inter', sans-serif !important;
  font-size: 1.05rem !important;
  line-height: 1.8 !important;
  color: var(--pol-muted) !important;
  max-width: 700px !important;
  margin: 0 auto 16px !important;
  text-align: center !important;
}

.description p em,
.text-content p em,
.product-details p em,
.product .right p em {
  font-style: italic;
  color: var(--pol-green-deep);
}

.description p strong,
.text-content p strong,
.usage-instructions p strong,
.product .right p strong {
  color: var(--pol-ink);
  font-weight: 600;
}

/* ===== 5. Separador (linha) ===== */
.separator {
  width: 60px !important;
  height: 2px !important;
  background: var(--pol-green) !important;
  margin: 60px auto !important;
  opacity: 0.6;
  border: 0 !important;
}

/* ===== 6. Imagem separadora (ex: BioBox image central) ===== */
.separator-image {
  margin: 0 auto 60px !important;
  padding: 40px 0;
  position: relative;
}

.separator-image::before {
  content: '';
  position: absolute;
  top: 0; left: 50%;
  transform: translateX(-50%);
  width: 70%;
  height: 70%;
  background: radial-gradient(circle at 50% 50%, rgba(139, 195, 74, 0.18), transparent 70%);
  filter: blur(24px);
  z-index: -1;
}

.separator-image img {
  width: 100% !important;
  max-width: 560px !important;
  height: auto !important;
  display: block;
  margin: 0 auto !important;
  filter: drop-shadow(0 30px 60px rgba(0, 60, 0, 0.2));
}

/* ===== 7. Ventajas (lista) polish ===== */
.product-details {
  max-width: 780px !important;
  margin: 0 auto 56px !important;
  padding: 0 20px;
  text-align: center !important;
}

.ventajas-content {
  text-align: center !important;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 32px;
}

.ventajas-content .ventajas-image {
  max-width: 260px !important;
  width: auto !important;
  height: auto !important;
  filter: drop-shadow(0 14px 30px rgba(0, 60, 0, 0.18));
  margin: 0 auto;
}

.ventajas-content ul {
  list-style: none !important;
  padding: 0 !important;
  margin: 0 auto !important;
  display: grid !important;
  grid-template-columns: 1fr 1fr;
  gap: 14px 40px;
  max-width: 720px;
  text-align: left !important;
}

@media (max-width: 720px) {
  .ventajas-content ul { grid-template-columns: 1fr; }
}

.ventajas-content ul li {
  position: relative;
  padding: 10px 10px 10px 36px !important;
  margin: 0 !important;
  font-size: 0.98rem !important;
  line-height: 1.55 !important;
  color: var(--pol-muted);
  border-bottom: 1px solid var(--pol-line);
}

.ventajas-content ul li::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 0;
  transform: translateY(-50%);
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--pol-green-tint);
  border: 1px solid var(--pol-green-soft);
}

.ventajas-content ul li::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 7px;
  width: 8px;
  height: 5px;
  border-left: 2px solid var(--pol-green-deep);
  border-bottom: 2px solid var(--pol-green-deep);
  transform: translateY(-70%) rotate(-45deg);
}

/* ===== 8. Layout 2-cols (azon, agromag, etc: <div.product> > .left + .right) ===== */
.product {
  display: grid !important;
  grid-template-columns: 1fr 1fr !important;
  gap: 72px !important;
  align-items: center !important;
  max-width: 1200px !important;
  margin: 100px auto !important;
  padding: 0 40px !important;
}

.product .left {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
  background: linear-gradient(135deg, #f8faf6 0%, #eef6ea 100%);
  border-radius: 24px;
  border: 1px solid var(--pol-line);
}

.product .left img {
  max-width: 100% !important;
  width: auto !important;
  height: auto !important;
  max-height: 420px;
  filter: drop-shadow(0 24px 48px rgba(0, 60, 0, 0.2));
}

.product .right {
  text-align: left !important;
}

.product .right h2 {
  text-align: left !important;
  margin-top: 0 !important;
}

.product .right h2::before { display: none !important; }

.product .right p {
  text-align: left !important;
  margin-left: 0 !important;
}

/* Tag discreta antes do h2 se existir multiple */
.product .right h2 + p + h2 {
  margin-top: 32px !important;
  padding-top: 32px;
  border-top: 1px solid var(--pol-line);
}

@media (max-width: 900px) {
  .product {
    grid-template-columns: 1fr !important;
    gap: 36px !important;
    padding: 0 20px !important;
    margin: 64px auto !important;
  }
  .product .left { padding: 28px; }
  .product .right h2,
  .product .right p { text-align: center !important; }
}

/* ===== 9. Usage instructions ===== */
.usage-instructions {
  padding: 40px 36px !important;
  background: linear-gradient(180deg, #f8faf6 0%, #ffffff 100%);
  border: 1px solid var(--pol-line);
  border-radius: 18px;
  margin: 40px auto !important;
  max-width: 800px !important;
}

.usage-instructions h2 {
  margin: 0 0 16px !important;
}

.usage-instructions h2::before {
  margin: 0 auto 14px;
}

.usage-instructions p {
  max-width: none !important;
}

/* ===== 10. Responsivo ===== */
@media (max-width: 768px) {
  .banner { height: 48vh !important; min-height: 280px; }
  body > header:has(> img:only-child),
  main > header:has(> img:only-child) { height: 48vh; min-height: 280px; }

  .content,
  main:not(:has(.product)) { padding: 64px 22px !important; }

  .titulo-imagen,
  .intro img { max-width: 220px !important; margin-bottom: 28px !important; }

  .description h2,
  .text-content h2,
  .product-details h2,
  .usage-instructions h2,
  .product .right h2 { font-size: 1.7rem !important; }

  .separator-image img { max-width: 320px !important; }

  .ventajas-content ul li { font-size: 0.92rem !important; }

  .separator { margin: 42px auto !important; }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .banner img { animation: none !important; transform: none !important; }
}
