/* AEC mobile QA fixes (2026-10-23). Mobile only, presentation only. */
@media (max-width:650px){
  /* 1. Canton Fair floating promo: not needed on the Canton Fair page itself
        (it covered the plan "reserve" buttons); compact elsewhere. */
  body:has(#plan-1) #cf-float{display:none!important}
  #cf-float{right:16px;bottom:78px;max-width:none;padding:6px 14px 6px 6px;border-radius:16px}
  #cf-float>a{min-height:44px;gap:9px}
  #cf-float .cf-orb{width:36px;height:40px;flex-basis:36px;border-radius:11px}
  #cf-float .cf-orb svg{width:20px;height:20px}
  #cf-float strong{font-size:14px;line-height:1.2}
  #cf-float small,#cf-float .cf-arrow{position:absolute!important;width:1px!important;height:1px!important;margin:-1px!important;padding:0!important;overflow:hidden!important;clip:rect(0 0 0 0)!important;white-space:nowrap!important;border:0!important}
  #cf-float .cf-close{width:24px;height:24px;top:-9px;right:-7px;font-size:16px}
  #cf-float .cf-close::before{content:"";position:absolute;inset:-10px}

  /* 2. Keep the end of every page clear of the WhatsApp / Canton floats. */
  body:has(.aec-wa-float) footer{padding-bottom:80px}
  body:has(#cf-float:not([hidden])):not(:has(#plan-1)) footer{padding-bottom:150px}
  body:has(#plan-1) footer{padding-bottom:80px}

  /* 3. Footer tap targets (>=44px). */
  footer nav[aria-label] > a{display:flex;align-items:center;min-height:44px;min-width:44px}
  footer nav[aria-label] > button[data-consent-open]{min-height:44px}
  footer a[aria-label][style*="width:36px"]{width:44px!important;height:44px!important}
  footer .aec-wechat-btn{width:44px!important;height:44px!important;min-width:44px;min-height:44px}
  footer p a{display:inline-block;padding-block:14px}

  /* 4. Other small tap targets. */
  header + nav.pad > a{display:inline-block;padding:14px 6px;margin:-14px -6px}
  #services-grid [data-topic] > div[style*="gap:6px"]{gap:0!important}
  #services-grid [data-topic] > div[style*="gap:6px"] > a{display:flex;align-items:center;min-height:44px}
  #services-360 > a{min-height:44px;display:inline-flex;align-items:center}
  details > summary{padding-block:12px}
  main a[href^="tel:"]:not([class]):not([style*="padding"]),
  main a[href^="mailto:"]:not([class]):not([style*="padding"]),
  main a[href*="wa.me"]:not([class]):not([style*="padding"]){display:inline-block;padding-block:14px}
  .aec-mnav-close{min-width:44px!important;min-height:44px!important}
  .aec-mnav-sub a{min-height:44px!important;box-sizing:border-box;display:flex!important;align-items:center}

  /* 5. Canton Fair: minimum readable text sizes. */
  .cf-eyebrow,.cf-limited,.cf-kicker,.cf-number,.cf-card-top .cf-number,.cf-experience span,
  .cf-city small,.cf-compare thead small,.cf-visual-caption small,#cf-float .cf-places{font-size:11px}
  .cf-pending,.cf-price small,.cf-disclosure,.cf-real p{font-size:12px}
  .cf-card-top .cf-number{max-width:128px}

  /* 6. Mis recursos portal. */
  .portal-langs a{min-height:44px;min-width:36px}
  .resource-cta{min-height:44px}
  .portal-legal a,.portal-footer a{display:inline-block;padding-block:12px}
  .resource-state{font-size:12px}
  .access-badge{font-size:11px}
}

/* 7. Team page: founder strip was clipped on narrow phones (long roles). */
@media (max-width:440px){
  .shell .founders{grid-template-columns:1fr}
  .shell .founder+.founder{border-left:0;border-top:1px solid var(--line)}
  .shell .founder>div{min-width:0}
  .shell .langs button{min-height:44px}
  .social-copy span{font-size:12px}
  .shell .founder p{font-size:11.5px}
}

/* 8. Hide the Canton float once the Instagram block scrolls in (it covered
      "Seguir en Instagram" and then the footer). CSS scroll-driven animation;
      browsers without support keep the compact float. */
@supports (animation-timeline: view()){
  @media (max-width:650px){
    html body{timeline-scope:--aec-ig, --aec-igbtn, --aec-igt2, --aec-igt4}
    body:has(#instagram) > div{overflow-x:clip!important}
    html body #instagram{view-timeline:--aec-ig block}
    @keyframes aec-cf-hide{from{opacity:1;visibility:visible}to{opacity:0;visibility:hidden}}
    /* WhatsApp float steps aside only while the follow button passes behind it */
    html body .aec-ig-follow{view-timeline:--aec-igbtn block}
    @keyframes aec-wa-dodge{0%,97%{opacity:0;visibility:hidden}100%{opacity:1;visibility:visible}}
    html body #instagram li:nth-child(2){view-timeline:--aec-igt2 block}
    html body #instagram li:nth-child(4){view-timeline:--aec-igt4 block}
    html body .aec-wa-float{animation:aec-wa-dodge linear none,aec-wa-dodge linear none,aec-wa-dodge linear none;animation-timeline:--aec-igbtn,--aec-igt2,--aec-igt4;animation-range:entry 0% contain 80px}
    html body #cf-float{animation:aec-cf-hide linear both!important;animation-timeline:--aec-ig!important;animation-range:entry 0% entry 35%!important}
  }
}
