/* R278: mobile editorial composition for public SAGAZ pages.
   Desktop rules remain untouched; this file is loaded after each page stylesheet. */

@media (max-width: 760px) {
  html { overflow-x: clip; }
  body { overflow-x: clip; }
  img { max-width: 100%; }

  .public-shell-page .site-header > nav {
    padding-inline: 14px;
  }

  .public-shell-page .site-header.nav-open .links {
    max-height: calc(100svh - 72px);
    overflow-y: auto;
    overscroll-behavior: contain;
  }

  /* Editorial and solution pages: image first, text second, no overlap. */
  .seo-page .seo-hero {
    display: flex !important;
    flex-direction: column;
    min-height: 0 !important;
    padding: 0 !important;
    overflow: hidden;
  }

  .seo-page .seo-hero-media {
    position: relative !important;
    inset: auto !important;
    order: 0;
    width: 100%;
    height: 228px;
    margin: 0;
    overflow: hidden;
  }

  .seo-page .seo-hero-media::after {
    background: linear-gradient(180deg, rgba(6,47,56,0) 30%, rgba(6,47,56,.86) 100%) !important;
  }

  .seo-page .seo-hero-media--cream::after {
    background: linear-gradient(180deg, rgba(247,242,230,0) 24%, #f7f2e6 100%) !important;
  }

  .seo-page .seo-hero-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
  }

  .seo-page .seo-hero > .shell {
    order: 1;
    width: min(calc(100% - 28px), 680px);
    padding: 30px 0 40px;
    margin-inline: auto;
  }

  .seo-page .seo-hero h1 {
    max-width: 100%;
    font-size: clamp(2.45rem, 11vw, 4rem);
    line-height: .98;
    letter-spacing: -.055em;
  }

  .seo-page .seo-hero p {
    max-width: 100%;
    font-size: 1rem;
    line-height: 1.55;
  }

  .seo-page .seo-title-line,
  .seo-page .hero-balanced-copy span {
    display: inline;
  }

  .seo-page .seo-actions a {
    width: 100%;
    min-height: 48px;
    justify-content: center;
    text-align: center;
    padding: 13px 16px;
    border-radius: 10px;
    background: #c8f25c;
    color: #0b2b35;
    font-weight: 900;
  }

  .seo-page .seo-grid,
  .seo-page .seo-section .seo-grid {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .seo-page .seo-card {
    border-radius: 0;
    padding: 24px 0 28px;
    box-shadow: none;
    border-inline: 0;
  }

  .seo-page .seo-card + .seo-card {
    border-top: 1px solid rgba(18,59,73,.18);
  }

  .seo-page .seo-section,
  .seo-page .seo-cta {
    padding: 54px 0;
  }

  /* Solution detail pages use the existing desktop image as a deliberate top panel. */
  .public-shell-page .breadcrumb {
    width: min(calc(100% - 28px), 1180px);
    padding: 14px 0 0;
    margin-inline: auto;
    font-size: .72rem;
    line-height: 1.4;
  }

  .public-shell-page .detail-hero {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 0;
    padding: 0 0 34px;
    overflow: hidden;
  }

  .public-shell-page .detail-media {
    order: 0;
    width: 100%;
    height: 226px;
    margin: 14px 0 0;
    overflow: hidden;
    border-radius: 0 0 24px 24px;
  }

  .public-shell-page .detail-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
  }

  .public-shell-page .detail-copy {
    order: 1;
    width: min(calc(100% - 28px), 680px);
    padding: 28px 0 0;
    margin-inline: auto;
  }

  .public-shell-page .detail-copy h1 {
    font-size: clamp(2.45rem, 11vw, 4rem);
    line-height: .98;
    letter-spacing: -.055em;
  }

  .public-shell-page .detail-copy p,
  .public-shell-page .detail-intro > p,
  .public-shell-page .section-heading > p {
    font-size: .98rem;
    line-height: 1.58;
  }

  .public-shell-page .detail-copy .button,
  .public-shell-page .cta-layout .button {
    width: 100%;
    min-height: 50px;
    text-align: center;
  }

  .public-shell-page .section {
    padding: 56px 0;
  }

  .public-shell-page .detail-intro,
  .public-shell-page .cta-layout,
  .public-shell-page .heading,
  .public-shell-page .central-layout,
  .public-shell-page .layers,
  .public-shell-page .band-inner {
    display: block;
  }

  .public-shell-page .detail-cards,
  .public-shell-page .checklist,
  .public-shell-page .offer-grid,
  .public-shell-page .signal-grid,
  .public-shell-page .profile-grid,
  .public-shell-page .steps,
  .public-shell-page .faq,
  .public-shell-page .journey,
  .public-shell-page .people-grid,
  .public-shell-page .promise-list {
    grid-template-columns: 1fr;
  }

  .public-shell-page .detail-card,
  .public-shell-page .checklist article {
    min-width: 0;
  }

  /* Solutions landing: controlled image panel followed by the diagnostic action. */
  .solutions-page .hero-final.hero-split {
    min-height: 0 !important;
    padding: 0 !important;
    overflow: hidden;
  }

  .solutions-page .hero-visual.hero-media {
    display: flex;
    flex-direction: column;
  }

  .solutions-page .hero-visual .hero-image {
    order: 0;
    position: relative;
    width: 100%;
    height: 228px;
    object-fit: cover;
    object-position: center;
  }

  .solutions-page .hero-visual .hero-content {
    order: 1;
    width: min(calc(100% - 28px), 680px);
    padding: 30px 0 38px;
    margin-inline: auto;
  }

  .solutions-page .hero-visual .hero-content h1 {
    font-size: clamp(2.45rem, 11vw, 4rem);
    line-height: .98;
    letter-spacing: -.055em;
  }

  .solutions-page .diagnostic-inline-form,
  .solutions-page .diagnostic-inline-form-grid {
    grid-template-columns: 1fr;
  }

  .solutions-page .diagnostic-inline-form {
    width: min(calc(100% - 28px), 680px);
    margin-inline: auto;
  }

  .solutions-page .card-grid,
  .solutions-page .steps,
  .solutions-page .principles,
  .solutions-page .solutions-line-title {
    grid-template-columns: 1fr;
  }

  .solutions-page .content-band {
    padding-block: 54px;
  }

  /* Representatives: full-width visual, then a readable action block. */
  .representatives-page .hero {
    width: 100%;
    min-height: 0;
    display: flex;
    flex-direction: column;
    border-radius: 0;
  }

  .representatives-page .hero > img {
    position: relative;
    order: 0;
    width: 100%;
    height: 226px;
    object-fit: cover;
    object-position: 68% center;
  }

  .representatives-page .hero::after {
    inset: 0 0 auto;
    height: 226px;
    z-index: 1;
    background: linear-gradient(180deg, rgba(7,37,47,.06), rgba(7,37,47,.72) 72%, rgba(7,37,47,.96));
  }

  .representatives-page .hero-copy {
    order: 1;
    width: min(calc(100% - 28px), 680px);
    padding: 30px 0 36px;
    margin-inline: auto;
  }

  .representatives-page .hero-copy h1 {
    font-size: clamp(2.45rem, 11vw, 4rem);
    line-height: .98;
  }

  .representatives-page .hero-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .representatives-page .hero-actions .btn,
  .representatives-page .band .btn {
    width: 100%;
  }

  .representatives-page .section,
  .representatives-page .band {
    padding-block: 56px;
  }

  /* About: original desktop hero image becomes a clean image band, never a text collision. */
  .about-page .about-hero {
    display: flex;
    flex-direction: column;
    min-height: 0;
    align-items: stretch;
  }

  .about-page .about-hero-media {
    position: relative;
    order: 0;
    width: 100%;
    height: 228px;
    object-fit: cover;
    object-position: center;
    z-index: 0;
  }

  .about-page .about-hero::after {
    inset: 0 0 auto;
    height: 228px;
    z-index: 1;
    background: linear-gradient(180deg, rgba(6,47,56,0) 28%, rgba(6,47,56,.88) 100%);
  }

  .about-page .about-hero-inner {
    order: 1;
    width: min(calc(100% - 28px), 680px);
    padding: 30px 0 40px;
    margin-inline: auto;
  }

  .about-page .about-hero-inner h1 {
    font-size: clamp(2.45rem, 11vw, 4rem);
  }

  .about-page .about-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .about-page .about-actions .button {
    width: 100%;
    text-align: center;
  }

  .about-page .about-section {
    padding-block: 56px;
  }

  /* Diagnóstico: keep the compact flow legible, with the controls below the prompt. */
  .diagnostic-page > .shell {
    width: min(calc(100% - 28px), 680px);
    padding: 18px 0 42px;
  }

  .diagnostic-page .brandbar {
    margin-bottom: 24px;
    align-items: flex-start;
  }

  .diagnostic-page .hero {
    margin-bottom: 18px;
  }

  .diagnostic-page .hero h1 {
    font-size: clamp(2.45rem, 12vw, 4rem);
    line-height: .98;
  }

  .diagnostic-page .hero-copy {
    font-size: 1rem;
    line-height: 1.55;
  }

  .diagnostic-page .surface {
    margin-top: 18px;
    border-radius: 18px;
  }

  .diagnostic-page #app {
    padding: 18px;
  }

  .diagnostic-page .question-top {
    display: block;
  }

  .diagnostic-page .question-voice-controls {
    justify-content: flex-start;
    width: 100%;
  }

  .diagnostic-page .composer-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .diagnostic-page .send-button {
    width: 100%;
    margin-left: 0;
  }

  /* Request flow: preserve the hero artwork as a shallow top band and keep the form below it. */
  .request-page .request-stage {
    min-height: 0;
    padding: 198px 0 44px;
    background-image: url('/assets/solicitar-hero-mobile-r280.png');
    background-size: auto 182px;
    background-position: center top;
    background-repeat: no-repeat;
  }

  .request-page .request-layout {
    width: min(calc(100% - 28px), 680px);
    display: block;
    margin-inline: auto;
  }

  .request-page .request-copy {
    padding-top: 0;
  }

  .request-page .request-copy h1 {
    font-size: clamp(2.45rem, 11vw, 4rem);
    line-height: .98;
  }

  .request-page .request-copy > p {
    font-size: .98rem;
    line-height: 1.58;
  }

  .request-page .request-form {
    width: 100%;
    max-width: none;
    margin-top: 22px;
  }

  .request-page .request-form-grid {
    grid-template-columns: 1fr;
  }

  /* Internal representative signup and confirmation pages stay readable without changing their flow. */
  .representative-page .viewport-shell,
  .confirmation,
  .proposal-page .shell {
    width: min(calc(100% - 28px), 680px);
  }

  .representative-page .intro,
  .representative-page .editorial-panel,
  .representative-page .access-panel,
  .representative-page .onboarding-section {
    padding-inline: 0;
  }

  .representative-page .grid,
  .representative-page .niche-grid {
    grid-template-columns: 1fr;
  }

  .representative-page .wide {
    grid-column: auto;
  }

  .representative-page input,
  .representative-page select,
  .representative-page textarea,
  .representative-page button {
    max-width: 100%;
  }

  .confirmation {
    min-height: calc(100svh - 40px);
    padding: 34px 0;
  }

  /* Presence already has its own language; these rules only stabilize its mobile rhythm. */
  .presence-page .presence-hero {
    padding: 56px 0 64px;
  }

  .presence-page .hero-grid {
    gap: 30px;
  }

  .presence-page .hero-copy h1 {
    font-size: clamp(2.8rem, 13vw, 4.6rem);
  }

  .presence-page .hero-card {
    padding: 24px;
  }

  .presence-page .presence-section,
  .presence-page .presence-cta {
    padding-block: 58px;
  }

  .presence-page .demo-card,
  .presence-page .offer-card {
    padding: 22px 18px;
  }
}

@media (max-width: 380px) {
  .seo-page .seo-hero > .shell,
  .public-shell-page .detail-copy,
  .solutions-page .hero-visual .hero-content,
  .representatives-page .hero-copy,
  .about-page .about-hero-inner,
  .request-page .request-layout {
    width: min(calc(100% - 22px), 680px);
  }

  .seo-page .seo-hero-media,
  .public-shell-page .detail-media,
  .solutions-page .hero-visual .hero-image,
  .representatives-page .hero > img,
  .about-page .about-hero-media {
    height: 205px;
  }

  .diagnostic-page > .shell {
    width: min(calc(100% - 22px), 680px);
  }
}
