/* ==========================================================================
   Portada: el mapa de su empresa, el mosaico de servicios y las reglas
   ========================================================================== */

/* ---------- El mapa ---------- */
.map { position: relative; isolation: isolate; min-height: 100svh; display: flex; align-items: center; padding: calc(var(--top-h) + 40px) 0 64px; overflow: hidden; background: var(--white); }
.map__stage { position: absolute; inset: 0; z-index: -1; }
.map__field { width: 100%; height: 100%; }
.map__stage::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(90deg, #fff 0%, rgba(255, 255, 255, .97) 34%, rgba(255, 255, 255, 0) 47%); }
.no-webgl .map__stage { background: radial-gradient(50% 60% at 75% 50%, var(--green-wash), transparent 70%); }
.map__labels { position: absolute; inset: 0; z-index: 2; pointer-events: none; }
.map__labels > * { position: absolute; left: 0; top: 0; pointer-events: auto; will-change: transform; }
.map__area { display: inline-flex; align-items: center; gap: 7px; padding: 7px 12px; border-radius: 999px; border: 1.5px solid rgba(51, 51, 51, .16); background: rgba(255, 255, 255, .94); font: 600 .9rem/1.1 var(--body); color: var(--ink); white-space: nowrap; box-shadow: 0 8px 18px -12px rgba(0, 0, 0, .45); transition: background-color .3s, color .3s, border-color .3s, box-shadow .3s; animation: label-in .35s var(--ease) both; }
@keyframes label-in { from { opacity: 0; } }
.map__area.is-demo { border-color: var(--ink); box-shadow: 0 0 0 3px rgba(51, 51, 51, .12), 0 10px 22px -10px rgba(0, 0, 0, .5); }
.map__area:hover { border-color: var(--ink); }
.map__dot { width: 14px; height: 14px; border-radius: 50%; border: 1.5px solid currentColor; transition: background-color .3s, border-color .3s; position: relative; }
.map__dot::after { content: ""; position: absolute; inset: 3px 2px 2px; border-right: 2px solid transparent; border-bottom: 2px solid transparent; }
.map__area[aria-pressed="true"] { color: var(--white); border-color: transparent; box-shadow: 0 10px 22px -10px rgba(0, 0, 0, .55); }
.map__area--agentes[aria-pressed="true"] { background: var(--green-ink); }
.map__area--sap[aria-pressed="true"] { background: var(--blue); }
.map__area--software[aria-pressed="true"] { background: var(--ink); }
.map__area--soporte[aria-pressed="true"] { background: #4a7320; }
.map__area[aria-pressed="true"] .map__dot { background: var(--white); border-color: var(--white); }
.map__area[aria-pressed="true"] .map__dot::after { left: 4px; top: 1px; width: 4px; height: 7px; inset: auto; border-color: var(--ink); transform: rotate(45deg); }
.map__hub { padding: 8px 16px; border-radius: 999px; background: var(--ink); color: var(--white); font: 700 1.05rem/1 var(--display); letter-spacing: -.01em; box-shadow: 0 0 0 3px var(--green); pointer-events: none !important; }
.map__copy { position: relative; z-index: 3; pointer-events: none; }
.map__copy > * { pointer-events: auto; }
@media (min-width: 861px) and (min-aspect-ratio: 19/20) {
  .map__copy > * { max-width: min(560px, 40vw); }
  .map__copy h1 { max-width: min(600px, 40vw); }
}
.map h1 { font-size: clamp(2.6rem, 4.1vw, 4.3rem); letter-spacing: -.035em; line-height: .97; }
.map h1 em { font-style: normal; color: var(--blue); }
.map__lead { margin-top: 26px; max-width: 42ch !important; font-size: clamp(1.08rem, 1.4vw, 1.25rem); color: var(--ink-2); }
.map__hint { display: flex; align-items: center; gap: 14px; margin-top: 34px; padding-top: 18px; border-top: 1.5px solid var(--ink); max-width: 30ch !important; font-weight: 600; font-size: 1.02rem; line-height: 1.4; }
.map__hint-dot { position: relative; width: 12px; height: 12px; border-radius: 50%; background: var(--green); flex: none; }
.map__hint-dot::after { content: ""; position: absolute; inset: -6px; border-radius: 50%; border: 2px solid var(--green); animation: ping 2.2s var(--ease) infinite; }
.map__hint[hidden] { display: none; }

/* Plan: lo que haríamos */
.plan { position: relative; z-index: 4; margin-top: 26px; width: min(460px, 40vw); max-height: calc(100svh - var(--top-h) - 250px); min-height: 240px; display: flex; flex-direction: column; gap: 14px; padding: 20px; border-radius: 24px; background: var(--white); box-shadow: 0 30px 60px -30px rgba(0, 0, 0, .45), 0 0 0 1px var(--line); animation: msg-in .5s var(--ease) both; }
.plan[hidden] { display: none; }
.plan__head { display: flex; justify-content: space-between; align-items: center; }
.plan__count { font-weight: 600; }
.plan__count b { font: 600 1.6rem/1 var(--display); margin-right: 4px; }
.plan__tools { display: flex; gap: 14px; align-items: center; }
.plan__toggle { display: none; white-space: nowrap; padding: 6px 12px; border-radius: 999px; border: 1.5px solid var(--ink); background: none; font-weight: 600; font-size: .86rem; }
.plan__clear { border: 0; background: none; color: var(--ink-2); text-decoration: underline; text-underline-offset: .2em; font-size: .9rem; }
.plan__list { flex: 1; overflow-y: auto; -webkit-mask-image: linear-gradient(#000 calc(100% - 28px), transparent); mask-image: linear-gradient(#000 calc(100% - 28px), transparent); padding-bottom: 24px; display: grid; gap: 10px; align-content: start; padding-right: 4px; scrollbar-width: thin; }
.plan__item { display: grid; gap: 3px; padding: 12px 14px; border-radius: 14px; border-left: 4px solid var(--green); background: var(--mist); animation: msg-in .45s var(--ease) both; }
.plan__item--sap { border-color: var(--blue); }
.plan__item--software { border-color: var(--ink); }
.plan__item--soporte { border-color: #8fbf5a; }
.plan__area { font: 600 1.02rem/1.2 var(--display); }
.plan__pain { font-size: .88rem; color: #8a2a1e; text-decoration: line-through; text-decoration-color: rgba(138, 42, 30, .5); }
.plan__fix { font-size: .92rem; line-height: 1.45; }
.plan__go { justify-self: start; display: inline-flex; gap: 6px; align-items: center; margin-top: 2px; font-size: .86rem; font-weight: 600; color: var(--blue); text-decoration: none; }
.plan__go:hover { text-decoration: underline; }
.map h1 { transition: font-size .6s var(--ease); }
.has-plan h1 { font-size: clamp(2.2rem, 3.3vw, 3.3rem); }
.has-plan .map__lead { display: none; }

/* ---------- Mosaico de servicios ---------- */
.services { padding-bottom: 0; }
.mosaic { position: relative; height: min(88svh, 820px); min-height: 560px; margin-top: 8px; }
.tile { position: absolute; inset: 0; display: block; text-decoration: none; clip-path: polygon(0 0); transition: filter .3s; }
.tile--green { background: var(--green); color: var(--ink); }
.tile--blue { background: var(--blue); color: var(--white); }
.tile--ink { background: var(--ink); color: var(--white); }
.tile--mist { background: var(--mist-2); color: var(--ink); }
.tile__body { position: absolute; left: var(--cx); top: var(--cy); transform: translate(-50%, -50%); width: min(340px, 30vw); display: grid; gap: 10px; transition: transform .6s var(--ease); }
.tile__body b { font: 600 clamp(1.8rem, 3.2vw, 3rem)/1 var(--display); letter-spacing: -.03em; }
.tile__line { font-size: 1.02rem; line-height: 1.45; opacity: .9; max-height: 0; overflow: hidden; transition: max-height .5s var(--ease), opacity .4s; }
.tile .num { opacity: .85; }
.tile__go { width: 48px; height: 48px; display: grid; place-items: center; border-radius: 50%; border: 1.5px solid currentColor; transition: background-color .3s, color .3s, transform .4s var(--ease); }
.tile__go .ico { width: 20px; height: 20px; }
.tile.is-active .tile__line, .mosaic:not(.has-active) .tile__line { max-height: 6em; }
.tile.is-active .tile__go { transform: rotate(-45deg); background: currentColor; }
.tile--green.is-active .tile__go .ico, .tile--mist.is-active .tile__go .ico { color: var(--white); }
.tile--blue.is-active .tile__go .ico, .tile--ink.is-active .tile__go .ico { color: var(--ink); }
.mosaic.has-active .tile:not(.is-active) .tile__body { transform: translate(-50%, -50%) scale(.86); }
.tile:focus-visible { outline: none; }
.tile:focus-visible .tile__body { outline: 2px solid currentColor; outline-offset: 10px; border-radius: 8px; }
.mosaic__grout { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.mosaic__grout path { fill: none; stroke: var(--white); stroke-width: 6; stroke-linejoin: round; }
.tile--green { view-transition-name: field-agentes; }
.tile--blue { view-transition-name: field-sap; }
.tile--ink { view-transition-name: field-software; }
.tile--mist { view-transition-name: field-soporte; }

/* ---------- Reglas ---------- */
.rules__title { font-size: clamp(2.3rem, 4.6vw, 4.2rem); max-width: 16ch; }
.rules__list { display: grid; grid-template-columns: repeat(3, 1fr); gap: 40px; margin-top: 64px; }
.rules__list li { display: grid; gap: 18px; align-content: start; padding-top: 22px; border-top: 2px solid var(--green); }
.rules__list .num { color: var(--green); }
.rules__list p { font-size: 1.08rem; line-height: 1.55; color: #d6dad7; }
.rules__list b { display: block; margin-bottom: 8px; font: 600 clamp(1.5rem, 2.2vw, 1.9rem)/1.1 var(--display); letter-spacing: -.02em; color: var(--white); }

/* ---------- Ofertas ---------- */
.offers { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.offer { display: grid; gap: 18px; align-content: start; padding: clamp(28px, 4vw, 48px); border-radius: 30px; }
.offer--white { border: 1.5px solid var(--line); }
.offer--green { background: var(--green); }
.offer h3 { font-size: clamp(2.2rem, 3.6vw, 3.2rem); }
.offer > p:not(.num) { font-size: 1.1rem; max-width: 44ch; }
.offer__fine { font-size: .9rem !important; color: var(--ink-2); }
.offer .btn { justify-self: start; margin-top: 6px; }

@media (max-width: 1020px) {
  .rules__list, .offers { grid-template-columns: 1fr; }
  .rules__list { gap: 28px; }
}
@media (max-aspect-ratio: 19/20), (max-width: 860px) {
  .map { flex-direction: column; align-items: stretch; padding: calc(var(--top-h) + 24px) 0 28px; min-height: 0; }
  .map__copy { display: contents; }
  .map__copy > * { max-width: none !important; margin-inline: var(--gutter); }
  .map h1 { order: 0; }
  .map__stage { order: 1; position: relative; inset: auto; z-index: 0; height: 56svh; min-height: 400px; margin-top: 20px; }
  .map__lead { order: 2; margin-top: 22px; }
  .map__hint { order: 3; margin-top: 18px; font-size: .95rem; }
  .map__stage::after { display: none; }
  .map__area { padding: 6px 10px; font-size: .8rem; }
  .map__hub { font-size: .95rem; }
  .has-plan h1 { font-size: clamp(2.5rem, 11vw, 3.4rem); }
  .has-plan .map__lead { display: block; }
  /* Hoja inferior con el plan */
  .plan { order: 4; position: fixed; left: 0 !important; right: 0; bottom: 0; z-index: 95; margin: 0 !important; width: auto; max-height: 70svh; min-height: 0; border-radius: 22px 22px 0 0; padding: 16px var(--gutter) calc(14px + env(safe-area-inset-bottom)); transform: translateY(110%); transition: transform .45s var(--ease); animation: none; }
  .map-in-view .plan { transform: none; }
  .plan__toggle { display: inline-block; }
  .plan .plan__list { display: none; }
  .plan.is-open .plan__list { display: grid; }
  .tile__body { width: min(78vw, 360px); }
  .tile__line { max-height: 6em; }
  .mosaic { height: 150svh; max-height: 1200px; }
}
@media (max-width: 720px) {
  .map h1 { font-size: clamp(2.5rem, 11vw, 3.4rem); }
}

.map__packet { position: absolute; left: 0; top: 0; padding: 4px 9px; border-radius: 999px; background: var(--ink); color: var(--white); font: 600 .74rem/1.2 var(--mono); white-space: nowrap; pointer-events: none !important; opacity: 0; box-shadow: 0 6px 14px -6px rgba(0, 0, 0, .5); }
.map__packet:not(.is-on) { display: none; }
