/*
Theme Name: Blocksy Child - NJ Global Fertilisers
Template: blocksy
Description: NJ Global Fertilisers child theme (dual-mode: India retail / international enquiry)
Version: 1.0.0
Text Domain: njgf
*/

:root {
  --bg: #FBF9F4;
  --bg-sunk: #F3EFE5;
  --green: #1F4A2C;
  --green-dark: #143020;
  --brown: #6B4423;
  --gold: #D9A441;
  --ink: #22201C;
  --muted: #7A756C;
  --line: rgba(107, 68, 35, 0.20);
  --font-serif: 'Zilla Slab', serif;
  --font-sans: 'Noto Sans', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
}

body { background: var(--bg); color: var(--ink); font-family: var(--font-sans); font-size: 16px; }
h1, h2, h3 { font-family: var(--font-serif); font-weight: 700; letter-spacing: -0.01em; color: var(--green); }
a { color: var(--green); }
a:hover { color: var(--green-dark); }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; } }

/* ---- Buttons ---- */
.njgf-btn-gold, .njgf-btn-outline, .njgf-btn-green {
  display: inline-block; font-family: var(--font-sans); font-weight: 600; font-size: 15px;
  padding: 12px 22px; border-radius: 4px; text-decoration: none; text-align: center;
  border: 2px solid transparent; cursor: pointer; box-shadow: none;
}
.njgf-btn-gold { background: var(--gold); color: var(--ink); border-color: var(--gold); }
.njgf-btn-gold:hover { background: transparent; color: var(--ink); border-color: var(--gold); }
.njgf-btn-outline { background: transparent; color: var(--green); border-color: var(--green); }
.njgf-btn-outline:hover { background: var(--green); color: #fff; }
.njgf-btn-green { background: var(--green); color: #fff; border-color: var(--green); padding: 10px 16px; font-size: 14px; }
.njgf-btn-green:hover { background: var(--green-dark); border-color: var(--green-dark); }

/* ---- Commerce grid (India) ---- */
.njgf-commerce-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; max-width: 1100px; margin: 0 auto; padding: 56px 24px; }
@media (min-width: 820px) { .njgf-commerce-grid { grid-template-columns: repeat(3, 1fr); gap: 24px; padding: 96px 24px; } }
.njgf-commerce-card { border: 1px solid var(--line); border-radius: 4px; background: var(--bg); padding: 16px; display: flex; flex-direction: column; gap: 8px; }
.njgf-commerce-card-media { display: block; aspect-ratio: 4 / 3; overflow: hidden; border-radius: 4px; background: var(--bg-sunk); }
.njgf-commerce-card-media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.njgf-commerce-card-media-placeholder { width: 100%; height: 100%; background: var(--bg-sunk); }
.njgf-commerce-card-title { font-size: 17px; margin: 4px 0 0; }
.njgf-commerce-card-title a { color: var(--ink); text-decoration: none; }
.njgf-commerce-price { font-family: var(--font-mono); font-size: 20px; font-weight: 700; color: var(--ink); }
.njgf-commerce-price .woocommerce-Price-amount { font-family: var(--font-mono); }
.njgf-commerce-cta { margin-top: 4px; }

/* ---- Spec table wrap (international) ---- */
.njgf-table-wrap { max-width: 1100px; margin: 0 auto; padding: 0 24px; overflow-x: auto; }
.njgf-table-wrap + .njgf-btn-gold { display: block; width: fit-content; margin: 24px auto 56px; }

/* ---- Lead forms (enquiry band / dealer band) ---- */
.njgf-lead-form { max-width: 720px; margin: 0 auto; }
.njgf-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 20px; }
@media (max-width: 620px) { .njgf-form-grid { grid-template-columns: 1fr; } }
.njgf-form-grid label { font-size: 14px; font-weight: 600; display: flex; flex-direction: column; gap: 6px; }
.njgf-permit-block { margin-bottom: 20px; }
.njgf-permit-question { font-weight: 700; display: block; margin-bottom: 6px; }
.njgf-permit-help { font-size: 13px; opacity: 0.85; margin: 0 0 10px; }
.njgf-permit-options { display: flex; gap: 20px; }
.njgf-permit-options label { display: flex; align-items: center; gap: 6px; font-weight: 600; }
.njgf-form-notice { border-radius: 4px; padding: 12px 16px; margin-bottom: 20px; font-size: 14.5px; font-weight: 600; }
.njgf-form-notice-success { background: rgba(31,74,44,0.12); color: var(--green); border: 1px solid var(--green); }
.njgf-form-notice-error { background: rgba(107,68,35,0.12); color: var(--brown); border: 1px solid var(--brown); }
.njgf-enquiry-band .njgf-form-notice-success { background: rgba(255,255,255,0.15); color: #fff; border-color: rgba(255,255,255,0.5); }
.njgf-enquiry-band .njgf-form-notice-error { background: rgba(0,0,0,0.15); color: #fff; border-color: rgba(255,255,255,0.5); }

/* ---- Dealer band ---- */
.njgf-dealer-band { background: var(--brown); color: #fff; padding: 56px 24px; }
.njgf-dealer-band h2 { color: #fff; }
.njgf-dealer-band .njgf-form-grid label { color: #fff; }
.njgf-dealer-band input, .njgf-dealer-band select { padding: 10px; border-radius: 4px; border: none; width: 100%; }

/* ---- Footer meta ---- */
.njgf-footer-meta { font-size: 13.5px; line-height: 1.7; }
.njgf-payment-logos { letter-spacing: 0.03em; opacity: 0.85; }

/* ---- Pincode checker ---- */
.njgf-pincode-checker { border: 1px solid var(--line); border-radius: 4px; padding: 16px; margin: 16px 0; }
.njgf-pincode-checker label { font-size: 14px; font-weight: 600; display: block; }
.njgf-pincode-row { display: flex; gap: 8px; margin-top: 6px; }
.njgf-pincode-row input { flex: 1; padding: 10px; border: 1px solid var(--line); border-radius: 4px; }
.njgf-pincode-result { font-size: 13.5px; margin: 10px 0 0; }
.njgf-pincode-result.njgf-pincode-ok { color: var(--green); font-weight: 600; }
.njgf-pincode-result.njgf-pincode-fail { color: var(--brown); font-weight: 600; }
.njgf-price-per-kg { font-size: 14px; color: var(--muted); }
.njgf-qty-stepper button { width: 32px; height: 32px; border: 1px solid var(--line); background: transparent; border-radius: 4px; font-size: 16px; cursor: pointer; }
.njgf-qty-stepper input.qty { width: 56px; text-align: center; padding: 6px; border: 1px solid var(--line); border-radius: 4px; }

/* ---- Utility bar ---- */
.njgf-utility-bar { position: sticky; top: 0; z-index: 50; background: var(--green); color: #fff; height: 36px; display: flex; align-items: center; justify-content: center; gap: 24px; font-size: 13px; padding: 0 16px; text-align: center; }
.njgf-utility-bar a { color: #fff; text-decoration: underline; }

/* ---- Nutrient panel (signature) ---- */
.njgf-nutrient-panel { background: var(--bg-sunk); padding: 56px 24px; }
.njgf-nutrient-panel .njgf-panel-inner { max-width: 900px; margin: 0 auto; border: 1px solid var(--line); background: var(--bg); border-radius: 4px; padding: 32px; }
/* .njgf-rule is a core/separator block (a real <hr>) so it survives being
   re-saved from the block editor — reset its default border/opacity first. */
.njgf-nutrient-panel .njgf-rule { border: none; opacity: 1; height: 2px; background: var(--brown); width: 64px; margin: 0 0 24px; }
.njgf-nutrient-panel .njgf-macro-row { display: flex; justify-content: space-between; border-bottom: 1px solid var(--line); padding-bottom: 8px; font-family: var(--font-mono); font-size: 17px; }
/* min-width:0 overrides the flex default of min-width:auto — without it, a
   wp-block-column refuses to shrink below its content's natural width and
   the chip row spills out past the panel border instead of wrapping. */
.njgf-nutrient-panel .wp-block-column { min-width: 0; }
.njgf-nutrient-panel .njgf-chip-row { display: flex; flex-wrap: wrap; gap: 8px; }
.njgf-nutrient-panel .njgf-chip { background: var(--bg-sunk); border: 1px solid var(--line); border-radius: 4px; padding: 6px 10px; font-family: var(--font-mono); font-size: 13px; white-space: nowrap; }

/* ---- Commerce block ---- */
.njgf-spec-table { width: 100%; border-collapse: collapse; background: var(--bg); font-size: 15px; }
.njgf-spec-table th { text-align: left; padding: 12px; border-bottom: 2px solid var(--brown); }
.njgf-spec-table td { padding: 12px; }
.njgf-spec-table tr:nth-child(even) { background: var(--bg-sunk); }
@media (max-width: 600px) {
  .njgf-spec-table, .njgf-spec-table thead, .njgf-spec-table tbody, .njgf-spec-table th, .njgf-spec-table td, .njgf-spec-table tr { display: block; }
  .njgf-spec-table thead { display: none; }
  .njgf-spec-table tr { border: 1px solid var(--line); border-radius: 4px; margin-bottom: 12px; padding: 8px; }
  .njgf-spec-table td { display: flex; justify-content: space-between; padding: 6px 8px; }
  .njgf-spec-table td::before { content: attr(data-label); font-weight: 600; color: var(--muted); }
}

/* ---- Enquiry band ---- */
.njgf-enquiry-band { background: var(--green); color: #fff; padding: 56px 24px; }
.njgf-enquiry-band h2 { color: #fff; }
.njgf-enquiry-band input, .njgf-enquiry-band select { padding: 10px; border-radius: 4px; border: none; width: 100%; }
.njgf-enquiry-band label { font-size: 14px; font-weight: 600; display: block; }
.njgf-permit-block { border: 1px solid rgba(255,255,255,0.3); border-radius: 4px; padding: 16px; background: rgba(255,255,255,0.06); }

/* ---- WhatsApp float ---- */
.njgf-whatsapp-float { position: fixed; bottom: 20px; right: 20px; width: 56px; height: 56px; border-radius: 50%; background: #25D366; display: flex; align-items: center; justify-content: center; box-shadow: 0 4px 12px rgba(0,0,0,0.25); z-index: 100; }

/* ---- Product page ---- */
.njgf-buybox-price { font-family: var(--font-mono); font-size: 30px; font-weight: 700; }
.njgf-pack-btn { border: 2px solid var(--line); border-radius: 4px; padding: 10px 16px; font-weight: 600; cursor: pointer; background: transparent; }
.njgf-pack-btn.selected { border-color: var(--green); background: var(--green); color: #fff; }
.njgf-cod-badge { display: inline-block; font-size: 12px; background: var(--green); color: #fff; padding: 4px 10px; border-radius: 4px; }
.njgf-spec-block { border: 1px solid var(--line); border-radius: 4px; padding: 20px; background: var(--bg-sunk); }
