/* Presentation corrections from physical Fold QA. No hero navigation changes. */
@media (max-width: 900px) {
  html {
    scroll-padding-bottom: calc(76px + env(safe-area-inset-bottom));
  }

  body .rp-vera-access {
    box-sizing: border-box;
    width: 44px;
    height: 44px;
    min-height: 44px;
    padding: 0;
    justify-content: center;
    gap: 0;
    right: max(12px, env(safe-area-inset-right)) !important;
    bottom: max(12px, env(safe-area-inset-bottom)) !important;
  }

  /* Retain the original accessible name, destination and desktop label. */
  body .rp-vera-access > span {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }

  body .buybox-mobile-access {
    box-sizing: border-box;
    left: max(12px, env(safe-area-inset-left));
    bottom: max(12px, env(safe-area-inset-bottom));
    width: min(270px, calc(100% - max(12px, env(safe-area-inset-left)) - max(12px, env(safe-area-inset-right)) - 56px));
    min-height: 44px;
    padding: 5px 12px;
    column-gap: 10px;
  }

  /* The final legal copy and keyboard focus can be scrolled fully above the controls. */
  body .rp-home-footer {
    padding-bottom: calc(80px + env(safe-area-inset-bottom));
  }
  body :is(input, select, textarea, button, [tabindex], a) {
    /* The scroll container already reserves the companion height above. */
    scroll-margin-bottom: 8px;
  }

  /* CSS fallback works without JS. No focus is moved and no form value is inspected. */
  html:has(form:focus-within) body .rp-vera-access,
  html:has(form:focus-within) body .buybox-mobile-access {
    visibility: hidden;
    pointer-events: none;
  }

  /* Existing inline access/Contacto links remain available in the navigation.
     Hidden companions leave no invisible tab stop and cannot cover reading. */
  body .rp-vera-access[data-reading-clearance]:not(:focus-within) {
    visibility: hidden;
    pointer-events: none;
  }

  /* An open mobile navigation owns the screen; companions must not cover its links. */
  html:has(.business-navigation :is([data-global-toggle], [data-page-toggle])[aria-expanded="true"]) body :is(.rp-vera-access, .buybox-mobile-access),
  html:has([data-nav-explore][aria-expanded="true"]) body :is(.rp-vera-access, .buybox-mobile-access),
  html:has(#rh-mobile-menu[open]) body :is(.rp-vera-access, .buybox-mobile-access) {
    visibility: hidden;
    pointer-events: none;
  }

  .prime-landing .card-navigation button {
    width: 44px;
    height: 44px;
    min-width: 44px;
    min-height: 44px;
  }
  .prime-landing :is(.strategy-switch, .faq-topics button, .hero-actions .button,
    .hero-actions .text-link, .section-top .button, .op-card-link, .existing-cta,
    .model-next, .risk-disclosure, .faq-interactive > .text-link) {
    min-height: 44px !important;
    touch-action: manipulation;
  }
  .information-page .term-permalink {
    box-sizing: border-box;
    width: 44px;
    min-width: 44px;
    min-height: 44px;
  }
  .information-page .term-related a {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
  }
  .blog-filters button {
    min-height: 44px;
    touch-action: manipulation;
  }
}

@media (max-width: 540px) {
  /* The larger strategy target needs real room, not an overlapping hitbox. */
  .prime-landing .strategy-card { grid-template-rows: 92px auto; }
  .prime-landing .strategy-art { height: 92px; min-height: 92px; }
  .prime-landing .strategy-switch { top: 36px; }
}

/* A short landscape phone has room for a 60px navigation, not an 86px masthead.
   Keep Close pinned inside either scrollable index so it never leaves the screen. */
