/*
 * LAFER v41 | Reachable portfolio search + compact help dialog.
 * Preserve the approved portraits, category dimensions and transitions.
 * Let the complete gateway determine its height: every control stays reachable
 * at short viewport heights, browser zoom and intermediate laptop widths.
 */

/* Release all three clipping ancestors left by the old 100dvh gateway lock.
   Keep clipping on the naturally sized explorer itself to contain its artwork. */
html body.lafer-enterprise.page-seguros:not(.lfseg-unlocked) {
  overflow-x:hidden!important;
  overflow-y:auto!important;
  overscroll-behavior-y:auto!important;
}
html body.lafer-enterprise.page-seguros:not(.lfseg-unlocked) #main,
html body.lafer-enterprise.page-seguros:not(.lfseg-unlocked) .lfseg-page {
  height:auto!important;
  max-height:none!important;
  overflow:visible!important;
}
html body.lafer-enterprise.page-seguros:not(.lfseg-unlocked)
.lfseg-explorer:not(.is-detail-open) {
  height:auto!important;
  min-height:100svh!important;
  max-height:none!important;
  /* Clip decorative artwork without retaining an invisible scroll position. */
  overflow:clip!important;
}

/* Desktop: retain the approved separation after the portraits. */
@media (min-width:1200px) {
  html body.lafer-enterprise.page-seguros:not(.lfseg-unlocked)
  .lfseg-explorer:not(.is-detail-open) .lfseg-bottom-bar {
    margin-top:-14px!important;
  }
}
/* Short laptops: recover vertical space from the heading's top gap only.
   Portraits and the stage keep their original dimensions; scrolling is the
   fallback when browser chrome or zoom leaves less usable height. */
@media (min-width:1200px) and (max-height:740px) {
  html body.lafer-enterprise.page-seguros:not(.lfseg-unlocked)
  .lfseg-explorer:not(.is-detail-open) {
    padding-top:calc(var(--lf-nav-h,82px) + 28px)!important;
    padding-bottom:max(14px,env(safe-area-inset-bottom));
  }
  html body.lafer-enterprise.page-seguros:not(.lfseg-unlocked)
  .lfseg-explorer:not(.is-detail-open) .lfseg-intro {
    margin-bottom:10px;
  }
}
/* Compact screens: search is the first control after the introduction.
   Preserve portrait sizing and let the category grid continue naturally below. */
@media (max-width:1199px) {
  html body.lafer-enterprise.page-seguros:not(.lfseg-unlocked)
  .lfseg-explorer:not(.is-detail-open) .lfseg-intro {
    order:0;
  }
  html body.lafer-enterprise.page-seguros:not(.lfseg-unlocked)
  .lfseg-explorer:not(.is-detail-open) .lfseg-bottom-bar {
    order:1;
    display:grid!important;
    grid-template-columns:minmax(0,1fr) 48px;
    grid-template-areas:"all pdf" "search search";
    width:min(760px,calc(100% - 26px));
    max-width:760px;
    gap:7px;
    padding:8px;
    border-radius:22px;
    margin:0 auto 16px!important;
  }
  html body.lafer-enterprise.page-seguros:not(.lfseg-unlocked)
  .lfseg-explorer:not(.is-detail-open) .lfseg-stage {
    order:2;
    height:auto!important;
    min-height:0!important;
  }
  html body.lafer-enterprise.page-seguros:not(.lfseg-unlocked)
  .lfseg-explorer:not(.is-detail-open) .lfseg-search-wrap {
    width:100%!important;
    max-width:none;
    min-width:0;
  }
  html body.lafer-enterprise.page-seguros:not(.lfseg-unlocked)
  .lfseg-explorer:not(.is-detail-open) .lfseg-search-results {
    top:calc(100% + 8px);
    bottom:auto;
    max-height:min(330px,35dvh);
  }
}
/* Intermediate laptops: six equally sized cards in the same sequence as desktop.
   The old full-width cash card now uses the same portrait inset as its peers. */
@media (min-width:901px) and (max-width:1199px) {
  html body.lafer-enterprise.page-seguros:not(.lfseg-unlocked)
  .lfseg-explorer:not(.is-detail-open) .lfseg-pillars-track {
    display:grid!important;
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
    grid-auto-rows:176px;
    height:auto!important;
  }
  html body.lafer-enterprise.page-seguros:not(.lfseg-unlocked)
  .lfseg-explorer:not(.is-detail-open) .lfseg-pillars-track>.lfseg-pillar {
    order:0!important;
    grid-column:auto!important;
    width:100%!important;
    height:176px!important;
  }
  html body.lafer-enterprise.page-seguros:not(.lfseg-unlocked)
  .lfseg-explorer:not(.is-detail-open) .lfseg-pillar[data-line="efectivo-operacion"] .lfseg-visual-wrap {
    left:54%;
    right:-5%;
    top:5px;
    bottom:-10px;
  }
}

/* ADDITIONAL HELP: downscale the dialog *and* every element inside, not the
 * browser itself. All actions remain native anchor links to the same teams. */
