/* Quote form cleanup */
.ew-form-box {
  padding: 18px 25px !important;
}

.ew-form-grid {
  gap: 10px 14px !important;
}

.ew-field p {
  line-height: 1.25 !important;
}

.ew-field input,
.ew-field select,
.ew-field .select_container {
  width: 100% !important;
  box-sizing: border-box !important;
}

.ew-field .select_container {
  height: 46px !important;
  margin-top: 6px !important;
  background-color: #10275e !important;
  border: 1px solid #d99a2b !important;
  border-radius: 6px !important;
}

.ew-field .select_container select[name="move-type"] {
  height: 46px !important;
  padding: 0 36px 0 12px !important;
  color: #ffffff !important;
  background-color: #10275e !important;
}

.ew-field .select_container:before {
  background-color: #10275e !important;
}

.ew-field .select_container:after {
  color: #ffffff !important;
}

.ew-btn {
  margin-top: 12px !important;
}

@media (max-width: 768px) {
  .ew-form-box {
    max-width: calc(100vw - 20px) !important;
    padding: 16px 10px !important;
  }

  .ew-form-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 9px !important;
  }

  .ew-field {
    min-width: 0 !important;
  }

  .ew-field input,
  .ew-field select,
  .ew-field .select_container {
    width: 100% !important;
    min-width: 0 !important;
  }
}

/* Final mobile quote form override */
@media screen and (max-width: 768px) {
  html body .page_wrap .wpcf7 form.wpcf7-form .ew-form-box {
    width: 100% !important;
    max-width: none !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    padding: 16px 10px !important;
    border: 0 !important;
    outline: 0 !important;
    box-shadow: none !important;
  }

  html body .page_wrap .wpcf7 form.wpcf7-form .ew-form-grid {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 9px !important;
    width: 100% !important;
  }

  html body .page_wrap .wpcf7 form.wpcf7-form .ew-form-grid .ew-field {
    width: auto !important;
    min-width: 0 !important;
  }

  html body .page_wrap .wpcf7 form.wpcf7-form .ew-form-grid .ew-field input,
  html body .page_wrap .wpcf7 form.wpcf7-form .ew-form-grid .ew-field select,
  html body .page_wrap .wpcf7 form.wpcf7-form .ew-form-grid .ew-field .select_container {
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
  }

  html body .page_wrap .wpcf7 form.wpcf7-form .ew-form-box h2 {
    font-size: 24px !important;
  }
}

@media screen and (max-width: 360px) {
  html body .page_wrap .wpcf7 form.wpcf7-form .ew-form-box {
    padding-left: 8px !important;
    padding-right: 8px !important;
  }

  html body .page_wrap .wpcf7 form.wpcf7-form .ew-form-grid {
    gap: 8px !important;
  }
}

/* Keep lightweight YouTube embed inside the WPBakery 16:9 video box */
.wpb_video_wrapper > .ew-lite-youtube {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.wpb_video_wrapper > .ew-lite-youtube iframe {
  width: 100%;
  height: 100%;
}

/* Force lightweight YouTube embed to use WPBakery's reserved 16:9 area */
html body .wpb_video_wrapper > .ew-lite-youtube {
  position: absolute !important;
  top: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  left: 0 !important;
  width: 100% !important;
  height: 100% !important;
}

html body .wpb_video_wrapper > .ew-lite-youtube iframe {
  width: 100% !important;
  height: 100% !important;
}

/* Reserve quote form space early to reduce layout shift */
html body .page_wrap .ew-form-box {
  min-height: 342px !important;
}

html body .page_wrap .ew-form-grid .ew-field {
  min-height: 70px !important;
}

html body .page_wrap .ew-form-grid input,
html body .page_wrap .ew-form-grid select {
  min-height: 46px !important;
}

@media screen and (max-width: 767px) {
  html body .page_wrap .ew-form-box {
    min-height: 650px !important;
  }
}

/* Restore mobile floating call and scroll buttons */
@media screen and (max-width: 767px) {
  html body .wp-call-button {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    position: fixed !important;
    left: 16px !important;
    right: auto !important;
    bottom: 16px !important;
    top: auto !important;
    z-index: 2147483647 !important;
  }

  html body #ht-ctc-chat {
    position: fixed !important;
    right: 16px !important;
    left: auto !important;
    bottom: 20px !important;
    top: auto !important;
    z-index: 99999999 !important;
  }

  html body .trx_addons_scroll_to_top {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    position: fixed !important;
    right: 16px !important;
    left: auto !important;
    bottom: 92px !important;
    top: auto !important;
    z-index: 100001 !important;
  }
}

