/* responsive-fix.css
 * Makes Duda's "desktop" export reflow like the live (production) site on
 * phones and tablets. Works with the dm-device-class body-class toggle
 * (injected per page) that switches the body to dmMobileBody / dmTabletBody so
 * Duda's smaller-breakpoint CSS applies. Duda also freezes a per-element pixel
 * width with !important on nearly every element (#dm .dmBody div.u_<id>{
 * width:Npx!important}); those use a single ID, so the #dmRoot #dm (two-ID)
 * prefix below outranks them and caps everything to its container.
 * Loaded LAST in <head>.
 *
 * Layout map of the breakpoints:
 *   - <=1024px  : shared rules — kill the empty sticky-header gap, put the
 *                 logo + "Request a Callback" button on one compact row, centre
 *                 the "Call Us Now" bar, release Duda's frozen margins/widths.
 *   - <=767px   : the Foundation grid already stacks columns (small-* + Duda's
 *                 own max-width:767 media), so only the margin/width release is
 *                 needed.
 *   - 768-1024  : the grid stays in its 2-column medium layout, but production
 *                 stacks every content section into a single column, so force
 *                 the columns to stack.
 */

/* ========================================================================
   SHARED — everything below the desktop breakpoint (mobile + tablet)
   ======================================================================== */
@media (max-width: 1024px) {
  html, body { overflow-x: hidden !important; }

  /* inner-wrapper min-width that otherwise clips the page */
  #dm .dmInner, .dmInner { min-width: 0 !important; width: 100% !important; }
  #dm .hasStickyHeader .dmInner #desktopHeaderBox,
  #dm .hasStickyHeader .dmInner .dmHeaderContainer { min-width: 0 !important; }

  /* The sticky-header spacer reserves the desktop header's height (~120px), but
     the real header renders inside the page body — leaving a big empty gap at
     the top of the page. The actual sticky header is empty here, so drop it. */
  #dmRoot #dm #stickyHeaderSpacer { height: 0 !important; min-height: 0 !important; }

  /* Duda freezes desktop positioning as large per-element left/right margins
     (e.g. margin-left:460px on the header button, 335px on the thank-you
     headline) plus fixed pixel widths — all with !important under a single-ID
     selector. The #dmRoot #dm (two-ID) prefix outranks them: reset the
     horizontal margins and release the widths so content fills its column,
     while keeping vertical margins for spacing. */
  #dmRoot #dm .dmBody [class*="u_"],
  #dmRoot #dm .p_hfcontainer [class*="u_"] {
    margin-left: 0 !important;
    margin-right: 0 !important;
    max-width: 100% !important;
    left: auto !important;
  }
  #dmRoot #dm .dmBody div.dmNewParagraph,
  #dmRoot #dm .dmBody div.dmRespCol { width: auto !important; }

  /* Several CTA buttons freeze a desktop width such as calc(100% - 460px) paired
     with a matching left margin to centre them in the 1200px layout. Resetting
     the margin (above) collapses that width to a ~30px sliver. Release the width
     so each block button spans its column, the way production renders them. */
  #dmRoot #dm .dmBody .dmButtonLink { width: auto !important; }

  /* the custom-HTML callback form embed (its own <style> floats it right) */
  #dm .cont-form { float: none !important; width: 100% !important; max-width: 100% !important; }

  /* The form's wrapper (.u_Form) is frozen at height:25px in desktop.css, so the
     ~630px form overflowed it and the following white section painted over the
     input fields. Release the height so the column contains the whole form and
     pushes the next section down. */
  #dmRoot #dm .dmBody .u_Form { height: auto !important; min-height: 0 !important; }

  /* never let media or column children exceed the viewport */
  #dm img, #dm .dmRespCol > * { max-width: 100% !important; }

  /* the footer logo's centering rule in desktop.css targets the header
     container (.p_hfcontainer), but the logo lives in the footer
     (.f_hcontainer/.dmFooter), so it never gets centred. Its column already has
     text-align:center, so make the logo widget inline-block to be centred. */
  #dmRoot #dm .u_1901167991 { display: inline-block !important; }

  /* --- Header: logo (left) + "Request a Callback" button (right) on one
     compact row, the way production renders it, instead of the button wrapping
     full-width below the logo. The extra .cont-headr class keeps this ahead of
     the tablet single-column stacking rule below. */
  #dmRoot #dm .dmBody .u_1953713122.cont-headr > .dmRespColsWrapper {
    display: flex !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
    justify-content: space-between !important;
    padding: 10px 15px !important;
  }
  #dmRoot #dm .dmBody .u_1953713122 .u_1693320574,   /* logo column  */
  #dmRoot #dm .dmBody .u_1953713122 .u_1245782302 {  /* button column */
    width: auto !important;
    flex: 0 0 auto !important;
    float: none !important;
    margin: 0 !important;
  }
  #dmRoot #dm .dmBody .u_1953713122 .u_1184696332 {  /* the button itself */
    width: auto !important;
    display: inline-block !important;
    margin: 0 !important;
    padding: 14px 22px !important;
  }

  /* the "Call Us Now : …" bar (the mobile/tablet-only row) — centred and
     spanning the full width, as on production, not left-clipped. */
  #dmRoot #dm .dmBody .u_1211635285,
  #dmRoot #dm .dmBody .u_1211635285 .dmRespColsWrapper,
  #dmRoot #dm .dmBody .u_1211635285 .u_1195175815,
  #dmRoot #dm .dmBody .u_1211635285 .dmNewParagraph {
    width: 100% !important;
    float: none !important;
    text-align: center !important;
  }
  /* the row adds 15px top/bottom padding, leaving a gap above and below the
     dark bar — remove it so the bar sits flush against its neighbours. */
  #dmRoot #dm .dmBody .u_1211635285 { padding-top: 0 !important; padding-bottom: 0 !important; }

  /* The feature image widgets keep their frozen desktop pixel widths (236/296px)
     and sit left-aligned; production fills the column with them. Release the
     widget and its image to span the full column width. */
  #dmRoot #dm .dmBody .u_1061154046,        /* "Worried About Fees" — London   */
  #dmRoot #dm .dmBody .u_1556937986,        /* "We Deliver Results" — handshake */
  #dmRoot #dm .dmBody .u_1573453227,        /* "What Makes Us Different" — pair */
  #dmRoot #dm .dmBody .u_1061154046 img,
  #dmRoot #dm .dmBody .u_1556937986 img,
  #dmRoot #dm .dmBody .u_1573453227 img {
    width: 100% !important;
  }
}

