@import url('service-page.css');

/* Ajustes propios de esta página. */
.auto {
  position: relative;
  overflow: hidden;
}
.auto::after {
  position: absolute;
  right: -6vw;
  bottom: -20vw;
  color: rgb(46 106 177 / 10%);
  content: '04';
  font-size: clamp(280px, 45vw, 700px);
  font-weight: 900;
}
.auto .section-inner {
  position: relative;
  z-index: 1;
}
.auto h1,
.last h2 {
  max-width: 11ch;
  font-size: clamp(48px, 7vw, 108px);
  letter-spacing: -0.08em;
}
.auto h1 span,
.last h2 span {
  display: block;
}
.auto .intro {
  max-width: 54ch;
  margin-top: 30px;
  padding-top: 17px;
  border-top: 2px solid var(--blue);
  font-size: clamp(17px, 1.4vw, 22px);
}
.auto .button {
  margin-top: 28px;
}
.flow {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(24px, 4vw, 70px);
  margin-top: 52px;
}
.flow article {
  position: relative;
  padding: 22px 14px 18px 52px;
  border-top: 2px solid #858783;
}
.flow .number {
  position: absolute;
  top: 25px;
  left: 14px;
}
.flow h3 {
  margin-bottom: 12px;
}
.last .section-inner {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: clamp(36px, 8vw, 120px);
  align-items: center;
}
.panel {
  padding: 30px;
  background: var(--panel);
  color: var(--paper);
  border-top: 3px solid var(--blue);
  box-shadow: 6px 6px 0 var(--blue);
}
.panel p {
  margin-bottom: 24px;
}
.panel .button {
  --button-bg: var(--paper);
  --button-shadow: var(--blue);
  color: var(--ink);
  border-color: var(--paper);
}
@media (max-width: 700px) {
  .auto h1,
  .last h2 {
    font-size: clamp(43px, 14vw, 68px);
  }
  .flow,
  .last .section-inner {
    grid-template-columns: 1fr;
  }
  .site-nav .nav-links {
    z-index: 2;
  }
}
/* Automatización: rutas, pasos y movimiento continuo. */
.auto {
  background-image: linear-gradient(90deg, transparent 0 24%, rgb(46 106 177 / 7%) 24% 24.2%, transparent 24.2% 100%);
}
.auto::before {
  width: min(50vw, 720px);
  border-style: dashed;
  transform: rotate(-24deg);
}
.auto .intro {
  max-width: 46ch;
}
.flow {
  position: relative;
  gap: 0;
  border-top: 1px solid rgb(12 13 12 / 30%);
}
.flow::before {
  position: absolute;
  top: 45px;
  right: 11%;
  left: 11%;
  height: 1px;
  background: var(--blue);
  content: '';
}
.flow article {
  min-height: 250px;
  padding: 78px 24px 24px;
  border: 0;
  border-right: 1px solid rgb(12 13 12 / 24%);
  background: rgb(245 242 233 / 58%);
}
.flow article:last-child {
  border-right: 0;
}
.flow .number {
  top: 27px;
  left: 24px;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  color: var(--paper);
  background: var(--blue);
}
.flow h3 {
  font-size: clamp(22px, 2vw, 30px);
}
.last {
  background: linear-gradient(135deg, #e7edf3 0 48%, var(--paper) 48%);
}
.panel {
  border-left: 3px solid var(--blue);
  box-shadow: 9px 9px 0 var(--blue);
}
@media (max-width: 700px) {
  .auto {
    background-image: none;
  }
  .flow {
    grid-template-columns: 1fr;
    gap: 10px !important;
    border: 0;
  }
  .flow::before {
    display: none;
  }
  .flow article {
    min-height: 0;
    padding: 64px 18px 18px !important;
    border: 1px solid rgb(12 13 12 / 24%);
  }
  .flow .number {
    top: 16px;
    left: 18px;
  }
  .last {
    background: var(--paper);
  }
}
@media (min-width: 701px) {
  .auto h1 {
    max-width: 13ch;
    font-size: clamp(52px, 5.1vw, 82px);
  }
  .auto .intro {
    margin-top: clamp(20px, 3vh, 30px);
  }
}
/* Automatización: el footer continúa el recorrido de la última pantalla. */
.last > .site-footer {
  border-top: 2px solid var(--blue);
  background-image: linear-gradient(90deg, rgb(46 106 177 / 8%) 1px, transparent 1px);
  background-size: 28px 100%;
}
.last > .site-footer nav a::after {
  margin-left: 7px;
  color: var(--blue);
  content: '→';
}
/* Automatización conserva el lienzo claro continuo hasta el cierre. */
main > .screen.last,
main > .screen.last > .site-footer {
  background-color: var(--paper) !important;
}

@media (max-width: 700px), (max-width: 1000px) and (max-height: 500px) {
  .auto::after {
    display: none;
  }
  .flow article {
    min-height: 0 !important;
    height: auto;
    padding: 11px 12px 9px 52px !important;
    overflow: hidden;
  }
  .flow .number {
    top: 11px !important;
    left: 12px !important;
    width: 24px !important;
    height: 24px !important;
  }
}

/* Responsive final de servicio: este bloque vive después del @import para
   prevalecer sobre la composición específica de cada página en móvil/tablet. */
@media (max-width: 1199px) {
  :root {
    --service-page-clearance: max(96px, calc(76px + env(safe-area-inset-bottom)));
  }
  main > .screen {
    height: auto;
    min-height: 100svh;
    overflow-x: clip;
    overflow-y: visible;
    padding-bottom: var(--service-page-clearance);
  }
  main > .screen > .section-inner {
    max-height: none;
  }
  main > .screen:last-child {
    display: block;
    min-height: 100svh;
  }
  main > .screen:last-child > .section-inner {
    padding-bottom: 30px;
  }
  main > .screen:last-child > .site-footer {
    margin-inline: 0;
    padding: 24px var(--gutter) var(--service-page-clearance);
  }
  .screen,
  .section-heading,
  .service-list li,
  .cards article,
  .flow article,
  .rows li,
  .closing .section-inner,
  .end .section-inner,
  .last .section-inner,
  .finish .section-inner {
    text-align: center;
  }
  .section-heading p,
  .page-hero .intro,
  .auto .intro,
  .lead,
  .box {
    margin-inline: auto;
  }
  .service-list li,
  .rows li {
    grid-template-columns: 1fr !important;
  }
  .service-list li p,
  .rows li p {
    grid-column: auto;
  }
  .service-list li .number,
  .rows li .number,
  .flow .number {
    justify-self: center;
  }
  .page-hero .button,
  .auto .button,
  .lead .button,
  .box .button,
  .panel .button,
  .closing .button,
  .end .button,
  .last .button,
  .finish .button {
    margin-inline: auto;
  }
  .site-nav .nav-links {
    pointer-events: none;
  }
  .site-nav.is-open .nav-links {
    pointer-events: auto;
  }
}
@media (max-width: 700px) {
  .screen > .section-inner {
    gap: 20px !important;
  }
  .page-hero h1,
  .hero2 h1,
  .auto h1,
  .support h1 {
    font-size: clamp(32px, 10.5vw, 46px) !important;
    line-height: 0.98;
  }
  .section-heading h2,
  .closing h2,
  .end h2,
  .last h2,
  .finish h2 {
    font-size: clamp(28px, 9vw, 38px) !important;
    line-height: 1;
  }
  .service-list,
  .cards,
  .flow,
  .rows {
    gap: 12px !important;
  }
  .service-list li,
  .cards article,
  .flow article,
  .rows li {
    padding: 16px !important;
  }
  .service-list p,
  .cards p,
  .flow p,
  .rows p {
    font-size: 13px !important;
    line-height: 1.32 !important;
  }
}

@media (min-width: 701px) and (max-width: 1199px) and (orientation: portrait) {
  main > .screen {
    padding-top: calc(var(--nav-height) + clamp(18px, 2.2dvh, 26px));
  }
  .page-hero h1,
  .hero2 h1,
  .auto h1,
  .support h1 {
    font-size: clamp(40px, min(6.5vw, 5.6dvh), 56px) !important;
    line-height: 0.96;
  }
  .section-heading h2,
  .closing h2,
  .end h2,
  .last h2,
  .finish h2 {
    font-size: clamp(34px, min(5.5vw, 4.8dvh), 46px) !important;
    line-height: 0.98;
  }
  .intro,
  .lead,
  .section-heading > p {
    font-size: clamp(14px, 1.9vw, 16px);
    line-height: 1.4;
  }
  .service-list,
  .cards,
  .flow,
  .rows {
    gap: clamp(12px, 2dvh, 18px) !important;
  }
  .service-list li,
  .cards article,
  .flow article,
  .rows li {
    min-height: 0;
    padding: clamp(16px, 2.2dvh, 22px) !important;
  }
}

/* La escala de iPad Pro se ajusta sin afectar a escritorio ni al menú móvil. */
@media (min-width: 901px) and (max-width: 1199px) and (orientation: portrait) {
  .page-hero h1,
  .hero2 h1,
  .auto h1,
  .support h1 {
    font-size: clamp(52px, 5.5vw, 64px) !important;
  }
  .section-heading h2,
  .closing h2,
  .end h2,
  .last h2,
  .finish h2 {
    font-size: clamp(44px, 4.8vw, 56px) !important;
  }
  .intro,
  .lead,
  .section-heading > p,
  .box {
    font-size: 18px;
    line-height: 1.45;
  }
  .service-list h3,
  .cards h3,
  .flow h3,
  .rows h3 {
    font-size: 23px;
  }
  .service-list p,
  .cards p,
  .flow p,
  .rows p {
    font-size: 16px;
    line-height: 1.4;
  }
  .closing aside p,
  .end aside p,
  .panel p,
  .finish p {
    font-size: 18px;
    line-height: 1.45;
  }
}

@media (max-width: 700px) {
  main > .screen {
    min-height: 0;
    height: auto;
    padding-top: calc(var(--nav-height) + 48px);
    padding-bottom: 64px;
    align-content: start;
  }
  main > .screen > .section-inner {
    min-height: 0;
    height: auto;
  }
  main > .screen:last-child {
    padding-bottom: 0;
  }
  main > .screen:last-child > .section-inner {
    padding-bottom: 52px;
  }
}

/* El pie replica el cierre claro de la landing y reserva siempre el bot?n flotante. */
main > .screen:last-child > .site-footer {
  color: var(--ink) !important;
  background: var(--paper) !important;
  border-top-color: rgb(12 13 12 / 16%) !important;
}
main > .screen:last-child > .site-footer::before {
  display: none;
}
main > .screen:last-child > .site-footer img {
  filter: invert(1) !important;
}
main > .screen:last-child > .site-footer .footer-legal {
  color: #50514f !important;
}
main > .screen:is(.closing, .finish) > .site-footer {
  color: var(--paper) !important;
  background: var(--panel) !important;
  border-top-color: rgb(245 242 233 / 22%) !important;
}
main > .screen:is(.closing, .finish) > .site-footer img {
  filter: none !important;
}
main > .screen:is(.closing, .finish) > .site-footer .footer-legal {
  color: rgb(245 242 233 / 62%) !important;
}
@media (max-width: 1199px) {
  main > .screen:last-child {
    display: grid;
    grid-template-rows: minmax(0, 1fr) auto;
  }
  main > .screen:last-child > .section-inner {
    align-self: center;
  }
  main > .screen:last-child > .site-footer {
    padding-bottom: max(86px, calc(66px + env(safe-area-inset-bottom)));
  }
}
/* Automatización: contraste entre el trabajo manual y el flujo resuelto. */
.automation-contrast {
  display: grid;
  grid-template-columns: 1.25fr 0.75fr;
  gap: 10px;
  margin: 0 0 24px;
}
.automation-contrast div {
  padding: 13px;
  border: 1px solid rgb(245 242 233 / 35%);
}
.automation-contrast div + div {
  border-color: var(--blue);
  background: rgb(46 106 177 / 18%);
}
.automation-contrast span {
  display: block;
  margin-bottom: 7px;
  color: #bcd7f4;
  font:
    700 9px/1 Arial,
    sans-serif;
  letter-spacing: 0.12em;
}
.automation-contrast strong {
  display: block;
  font-size: 14px;
  line-height: 1.2;
}
.automation-before ol {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.automation-before li {
  position: relative;
  padding: 5px 7px;
  border: 1px solid rgb(245 242 233 / 18%);
  color: #f5f2e9;
  font-size: 11px;
  line-height: 1.2;
}
.automation-before li::after {
  position: absolute;
  right: -5px;
  bottom: -8px;
  z-index: 1;
  color: #82b8ef;
  content: '↓';
  font-weight: 700;
}
.automation-before li:nth-last-child(-n + 2)::after {
  content: none;
}
.automation-after {
  display: grid;
  align-content: center;
  gap: 9px;
  min-height: 100%;
}
.automation-after b {
  color: #dcecff;
  font-size: clamp(15px, 1.5vw, 21px);
  line-height: 0.96;
  letter-spacing: -0.04em;
}
@media (max-width: 700px) {
  .last .section-inner {
    justify-items: center;
  }
  .last .panel {
    width: min(100%, 340px);
    margin-inline: auto;
    padding: 18px !important;
  }
  .last .panel > p {
    margin-bottom: 16px;
    font-size: 14px !important;
    line-height: 1.35;
  }
  .automation-contrast {
    position: relative;
    grid-template-columns: 1fr;
    gap: 30px;
  }
  .automation-contrast::after {
    content: none;
  }
  .automation-contrast div {
    padding: 18px;
  }
  .automation-contrast span {
    margin-bottom: 12px;
    font-size: 11px;
  }
  .automation-before ol {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
  }
  .automation-before li {
    padding: 9px 22px 9px 10px;
    font-size: 14px;
    line-height: 1.2;
    text-align: left;
  }
  .automation-before li::after {
    right: 10px;
    bottom: 7px;
  }
  .automation-before li:nth-child(even)::after,
  .automation-before li:nth-last-child(-n + 2)::after {
    content: none;
  }
  .automation-contrast strong {
    font-size: 16px;
  }
  .automation-after {
    position: relative;
    min-height: 124px;
    padding: 18px !important;
    text-align: center;
  }
  .automation-after::before {
    position: absolute;
    top: -43px;
    left: 50%;
    z-index: 2;
    display: grid;
    width: 38px;
    height: 38px;
    place-items: center;
    border: 2px solid var(--blue);
    color: var(--paper);
    background: var(--panel);
    content: '↓';
    font-weight: 800;
    transform: translateX(-50%);
  }
  .automation-after b {
    font-size: clamp(20px, 6.2vw, 27px);
    line-height: 1;
  }
}
/* La cinta de automatización no desplaza su etiqueta fuera del hero. */
body[data-service='automatizacion'] .service-page-ribbon span {
  width: auto;
  max-width: calc(100% - 32px);
  overflow: hidden;
  text-overflow: ellipsis;
  animation: none;
}
/* Cinta de automatización: legible y coherente con el servicio. */
body[data-service='automatizacion'] .service-page-ribbon {
  color: #fff;
  background: linear-gradient(90deg, #14304f 0%, #245d99 50%, #14304f 100%);
  border-top: 1px solid #8db9e9;
  border-bottom: 1px solid #8db9e9;
}
@media (min-width: 701px) and (prefers-reduced-motion: no-preference) {
  body[data-service='automatizacion'] .service-page-ribbon {
    justify-content: flex-start;
  }
  body[data-service='automatizacion'] .service-page-ribbon span {
    max-width: none;
    overflow: visible;
    text-overflow: clip;
    animation: contained-service-ribbon-sweep 13s linear infinite alternate;
    animation-delay: 0s;
  }
}
