/* =========================================================
   FleTrack — capa de rediseño SaaS
   Navegación, mega menús, CTA, beneficios, productos y planes.
   Se carga después de styles.css y pages.css.
   ========================================================= */

/* Títulos: líneas equilibradas en lugar de una palabra suelta al final */
.h2, .h1-sm, .hero__title, .phero__title, .mega__title, .custom-plan h2, .feature h3 { text-wrap: balance; }
.lead, .feature__txt, .prod-card p { text-wrap: pretty; }

/* ---------- Navegación: logo | menú | botones, sin desbordes ---------- */
.nav { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; column-gap: 16px; padding: 18px 20px; }
.nav__logo { flex: none; padding-left: 16px; }
.nav__menu { justify-content: center; min-width: 0; }
.nav__menu ul { gap: 2px; }
.nav__link { padding: 8px clamp(10px, 1vw, 16px); white-space: nowrap; }
.nav__actions { gap: 8px; }
.nav__actions .btn { padding: 11px 22px; }
.nav__toggle { justify-self: end; }
@media (max-width: 1240px) {
  .nav__menu, .nav__actions { display: none; }
  .nav__toggle { display: flex; }
  .mega { display: none !important; }
}

/* ---------- Mega menús: tarjetas del mismo tamaño, título en una línea ---------- */
.mega__panel { grid-template-columns: 58fr 42fr; }
.mega__grid { grid-auto-rows: 1fr; }
.mbox { min-height: 76px; height: 100%; padding: 12px 14px 12px 12px; gap: 12px; }
.mbox__icon { width: 44px; height: 44px; border-radius: 16px; }
.mbox > span:last-child { min-width: 0; }
.mbox strong { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 13.5px; }
.mbox small { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; line-height: 1.3; }
.mega__products { grid-auto-rows: 1fr; }
.pbox { height: 100%; }
.pbox strong { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- Banda CTA: título amplio, 2–3 líneas ---------- */
.cta-band { gap: 24px; padding-block: calc(var(--section-y) + 20px); }
.cta-band__title { max-width: min(100%, 22ch); font-size: clamp(36px, 3.6vw, 56px); letter-spacing: -0.055em; line-height: 1.04; }
.cta-band .btn { margin-top: 8px; }

/* ---------- Beneficios (sección oscura): tarjetas homogéneas ---------- */
.features {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px;
  border: 0; border-radius: 0; padding: 0; margin-top: 40px;
}
.feature {
  position: relative; display: flex; flex-direction: column; gap: 0;
  padding: 32px 28px 36px; border-radius: 24px;
  border: 1px solid rgba(255, 255, 255, .09) !important;
  background: linear-gradient(180deg, rgba(255, 255, 255, .06) 0%, rgba(255, 255, 255, .02) 100%);
  transition: transform .3s cubic-bezier(.2, .7, .2, 1), border-color .3s ease;
}
.feature:hover { transform: translateY(-4px); border-color: rgba(172, 198, 255, .35) !important; }
.feature__icon {
  display: grid; place-items: center; width: 52px; height: 52px; margin-bottom: 28px;
  border-radius: 16px; border: 1px solid rgba(172, 198, 255, .3);
  background: linear-gradient(145deg, rgba(172, 198, 255, .28), rgba(172, 198, 255, .08));
  box-shadow: none; backdrop-filter: none;
}
.feature__icon svg { width: 24px; height: 24px; fill: none; stroke: var(--accent); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.feature h3 { font-size: 26px; font-weight: 600; letter-spacing: -0.03em; line-height: 1.1; }
.feature__sub { max-width: none; margin-top: 8px; font-size: 15px; font-weight: 500; line-height: 1.35; letter-spacing: -.01em; color: var(--accent); }
.feature__txt { margin-top: 14px; font-size: 15px; line-height: 1.55; color: rgba(255, 255, 255, .64); }

/* ---------- Tarjetas de producto / industria: imagen + cuerpo + pie ---------- */
.prod-cards--img .prod-card::before { content: none; }
.prod-card { overflow: hidden; transition: transform .3s cubic-bezier(.2, .7, .2, 1), box-shadow .3s ease; }
.prod-card:hover { transform: translateY(-4px); box-shadow: 0 18px 40px -18px rgba(17, 19, 22, .25); }
.prod-card__media { display: block; aspect-ratio: 16 / 10; overflow: hidden; background: #dcdde2; }
.prod-card__media img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s ease; }
.prod-card:hover .prod-card__media img { transform: scale(1.03); }
.prod-card__body { flex: 1; display: flex; flex-direction: column; align-items: flex-start; gap: 10px; padding: 24px 24px 20px; }
.prod-card__body .tag { font-size: 12.5px; padding: 7px 14px; }
.prod-card__body h3 { font-size: 26px; font-weight: 600; letter-spacing: -0.03em; line-height: 1.1; }
.prod-card__body p { padding: 0; font-size: 15px; line-height: 1.5; color: var(--muted); }
.prod-card__foot { margin: 0 24px; padding: 16px 0 22px; border-top: 1px solid var(--line); }
.prod-card__foot > span:first-child { max-width: none; font-size: 15px; font-weight: 600; letter-spacing: -.01em; padding-top: 0; }
.prod-cards--img .prod-card__foot > span:first-child { font-size: 15px; }

/* ---------- Planes: tarjetas compactas, funciones desplegables ---------- */
.plans { align-items: start; gap: 20px; margin-top: 16px; }
.plan {
  position: relative; padding: 32px; border-radius: 24px; background: #fff;
  border: 1px solid rgba(17, 19, 22, .08); box-shadow: 0 1px 2px rgba(17, 19, 22, .04);
}
.plans--white .plan { background: #fff; }
.plan__top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.plan__name { font-size: 24px; font-weight: 600; letter-spacing: -.03em; line-height: 1.2; color: var(--ink); }
.plan__badge { padding: 6px 12px; border-radius: 999px; background: var(--accent); color: var(--ink); font-size: 12px; font-weight: 600; white-space: nowrap; }
.plan__device { margin-top: 6px; font-size: 14px; line-height: 1.4; color: var(--ink-2); min-height: 2.8em; }
.plan__price { display: flex; align-items: baseline; flex-wrap: wrap; gap: 8px; margin-top: 20px; }
.plan__amount { font-size: 52px; font-weight: 700; letter-spacing: -.05em; line-height: 1; color: var(--ink); }
.plan__per { font-size: 14px; font-weight: 500; letter-spacing: 0; line-height: 1.4; color: var(--ink-2); }
.plan .btn.plan__cta { width: 100%; margin-top: 24px; padding: 14px 20px; font-weight: 500; box-shadow: none; }
.plan__specs { margin: 24px 0 0; padding: 20px 0; border-block: 1px solid var(--line); display: flex; flex-direction: column; gap: 12px; }
.plan__specs div { display: grid; grid-template-columns: 92px 1fr; gap: 12px; }
.plan__specs dt { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-2); padding-top: 2px; }
.plan__specs dd { margin: 0; font-size: 14px; line-height: 1.45; color: var(--ink); }
.plan__includes { margin-top: 20px; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-2); }
.plan__list { margin: 12px 0 0; gap: 10px; }
.plan__list li { gap: 10px; align-items: flex-start; font-size: 14.5px; line-height: 1.4; letter-spacing: -.01em; color: var(--ink); }
.plan__list li.off { color: #9aa1ab; }
.plan__list svg { width: 20px; height: 20px; flex: none; }
.plan__more { margin-top: 10px; }
.plan__more summary {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 0; list-style: none; cursor: pointer;
  font-size: 14px; font-weight: 600; color: var(--ink);
}
.plan__more summary::-webkit-details-marker { display: none; }
.plan__more summary:hover { text-decoration: underline; text-underline-offset: 3px; }
.plan__chev { width: 16px; height: 16px; transition: transform .2s ease; }
.plan__more[open] .plan__chev { transform: rotate(180deg); }
.plan__more-close, .plan__more[open] .plan__more-open { display: none; }
.plan__more[open] .plan__more-close { display: inline; }
.plan__more .plan__list { margin-top: 6px; }

/* Plan destacado */
.plan--featured, .plans--white .plan--featured { background: var(--ink); border-color: var(--ink); color: #fff; box-shadow: 0 24px 50px -24px rgba(17, 19, 22, .55); }
.plan--featured .plan__name, .plan--featured .plan__amount, .plan--featured .plan__specs dd,
.plan--featured .plan__list li, .plan--featured .plan__more summary { color: #fff; }
.plan--featured .plan__device, .plan--featured .plan__per, .plan--featured .plan__specs dt, .plan--featured .plan__includes { color: rgba(255, 255, 255, .62); }
.plan--featured .plan__specs { border-color: rgba(255, 255, 255, .14); }
.plan--featured .plan__list li.off { color: rgba(255, 255, 255, .38); }
.plan--featured .plan__list li.off svg circle { fill: rgba(255, 255, 255, .1); }

/* ---------- Banner "plan a la medida" ---------- */
.custom-plan {
  position: relative; overflow: hidden; isolation: isolate;
  display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 32px;
  margin-top: 16px; padding: 44px 48px; border-radius: 28px; background: var(--ink); color: #fff; text-align: left;
}
.custom-plan::before {
  content: ""; position: absolute; top: -60%; right: -10%; width: 520px; height: 520px; z-index: -1;
  background: radial-gradient(circle, rgba(172, 198, 255, .35) 0%, rgba(172, 198, 255, 0) 65%);
}
.custom-plan__text { display: flex; flex-direction: column; gap: 10px; max-width: 640px; }
.custom-plan h2 { font-size: clamp(28px, 2.6vw, 40px); font-weight: 500; letter-spacing: -.045em; line-height: 1.08; color: #fff; }
.custom-plan p:not(.eyebrow) { font-size: 16px; line-height: 1.5; color: rgba(255, 255, 255, .66); }
.custom-plan .btn.custom-plan__cta { padding: 16px 26px; white-space: nowrap; box-shadow: none; }

/* ---------- Responsive del rediseño ---------- */
@media (max-width: 1200px) {
  .features { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .plans { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); max-width: none; }
}
@media (max-width: 1024px) {
  .custom-plan { grid-template-columns: 1fr; padding: 36px; }
  .plans { grid-template-columns: 1fr; max-width: 560px; }
}
@media (max-width: 767px) {
  .features { grid-template-columns: 1fr; gap: 12px; }
  .feature { padding: 26px 24px 28px; }
  .feature__icon { margin-bottom: 20px; }
  .cta-band__title { font-size: 34px; }
  .plan { padding: 26px 22px; }
  .plan__amount { font-size: 44px; }
  .custom-plan { padding: 30px 24px; border-radius: 24px; }
  .custom-plan .btn.custom-plan__cta { white-space: normal; width: 100%; }
}

/* ---------- Menú al hacer scroll: fondo casi sólido para leerse sobre cualquier sección ---------- */
.nav { transition: background-color .25s ease, box-shadow .25s ease, border-color .25s ease; }
.site-header.is-scrolled .nav {
  background: rgba(248, 249, 251, .86);
  border-color: rgba(17, 19, 22, .06);
  box-shadow: 0 12px 32px -14px rgba(17, 19, 22, .22);
}

/* Planes del mismo alto: la tarjeta más alta marca la medida y «Ver funciones» queda alineado abajo.
   Si alguien despliega las funciones de un plan, esa tarjeta crece sola (sin estirar las otras). */
.plans { align-items: stretch; }
.plan__more { margin-top: auto; padding-top: 10px; }
.plans:has(.plan__more[open]) { align-items: start; }

/* ---------- Planes en slider ----------
   Siempre la misma vista: 4 planes en computadora, 3 en laptop chica, 2 en tablet y 1 en teléfono
   (asomando el siguiente). Si los planes activos caben, se centran sin flechas. */
.plans-slider { --per: 4; --gap: 16px; position: relative; width: 100%; }
@media (min-width: 1280px) { .plans-slider { width: min(1360px, calc(100vw - 48px)); margin-inline: calc((100% - min(1360px, calc(100vw - 48px))) / 2); } }
@media (max-width: 1279px) { .plans-slider { --per: 3; } }
@media (max-width: 1023px) { .plans-slider { --per: 2; } }
@media (max-width: 699px) { .plans-slider { --per: 1.12; --gap: 12px; } }
.plans-slider .plans { display: flex; flex-wrap: nowrap; justify-content: flex-start; gap: var(--gap); max-width: none; width: auto; margin: 0;
  overflow-x: auto; overscroll-behavior-x: contain; scroll-snap-type: x mandatory; scroll-behavior: smooth; scrollbar-width: none;
  /* El área de desplazamiento recorta todo lo que sale de ella: se le da espacio suficiente para
     que la sombra de las tarjetas no se corte (abajo y a los lados), y se compensa con margen negativo. */
  /* El margen lateral (14px) es menor que la separación entre tarjetas (16px): no se asoma la siguiente */
  padding: 16px 14px 44px; margin: -4px -14px -24px; scroll-padding-inline: 14px; }
.plans-slider .plans::-webkit-scrollbar { display: none; }
.plans-slider .plans:focus-visible { outline: 2px solid #4a5fcf; outline-offset: 4px; border-radius: 24px; }
.plans-slider .plans > .plan { flex: 0 0 calc((100% - (var(--per) - 1) * var(--gap)) / var(--per)); min-width: 0; scroll-snap-align: start; padding: 26px 22px; }
.plans-slider.is-static .plans { justify-content: center; }
.plan__from { display: block; width: 100%; font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-2); }
.plan--featured .plan__from { color: rgba(255, 255, 255, .7); }
.plan__amount { font-size: clamp(38px, 3.2vw, 46px); }
.plan__specs div { grid-template-columns: 84px 1fr; gap: 10px; }
.plan__device { min-height: 2.8em; }

.plans-nav { display: flex; align-items: center; justify-content: center; gap: 14px; margin-top: 4px; }
.plans-nav[hidden] { display: none; }
.plans-nav__btn { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; border: 1px solid rgba(17, 19, 22, .1); background: #fff; color: #111316; cursor: pointer; box-shadow: 0 6px 16px -10px rgba(17, 19, 22, .35); transition: opacity .2s, transform .2s; }
.plans-nav__btn:hover:not(:disabled) { transform: translateY(-1px); }
.plans-nav__btn:disabled { opacity: .35; cursor: default; }
.plans-nav__btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.plans-nav__btn:focus-visible, .plans-dots button:focus-visible { outline: 2px solid #4a5fcf; outline-offset: 2px; }
.plans-dots { display: flex; gap: 6px; }
.plans-dots button { width: 8px; height: 8px; padding: 0; border: 0; border-radius: 99px; background: rgba(17, 19, 22, .18); cursor: pointer; transition: width .25s, background .25s; }
.plans-dots button[aria-selected="true"] { width: 24px; background: #111316; }
@media (max-width: 699px) { .plans-dots button { width: 10px; height: 10px; } .plans-dots button[aria-selected="true"] { width: 26px; } }
@media (prefers-reduced-motion: reduce) { .plans-slider .plans { scroll-behavior: auto; } }
/* Sombras de las tarjetas dentro del slider: suaves y contenidas en el espacio que deja el slider */
.plans-slider .plans > .plan, .plans-slider .plans > .plan--featured { box-shadow: none; }   /* sin sombra: solo el contorno de la tarjeta */
/* Cuando el slider se desplaza, las orillas laterales (el espacio de 14px para las sombras) se ocultan:
   así no se ve la sombra de la tarjeta que está fuera de la vista, a la derecha o a la izquierda. */
.plans-slider:not(.is-static) .plans {
  -webkit-mask-image: linear-gradient(to right, transparent 0, #000 14px, #000 calc(100% - 14px), transparent 100%);
          mask-image: linear-gradient(to right, transparent 0, #000 14px, #000 calc(100% - 14px), transparent 100%);
}