/* ========================================================================
   MOBILE — <=767px: shrink the header logo and callback button so they sit
   compactly on a phone instead of dominating the top of the page.
   ======================================================================== */
@media (max-width: 767px) {
  #dmRoot #dm .dmBody .u_1953713122 .u_1693320574 img {  /* logo */
    width: 96px !important;
    height: auto !important;
  }
  #dmRoot #dm .dmBody .u_1953713122 .u_1184696332 {       /* callback button */
    padding: 7px 14px !important;
    min-height: 0 !important;          /* desktop.css freezes min-height:49.5px */
  }
  #dmRoot #dm .dmBody .u_1953713122 .u_1184696332 .text {
    font-size: 12px !important;
  }

  /* hero section freezes 80px top/bottom padding — drop the top so the hero
     content starts right below the call-us bar */
  #dmRoot #dm .dmBody div.u_1594112745 { padding-top: 0 !important; }

  /* the callback form wrapper freezes width:calc(100% - 48px), leaving a 48px
     gap on the right — make it span the full column width on mobile */
  #dmRoot #dm .dmBody .u_Form { width: 100% !important; max-width: 100% !important; }

  /* The CTA buttons under the reviews (.u_1424307725) and under the steps
     (.u_1072016900) sit in rows with 40px side padding and collapse to their
     text width, so they read narrower/indented than the other section CTAs.
     Match them to the full-width buttons (e.g. "What Makes Us Different"). */
  #dmRoot #dm .dmBody .u_1424307725,
  #dmRoot #dm .dmBody .u_1072016900 {
    padding-left: 15px !important;
    padding-right: 15px !important;
  }
  #dmRoot #dm .dmBody .u_1424307725 .dmRespCol,
  #dmRoot #dm .dmBody .u_1072016900 .dmRespCol,
  #dmRoot #dm .dmBody .u_1424307725 .dmButtonLink,
  #dmRoot #dm .dmBody .u_1072016900 .dmButtonLink {
    width: 100% !important;
  }

  /* The footer CTA ("Don't Leave Your Next Lease…", row .u_1540931574) has a
     frozen-narrow column with 24px right padding, so its button reads ~181px and
     left-aligned. Its row already sits at the gutter, so just release the column
     and button to full width — making it consistent and centred like the rest. */
  #dmRoot #dm .dmBody .u_1540931574 .dmRespCol { width: 100% !important; padding-right: 0 !important; }
  #dmRoot #dm .dmBody .u_1540931574 .dmButtonLink { width: 100% !important; }
}

/* ========================================================================
   TABLET — 768-1024px: production stacks every content section into a single
   column. The desktop export keeps the medium-grid 2-column rows, so force the
   columns to stack (the header row above is exempted by higher specificity).
   ======================================================================== */
@media (min-width: 768px) and (max-width: 1024px) {
  /* Stack every content row into a single column. Two rows are exempted:
     .cont-headr (the logo + button header, laid out as flex above) and the hero
     (.u_1594112745), which production keeps as two columns — heading/bullets on
     the left, the callback card on the right. */
  #dmRoot #dm .dmBody .dmRespRow:not(.cont-headr):not(.u_1594112745) > .dmRespColsWrapper {
    display: block !important;
  }
  #dmRoot #dm .dmBody .dmRespRow:not(.cont-headr):not(.u_1594112745) > .dmRespColsWrapper > .dmRespCol {
    width: 100% !important;
    float: none !important;
    clear: both !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
  }

  /* Hero: keep the two-column split — text left (~58%), callback card right. */
  #dmRoot #dm .dmBody .u_1594112745 .u_1565661061 { width: 58% !important; float: left !important; }
  #dmRoot #dm .dmBody .u_1594112745 .u_1078982915 { width: 42% !important; float: left !important; }
  /* release Duda's frozen desktop pixel widths inside the stacked rows so text
     and images fill the single column instead of keeping ~1200px-layout sizes */
  #dmRoot #dm .dmBody .dmRespRow:not(.cont-headr) div.dmNewParagraph { width: auto !important; }

  /* production drops the inline "Call Us Now" text from the tablet header,
     leaving just the logo and the callback button */
  #dmRoot #dm .dmBody .u_1953713122 .u_1833840053 { display: none !important; }
}
