/* ==========================================================================
 * Mangwao Storefront Child — v1.2.39 (PDP root-cause spacing fix)
 * Loads last (dependency: mangwao-138). Every rule below targets ONE
 * boundary element of a measured rendered band, and states the rule that
 * actually produced the live value before this file. Nothing here touches
 * content, font sizes, colours, the card, the header, the lightbox
 * arrows, the Tags removal, or the newsletter.
 *
 * Why: rendered gap inventory under live 1.2.38 (visual estimates
 * ±20-30px, NOT devtools): (1) buy-box end -> tabs row ~200px on both
 * PDPs; (2) description panel end -> Related heading ~180-220px on both;
 * (3) buy-box looseness: price->desc ~55-65px, desc->cart ~50-70px,
 * cart->Why box ~40-70px; (4) related cards -> footer headings ~150px
 * (Peach) / ~145px (CeraVe: ~95px white band + ~50px footer top padding).
 * The 1.2.35/1.2.37/1.2.38 trims did NOT remove bands (1) and (2) because
 * the margins they cut were never the live values — see the two proven
 * vetoes below. Pixel savings are CSS-value arithmetic, not a screen
 * measurement.
 *
 * PROVEN VETO 1 — related margin was NEVER 22px: 1.2.30.css line 983
 * (v1.2.16) sets
 *   body.single-product section.related.products{...margin:60px auto 20px!important...}
 * unscoped, with !important. The 1.2.35 rule (margin 32px 0 16px, no
 * !important) and the 1.2.38 rule (margin-top 22px, no !important) both
 * LOSE to it, so the live related section was 60px top / 20px bottom
 * all along. That alone is 38px of band (2) and 4px of band (4) that
 * every earlier audit believed was already cut. The 1.2.39 related rule
 * below therefore carries !important too — the ONLY !important in this
 * file — with the identical selector, so load-last order wins it.
 *
 * PROVEN VETO 2 — panel padding/margin never did what 1.2.35 believed:
 * the child sets panel padding (1.2.30: 28px, 1.2.35: 18px) with the
 * selector .single-product .woocommerce-Tabs-panel = (0,2,0), but
 * WooCommerce core sets
 *   .woocommerce div.product .woocommerce-tabs .panel{margin:0 0 2em;padding:0}
 * at (0,4,1), which WINS on both properties. So live panel padding was
 * 0 (not 18) and live panel margin-bottom was 2em = 28px at the 14px
 * base font (the child never sets panel margin-bottom at all). Same
 * story for form.cart: child (0,2,1) 8px loses to WooCommerce core
 *   .woocommerce div.product form.cart{margin-bottom:2em} at (0,2,2),
 * so live cart margin-bottom was 28px, not 8px. And the summary itself:
 * the child never sets div.summary margin-bottom, so WooCommerce core
 *   .woocommerce div.product div.summary{margin-bottom:2em}
 * applies = 28px live. (WooCommerce core rules are standard public
 * defaults, not files on this VM — the child-code side of each veto,
 * selector + absence, IS proven from this theme's files.)
 *
 * What the proven stack accounts for, at the 14px base font
 * (style.css body font 14px/1.45):
 * - Band (1) buy-box end -> tab strip: summary mb 28 + tabs mt 24
 *   (1.2.35, wins: no !important veto on tabs margin) = 52px.
 * - Band (2) panel content end -> Related heading: panel mb 28 +
 *   tabs mb 20 (1.2.38, wins) + related mt 60 (veto 1) = 108px.
 * - Band (3) desc->cart: desc mb 10 (1.2.37, wins) + form mb 28
 *   (veto 2) = 38px + line-height extras ~10 = ~48, matching the
 *   measured 50-70px. cart->Why: form mb 28 + Why mt 10 = 38px +
 *   extras ~7 = ~45, matching the measured 40-70px.
 * - Band (4) related cards -> footer headings: related mb 20 (veto 1)
 *   + content-area mb ~37 (Storefront 2.617924em rhythm, value not
 *   verifiable from disk — defensive override below) + footer mt 35
 *   (style.css:375, proven) = ~92px white band, matching CeraVe's
 *   measured ~95px; plus footer padding-top 38 (style.css:375) =
 *   ~130-145 total, matching the measured ~145-150px.
 * - NOT fully accounted for, stated plainly: band (1) measured
 *   ~200px leaves ~148px unexplained by any child-code rule, and
 *   band (2) measured ~180-220px leaves ~70-110px unexplained, and
 *   price->desc measured ~55-65px leaves ~35-45px unexplained
 *   (price mb is proven 12px via 1.2.38, price line-height is proven
 *   1.2 via the v1.2.15 !important rule, so neither explains it).
 *   A follow-up measurement on CeraVe even implied only ~55-65px for
 *   band (1) (buy box ends ~560-570, tabs start ~625), which does NOT
 *   reconcile with the original ~200px estimate — visual estimates
 *   without devtools are unreliable at that scale. This file collapses
 *   every PROVEN boundary to an explicit tight total (16px / 18px /
 *   16px / ~56px); if a larger band persists after install, its cause
 *   is outside the child code (a parent rule or element no child file
 *   can see) and needs devtools on the live page, not another blind
 *   trim. No rule here guesses at an unidentified element.
 *
 * EXCLUDED (per brief, structural, untouched): the blank left column
 * below the gallery thumbnails (gallery column shorter than the buy
 * box: Peach ~500px, CeraVe ~220-250px). Fixing it needs a layout
 * redesign, which is out of scope — no rule here touches column
 * widths, floats, or gallery geometry.
 * CORRECTED (per brief, do NOT chase): the CeraVe related price
 * ("Free Delivery") -> Add to cart button gap is 20-40px, NORMAL
 * (an earlier ~80-100px estimate was a sticky-bar artefact). No rule
 * here touches related-card internals.
 * ========================================================================== */

