/* BB Clinic Blueprint 1.11.62 — mobile layout stability.
 * Replace competing wrapper scanners with one limited, measured intervention.
 * Never reset every .e-con / every Elementor widget / saved page layout.
 * Per-widget opt out: Responsive > Compactar espacios internos = No. */
@media (max-width:1024px) {
  /* Only compact enabled BB Clinic widgets, never Elementor containers wholesale. */
  .elementor-widget:has(> .elementor-widget-container > .bbcb-elementor-render.bbcb-mobile-compact) {
    min-height:0;
    max-height:none;
    align-self:auto;
  }
  .bbcb-elementor-render.bbcb-mobile-compact {
    min-width:0;
    min-height:0;
    max-height:none;
    height:auto;
  }
  .bbcb-elementor-render.bbcb-mobile-compact > :is(.section-pad,.bbcf-section,.hero-slider) {
    min-height:0;
    box-sizing:border-box;
  }
  /* Hidden Grid slides cannot dictate the size of the active Hero on tablet. */
  .elementor-widget-bbcb_home_hero .bbcb-mobile-compact .hero-slide:not(.is-active) {
    height:0!important;min-height:0!important;max-height:0!important;
    padding-block:0!important;margin-block:0!important;
    overflow:hidden!important;visibility:hidden;
  }
  /* Applied by JS only to structurally isolated ancestors with proven surplus. */
  .elementor .bbcb-mobile-tight-shell-11162 {
    min-height:0!important;
    height:auto!important;
    max-height:none!important;
    align-content:start!important;
    justify-content:flex-start!important;
  }
  .elementor .bbcb-mobile-tight-shell-11162.bbcb-mobile-tight-padding-11162 {
    padding-top:clamp(12px,2.8vw,26px)!important;
    padding-bottom:clamp(12px,2.8vw,26px)!important;
  }
  .elementor .bbcb-mobile-tight-widget-11162 { margin-block:0!important; }
}

/* Genuine mobile: size sections to content rather than a desktop scene or the
 * longest (possibly hidden) Swiper card. Keep header clearance in the Hero. */