html body.lafer-enterprise dialog.lf-help-dialog {
  /* Explicit viewport centering: the entrance animation animates transform,
     so center using the independent translate property instead. */
  position:fixed!important;
  top:50%!important;
  left:50%!important;
  right:auto!important;
  bottom:auto!important;
  margin:0!important;
  translate:-50% -50%!important;
  box-sizing:border-box!important;
  width:min(710px,calc(100vw - 30px))!important;
  max-width:calc(100vw - 30px)!important;
  max-height:min(82dvh,605px)!important;
  padding:0!important;
  overflow-x:hidden!important;
  overflow-y:auto!important;
  overscroll-behavior:contain;
  border-radius:25px!important;
}
html body.lafer-enterprise .lf-help-dialog-inner {
  padding:clamp(20px,2.7vw,34px)!important;
}
html body.lafer-enterprise .lf-help-dialog-orb {
  width:43px!important;
  height:43px!important;
  margin-bottom:14px!important;
  border-radius:14px!important;
}
html body.lafer-enterprise .lf-help-dialog-orb svg {
  width:23px!important;
  height:23px!important;
}
html body.lafer-enterprise .lf-help-dialog h2 {
  max-width:calc(100% - 38px)!important;
  margin-bottom:8px!important;
  font-size:clamp(26px,calc(18px + 1.25vw),37px)!important;
  line-height:1.15!important;
  letter-spacing:-.045em!important;
}
html body.lafer-enterprise .lf-help-dialog-inner>p {
  max-width:580px!important;
  margin-bottom:18px!important;
  font-size:clamp(13px,1.05vw,14px)!important;
  line-height:1.5!important;
}
html body.lafer-enterprise .lf-help-close {
  top:13px!important;
  right:13px!important;
  width:41px!important;
  height:41px!important;
  font-size:25px!important;
}
html body.lafer-enterprise .lf-help-choices {
  gap:11px!important;
}
html body.lafer-enterprise .lf-help-choice {
  min-height:178px!important;
  padding:19px!important;
  gap:13px!important;
  border-radius:20px!important;
}
html body.lafer-enterprise .lf-help-choice-icon {
  width:43px!important;
  height:43px!important;
  flex:0 0 43px!important;
  border-radius:13px!important;
}
html body.lafer-enterprise .lf-help-choice-icon svg {
  width:24px!important;
  height:24px!important;
}
html body.lafer-enterprise .lf-help-choice-copy {
  gap:6px!important;
}
html body.lafer-enterprise .lf-help-choice-copy strong {
  font-size:clamp(18px,1.45vw,22px)!important;
  line-height:1.18!important;
}
html body.lafer-enterprise .lf-help-choice-copy small {
  font-size:12.5px!important;
  line-height:1.4!important;
}
html body.lafer-enterprise .lf-help-choice-copy>span {
  margin-top:5px!important;
  font-size:12px!important;
  line-height:1.35!important;
  gap:6px!important;
}
html body.lafer-enterprise .lf-help-dialog-foot {
  margin-top:13px!important;
  font-size:11px!important;
}

/* Vertically limited screens: retain all help and close controls via
 * scrolling instead of large fixed cards or clipped bottom actions. */
@media (max-height:620px) and (min-width:741px) {
  html body.lafer-enterprise dialog.lf-help-dialog {
    max-height:calc(100dvh - 30px)!important;
  }
  html body.lafer-enterprise .lf-help-dialog-inner {
    padding:17px 23px!important;
  }
  html body.lafer-enterprise .lf-help-choice {
    min-height:153px!important;
    padding:15px!important;
  }
  html body.lafer-enterprise .lf-help-dialog-orb {
    margin-bottom:9px!important;
  }
  html body.lafer-enterprise .lf-help-dialog-inner>p {
    margin-bottom:11px!important;
  }
}
@media (max-width:740px) {
  html body.lafer-enterprise dialog.lf-help-dialog {
    width:min(460px,calc(100vw - 18px))!important;
    max-width:calc(100vw - 18px)!important;
    max-height:min(84dvh,595px)!important;
    border-radius:20px!important;
  }
  html body.lafer-enterprise .lf-help-dialog-inner {
    padding:20px 17px 22px!important;
  }
  html body.lafer-enterprise .lf-help-dialog h2 {
    font-size:clamp(24px,6.1vw,31px)!important;
    max-width:calc(100% - 36px)!important;
  }
  html body.lafer-enterprise .lf-help-dialog-inner>p {
    font-size:13px!important;
    margin-bottom:13px!important;
  }
  html body.lafer-enterprise .lf-help-choices {
    grid-template-columns:1fr!important;
    gap:9px!important;
  }
  html body.lafer-enterprise .lf-help-choice {
    flex-direction:row!important;
    align-items:center!important;
    min-height:0!important;
    padding:14px 15px!important;
    gap:12px!important;
  }
  html body.lafer-enterprise .lf-help-choice-icon {
    width:39px!important;
    height:39px!important;
    flex:0 0 39px!important;
  }
  html body.lafer-enterprise .lf-help-choice-icon svg {
    width:22px!important;
    height:22px!important;
  }
  html body.lafer-enterprise .lf-help-choice-copy {
    flex:1 1 auto;
    min-width:0;
  }
  html body.lafer-enterprise .lf-help-choice-copy strong {
    font-size:18px!important;
  }
  html body.lafer-enterprise .lf-help-choice-copy small {
    font-size:12px!important;
  }
  html body.lafer-enterprise .lf-help-choice-copy>span {
    margin-top:3px!important;
  }
  html body.lafer-enterprise .lf-help-dialog-foot {
    margin-top:11px!important;
  }
}