@media (max-width: 900px) and (orientation: landscape) and (max-height: 450px) {
  .business-navigation .bn-space { height: 60px; }
  .business-navigation .bn-global { min-height: 60px; padding: 4px 12px; }
  .business-navigation .bn-logo img { height: 38px; }
  .business-navigation .bn-context { top: max(4px, env(safe-area-inset-top)); }
  .business-navigation .bn-location { display: none; }
  .business-navigation .bn-general-menu,
  .business-navigation .bn-page-menu { max-height: calc(100dvh - 72px - env(safe-area-inset-top) - env(safe-area-inset-bottom)); }
  .business-navigation .bn-panel-heading { position: sticky; top: 0; z-index: 2; background: #fff; padding-top: 10px; }
  html { scroll-padding-top: 70px; }
}

/* Consent takes precedence over all floating companions, including the fixed
   product action, until the visitor has made a choice. */
body:has([data-cookie-banner]) :is(.buybox-mobile-access, .rp-vera-access, [data-agent-launcher]) {
  visibility: hidden;
  pointer-events: none;
}

/* Keep numbers together; widen the figure's column instead of wrapping ≥. */
.pp-big-percent { white-space: nowrap; }
@media (min-width: 541px) and (max-width: 760px) {
  .pp-presale { grid-template-columns: 170px minmax(0, 1fr); }
}
@media (max-width: 540px) {
  .pp-presale { grid-template-columns: minmax(0, 1fr); }
  .pp-presale h3 { grid-column: 1; grid-row: auto; }
  .pp-big-percent { font-size: clamp(52px, 15vw, 69px); }
  .pp-unit-grid { max-width: 240px; }
}

/* Natural line wrapping avoids a one-word orphan before an imposed break. */
@media (max-width: 760px) {
  body[data-rp-npl] .hero h1 br { display: none; }
  body[data-rp-npl] .hero h1 { text-wrap: balance; }
  body[data-rp-npl] .hero h1 > span { display: block; }
  .corporate-dossier .data-table > div { grid-template-columns: minmax(0, 1fr); gap: 7px; }
  .io3-lot-layout { grid-template-columns: minmax(0, 1fr); }
  .io3-lot-visual .io3-render { height: auto; max-height: 300px; aspect-ratio: 3 / 2; }
  .io3-lot-visual figcaption > span br { display: initial; }
  .io2-heading { display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; }
  .io2-heading > p { max-width: none; }
}

.io3-lot-visual figcaption > span br { display: initial; }

/* User-approved exception for very narrow phones only (02/10/2026).
 * Mirror the approved prose scope; figures, labels and controls keep their alignment.
 * The original justified reading rule continues unchanged above 480px.
 */
@media (max-width: 480px) {
  html:lang(es) body p:not(:where(
    nav *, button *, summary *, figure *, label *, [role="status"], [role="alert"], [aria-live],
    .business-navigation *, .rp-section-nav *, .rp-page-index *, .info-search *,
    .eyebrow, .rp-eyebrow, .rh-kicker, .io2-kicker,
    .bn-location, .rp-section-location, .rp-sequence-hint, .faq-instruction,
    .oc-metric-label, .oc-metric *, .op-metric *, .pp-split *, .pp-benefit-split *,
    .io2-entry-amount, .operation-location, .traditional *, .prime-order *,
    .dossier-sheet *, .rp-brand-line, .gines-gallery-note,
    .cv-required, .cv-error, .cv-form-tail, .info-empty,
    .term-related, .term-source, .blog-count, .blog-card-meta, .blog-publication,
    .blog-sources, .legal-updated, .rp-footer-copy, .rp-footer-bottom *,
    .text-center, .text-center *, [align="center"], [style*="text-align:center"],
    [style*="text-align: center"]
  )),
  .data-table dd,
  .info-rows dd,
  .io2-review-list dd,
  .io2-roles dd,
  .io3-economics dd,
  .document-index small,
  .info-checklist li,
  .resource-feature li,
  .legal-document li {
    text-align: left !important;
    text-align-last: start !important;
    -webkit-hyphens: none !important;
    hyphens: none !important;
  }
}
