/*
 * Mobile layout fixes layered on top of the Webflow export.
 * Injected globally via renderDoc (single chokepoint) so it applies to every
 * page and loads after the Webflow stylesheet for correct cascade precedence.
 * All rules are scoped to mobile breakpoints; desktop is untouched.
 */

/* ---- Tablet & phone (Webflow's 767px breakpoint) ---------------------- */
@media screen and (max-width: 767px) {
  /* Stop any stray off-canvas element from creating a horizontal scrollbar. */
  html,
  body {
    overflow-x: hidden;
  }

  /* Landing-page heroes keep a fixed height (only `.is-main` gets auto on
     mobile). Stacking the CTA + Trustpilot makes content taller, so let every
     hero grow to fit instead of overflowing into the section below. */
  .hero {
    height: auto;
  }

  /* Hero CTA + Trustpilot logo: stack instead of overflowing in a row. */
  .hero-wrapper-two-2 {
    flex-direction: column;
    flex-wrap: wrap;
    grid-column-gap: 1.25em;
    grid-row-gap: 1.25em;
    width: 100%;
    max-width: 100%;
    padding-left: 1.25em;
    padding-right: 1.25em;
    box-sizing: border-box;
  }

  /* Hero CTA: never wider than the screen; allow the label to wrap. */
  .fs_modal-2_button.main-btn.is-top,
  .main-btn.is-t-32 {
    max-width: 100%;
    white-space: normal;
    text-align: center;
  }

  /* All primary buttons: tame the size and prevent edge overflow. */
  .main-btn {
    max-width: 100%;
    font-size: 0.9em;
    padding: 0.65em 1.15em;
  }

  /* Trustpilot logo: keep it on-screen and proportional. */
  .hero-image {
    width: auto;
    max-width: 11em;
    height: auto;
    align-self: center;
  }

  /* Neutralise leftover Webflow desktop offsets that push items off-canvas. */
  .hero-image.shadow-two,
  .f-testimonial-star-wrapper-4,
  .code-embed-3 {
    margin-left: 0 !important;
  }

  /* Server-injected SEO sections: keep their bordered boxes off the edges. */
  .internal-links,
  .landing-overview {
    margin-left: 1em !important;
    margin-right: 1em !important;
    max-width: calc(100% - 2em) !important;
    box-sizing: border-box;
  }

  /* ---- Bot comparison table -> stacked card on mobile ----------------- */
  /* The desktop column-header row can't align to wrapped cards: hide it. */
  .table-header {
    display: none !important;
  }

  /* Each row becomes a wrapping card instead of a row that runs off-screen. */
  .bot-line {
    flex-wrap: wrap;
    justify-content: flex-start;
    align-items: center;
    grid-column-gap: 0.75em;
    grid-row-gap: 0.85em;
    padding: 1.1em 1.15em;
  }

  /* Line 1: logo + name on the left, AI score gauge pushed to the right. */
  .bot-line .div-block-5 {
    width: auto;
    max-width: 62%;
    flex: 1 1 auto;
    min-width: 0;
    order: 0;
  }
  .bot-line .div-block-5 .p-16px {
    overflow-wrap: anywhere;
  }
  .bot-line .div-block-29 {
    flex: 0 0 auto;
    margin-left: auto;
    order: 1;
  }

  /* Line 2: rating on the left, category pill on the right. */
  .bot-line .rating {
    width: auto;
    flex: 0 0 auto;
    align-items: flex-start;
    order: 2;
  }
  .bot-line .category-box-item {
    flex: 0 0 auto;
    margin-left: auto;
    order: 3;
  }

  /* Line 3: broker list spans full width. */
  .bot-line .div-block-27 {
    flex: 1 1 100%;
    order: 4;
  }

  /* Line 4: action / "View Reviews" becomes a full-width button. */
  .bot-line .div-block-14 {
    flex: 1 1 100%;
    order: 5;
  }
  .bot-line .div-block-14 .link-block-2 {
    width: 100%;
    justify-content: center;
  }
}

/* ---- Small phones (Webflow's 479px breakpoint) ------------------------ */
@media screen and (max-width: 479px) {
  .main-btn {
    font-size: 0.85em;
    padding: 0.6em 1em;
  }

  .hero-wrapper-two-2 {
    margin-top: 1.5em;
  }

  .hero-image {
    max-width: 9.5em;
  }
}