/* --- Band (1): buy-box end -> tab strip. Proven stack was 52px. -------- */
/* Summary margin-bottom: was WooCommerce 2em = 28px (child never set it).
   Now 0. The tabs wrapper's own 16px top margin below becomes the whole
   band, so the strip sits 16px under the buy box — tight, not touching. */
body.single-product div.product div.summary{margin-bottom:0;padding-bottom:0}

/* Tabs wrapper: was margin-top 24px (1.2.35) + any Storefront top padding
   (defensively zeroed — the child never set tabs padding, so a parent
   value, if any, was live). Now margin 16px 0 0, padding 0. Bottom margin
   0 here is also the first half of the band (2) fix. */
body.single-product div.product .woocommerce-tabs{margin:16px 0 0;padding:0}

/* --- Band (2): panel content end -> Related heading. Proven stack was -- */
/* --- 108px. New total: 18px (panel's own bottom padding, kept as ------ */
/* --- breathing room) + 0 + 0 + 0 = 18px to the heading. --------------- */
/* Panel: was margin-bottom 28px (WooCommerce, veto 2) and padding 0
   (WooCommerce beat the child's 18px). Now margin-bottom 0 and padding
   18px restored — the padding is INSIDE the panel, so text keeps its
   breathing room while the gap AFTER the panel disappears. Selector
   (0,4,2) beats WooCommerce core (0,4,1). */
body.single-product div.product .woocommerce-tabs .woocommerce-Tabs-panel{margin-bottom:0;padding:18px}

/* Related section: was margin-top 60px / margin-bottom 20px via the
   1.2.30 line 983 !important veto (NOT the believed 22px/16px). Now
   margin 0 0 8px with !important on the identical selector, so load-last
   order finally wins it. Padding 0 defensively (no child rule set it).
   Heading margin-bottom 16px (1.2.35) is untouched — heading-to-grid
   rhythm stays. Grid columns/gap and card internals untouched. */
body.single-product section.related.products{margin:0 0 8px!important;padding:0!important}

