.wp-block-navigation .wp-block-button__link {
  white-space: nowrap !important;
  word-break: keep-all !important;
}

/* Formost mobile responsiveness pass - CSS only, reversible */
@media (max-width: 782px) {
  html,
  body {
    max-width: 100%;
    overflow-x: hidden;
  }

  body {
    font-size: 16px !important;
  }

  /* Header: reduce pressure from logo, navigation, and CTA */
  header .wp-block-site-logo,
  .wp-block-site-logo {
    flex-shrink: 1;
  }

  header .wp-block-site-logo img,
  .wp-block-site-logo img {
    width: auto !important;
    max-width: 148px !important;
    height: auto !important;
  }

  header .wp-block-group,
  header .wp-block-buttons,
  header .wp-block-navigation,
  header .wp-block-navigation__container {
    flex-wrap: wrap !important;
    min-width: 0;
  }

  header .wp-block-group.alignwide {
    gap: 12px !important;
  }

  header .wp-block-navigation .wp-block-navigation-item__content,
  header .wp-block-button__link {
    font-size: 16px !important;
    line-height: 1.25 !important;
  }

  header .wp-block-buttons,
  header .wp-block-button {
    max-width: 100%;
  }

  header .wp-block-button__link {
    max-width: 100%;
    white-space: normal !important;
    word-break: normal !important;
    overflow-wrap: anywhere;
    padding: 10px 14px !important;
  }

  .wp-block-navigation__responsive-container-open {
    flex: 0 0 auto;
    min-width: 44px;
    min-height: 44px;
    padding: 8px !important;
  }

  /* Navigation/button text: allow mobile wrapping instead of overflow */
  .wp-block-navigation .wp-block-button__link,
  .wp-block-navigation .wp-block-navigation-item__content {
    white-space: normal !important;
    word-break: normal !important;
    overflow-wrap: anywhere;
  }

  /* Product pages/content columns: stack image/gallery and details earlier */
  .entry-content .wp-block-columns.is-layout-flex,
  .entry-content .wp-block-columns {
    flex-direction: column !important;
    align-items: stretch !important;
  }

  .entry-content .wp-block-column {
    flex-basis: 100% !important;
    min-width: 0 !important;
    width: 100% !important;
  }

  .entry-content .fm-gallery,
  .entry-content .fm-gallery img,
  .entry-content [id^="fm-main-"] {
    max-width: 100% !important;
  }

  .entry-content .fm-gallery > div:first-child {
    width: 100% !important;
  }

  /* Product/content CTA buttons */
  .entry-content .wp-block-buttons.is-layout-flex {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 10px !important;
  }

  .entry-content .wp-block-button,
  .entry-content .wp-block-button__link {
    max-width: 100%;
    box-sizing: border-box;
  }

  .entry-content .wp-block-button__link {
    width: 100%;
    text-align: center;
    white-space: normal;
    overflow-wrap: anywhere;
  }

  /* Product specification tables: preserve desktop, prevent mobile overflow */
  .wp-block-table {
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .wp-block-table table,
  .fmspec,
  .fmpd-spec {
    width: 100%;
    max-width: 100%;
  }

  .wp-block-table td,
  .wp-block-table th,
  .fmspec td,
  .fmspec th,
  .fmpd-spec td,
  .fmpd-spec th {
    white-space: normal !important;
    overflow-wrap: anywhere;
    word-break: normal;
  }

  .fmspec td:first-child,
  .fmpd-spec td:first-child {
    white-space: normal !important;
  }

  /* Full-width custom sections: avoid 100vw rounding overflow on mobile */
  .alignfull,
  #fmcs-wrap,
  .fmpd-hero,
  .fmpd-main-img,
  .fmpd-cta-block,
  .fmcp-hero,
  .fmcp-cta {
    max-width: 100% !important;
    overflow-x: hidden;
  }
}

/* Formost mobile responsiveness pass 2 - hero, banner, gallery, CTA */
@media (max-width: 782px) {
  /* Hero/category sections: reduce overflow pressure without clipping inner content */
  .entry-content .alignfull,
  .entry-content #fmcs-wrap,
  .entry-content .fmcp-hero,
  .entry-content .fmcp-cta,
  .entry-content .fmpd-hero,
  .entry-content .fmpd-main-img,
  .entry-content .fmpd-cta-block {
    width: 100% !important;
    max-width: 100% !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    box-sizing: border-box;
  }

  .entry-content .fmcp-hero,
  .entry-content .fmcp-cta,
  .entry-content .fmpd-hero,
  .entry-content .fmpd-cta-block {
    padding-left: 18px !important;
    padding-right: 18px !important;
  }

  .entry-content .fmcp-hero h1,
  .entry-content .fmpd-hero h1,
  .entry-content .alignfull h1,
  .entry-content .alignfull h2 {
    max-width: 100%;
    overflow-wrap: anywhere;
    word-break: normal;
  }

  /* Homepage banner: give mobile a usable visual height without page overflow */
  .entry-content #fmcs-wrap {
    line-height: 0;
  }

  .entry-content #fmcs-wrap .fmcs-slide,
  .entry-content #fmcs-wrap .fmcs-slide.active {
    min-height: clamp(220px, 58vw, 320px);
  }

  .entry-content #fmcs-wrap .fmcs-slide img {
    width: 100% !important;
    height: clamp(220px, 58vw, 320px) !important;
    object-fit: cover;
    object-position: center center;
  }

  .entry-content #fmcs-wrap .fmcs-arr {
    width: 36px !important;
    height: 36px !important;
    font-size: 22px !important;
  }

  .entry-content #fmcs-dots {
    bottom: 12px !important;
  }

  /* Floating WhatsApp: keep visible but less intrusive on small screens */
  .floating-whatsapp,
  .whatsapp-float,
  [class*="whatsapp"] {
    width: 42px !important;
    height: 42px !important;
    right: 12px !important;
    bottom: 12px !important;
    font-size: 20px !important;
    max-width: 42px !important;
    max-height: 42px !important;
  }

  /* Product gallery: avoid overly tall or cropped mobile images */
  .entry-content .fm-gallery > div:first-child {
    max-height: 72vh;
    overflow: hidden;
  }

  .entry-content .fm-gallery > div:first-child img,
  .entry-content [id^="fm-main-"] {
    width: 100% !important;
    height: auto !important;
    max-height: 72vh !important;
    object-fit: contain !important;
  }

  .entry-content .fm-gallery > div:nth-child(2) {
    gap: 6px !important;
    justify-content: center;
  }

  .entry-content .fm-gallery > div:nth-child(2) img {
    width: 58px !important;
    height: 58px !important;
    object-fit: cover;
  }

  /* Product CTA spacing: keep stacked buttons comfortable but compact */
  .entry-content .wp-block-buttons {
    margin-top: 18px !important;
    gap: 10px !important;
  }

  .entry-content .wp-block-button__link {
    min-height: 44px;
    display: flex !important;
    align-items: center;
    justify-content: center;
    padding-top: 12px !important;
    padding-bottom: 12px !important;
    line-height: 1.25 !important;
  }
}