/* Mobile button order and image restore */
@media screen and (max-width: 767px) {
  html body #ht-ctc-chat {
    right: 16px !important;
    left: auto !important;
    bottom: 92px !important;
    top: auto !important;
    z-index: 99999999 !important;
  }

  html body .trx_addons_scroll_to_top {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    right: 16px !important;
    left: auto !important;
    bottom: 20px !important;
    top: auto !important;
    z-index: 100001 !important;
  }
}

html body .sc_layouts_logo img,
html body img.logo_image,
html body .sc_services_item img,
html body .sc_services_item_thumb img,
html body .sc_services img {
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
  max-width: 100% !important;
  height: auto !important;
}

/* Mobile quote gap and desktop scroll fix */
@media screen and (max-width: 767px) {
  html body .page_wrap .ew-form-box {
    min-height: 0 !important;
    padding-bottom: 24px !important;
  }

  html body .page_wrap .ew-form-grid {
    margin-bottom: 12px !important;
  }

  html body .page_wrap .ew-form-box .ew-submit,
  html body .page_wrap .ew-form-box input[type="submit"] {
    margin-bottom: 0 !important;
  }
}

@media screen and (min-width: 768px) {
  html body .trx_addons_scroll_to_top {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    position: fixed !important;
    right: 24px !important;
    bottom: 24px !important;
    top: auto !important;
    left: auto !important;
    z-index: 100001 !important;
  }
}

/* Mobile hero image stability */
@media screen and (max-width: 767px) {
  html body .wpb_single_image img,
  html body .post_content > .wpb-content-wrapper > .vc_row:first-child img {
    width: 100% !important;
    height: auto !important;
    aspect-ratio: 3 / 2 !important;
    object-fit: cover !important;
  }
}

/* CLS: reserve first viewport slider space while Slider Revolution initializes */
.home .wpb_revslider_element,
.home sr7-module#SR7_1_1,
.home sr7-module#SR7_1_1 sr7-content {
  display: block !important;
  min-height: clamp(190px, 53vw, 540px) !important;
}

@media screen and (max-width: 767px) {
  .home .wpb_revslider_element,
  .home sr7-module#SR7_1_1,
  .home sr7-module#SR7_1_1 sr7-content {
    min-height: 205px !important;
  }
}

/* Codex desktop CLS tightening */
@media screen and (min-width: 1025px) {
  body.home .top_panel,
  body.home header.top_panel {
    min-height: 96px !important;
  }

  body.home .sc_layouts_row,
  body.home .sc_layouts_row_fixed_placeholder {
    min-height: 96px !important;
  }

  body.home .logo_image,
  body.home .custom-logo-link img {
    width: auto !important;
    height: 64px !important;
    max-height: 64px !important;
  }

  body.home .wpb_revslider_element,
  body.home .rev_slider_wrapper,
  body.home rs-module-wrap,
  body.home sr7-module#SR7_1_1,
  body.home sr7-module#SR7_1_1 sr7-content {
    display: block !important;
    min-height: 540px !important;
  }
}

@media screen and (min-width: 1025px) and (max-width: 1280px) {
  body.home .wpb_revslider_element,
  body.home .rev_slider_wrapper,
  body.home rs-module-wrap,
  body.home sr7-module#SR7_1_1,
  body.home sr7-module#SR7_1_1 sr7-content {
    min-height: 500px !important;
  }
}
/* /Codex desktop CLS tightening */

/* Codex desktop CLS ratio reserve */
@media screen and (min-width: 1025px) {
  body.home .wpb_revslider_element,
  body.home .rev_slider_wrapper,
  body.home rs-module-wrap,
  body.home sr7-module#SR7_1_1,
  body.home sr7-module#SR7_1_1 sr7-content {
    display: block !important;
    min-height: clamp(540px, 53.65vw, 760px) !important;
  }

  body.home sr7-module#SR7_1_1 sr7-slide,
  body.home sr7-module#SR7_1_1 sr7-mask,
  body.home sr7-module#SR7_1_1 sr7-bg {
    min-height: clamp(540px, 53.65vw, 760px) !important;
  }
}
/* /Codex desktop CLS ratio reserve */