@media (max-width:767px) {
  .elementor-widget-bbcb_home_hero .bbcb-mobile-compact > .hero-slider,
  .elementor-widget-bbcb_home_team .bbcb-mobile-compact > .team,
  .elementor-widget-bbcb_home_philosophy .bbcb-mobile-compact > .philosophy,
  .elementor-widget-bbcb_home_reviews .bbcb-mobile-compact > .reviews,
  .elementor-widget-bbcb_home_specialties .bbcb-mobile-compact > .specialties,
  .elementor-widget-bbcb_home_appointment .bbcb-mobile-compact > .appointment {
    min-height:0!important;
    height:auto!important;
    max-height:none!important;
    padding-top:var(--bbcb-mobile-outer-pad-top,clamp(24px,6vw,34px))!important;
    padding-bottom:var(--bbcb-mobile-outer-pad-bottom,clamp(24px,6vw,34px))!important;
  }
  /* Home Hero: padding includes an intentional clearance for the header. */
  .elementor-widget-bbcb_home_hero .bbcb-mobile-compact > .hero-slider {
    padding-block:0!important;
    overflow:clip;
  }
  .elementor-widget-bbcb_home_hero .bbcb-mobile-compact .hero-slides {
    display:grid;
    grid-template-columns:minmax(0,1fr);
    position:relative;
    min-height:0!important;
  }
  .elementor-widget-bbcb_home_hero .bbcb-mobile-compact .hero-slide {
    min-height:0!important;
    max-height:none!important;
    height:auto;
    padding-top:var(--bbcb-mobile-outer-pad-top,clamp(88px,19vw,112px))!important;
    padding-bottom:var(--bbcb-mobile-outer-pad-bottom,clamp(68px,14vw,88px))!important;
    box-sizing:border-box;
    align-items:flex-start;
  }
  /* Hidden slides still participate in CSS grid intrinsic sizing unless their
   * box is collapsed. .is-active is added BEFORE GSAP starts the transition. */
  .elementor-widget-bbcb_home_hero .bbcb-mobile-compact .hero-slide:not(.is-active) {
    height:0!important;
    min-height:0!important;
    max-height:0!important;
    padding-block:0!important;
    margin-block:0!important;
    overflow:hidden!important;
    visibility:hidden;
  }
  .elementor-widget-bbcb_home_hero .bbcb-mobile-compact .hero-grid {
    display:grid;
    grid-template-columns:minmax(0,1fr)!important;
    gap:clamp(16px,4.6vw,25px);
    align-items:start;
    min-width:0;
  }
  .elementor-widget-bbcb_home_hero .bbcb-mobile-compact .hero-copy,
  .elementor-widget-bbcb_home_hero .bbcb-mobile-compact .hero-visual {
    width:100%;max-width:100%;min-width:0;
  }
  .elementor-widget-bbcb_home_hero .bbcb-mobile-compact .hero-copy > :is(.hero-intro,.actions,.hero-signals) {
    min-height:0;
  }
  .elementor-widget-bbcb_home_hero .bbcb-mobile-compact .hero-intro {margin-top:clamp(12px,3vw,18px)}
  .elementor-widget-bbcb_home_hero .bbcb-mobile-compact .actions {margin-top:clamp(14px,3.5vw,20px)}
  .elementor-widget-bbcb_home_hero .bbcb-mobile-compact .hero-signals {margin-top:clamp(16px,4vw,24px)}
  .elementor-widget-bbcb_home_hero .bbcb-mobile-compact .hero-signals:not(:has(>span)) {display:none}
  .elementor-widget-bbcb_home_hero .bbcb-mobile-compact .actions:not(:has(>a)) {display:none}
  .elementor-widget-bbcb_home_hero .bbcb-mobile-compact .hero-media:not([class*="bbcb-frame--"]) {
    height:clamp(215px,71vw,350px)!important;
    min-height:0!important;
  }
  .elementor-widget-bbcb_home_hero .bbcb-mobile-compact .hero-media[class*="bbcb-frame--"] {
    height:auto!important;
    min-height:0!important;
  }
  .elementor-widget-bbcb_home_hero .bbcb-mobile-compact .hero-float-card {
    max-width:calc(100% - 20px); padding:10px 12px; gap:10px;
  }

  /* Philosophy: desktop 500–600px figure plus large badge is not a mobile row. */
  .elementor-widget-bbcb_home_philosophy .bbcb-mobile-compact .philosophy-grid {
    display:grid;grid-template-columns:minmax(0,1fr)!important;
    gap:clamp(16px,4vw,24px)!important;
    align-items:start;
  }
  .elementor-widget-bbcb_home_philosophy .bbcb-mobile-compact :is(.philosophy-visual,.philosophy-copy) {
    width:100%;height:auto;min-height:0!important;max-height:none!important;
  }
  .elementor-widget-bbcb_home_philosophy .bbcb-mobile-compact .philosophy-media {
    height:clamp(220px,78vw,350px)!important;
    min-height:0!important;
    max-height:350px!important;
    overflow:hidden;
  }
  .elementor-widget-bbcb_home_philosophy .bbcb-mobile-compact .philosophy-media > img {
    max-height:100%;object-position:center 38%;
  }
  .elementor-widget-bbcb_home_philosophy .bbcb-mobile-compact .philosophy-badge {
    position:relative!important;
    inset:auto!important;
    display:flex;align-items:center;justify-content:flex-start;text-align:left;
    width:100%;max-width:100%;aspect-ratio:auto;
    min-height:0!important;height:auto!important;
    margin-top:10px;padding:11px 15px;gap:12px;
    border-radius:16px;box-shadow:none;
  }
  .elementor-widget-bbcb_home_philosophy .bbcb-mobile-compact .philosophy-badge span {font-size:1.25rem;flex:none}
  .elementor-widget-bbcb_home_philosophy .bbcb-mobile-compact .philosophy-badge p {margin:0;font-size:.79rem}
  .elementor-widget-bbcb_home_philosophy .bbcb-mobile-compact .philosophy-copy h2 {margin-bottom:15px}
  .elementor-widget-bbcb_home_philosophy .bbcb-mobile-compact .philosophy-copy blockquote {
    margin-top:clamp(16px,4vw,24px)!important;padding-top:15px;
    font-size:clamp(1.38rem,6vw,1.9rem);line-height:1.18;
  }
  /* GSAP image translations can reveal the empty image underlay during scroll. */
  .elementor-widget-bbcb_home_philosophy .bbcb-mobile-compact [data-parallax-media] {
    transform:none!important;
  }

  /* Testimonials: don't inherit slide height from a different, longer review. */
  .elementor-widget-bbcb_home_reviews .bbcb-mobile-compact .reviews-head {
    grid-template-columns:minmax(0,1fr);gap:15px!important;margin-bottom:20px!important;
  }
  .elementor-widget-bbcb_home_reviews .bbcb-mobile-compact .reviews-shell,
  .elementor-widget-bbcb_home_reviews .bbcb-mobile-compact .reviews-swiper {
    min-height:0!important;height:auto;
  }
  .elementor-widget-bbcb_home_reviews .bbcb-mobile-compact .reviews-swiper > .swiper-wrapper {
    align-items:flex-start!important;min-height:0!important;
  }
  .elementor-widget-bbcb_home_reviews .bbcb-mobile-compact .review-card {
    height:auto!important;min-height:0!important;max-height:none!important;
    align-self:flex-start;justify-content:flex-start;
    padding:clamp(17px,4.5vw,22px)!important;
  }
  .elementor-widget-bbcb_home_reviews .bbcb-mobile-compact .review-top {
    align-items:flex-start;flex-wrap:wrap;gap:10px;margin-bottom:clamp(12px,3vw,18px)!important;
  }
  .elementor-widget-bbcb_home_reviews .bbcb-mobile-compact .review-card > p {
    flex:none!important;margin:0 0 16px!important;font-size:clamp(1.12rem,4.8vw,1.38rem);
    line-height:1.38;overflow-wrap:anywhere;
  }
  .elementor-widget-bbcb_home_reviews .bbcb-mobile-compact .reviews-controls {margin-top:16px}
  /* CTA is output AFTER the dark review section; keep one continuous surface. */
  .elementor-widget-bbcb_home_reviews .bbcb-mobile-compact > .bbcb-reviews-archive-cta {
    margin:0!important;
    padding:0 16px 25px!important;
    min-height:0!important;
    background:var(--brand-navy,#264d8c);
    color:#fff;
  }

  /* Equipo: mobile slides must not stretch to the longest professional text. */
  .elementor-widget-bbcb_home_team .bbcb-mobile-compact .bbcb-team-swiper > .swiper-wrapper {
    align-items:flex-start!important;
  }
  .elementor-widget-bbcb_home_team .bbcb-mobile-compact .bbcb-team-slide {
    height:auto!important;min-height:0!important;max-height:none!important;
    align-self:flex-start!important;
  }
  .elementor-widget-bbcb_home_team .bbcb-mobile-compact .bbcb-team-slide .card-media {
    height:clamp(208px,68vw,290px)!important;max-height:290px;
    min-height:0!important;margin:0;
    background:var(--paper-2,#eff3f9);
  }
  .elementor-widget-bbcb_home_team .bbcb-mobile-compact .bbcb-team-slide .card-media > img {
    object-fit:contain!important;object-position:center top;
    transform:none!important;
  }
  .elementor-widget-bbcb_home_team .bbcb-mobile-compact .bbcb-team-slide .card-body {
    display:flex;flex-direction:column;gap:0;
    height:auto!important;min-height:0!important;max-height:none!important;
    flex:0 0 auto!important;padding:clamp(16px,4vw,22px);
  }
  .elementor-widget-bbcb_home_team .bbcb-mobile-compact .bbcb-team-slide .card-body h3 {
    margin:10px 0 12px;overflow-wrap:anywhere;
  }
  .elementor-widget-bbcb_home_team .bbcb-mobile-compact .bbcb-team-slide .bbcb-team-card__subtitle {margin:0 0 10px}
  .elementor-widget-bbcb_home_team .bbcb-mobile-compact .bbcb-team-slide .bbcb-team-card__description {
    flex:none!important;margin:0 0 13px;overflow-wrap:anywhere;
  }
  .elementor-widget-bbcb_home_team .bbcb-mobile-compact .bbcb-team-slide .bbcb-team-slide__footer {margin-top:0}
  .elementor-widget-bbcb_home_team .bbcb-mobile-compact .bbcb-team-final-cta {margin-top:17px}

  /* Other homepage widgets share the same section rhythm. */
  .elementor-widget-bbcb_home_specialties .bbcb-mobile-compact .specialty-card .card-body {
    min-height:0!important;height:auto!important;flex:none;
  }
  .elementor-widget-bbcb_home_specialties .bbcb-mobile-compact .specialty-card .card-body > p {flex:none}
  .elementor-widget-bbcb_home_appointment .bbcb-mobile-compact .appointment-title {
    position:static!important;top:auto!important;
  }
  .bbcb-elementor-render.bbcb-mobile-compact .section-head {margin-bottom:clamp(16px,5vw,24px)}
  .bbcb-elementor-render.bbcb-mobile-compact .container {max-width:100%;min-width:0}
}

/* Small tablet: only remove forced geometry, do not shrink all editorial type. */
@media (min-width:768px) and (max-width:1024px) {
  .elementor-widget-bbcb_home_hero .bbcb-mobile-compact .hero-slide {min-height:0!important}
  .elementor-widget-bbcb_home_philosophy .bbcb-mobile-compact .philosophy-media {
    min-height:0!important;max-height:min(56vw,550px)
  }
  .elementor-widget-bbcb_home_reviews .bbcb-mobile-compact .review-card {min-height:0}
}
