/* Al Margen Studio 4.37.3 — Tipografía interior estable.
 * Se carga al final solo en páginas interiores. No modifica home, archivos,
 * carrito ni checkout. Evita conflictos de grids antiguos en 17"–27". */

/* Texto estable y sin palabras partidas en encabezados editoriales. */
:is(.am-intent-page,.am-unique-service,.am-service-detail-page,.am-services-page,
.am-lab-page,.am-print-landing,.am-work-hub-page,.am-showcase-page,
.am-budget-page,.am-resources-page,.am-contact-page,.am-terms-page)
:is(h1,h2) {
  box-sizing:border-box;
  white-space:normal!important;
  word-break:normal!important;
  overflow-wrap:normal!important;
  hyphens:none!important;
  text-wrap:wrap!important;
}

/* En escritorio, el container deja de crecer a partir de un ancho de lectura útil. */
@media (min-width:1100px) {
  /* Landings nacionales: se reemplazan los viejos FLEX/min-width:560px que
     colapsaban títulos al crecer la pantalla. */
  .am-intent-page { max-width:1440px!important; margin-inline:auto!important; }
  .am-intent-page .am-intent-hero {
    display:grid!important;
    grid-template-columns:minmax(0,1fr) minmax(280px,350px)!important;
    gap:clamp(28px,3.1vw,52px)!important;
    align-items:center!important;
  }
  .am-intent-page .am-intent-hero__copy {
    min-width:0!important; width:auto!important; max-width:none!important;
  }
  .am-intent-page .am-intent-hero h1,
  .am-pyme-page .am-intent-hero h1 {
    display:block!important;
    width:auto!important;
    max-width:100%!important;
    min-width:0!important;
    font-size:clamp(43px,3.45vw,61px)!important;
    line-height:1.12!important;
    letter-spacing:-.04em!important;
  }
  .am-intent-page .am-intent-section-head,
  .am-intent-page .am-intent-section > header,
  .am-pyme-page .am-pyme-head {
    display:grid!important;
    grid-template-columns:minmax(0,1.55fr) minmax(0,.8fr)!important;
    column-gap:clamp(24px,3.4vw,48px)!important;
    row-gap:14px!important;
    width:100%!important;
    max-width:none!important;
    align-items:center!important;
  }
  .am-intent-page .am-intent-section-head > div,
  .am-intent-page .am-intent-section > header > div,
  .am-pyme-page .am-pyme-head > div {
    flex:none!important;
    display:block!important;
    width:auto!important;
    min-width:0!important;
    max-width:100%!important;
  }
  .am-intent-page .am-intent-section-head h2,
  .am-intent-page .am-intent-section > header h2,
  .am-intent-page .am-intent-faq .am-intent-section-head h2,
  .am-pyme-page .am-pyme-head h2 {
    display:block!important;
    width:auto!important;
    min-width:0!important;
    max-width:100%!important;
    font-size:clamp(34px,2.7vw,44px)!important;
    line-height:1.18!important;
    letter-spacing:-.035em!important;
  }
  .am-intent-page .am-intent-section-head > p,
  .am-intent-page .am-intent-section > header > p:last-child,
  .am-pyme-page .am-pyme-head > p:last-child {
    display:block!important;
    flex:none!important;
    min-width:0!important;
    width:auto!important;
    max-width:100%!important;
    align-self:center!important;
    margin:0!important;
    line-height:1.72!important;
  }
  /* FAQ: título a ancho natural, nunca media columna vacía. */
  .am-intent-page .am-intent-faq > .am-intent-section-head,
  .am-intent-page .am-intent-faq > header {
    display:block!important;
  }
  .am-intent-page .am-intent-faq .am-intent-section-head h2 {
    max-width:900px!important;
  }
  .am-intent-page :is(.am-intent-decision__copy,.am-commerce-operation__copy,
    .am-intent-split > div:first-child) h2 {
    max-width:100%!important;
    min-width:0!important;
    font-size:clamp(34px,2.65vw,44px)!important;
    line-height:1.18!important;
    letter-spacing:-.035em!important;
  }
  /* Pymes: casos especiales de la última versión no deben imponer 760px fijo. */
  .am-pyme-page .am-pyme-proof {
    grid-template-columns:minmax(0,1fr) minmax(0,.84fr)!important;
  }
}

