/* Redbit 2.0: continuidad visual y páginas con contenido propio. */
.section-link { text-align: center; margin: -12px 0 32px; }
.section-link a, .text-link { color: var(--brand-dark); font-weight: 650; text-decoration: underline; text-underline-offset: 6px; display: inline-block; padding: 12px 0; }
.v2-intro-band { background: #f5e9e5; padding: 56px 0; }
.v2-split { display: grid; grid-template-columns: 1fr 1fr; gap: 64px; align-items: start; }
.v2-split > .text-link { align-self: center; justify-self: end; }
.v2-split h2, .v2-inner h2 { color: var(--brand-dark); font-size: clamp(1.5rem, 2.4vw, 2rem); line-height: 1.25; margin-top: 0; }
.v2-inner main > section:not(.v2-page-head) { padding-block: 56px; }
.v2-inner p, .v2-inner li { line-height: 1.75; }
.v2-inner li { margin-bottom: 10px; }
.v2-page-head { padding: calc(var(--header-h) + 48px) 0 58px; background: #f5e9e5; }
.v2-back { color: var(--brand-dark); text-decoration: underline; text-underline-offset: 4px; }
.v2-page-head h1 { max-width: 19ch; color: var(--brand-dark); font-size: clamp(2.3rem, 4.7vw, 4.5rem); line-height: 1.12; letter-spacing: -.03em; margin: 28px 0 24px; }
.v2-page-head p { max-width: 65ch; font-size: 1.15rem; margin: 0; }
.v2-three { display: grid; grid-template-columns: repeat(3, 1fr); gap: 36px; margin-block: 28px; }
.v2-three h2 { font-size: 1.4rem; }
.v2-three h3 { color: var(--brand-dark); }
.v2-invitation { text-align: center; border-top: 1px solid #ddc9c2; }
.v2-invitation p { max-width: 60ch; margin: 0 auto 24px; }
.v2-invitation .btn { display: inline-flex; color: white; padding: 14px 22px; border-radius: 999px; }
.service-index { display: flex; flex-wrap: wrap; gap: 12px 28px; }
.service-index a { color: var(--brand-dark); text-decoration: underline; text-underline-offset: 5px; padding: 8px 0; }
.v2-service { border-top: 1px solid #ddc9c2; }
.v2-service-sub { color: var(--muted); }
.tech-filters { display: flex; flex-wrap: wrap; gap: 10px; }
.tech-filters button { border: 1px solid #c6aaa1; border-radius: 999px; background: transparent; color: var(--brand-dark); padding: 10px 18px; min-height: 44px; cursor: pointer; }
.tech-filters button[aria-pressed="true"] { background: var(--brand-dark); color: white; border-color: var(--brand-dark); }
.tech-count { color: var(--muted); font-size: .9rem; }
.tech-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 36px; }
.tech-item { border-top: 1px solid #ddc9c2; padding: 24px 0; }
.tech-category { font-size: .85rem; color: var(--muted); margin: 0 0 12px; }
.tech-item h2 { font-size: 1.4rem; }
.v2-note { max-width: 75ch; border-top: 1px solid #ddc9c2; padding-top: 24px; }
@media (max-width: 768px) {
 .v2-split, .v2-three { grid-template-columns: 1fr; gap: 20px; }
 .v2-split > .text-link { justify-self: start; }
 .tech-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 20px; }
 .v2-page-head { padding-top: calc(var(--header-h) + 30px); }
 .v2-inner main > section:not(.v2-page-head) { padding-block: 36px; }
}
@media (max-width: 440px) { .tech-grid { grid-template-columns: 1fr; } }

nav#main-menu a[aria-current="page"] { color: var(--brand-dark); }
nav#main-menu a[aria-current="page"]::after { transform: scaleX(1); }

/* Version 3: single page, progressive detail without leaving the page. */
.v3-services, .v3-technologies { padding: 64px 0; }
.v3-services > .container > h2, .v3-technologies h2 { color: var(--brand-dark); }
.v3-services > .container > h2, .v3-technologies > .container > h2 { font-size: clamp(1.7rem, 3vw, 2.3rem); margin: 0 0 16px; }
.v3-lead { max-width: 65ch; color: var(--muted); margin-bottom: 32px; line-height: 1.7; }
.v3-service-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; align-items: start; }
.service-detail { border: 1px solid #ddc9c2; border-radius: 18px; background: white; }
.service-detail summary { padding: 26px; cursor: pointer; list-style: none; }
.service-detail summary::-webkit-details-marker { display: none; }
.service-detail h3 { color: var(--brand-dark); font-size: 1.18rem; line-height: 1.35; margin: 20px 0 12px; }
.service-teaser { display: block; color: var(--muted); line-height: 1.6; min-height: 52px; }
.service-toggle { display: flex; justify-content: space-between; color: var(--brand-dark); font-weight: 600; margin-top: 22px; }
.service-detail .when-open, .service-detail[open] .when-closed { display: none; }
.service-detail[open] .when-open { display: inline; }
.service-detail[open] .service-toggle > span:last-child { transform: rotate(45deg); }
.service-content { padding: 0 26px 26px; line-height: 1.7; }
.service-content h4 { color: var(--brand-dark); font-size: 1.05rem; margin: 22px 0 10px; }
.service-content ul { padding-left: 20px; }
.service-content li { margin-bottom: 10px; }
.service-content section { padding: 0; background: transparent; }
.service-content .container { padding: 0; }
.service-content .v2-split, .service-content .v2-three { display: block; margin: 0; }
.service-content .v2-split h4 { font-size: 1.05rem; }
.service-content .v3-abono { border-top: 1px solid #ddc9c2; margin-top: 22px; }
.v3-technologies { border-block: 1px solid #ddc9c2; }
.v3-team p { line-height: 1.7; }
.v3-team > section:not(.v2-intro-band) { padding: 48px 0; }
@media (min-width: 769px) { .bar { grid-template-columns: 100px 1fr 180px; } nav#main-menu ul { gap: 18px; } }
@media (min-width: 769px) and (max-width: 1100px) {
 .bar { grid-template-columns: 70px 1fr 164px; }
 nav#main-menu ul { gap: 10px; }
 header:not(.shrink) nav#main-menu a, nav#main-menu a { font-size: .85rem; }
 header:not(.shrink) .cta-outline, .cta-outline { font-size: .9rem; padding: .75rem 1rem; }
}
@media (max-width: 1000px) { .v3-service-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px) { .v3-service-grid { grid-template-columns: 1fr; } .v3-services, .v3-technologies { padding: 44px 0; } }

/* El detalle abierto gana ancho para que soporte y abonos se lean con comodidad. */
.service-detail[open] { grid-column: 1 / -1; }
.service-detail[open] summary { border-bottom: 1px solid #eee5e1; }
.service-detail[open] .service-teaser { min-height: 0; }
.service-content { max-width: 82ch; padding-top: 16px; }

/* Servicios en ventanas amplias y herramientas compactas. */
#service-dialog { width: min(960px, calc(100vw - 40px)); max-height: calc(100dvh - 48px); padding: 0; border: 1px solid #ddc9c2; border-radius: 24px; background: var(--bg); color: var(--ink); overscroll-behavior: contain; box-shadow: 0 30px 90px #1f1f2345; }
#service-dialog::backdrop { background: #1f1f2375; backdrop-filter: blur(5px); }
#service-dialog[open] { animation: dialog-arrive .3s cubic-bezier(.2,.8,.2,1) both; }
#service-dialog.is-closing { animation: dialog-leave .17s ease both; }
@keyframes dialog-arrive { from { opacity: 0; transform: scale(.92) translateY(20px); } to { opacity: 1; transform: none; } }
@keyframes dialog-leave { to { opacity: 0; transform: scale(.94) translateY(12px); } }
.dialog-heading { position: sticky; top: 0; z-index: 1; background: var(--bg); display: flex; align-items: center; justify-content: space-between; gap: 20px; border-bottom: 1px solid #ddc9c2; padding: 24px 32px; }
.dialog-heading h2 { color: var(--brand-dark); font-size: 1.65rem; line-height: 1.25; margin: 0; }
.dialog-close { flex: 0 0 44px; width: 44px; height: 44px; border: 1px solid #ddc9c2; border-radius: 50%; background: white; color: var(--brand-dark); font-size: 1.8rem; cursor: pointer; }
.dialog-body .service-content { max-width: none; padding: 12px 40px 36px; }
.dialog-body .service-content > p, .dialog-body .service-content p { max-width: 78ch; }
.dialog-body .service-contact { margin-top: 24px; }
.work-journey { padding: 70px 0; overflow: hidden; }
.work-journey h2 { font-size: clamp(1.7rem,3vw,2.3rem); color: var(--brand-dark); margin: 0; }
.journey-steps { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(3,1fr); gap: 48px; margin: 45px 0 36px; }
.journey-steps li { position: relative; padding: 28px; background: white; border: 1px solid #e7dcd6; border-radius: 24px; box-shadow: 0 14px 30px #8c3f3110; animation: journey-float 5s ease-in-out infinite; }
.journey-steps li:nth-child(2) { animation-delay: -.9s; }
.journey-steps li:nth-child(3) { animation-delay: -1.8s; }
.journey-number { color: var(--brand-dark); font-weight: 650; }
.journey-steps h3 { color: var(--brand-dark); font-size: 1.4rem; margin: 12px 0; }
.journey-steps p { margin: 0; line-height: 1.6; }
.journey-arrow { position: absolute; right: -38px; top: 45%; color: var(--brand); font-size: 1.8rem; }
.journey-cta { display: inline-flex; gap: 24px; padding: 14px 0; color: var(--brand-dark); font-weight: 650; text-decoration: underline; text-underline-offset: 6px; }
@keyframes journey-float { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-7px); } }
.brand-tools { display: grid; grid-template-columns: repeat(6,minmax(0,1fr)); gap: 24px; margin: 36px 0 24px; }
.brand-tool { text-align: center; }
.brand-tool-logo { height: 44px; display: flex; align-items: center; justify-content: center; }
.brand-tool img { max-width: 125px; max-height: 36px; width: auto; height: auto; }
.brand-tool h3 { font-size: .94rem; margin: 14px 0 6px; }
.brand-tool p { font-size: .82rem; color: var(--muted); line-height: 1.5; margin: 0; }
.more-technologies { margin-top: 28px; border-top: 1px solid #ddc9c2; }
.more-technologies > summary { display: flex; justify-content: space-between; cursor: pointer; color: var(--brand-dark); padding: 20px 0; font-weight: 650; }
.more-technologies .tech-item { padding-block: 18px; }
.more-technologies .tech-item h2 { font-size: 1.12rem; }
.more-technologies .tech-item p { font-size: .88rem; }
@media(max-width:900px) { .brand-tools { grid-template-columns: repeat(3,minmax(0,1fr)); row-gap: 32px; } }
@media(max-width:600px) {
 .journey-steps { grid-template-columns: 1fr; gap: 42px; }
 .journey-arrow { top: auto; bottom: -40px; left: 50%; right: auto; transform: rotate(90deg); }
 .brand-tools { grid-template-columns: repeat(2,minmax(0,1fr)); }
 .dialog-heading { padding: 20px; } .dialog-heading h2 { font-size: 1.3rem; }
 .dialog-body .service-content { padding: 8px 22px 24px; }
 #service-dialog { width: calc(100vw - 24px); max-height: calc(100dvh - 24px); border-radius: 18px; }
}
@media(prefers-reduced-motion:reduce) { .journey-steps li, #service-dialog[open], #service-dialog.is-closing { animation: none; } }

/* Marcas también en las herramientas ampliadas. */
.tool-mark-row { display: flex; align-items: center; gap: 14px; min-height: 48px; margin: 12px 0 16px; }
.tool-mark-row img { display: block; width: auto; height: auto; max-width: 100px; max-height: 36px; object-fit: contain; }
.tool-mark-row img:only-child { max-width: 145px; }

.tool-mark-row img[src$="documentador.svg"] { width: 210px; max-width: 100%; max-height: 46px; }
.tool-mark-row img[src$="lexdoctor.png"] { width: 145px; max-height: 42px; }

/* Franja secundaria y catálogo por función. */
.technology-marquee { overflow: hidden; margin-top: 36px; border-top: 1px solid #ddc9c2; padding: 26px 0; }
.technology-track { display: flex; width: max-content; }
.technology-track.is-looping { animation: technology-scroll 90s linear infinite; }
.technology-set { display: flex; align-items: center; gap: 36px; padding-right: 36px; }
.technology-chip { width: 150px; flex: 0 0 150px; text-align: center; }
.technology-chip > div { height: 38px; display: flex; align-items: center; justify-content: center; gap: 8px; }
.technology-chip img { width: auto; height: auto; max-width: 110px; max-height: 30px; object-fit: contain; }
.technology-chip > div:has(img:nth-child(2)) img { max-width: 48px; }
.technology-chip span { display: block; margin-top: 12px; font-size: .78rem; color: var(--muted); }
@keyframes technology-scroll { to { transform: translateX(-50%); } }
.more-technologies { margin-top: 0; }
.more-technologies > summary { justify-content: center; gap: 24px; padding: 22px 0; }
.technology-catalog { padding: 8px 32px 32px; }
.technology-category { padding: 24px 0 !important; background: transparent !important; border-bottom: 1px solid #ddc9c2; }
.technology-category > h3 { color: var(--brand-dark); font-size: 1.2rem; margin: 0 0 16px; }
.catalog-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 24px; }
.catalog-grid .tech-item { padding: 0; border: 0; min-width: 0; }
.catalog-grid .tech-item h3 { margin: 12px 0 6px; font-size: 1rem; }
.catalog-grid .tech-item p { font-size: .85rem; line-height: 1.6; margin: 0; }
.catalog-grid .tool-mark-row { margin: 0 0 8px; }
@media(max-width:650px) { .catalog-grid { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 24px 18px; } .technology-catalog { padding: 8px 20px 24px; } .catalog-grid .tool-mark-row img { max-width: 100%; } .catalog-grid .tool-mark-row:has(img:nth-child(2)) img { max-width: 30%; } }
@media(max-width:420px) { .catalog-grid { grid-template-columns: 1fr; } }
@media(prefers-reduced-motion:reduce) { .technology-track.is-looping { animation: none; } .technology-marquee { overflow-x: auto; } }

/* Una única fila de tecnologías, de borde a borde. */
.v3-technologies > .technology-marquee { width: 100%; margin-top: 32px; padding: 32px 0; border-bottom: 1px solid #ddc9c2; }
.v3-technologies .more-technologies { border-top: 0; }
.v3-technologies .more-technologies > summary { min-height: 72px; }
.technology-track.is-looping { animation-duration: 150s; }

/* Tres filas continuas, con velocidad controlada sin saltos por JavaScript. */
.technology-rows { margin-top: 32px; }
.technology-rows .technology-marquee { margin: 0; padding: 23px 0; border: 0; }
.technology-rows .technology-track { animation: none; }
.technology-chip img[src$="latincloud.png"] { filter: brightness(0); opacity: .8; }
.technology-chip img[src$="donweb.ico"] { width: 34px; height: 34px; max-height: 34px; }
.technology-context { padding-top: 26px; }
.technology-context p { font-size: .86rem; line-height: 1.7; color: var(--muted); max-width: 100ch; margin: 0 auto 12px; }
.technology-marquee { overflow-x: auto; scrollbar-width: none; }
.technology-marquee::-webkit-scrollbar { display: none; }
@media(prefers-reduced-motion:no-preference) { .technology-marquee:has(.technology-set + .technology-set) { overflow: hidden; } }

/* Tecnologías: una fila en computadora, tres en celular. Clientes más rápidos en celular (17/11/2026) */
.technology-rows--mobile { display: none; }
@media (max-width: 768px) {
  .technology-rows--desktop { display: none; }
  .technology-rows--mobile { display: block; }
  .client-track { animation-duration: 22s; }
  .client-lane:nth-child(2) .client-track { animation-duration: 25s; }
}

/* Servicios: aparición, estado cliqueable y cruz del diálogo (17/11/2026) */
.service-detail { transition: transform .3s ease, box-shadow .3s ease, border-color .3s ease; }
.service-detail:hover, .service-detail:has(summary:focus-visible) { transform: translateY(-6px); box-shadow: 0 18px 36px rgba(156, 78, 65, .14); border-color: #c99a8e; }
.service-detail .service-icon { transition: transform .35s ease; }
.service-detail:hover .service-icon { transform: translateY(-3px) rotate(-5deg); }
.service-detail .service-toggle > span:last-child { display: inline-block; transition: transform .3s ease; }
.service-detail:hover .service-toggle > span:last-child { transform: rotate(90deg); }
.service-reveal { opacity: 0; transform: translateY(36px) scale(.97); transition: opacity .7s ease, transform .7s cubic-bezier(.2, .7, .2, 1); }
.service-reveal.is-visible { opacity: 1; transform: none; }
.dialog-close { position: relative; padding: 0; font-size: 0; line-height: 0; transition: background-color .2s ease, color .2s ease, border-color .2s ease; }
.dialog-close::before, .dialog-close::after { content: ""; position: absolute; top: 50%; left: 50%; width: 18px; height: 2px; border-radius: 2px; background: currentColor; transform: translate(-50%, -50%) rotate(45deg); }
.dialog-close::after { transform: translate(-50%, -50%) rotate(-45deg); }
.dialog-close:hover, .dialog-close:focus-visible { background: var(--brand-dark); border-color: var(--brand-dark); color: #fff; }
@media (hover: none) { .service-detail:hover { transform: none; box-shadow: none; border-color: #ddc9c2; } }
@media (prefers-reduced-motion: reduce) { .service-detail, .service-detail:hover, .service-detail:hover .service-icon, .service-detail:hover .service-toggle > span:last-child { transition: none; transform: none; } }

/* Servicios: con cinco tarjetas, las dos de abajo centradas en computadora (17/11/2026) */
@media (min-width: 1001px) {
  .v3-service-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .v3-service-grid > .service-detail { grid-column: span 2; }
  .v3-service-grid > .service-detail:nth-child(4):nth-last-child(2) { grid-column: 2 / 4; }
  .v3-service-grid > .service-detail:nth-child(5):last-child { grid-column: 4 / 6; }
}

/* Inicio en celular: el fondo se aclara detrás del título y el subtítulo para que se lean (17/11/2026).
   Opción A elegida por Salvador, con ~5% más de fondo visible que la propuesta. */
@media (max-width: 700px) {
  .hero .container { position: relative; z-index: 0; }
  .hero .container::before { content: ""; position: absolute; inset: -40px -30px; z-index: -1; pointer-events: none;
    background: radial-gradient(ellipse at center, rgba(255, 250, 249, .95) 45%, rgba(255, 250, 249, .8) 62%, rgba(255, 250, 249, 0) 75%); }
}