/* Formost mobile responsiveness pass 3 - banner contain, CTA spacing, WhatsApp compact */
@media (max-width: 782px) {
  /* Homepage banner carousel: show full image/text instead of cropping */
  .entry-content #fmcs-wrap {
    background: #f7f8fa;
  }

  .entry-content #fmcs-wrap .fmcs-slide,
  .entry-content #fmcs-wrap .fmcs-slide.active {
    min-height: 0 !important;
  }

  .entry-content #fmcs-wrap .fmcs-slide img {
    width: 100% !important;
    height: auto !important;
    max-height: none !important;
    object-fit: contain !important;
    object-position: center center !important;
  }

  /* Product final CTA block: improve mobile breathing room and tap targets */
  .entry-content .wp-block-group.alignfull.has-background[style*="background-color:#0693e3"] {
    padding: 36px 18px 40px !important;
  }

  .entry-content .wp-block-group.alignfull.has-background[style*="background-color:#0693e3"] .wp-block-heading {
    margin-bottom: 10px !important;
    line-height: 1.22 !important;
  }

  .entry-content .wp-block-group.alignfull.has-background[style*="background-color:#0693e3"] p {
    max-width: 32rem;
    margin-left: auto !important;
    margin-right: auto !important;
    line-height: 1.55 !important;
  }

  .entry-content .wp-block-group.alignfull.has-background[style*="background-color:#0693e3"] .wp-block-buttons {
    width: 100%;
    max-width: 320px;
    margin: 22px auto 0 !important;
  }

  .entry-content .wp-block-group.alignfull.has-background[style*="background-color:#0693e3"] .wp-block-button,
  .entry-content .wp-block-group.alignfull.has-background[style*="background-color:#0693e3"] .wp-block-button__link {
    width: 100% !important;
  }

  .entry-content .wp-block-group.alignfull.has-background[style*="background-color:#0693e3"] .wp-block-button__link {
    min-height: 48px !important;
    padding: 13px 20px !important;
    border-radius: 10px !important;
    line-height: 1.25 !important;
  }

  /* Social Chat / WhatsApp: compact circular mobile icon instead of long bar */
  .qlwapp {
    --qlwapp-scheme-font-size: 0px !important;
    --qlwapp-scheme-icon-size: 40px !important;
    --qlwapp-scheme-icon-font-size: 21px !important;
    right: 12px !important;
    bottom: 12px !important;
    max-width: 44px !important;
    z-index: 998 !important;
  }

  .qlwapp .qlwapp-toggle,
  .qlwapp a.qlwapp-toggle,
  .qlwapp .qlwapp-button,
  .qlwapp a[class*="button"] {
    width: 40px !important;
    min-width: 40px !important;
    height: 40px !important;
    min-height: 40px !important;
    max-width: 40px !important;
    padding: 0 !important;
    border-radius: 999px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    overflow: hidden !important;
  }

  .qlwapp .qlwapp-text,
  .qlwapp [class*="text"],
  .qlwapp [class*="label"] {
    display: none !important;
  }

  .qlwapp .qlwapp-icon,
  .qlwapp [class*="whatsapp-icon"],
  .qlwapp i {
    margin: 0 !important;
    font-size: 21px !important;
    line-height: 1 !important;
  }
}

