/* =========================
   THRIVEWELL RESPONSIVE FIX
   ========================= */

/* Global stability */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  overflow-x: hidden;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* Prevent widgets from overflowing */
.elementor-widget,
.elementor-widget-container,
.elementor-widget-text-editor,
.elementor-widget-heading {
  max-width: 100%;
}

/* Better text wrapping */
.elementor-widget-heading h1,
.elementor-widget-heading h2,
.elementor-widget-heading h3,
.elementor-widget-text-editor p {
  overflow-wrap: break-word;
  word-wrap: break-word;
}

/* Desktop defaults */
.elementor-widget-heading h1 {
  font-size: 56px;
  line-height: 1.05;
}

.elementor-widget-heading h2 {
  font-size: 36px;
  line-height: 1.15;
}

.elementor-widget-text-editor,
.elementor-widget-text-editor p {
  font-size: 18px;
  line-height: 1.7;
}

/* Give sections breathing room */
.elementor-element.e-con {
  width: 100%;
  max-width: 100%;
}

/* Tablet */
@media (max-width: 1024px) {
  .elementor-widget-heading h1 {
    font-size: 44px !important;
    line-height: 1.08 !important;
  }

  .elementor-widget-heading h2 {
    font-size: 30px !important;
    line-height: 1.15 !important;
  }

  .elementor-widget-text-editor,
  .elementor-widget-text-editor p {
    font-size: 17px !important;
    line-height: 1.65 !important;
  }

  .elementor-top-section,
  .elementor-element.e-con {
    padding-left: 20px !important;
    padding-right: 20px !important;
  }
}

/* Mobile */
@media (max-width: 767px) {
  /* Force containers to stack cleanly */
  .elementor-element.e-con {
    flex-direction: column !important;
    align-items: stretch !important;
    justify-content: flex-start !important;
    gap: 24px !important;
    min-width: 0 !important;
  }

  /* Force child containers and widgets full width */
  .elementor-element.e-con > .e-con,
  .elementor-element.e-con > .elementor-widget,
  .elementor-widget,
  .elementor-widget-container {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    flex: 1 1 100% !important;
  }

  /* Heading sizes */
  .elementor-widget-heading h1 {
    font-size: 34px !important;
    line-height: 1.08 !important;
    max-width: 100% !important;
  }

  .elementor-widget-heading h2 {
    font-size: 26px !important;
    line-height: 1.12 !important;
    max-width: 100% !important;
  }

  .elementor-widget-heading h3 {
    font-size: 22px !important;
    line-height: 1.15 !important;
    max-width: 100% !important;
  }

  /* Paragraph text */
  .elementor-widget-text-editor,
  .elementor-widget-text-editor p {
    font-size: 17px !important;
    line-height: 1.65 !important;
    max-width: 100% !important;
  }

  /* Images */
  .elementor-widget-image img {
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
  }

  /* Buttons */
  .elementor-button {
    width: 100%;
    text-align: center;
  }

  /* Safer mobile spacing */
  .elementor-top-section,
  .elementor-element.e-con {
    padding-left: 16px !important;
    padding-right: 16px !important;
  }
}

/* Small phones */
@media (max-width: 480px) {
  .elementor-widget-heading h1 {
    font-size: 30px !important;
  }

  .elementor-widget-heading h2 {
    font-size: 24px !important;
  }

  .elementor-widget-text-editor,
  .elementor-widget-text-editor p {
    font-size: 16px !important;
  }

  .elementor-top-section,
  .elementor-element.e-con {
    padding-left: 14px !important;
    padding-right: 14px !important;
  }
}