/**
 * Azure Premium responsive repair layer.
 *
 * This file deliberately owns only the recorded narrow-screen exceptions. It
 * is sandbox-gated independently from the colour compatibility layer so the
 * layout repairs can be disabled without removing the approved rebrand.
 */

@media (max-width: 767px) {
  /* Shared footer 13883: allow the longer sandbox email to wrap at 320px. */
  body.az-premium-site.az-premium-responsive
    .elementor-location-footer.elementor-13883 [data-id="48d481e7"] a[href^="mailto:"] {
    overflow-wrap: anywhere;
    word-break: break-word;
  }

  /* Invisalign Liverpool 9011: remove the hero's min-content track spill. */
  body.az-premium-site.az-premium-responsive.page-id-9011
    .elementor.elementor-9011 [data-id="8648b72"] .az-grid.hero.az-2 {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  body.az-premium-site.az-premium-responsive.page-id-9011
    .elementor.elementor-9011 [data-id="8648b72"] .az-grid.hero.az-2 > * {
    min-width: 0 !important;
  }

  body.az-premium-site.az-premium-responsive.page-id-9011
    .elementor.elementor-9011 [data-id="8648b72"] .az-grid.hero.az-2 .ribbon {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  body.az-premium-site.az-premium-responsive.page-id-9011
    .elementor.elementor-9011 [data-id="8648b72"] .az-grid.hero.az-2 .btn-row .az-btn {
    flex: 1 1 100%;
    min-width: 0;
    width: 100%;
  }

  body.az-premium-site.az-premium-responsive.page-id-9011
    .elementor.elementor-9011 [data-id="8648b72"] #prices {
    overflow-x: auto !important;
    overscroll-behavior-inline: contain;
    -webkit-overflow-scrolling: touch;
  }

  body.az-premium-site.az-premium-responsive.page-id-9011
    .elementor.elementor-9011 [data-id="8648b72"] .testi {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  body.az-premium-site.az-premium-responsive.page-id-9011
    .elementor.elementor-9011 [data-id="8648b72"] .testi > * {
    min-width: 0 !important;
  }

  /* Airflow 6679: allow long FAQ questions to wrap before the icon. */
  body.az-premium-site.az-premium-responsive.single-treatments.postid-6679
    .elementor.elementor-6679 [data-id="81768b4"] .az-faq-q {
    align-items: flex-start;
    min-width: 0;
    white-space: normal !important;
  }

  body.az-premium-site.az-premium-responsive.single-treatments.postid-6679
    .elementor.elementor-6679 [data-id="81768b4"] .az-faq-q .az-faq-icon {
    flex: 0 0 auto;
    margin-left: 12px;
  }

  /* Enlighten 8211: stack the three hero actions inside the mobile track. */
  body.az-premium-site.az-premium-responsive.single-treatments.postid-8211
    .elementor.elementor-8211 [data-id="21c250b"] .evo-hero-text {
    flex: 1 1 100% !important;
    min-width: 0 !important;
    max-width: 100%;
  }

  body.az-premium-site.az-premium-responsive.single-treatments.postid-8211
    .elementor.elementor-8211 [data-id="21c250b"] .evo-hero-ctas {
    flex-wrap: wrap !important;
  }

  body.az-premium-site.az-premium-responsive.single-treatments.postid-8211
    .elementor.elementor-8211 [data-id="21c250b"] .evo-hero-ctas > a {
    flex: 1 1 100%;
    min-width: 0;
    max-width: 100%;
    width: 100%;
  }

  /* Dental Sedation 8514: wrap the page-owned local navigation. */
  body.az-premium-site.az-premium-responsive.single-treatments.postid-8514
    .elementor.elementor-8514 [data-id="12edea3"] nav {
    flex-wrap: wrap !important;
  }

  body.az-premium-site.az-premium-responsive.single-treatments.postid-8514
    .elementor.elementor-8514 [data-id="12edea3"] nav > ul {
    box-sizing: border-box;
    flex: 1 1 100%;
    flex-wrap: wrap !important;
    justify-content: center;
    min-width: 0;
    max-width: 100%;
    padding-left: 0 !important;
    width: 100%;
  }

  body.az-premium-site.az-premium-responsive.single-treatments.postid-8514
    .elementor.elementor-8514 [data-id="12edea3"] nav > ul > li {
    min-width: 0;
  }

  /* Zoom 10992: replace the fixed 420px gallery track on phones. */
  body.az-premium-site.az-premium-responsive.single-treatments.postid-10992
    .elementor.elementor-10992 [data-id="04506f8"] .az-gallery-grid {
    grid-template-columns: minmax(0, 1fr) !important;
    max-width: 100%;
    width: 100%;
  }

  body.az-premium-site.az-premium-responsive.single-treatments.postid-10992
    .elementor.elementor-10992 [data-id="04506f8"] .az-gallery-item {
    min-width: 0 !important;
    max-width: 100%;
    width: 100% !important;
  }

  body.az-premium-site.az-premium-responsive.single-treatments.postid-10992
    .elementor.elementor-10992 [data-id="04506f8"] .az-gallery-item > a {
    display: block;
    max-width: 100%;
  }

  body.az-premium-site.az-premium-responsive.single-treatments.postid-10992
    .elementor.elementor-10992 [data-id="04506f8"] .az-gallery-item img {
    height: auto;
    max-width: 100%;
    width: 100% !important;
  }

  body.az-premium-site.az-premium-responsive.single-treatments.postid-10992
    .elementor.elementor-10992 [data-id="04506f8"] .az-gallery-item figcaption {
    max-width: 100%;
    width: auto !important;
  }

  /* Dental Bridges 12192: keep the comparison readable in a local scroller. */
  body.az-premium-site.az-premium-responsive.page-id-12192
    .elementor.elementor-12192 [data-id="f0d67ad"] .az-panel:has(> .az-compare) {
    overflow-x: auto !important;
    overscroll-behavior-inline: contain;
    -webkit-overflow-scrolling: touch;
  }

  /* Patient Reviews 323: use one filter column; retain its intended carousel. */
  body.az-premium-site.az-premium-responsive.page-id-323
    .elementor.elementor-323 [data-id="42f163c"] .az-filter-row {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  body.az-premium-site.az-premium-responsive.page-id-323
    .elementor.elementor-323 [data-id="42f163c"] .az-filter {
    min-width: 0 !important;
    white-space: normal !important;
    width: 100%;
  }

  body.az-premium-site.az-premium-responsive.page-id-323
    .elementor.elementor-323 [data-id="42f163c"] .az-carousel {
    max-width: 100%;
    overscroll-behavior-inline: contain;
  }

  /* Orthodontist 2483: the sandbox hostname makes this email unusually long. */
  body.az-premium-site.az-premium-responsive.page-id-2483
    .elementor.elementor-2483 [data-id="35a438eb"] a[href^="mailto:"] {
    overflow-wrap: anywhere;
    word-break: break-word;
  }

  /* Contact 2654: prevent the email from defining an over-wide grid track. */
  body.az-premium-site.az-premium-responsive.page-id-2654
    .elementor.elementor-2654 [data-id="7ebba06"] .az-grid.az-2 {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  body.az-premium-site.az-premium-responsive.page-id-2654
    .elementor.elementor-2654 [data-id="7ebba06"] .az-grid.az-2 > * {
    min-width: 0 !important;
    max-width: 100%;
  }

  body.az-premium-site.az-premium-responsive.page-id-2654
    .elementor.elementor-2654 [data-id="7ebba06"] a[href^="mailto:"] {
    overflow-wrap: anywhere;
    word-break: break-word;
  }

  /* Bonding longevity 12073: localise both existing wide data tables. */
  body.az-premium-site.az-premium-responsive.single-post.postid-12073
    .elementor.elementor-12073 [data-id="ca38a7f"] .azcb-section:has(> .azcb-table) {
    overflow-x: auto !important;
    overscroll-behavior-inline: contain;
    -webkit-overflow-scrolling: touch;
  }

  /*
   * Estate QA repairs: the sandbox hostname makes legacy contact addresses
   * substantially longer than their production equivalents. Keep those
   * addresses inside the existing content measure without changing copy.
   */
  body.az-premium-site.az-premium-responsive a[href^="mailto:"] {
    overflow-wrap: anywhere;
    word-break: break-word;
  }

  body.az-premium-site.az-premium-responsive.page-id-8548
    :is(.float-cta-btn, .azure-two-btn-wrap > a) {
    box-sizing: border-box;
    min-width: 0;
    max-width: 100%;
  }

  /* Legacy testimonial 280: retain the video while making it fluid. */
  body.az-premium-site.az-premium-responsive.single-testimonials.postid-280
    iframe[src*="youtube.com/embed"] {
    aspect-ratio: 16 / 9;
    height: auto !important;
    max-width: 100% !important;
    width: 100% !important;
  }

  /*
   * Raw-HTML comparison and guide pages: remove intrinsic min-content tracks
   * on phones. Their desktop grids are unchanged.
   */
  body.az-premium-site.az-premium-responsive:is(
    .page-id-12143,
    .postid-12145,
    .postid-12154,
    .postid-12155,
    .postid-12161,
    .postid-12177,
    .postid-12181,
    .postid-12184,
    .postid-11526,
    .postid-11330,
    .postid-11246,
    .postid-12250
  ) :is(.grid, .az-grid, .grid2, .grid3) {
    grid-template-columns: minmax(0, 1fr) !important;
    max-width: 100%;
    width: 100%;
  }

  body.az-premium-site.az-premium-responsive:is(
    .page-id-12143,
    .postid-12145,
    .postid-12154,
    .postid-12155,
    .postid-12161,
    .postid-12177,
    .postid-12181,
    .postid-12184,
    .postid-11526,
    .postid-11330,
    .postid-11246,
    .postid-12250
  ) :is(.grid, .az-grid, .grid2, .grid3) > * {
    box-sizing: border-box;
    min-width: 0;
    max-width: 100%;
  }

  body.az-premium-site.az-premium-responsive:is(
    .page-id-12143,
    .postid-12145,
    .postid-12154,
    .postid-12155,
    .postid-12161
  ) :is(
    #nhs-vs-private-dentures,
    #dentures-vs-implants,
    #dentures-vs-bridges,
    #implant-retained-dentures,
    #dentures-for-bottom-teeth
  ) .links a {
    box-sizing: border-box;
    min-width: 0;
    max-width: 100%;
    width: 100% !important;
  }

  /* Keep wide data comparisons readable in a local horizontal scroller. */
  body.az-premium-site.az-premium-responsive:is(
    .postid-12111,
    .postid-12193,
    .postid-12201,
    .postid-12239,
    .postid-12177,
    .postid-12181,
    .postid-12184,
    .postid-12161,
    .postid-11984,
    .postid-11848,
    .postid-11526,
    .postid-11330,
    .postid-11246,
    .postid-11241
  ) table {
    display: block;
    max-width: 100% !important;
    overflow-x: auto !important;
    overscroll-behavior-inline: contain;
    -webkit-overflow-scrolling: touch;
  }

  /* Ten related Airflow guides share the same no-wrap FAQ control. */
  body.az-premium-site.az-premium-responsive:is(
    .postid-12248,
    .postid-12256,
    .postid-12255,
    .postid-12253,
    .postid-12251,
    .postid-12252,
    .postid-12249,
    .postid-12240,
    .postid-12239,
    .postid-12250
  ) .az-faq-q {
    align-items: flex-start;
    min-width: 0;
    white-space: normal !important;
    width: 100%;
  }

  body.az-premium-site.az-premium-responsive:is(
    .postid-12248,
    .postid-12256,
    .postid-12255,
    .postid-12253,
    .postid-12251,
    .postid-12252,
    .postid-12249,
    .postid-12240,
    .postid-12239,
    .postid-12250
  ) .az-faq-q > span {
    flex: 0 0 auto;
    margin-left: 12px;
  }

  body.az-premium-site.az-premium-responsive.postid-12249 .az-split {
    grid-template-columns: minmax(0, 1fr) !important;
    max-width: 100%;
  }

  body.az-premium-site.az-premium-responsive.postid-12249 .az-split > * {
    min-width: 0;
    max-width: 100%;
  }
}

@media (min-width: 768px) and (max-width: 900px) {
  /* Patient Reviews 323: two equal filter columns at the tablet breakpoint. */
  body.az-premium-site.az-premium-responsive.page-id-323
    .elementor.elementor-323 [data-id="42f163c"] .az-filter-row {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  body.az-premium-site.az-premium-responsive.page-id-323
    .elementor.elementor-323 [data-id="42f163c"] .az-filter {
    min-width: 0 !important;
    white-space: normal !important;
    width: 100%;
  }
}