/* Formost mobile responsiveness pass 4 - cleanup gallery banner WhatsApp */
@media (max-width: 782px) {
  /* Product gallery cleanup: undo tall/cropped behavior and keep product visible */
  .entry-content .fm-gallery > div:first-child {
    max-height: none !important;
    overflow: visible !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    background: #f5f5f5;
  }

  .entry-content .fm-gallery > div:first-child img,
  .entry-content .fm-gallery img[id^="fm-main-"] {
    width: auto !important;
    max-width: 100% !important;
    height: auto !important;
    max-height: 68vh !important;
    object-fit: contain !important;
    object-position: center center !important;
    margin-left: auto !important;
    margin-right: auto !important;
  }

  .entry-content .fm-gallery > div:nth-child(2) {
    overflow-x: auto;
    flex-wrap: nowrap !important;
    justify-content: flex-start !important;
    padding-bottom: 4px;
    -webkit-overflow-scrolling: touch;
  }

  /* Homepage carousel cleanup: full mobile width, no text cropping */
  .home .entry-content #fmcs-wrap,
  .entry-content #fmcs-wrap {
    width: 100% !important;
    max-width: 100% !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    background: #f7f8fa;
  }

  .home .entry-content #fmcs-wrap .fmcs-slide,
  .entry-content #fmcs-wrap .fmcs-slide,
  .home .entry-content #fmcs-wrap .fmcs-slide.active,
  .entry-content #fmcs-wrap .fmcs-slide.active {
    min-height: 0 !important;
  }

  .home .entry-content #fmcs-wrap .fmcs-slide img,
  .entry-content #fmcs-wrap .fmcs-slide img {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
    max-height: none !important;
    object-fit: contain !important;
    object-position: center center !important;
  }

  .entry-content #fmcs-wrap .fmcs-arr {
    top: 50% !important;
  }

  /* WhatsApp: compact mobile pill with visible text */
  .qlwapp {
    --qlwapp-scheme-font-size: 14px !important;
    --qlwapp-scheme-icon-size: 22px !important;
    --qlwapp-scheme-icon-font-size: 18px !important;
    right: 12px !important;
    bottom: 14px !important;
    max-width: none !important;
    width: auto !important;
    z-index: 998 !important;
  }

  .qlwapp .qlwapp-toggle,
  .qlwapp a.qlwapp-toggle,
  .qlwapp .qlwapp-button,
  .qlwapp a[class*="button"] {
    width: auto !important;
    min-width: 0 !important;
    max-width: calc(100vw - 24px) !important;
    height: 46px !important;
    min-height: 46px !important;
    padding: 0 16px !important;
    border-radius: 999px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 8px !important;
    overflow: visible !important;
    white-space: nowrap !important;
    line-height: 1 !important;
  }

  .qlwapp .qlwapp-text,
  .qlwapp [class*="text"],
  .qlwapp [class*="label"] {
    display: inline !important;
    font-size: 14px !important;
    line-height: 1 !important;
    max-width: none !important;
    overflow: visible !important;
  }

  .qlwapp .qlwapp-icon,
  .qlwapp [class*="whatsapp-icon"],
  .qlwapp i {
    margin: 0 !important;
    font-size: 18px !important;
    line-height: 1 !important;
    flex: 0 0 auto !important;
  }
}

/* Formost mobile floating WhatsApp plugin rendered button only */
@media (max-width: 782px) {
  .qlwapp .qlwapp__container {
    right: 12px !important;
    bottom: 14px !important;
    left: auto !important;
    width: auto !important;
    height: auto !important;
  }

  .qlwapp .qlwapp__button {
    width: auto !important;
    min-width: 0 !important;
    height: 46px !important;
    min-height: 46px !important;
    padding: 10px 14px !important;
    border-radius: 999px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 6px !important;
    line-height: 1 !important;
    white-space: nowrap !important;
  }

  .qlwapp .qlwapp__text {
    font-size: 0 !important;
    line-height: 1 !important;
  }

  .qlwapp .qlwapp__text::after {
    content: "WhatsApp Us";
    font-size: 15px !important;
    line-height: 1 !important;
    white-space: nowrap !important;
  }

  .qlwapp .qlwapp__icon {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 20px !important;
    height: 20px !important;
    min-width: 20px !important;
    font-size: 18px !important;
    line-height: 1 !important;
    margin: 0 !important;
    padding: 0 !important;
    vertical-align: middle !important;
    transform: none !important;
    flex: 0 0 20px !important;
  }
}