/* Titulares principales de servicios: misma escala máxima entre plantillas. */
@media (min-width:1100px) {
  .am-unique-service :is(.am-landing-copy,.am-corp-main,.am-b2b-copy,.am-shop-copy,
    .am-support-copy,.am-eng-copy,.am-pos-copy,.am-cyber-copy,.am-app-copy,
    .am-plugin-copy,.am-p-corp-intro,.am-p-shop-intro) h1,
  .am-premium-service :is(.am-landing-copy,.am-p-corp-intro,.am-p-shop-intro) h1,
  .am-service-detail-page .am-service-detail-hero h1,
  .am-services-page .am-service-hero h1,
  .am-lab-page .am-lab-hero h1,
  .am-print-landing .am-print-landing-hero h1,
  .am-work-hub-page .am-work-hub-hero h1,
  .am-showcase-page .am-showcase-hero h1,
  .am-budget-page .am-budget-hero h1,
  .am-resources-page .am-resources-hero h1,
  .am-contact-page .am-contact-intro h1 {
    width:auto!important;
    min-width:0!important;
    max-width:100%!important;
    font-size:clamp(42px,3.65vw,65px)!important;
    line-height:1.12!important;
    letter-spacing:-.047em!important;
  }

  .am-unique-service .am-unique-section-head h2,
  .am-premium-service .am-unique-section-head h2,
  .am-services-page .am-service-section-head h2,
  .am-service-detail-page .am-service-detail-head h2,
  .am-lab-page .am-lab-section-head h2,
  .am-print-landing .am-showcase-heading h2,
  .am-work-hub-page .am-work-hub-heading h2,
  .am-showcase-page .am-showcase-heading h2,
  .am-resources-page .am-resources-section-head h2,
  .am-budget-page .am-budget-builder-head h2 {
    width:auto!important;
    min-width:0!important;
    max-width:100%!important;
    font-size:clamp(32px,2.65vw,46px)!important;
    line-height:1.17!important;
    letter-spacing:-.035em!important;
  }

  /* Las copias largas no usan columnas con mínimo mayor que el ancho real. */
  .am-unique-service :is(.am-landing-copy,.am-corp-main,.am-b2b-copy,.am-shop-copy,
    .am-support-copy,.am-eng-copy,.am-pos-copy,.am-cyber-copy,.am-app-copy,
    .am-plugin-copy,.am-p-corp-intro,.am-p-shop-intro),
  .am-lab-hero-copy,.am-print-landing-hero__copy,.am-service-hero-copy,
  .am-service-detail-copy,.am-work-hub-hero-copy,
  .am-showcase-hero-grid > div:first-child {
    min-width:0!important;
    max-width:100%!important;
  }
}

/* Fichas WooCommerce + los encabezados añadidos por plugins de imprenta.
 * No modifica precio, miniatura, visualizador 3D ni botón de compra. */
@media (min-width:1100px) {
  body.single-product main h1:not(.product_title),
  body.am-roller-typography-page .am-roller-responsive-title {
    min-width:0!important;
    max-width:min(100%,900px)!important;
    font-size:clamp(41px,3.4vw,62px)!important;
    line-height:1.13!important;
    letter-spacing:-.043em!important;
    text-wrap:wrap!important;
    word-break:normal!important;
    overflow-wrap:normal!important;
  }
  body.single-product .am-product-heading h1 {
    font-size:clamp(30px,3vw,46px)!important;
    line-height:1.16!important;
  }
  body.am-roller-typography-page .am-roller-responsive-lead {
    font-size:clamp(16px,1.05vw,19px)!important;
    line-height:1.63!important;
    max-width:64ch!important;
  }
}

/* Evita que el contenido real se escape del viewport al reducir la ventana. */
@media (max-width:1099px) {
  .am-intent-page .am-intent-section-head,
  .am-intent-page .am-intent-section > header,
  .am-pyme-page .am-pyme-head {
    display:block!important;
    width:100%!important;
    min-width:0!important;
    max-width:100%!important;
  }
  .am-intent-page .am-intent-section-head > div,
  .am-intent-page .am-intent-section > header > div,
  .am-pyme-page .am-pyme-head > div,
  .am-intent-page .am-intent-section-head > p,
  .am-intent-page .am-intent-section > header > p:last-child,
  .am-pyme-page .am-pyme-head > p:last-child {
    width:100%!important;
    min-width:0!important;
    max-width:100%!important;
  }
  .am-intent-page .am-intent-section-head > p,
  .am-intent-page .am-intent-section > header > p:last-child,
  .am-pyme-page .am-pyme-head > p:last-child {
    margin-top:16px!important;
  }
}
