/* ==========================================================================
   DM UI/UX fixes - PromotEdge audit deck, August 2026
   Loaded last so these overrides win without !important wars.
   Each rule names its issue id from the deck so it can be traced or reverted.
   ========================================================================== */

/* --------------------------------------------------------------------------
   C5 - Floating WhatsApp bubble overlaps "Add to Compare".
   Measured on /excavator/jcb-nxt-215-lc-fuel-master/ at 1275px:
     .wpIconWrap  x 1224-1385, bottom:20px, height 50px, z-index 3
     .sideCompare x 1088-1251, bottom:24px, height 40px, z-index 2
   = 27px of horizontal overlap in the same vertical band, with WhatsApp
   painting on top of the last characters and part of the click area of
   "Add to Compare" - a core action on a comparison site.
   Fix: lift the bubble clear of the button rather than moving the button,
   so the compare CTA keeps its established position.
   -------------------------------------------------------------------------- */
.wpIconWrap { bottom: 96px; }

/* The compare button is itself lifted to 96px while the enquiry panel is open
   (body.productQueryOpen .sideCompare { bottom: 96px !important } in product-details.css),
   so the bubble has to clear it again in that state or the collision simply returns higher
   up the screen. sideCompare is 40px tall, so 96 + 40 + a 16px gap = 152px. */
body.productQueryOpen .wpIconWrap { bottom: 152px; }

/* Short viewports: keep both clear of the fold without pushing the bubble off-screen. */
@media (max-height: 620px) {
  .wpIconWrap { bottom: 76px; }
  body.productQueryOpen .wpIconWrap { bottom: 132px; }
}

/* --------------------------------------------------------------------------
   A4 / C3 - Partner logos too small and inconsistently sized.
   Shared component, so fixing it here covers the homepage finance/insurance
   walls AND the PDP "Loan & Insurance" section in one place.

   Cause: .bankLogoImg a has no height, and its img is width:100%;height:100%.
   With an auto-height parent, height:100% resolves to auto, so every logo
   renders at its own intrinsic aspect ratio - a wide mark collapses while a
   squarer one stands tall. Measured on the homepage at 1280px: logo heights
   ranged 19px (sundaram-finance, shriram-finance) to 40px (oriental-insurance,
   united-india-insurance) - a 2.1x spread, and cards raggedly different heights.

   Fix: give the card a uniform height, centre the mark inside it, and cap the
   mark at roughly two thirds of the card height as the audit recommends.
   object-fit:contain is kept so no logo is ever distorted or cropped.
   -------------------------------------------------------------------------- */
/* Round 2, after reviewing real screenshots.

   Round 1 gave the cards a uniform height (good) but WIDENED the size gap: a generous
   58px cap let squarer marks (Chola MS, Oriental, United India, Kotak, HDFC Ergo) grow to
   the cap, while wide marks (Central Bank of India, Bank of Baroda, Mahindra Finance,
   Poonawalla, Sakthi, Ratnaafin, Canara, IDBI) are constrained by the card's WIDTH and so
   stayed small. object-fit:contain fits the whole mark inside the box, so an 8:1 logo hits
   the width limit long before the height limit.

   Inside one fixed-width card, an 8:1 and a 2:1 mark cannot share a visual height without
   cropping or distorting them. So close the gap from both ends instead:
     - cut horizontal padding, giving wide marks more usable width (taller render)
     - lower the cap so squarer marks stop towering
   Spread goes from roughly 19-58px (3.0x) to roughly 33-44px (1.3x).

   True normalisation needs the SOURCE IMAGES standardised onto a common canvas with
   consistent internal padding - an asset job, not a CSS one. Flagged to Saurav.

   Keep height:100% on the img, never height:auto: these are lazy-loaded without
   width/height attributes and collapse to 0px until they load. */
.bankingLogoBox .bankingLogo .bankLogoImg a {
  height: 84px !important;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px 12px;          /* was 12px 16px - more width for wide marks */
}
.bankingLogoBox .bankingLogo .bankLogoImg a img {
  width: 100%;
  height: 100%;
  object-fit: contain;         /* no max-height: the source PNGs are now all
                                  re-padded onto a uniform 400x100 (4:1) canvas
                                  matching this box, so contain alone yields an
                                  even optical size. A cap here would only shrink
                                  every mark and re-open the gap. */
}

@media (max-width: 991px) {
  .bankingLogoBox .bankingLogo .bankLogoImg a { height: 74px !important; padding: 8px 10px; }
}
@media (max-width: 767px) {
  .bankingLogoBox .bankingLogo .bankLogoImg a { height: 62px !important; padding: 6px 8px; }
}