/* --- Band (3): buy-box looseness. --------------------------------------- */
/* Price -> short description: price margin-bottom was 12px (1.2.38, won).
   Now 8px. Price line-height stays 1.2 from the v1.2.15 !important rule
   (not repeated here). Proven part of the gap was only ~20px; the
   ~35-45px remainder is unproven (see header) — this tightens what is
   proven and nothing else. */
body.single-product div.product div.summary p.price,body.single-product div.product div.summary span.price{margin-bottom:8px}

/* Short description -> cart row: was desc mb 10px + form mb 28px
   (WooCommerce veto 2) = 38px. Now desc mb 8px (top explicitly 0) and
   form mb 8px via a (0,4,4) selector that beats WooCommerce (0,2,2).
   Desc inner p:last-child margin 0 (1.2.37) already won and is untouched;
   multi-paragraph excerpts keep their between-paragraph rhythm. */
body.single-product div.product div.summary .woocommerce-product-details__short-description{margin:0 0 8px}
body.single-product div.product div.summary form.cart{margin:0 0 8px}

/* Cart row -> Why box: was form mb 28px + Why mt 10px = 38px. Now form mb
   8px (above) + Why mt 8px = 16px. Why box padding 14px 16px (1.2.35) is
   internal and untouched. Pay Securely / meta / share below the Why box
   are untouched — they are content rhythm, not a listed band. */
body.single-product div.product div.summary .mg-love{margin:8px 0}

/* --- Band (4): related cards -> footer headings. Proven stack was ----- */
/* --- ~92px white + 38px footer padding = ~130-145px. New total: ------ */
/* --- white 8 + 0 + 20 = 28px, footer padding-top 28px, total ~56px. --- */
/* Content-area bottom margin (single-product only): was Storefront's
   ~37px rhythm value if set (not verifiable from disk — defensive).
   Now 0. Other pages untouched (scoped to body.single-product). */
body.single-product .content-area{margin-bottom:0}

/* Footer top spacing: was margin-top 35px + padding-top 38px
   (style.css:375, proven). Now margin-top 20px + padding-top 28px.
   Background, border-top, colours, links, headings, copy bar and all
   content are untouched — only the top air shrinks, as authorised. */
body .footer{margin-top:20px;padding:28px 4% 20px}

/* --- Mobile (same bands, same causes; NO invented measurements) ------- */
/* The rules above are not width-scoped, so they already apply on
   phones (summary/tabs/panel/related/form/price/desc/footer). Two
   mobile-only values need matching treatment, because a later
   mobile rule would otherwise keep the old total:
   - Page bottom on phones: div.product padding-bottom was 24px
     (1.2.35, <=820px). Now 16px.
   - Panel padding on phones: was 16px (1.2.35, <=768px). The global
     18px rule above would override it (same file, later position is
     not enough — this block comes AFTER it, so 16px wins back at
     <=768px, preserving the intended phone value). */
@media(max-width:820px){
  body.single-product div.product{padding-bottom:16px}
}
@media(max-width:768px){
  body.single-product div.product .woocommerce-tabs .woocommerce-Tabs-panel{padding:16px}
}

/* --- Deliberately NOT touched ------------------------------------------- *
 * - Gallery column / thumbnails / summary widths and floats: the blank
 *   left column is structural (see header) — layout redesign is out
 *   of scope.
 * - Related grid columns/gap, related card internals, related heading
 *   margin-bottom 16px: content/geometry, not a listed band.
 * - Tab strip padding (12px 24px), tab labels, panel font/line-height,
 *   panel headings/lists: content, not bands.
 * - Crumb, brand, rating, title, Why box padding, Pay Securely, meta,
 *   share: buy-box content rhythm above/below the listed bands.
 * - Lightbox arrows, Tags removal, header, footer colours/content,
 *   newsletter: fixed elsewhere / out of scope.
 * - No !important anywhere except the related section margin/padding,
 *   where it is the only way to beat the 1.2.30 line 983 !important.
 */
