/* ==========================================================================
   Bari App — sección de la página principal
   Reutiliza tokens, botones y tipografía de css/styles.css. Solo se carga en
   index.html, por lo que no afecta a Bariatric Shop.
   ========================================================================== */

.bariapp {
  --ba-red: #B3203A;          /* rojo de la marca Bari App (solo acentos) */
  --ba-red-50: #FCEFF1;
  position: relative; isolation: isolate; overflow: hidden; overflow: clip;
  background: linear-gradient(180deg, #fff 0%, var(--navy-50) 55%, #fff 100%);
}
.ba-bg {
  position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(circle at 92% 6%, rgba(179, 32, 58, .08), transparent 30%),
    radial-gradient(circle at 4% 42%, rgba(27, 54, 93, .07), transparent 34%),
    radial-gradient(rgba(27, 54, 93, .13) 1.2px, transparent 1.4px);
  background-size: auto, auto, 22px 22px;
  -webkit-mask-image: linear-gradient(180deg, #000 0, rgba(0, 0, 0, .35) 30%, transparent 60%);
  mask-image: linear-gradient(180deg, #000 0, rgba(0, 0, 0, .35) 30%, transparent 60%);
}
.ba-eyebrow { color: var(--ba-red); }
.ba-eyebrow .eyebrow-dot { background: repeating-linear-gradient(90deg, var(--ba-red) 0 5px, transparent 5px 8px); }

/* ---------- Botón «Bari App» del menú superior ----------
   Tercer nivel de navegación: más destacado que los enlaces de texto y distinto del
   botón blanco de Bariatric Shop. Tono azul verdoso oscuro que armoniza con el marino. */
.main-nav {
  --ba-teal: #0E5C63;
  --ba-teal-700: #0A474D;
  --ba-teal-100: #DCEFEF;
}
.main-nav ul a.nav-bariapp {
  display: inline-flex; align-items: center; gap: .45em;
  margin-inline: .3em; padding: .5em .95em .5em .8em; border-radius: 999px;
  color: #fff; background: var(--ba-teal);
  box-shadow: 0 6px 16px -8px rgba(14, 92, 99, .75), inset 0 0 0 1px rgba(255, 255, 255, .12);
  transition: background-color .3s var(--ease), box-shadow .3s var(--ease), transform .3s var(--ease);
}
.main-nav ul a.nav-bariapp .ic { width: 1.1em; height: 1.1em; opacity: .9; transition: transform .35s var(--ease); }
.main-nav ul a.nav-bariapp::after { display: none; }
.main-nav ul a.nav-bariapp:hover { color: #fff; background: var(--ba-teal-700); transform: translateY(-1px); box-shadow: 0 10px 20px -10px rgba(14, 92, 99, .85), inset 0 0 0 1px rgba(255, 255, 255, .16); }
.main-nav ul a.nav-bariapp:hover .ic { transform: translateY(-1px) rotate(-6deg); }
/* Activo: dentro de la sección Bari App */
.main-nav ul a.nav-bariapp.is-active {
  color: #fff; background: var(--ba-teal-700);
  box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--gold), 0 8px 18px -10px rgba(14, 92, 99, .8);
}
.main-nav ul a.nav-bariapp:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; }

@media (max-width: 1400px) {
  .main-nav ul a.nav-bariapp { margin-inline: .15em; padding: .45em .75em .45em .6em; gap: .4em; }
}
/* Menú móvil: se mantiene en la lista, con su propio acento azul verdoso */
@media (max-width: 1365px) {
  .main-nav ul a.nav-bariapp {
    display: flex; margin: 0; padding: .3em 0; gap: .5em; border-radius: 0;
    background: none; color: var(--ba-teal); box-shadow: none; transform: none;
  }
  .main-nav ul a.nav-bariapp .ic {
    width: 1.35em; height: 1.35em; padding: .22em; border-radius: 10px; flex: none;
    background: var(--ba-teal); color: #fff; opacity: 1; box-sizing: content-box; font-size: .62em;
  }
  .main-nav ul a.nav-bariapp:hover, .main-nav ul a.nav-bariapp.is-active { background: none; color: var(--ba-teal-700); box-shadow: none; transform: none; }
}

/* ---------- Encabezado ---------- */
.ba-head {
  display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, .65fr);
  gap: 24px clamp(32px, 6vw, 72px); align-items: end; margin-bottom: clamp(28px, 4vw, 40px);
}
.ba-head h2 { font-size: clamp(2rem, 4.2vw, 3.1rem); margin-bottom: 1rem; }
.ba-head h2 em { color: var(--ba-red); }
.ba-head .section-lead { max-width: 40em; }
.ba-head-actions { display: grid; gap: 12px; justify-items: stretch; }
.ba-store {
  display: flex; align-items: center; gap: 12px; min-height: 58px; padding: 10px 18px;
  border-radius: 16px; background: var(--navy-950); color: #fff; text-decoration: none;
  box-shadow: 0 12px 26px -16px rgba(11, 26, 48, .7);
  transition: transform .3s var(--ease), box-shadow .3s var(--ease), background-color .3s;
}
.ba-store:hover { color: #fff; background: var(--navy); transform: translateY(-2px); box-shadow: 0 16px 30px -16px rgba(11, 26, 48, .75); }
.ba-store .ic { width: 26px; height: 26px; flex: none; }
.ba-store > span:not(.visually-hidden) { display: grid; line-height: 1.15; font-size: 1.08rem; font-weight: 700; letter-spacing: -.01em; }
.ba-store small { font-size: .72rem; font-weight: 500; letter-spacing: .02em; color: rgba(255, 255, 255, .72); }

/* ---------- Banner: imagen completa en escritorio, recorte propio en móvil ---------- */
.ba-banner {
  margin: 0 0 clamp(48px, 7vw, 88px); overflow: hidden; border-radius: var(--radius-lg);
  aspect-ratio: 1986 / 792; background: #EEF2F7;
  box-shadow: 0 30px 60px -36px rgba(16, 36, 63, .55), 0 0 0 1px rgba(16, 36, 63, .06);
}
.ba-banner img { width: 100%; height: 100%; display: block; object-fit: cover; object-position: center; }

/* ---------- Video destacado + funcionalidades ---------- */
.ba-showcase {
  display: grid; grid-template-columns: minmax(260px, 340px) minmax(0, 1fr);
  gap: clamp(40px, 6vw, 88px); align-items: center; margin-bottom: clamp(56px, 8vw, 104px);
}
.ba-phone-wrap { display: grid; justify-items: center; gap: 14px; }
.ba-phone {
  position: relative; width: min(100%, 320px); padding: 11px; border-radius: 46px;
  background: linear-gradient(160deg, #23324A, var(--navy-950));
  box-shadow: 0 40px 70px -34px rgba(11, 26, 48, .7), inset 0 0 0 1.5px rgba(255, 255, 255, .12);
}
.ba-phone::before {
  content: ""; position: absolute; z-index: 3; top: 20px; left: 50%; width: 76px; height: 20px;
  transform: translateX(-50%); border-radius: 999px; background: var(--navy-950); pointer-events: none;
}
.ba-caption { font-size: .84rem; color: var(--muted); }

.ba-player { position: relative; overflow: hidden; background: var(--navy-950); }
.ba-player video { display: block; width: 100%; height: 100%; object-fit: cover; background: #000; }
.ba-player-vertical { aspect-ratio: 9 / 16; border-radius: 36px; }
.ba-player-wide { aspect-ratio: 16 / 9; border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); }
.ba-play {
  position: absolute; inset: 0; z-index: 2; width: 100%; padding: 0; border: 0; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px;
  background: linear-gradient(180deg, rgba(11, 26, 48, .05) 30%, rgba(11, 26, 48, .55));
  color: #fff; font: inherit;
  transition: opacity .45s var(--ease), visibility 0s .45s, background-color .3s;
}
.ba-play-btn {
  width: 74px; height: 74px; display: grid; place-items: center; border-radius: 50%;
  background: rgba(255, 255, 255, .94); color: var(--navy);
  box-shadow: 0 14px 34px -10px rgba(0, 0, 0, .55), 0 0 0 8px rgba(255, 255, 255, .18);
  transition: transform .35s var(--ease), background-color .3s, box-shadow .35s var(--ease);
}
.ba-play-btn .ic { width: 30px; height: 30px; margin-left: 4px; }
.ba-play-label {
  padding: .45em 1em; border-radius: 999px; font-size: .86rem; font-weight: 700; letter-spacing: .01em;
  background: rgba(11, 26, 48, .55); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
}
.ba-play:hover .ba-play-btn, .ba-play:focus-visible .ba-play-btn { transform: scale(1.07); background: #fff; box-shadow: 0 16px 38px -10px rgba(0, 0, 0, .6), 0 0 0 10px rgba(255, 255, 255, .25); }
.ba-play:focus-visible { outline: 3px solid var(--gold); outline-offset: -6px; }
/* Estados del reproductor */
.ba-player.is-playing .ba-play { opacity: 0; visibility: hidden; }
.ba-player:not(.is-playing) .ba-play { transition: opacity .3s var(--ease), visibility 0s, background-color .3s; }
.ba-player.is-paused .ba-play { background: rgba(11, 26, 48, .35); }
.ba-player.is-loading .ba-play-btn { animation: baPulse 1s ease-in-out infinite alternate; }
@keyframes baPulse { to { transform: scale(.92); opacity: .75; } }

.ba-sub { font-family: var(--font-display); font-weight: 500; font-size: clamp(1.6rem, 3vw, 2.2rem); letter-spacing: -.01em; margin-bottom: 1.4rem; }
.ba-features { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.ba-feature {
  padding: 18px 18px 18px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow-sm); transition: transform .35s var(--ease), box-shadow .35s var(--ease), border-color .35s;
}
.ba-feature:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: rgba(179, 32, 58, .25); }
.ba-feature-icon {
  width: 40px; height: 40px; display: grid; place-items: center; margin-bottom: 12px; border-radius: 12px;
  background: var(--ba-red-50); color: var(--ba-red); transition: background-color .3s, color .3s;
}
.ba-feature:hover .ba-feature-icon { background: var(--ba-red); color: #fff; }
.ba-feature-icon .ic { width: 21px; height: 21px; }
.ba-feature h4 { font-size: 1rem; margin-bottom: .3rem; }
.ba-feature p { font-size: .88rem; color: var(--muted); line-height: 1.5; }
.ba-features-cta { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 26px; margin-top: 26px; }

/* ---------- Capturas de la aplicación ---------- */
.ba-screens {
  display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); gap: clamp(32px, 5vw, 64px);
  align-items: center; margin-bottom: clamp(56px, 8vw, 104px);
  padding: clamp(28px, 4vw, 48px); border-radius: 32px; background: var(--navy-900); color: rgba(255, 255, 255, .78);
  position: relative; overflow: hidden; overflow: clip; isolation: isolate;
}
.ba-screens::before {
  content: ""; position: absolute; z-index: -1; right: -120px; bottom: -160px; width: 420px; height: 420px; border-radius: 50%;
  background: radial-gradient(circle, rgba(179, 32, 58, .35), transparent 65%);
}
.ba-screens .ba-sub { color: #fff; }
.ba-screens-copy p { font-size: .98rem; }
.ba-screens-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; align-items: end; }
.ba-screens-list li { display: grid; justify-items: center; gap: 10px; }
.ba-screens-list li > span { font-size: .8rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: rgba(255, 255, 255, .7); }
.ba-screens-list li:first-child img { width: 146%; max-width: none; margin: -14% -23% -16%; filter: drop-shadow(0 18px 30px rgba(0, 0, 0, .45)); }
.ba-screens-list li:first-child { position: relative; z-index: 1; }
.ba-screen-frame {
  width: 100%; aspect-ratio: 9 / 19; overflow: hidden; border-radius: 26px; border: 7px solid #0A1424;
  background: #fff; box-shadow: 0 22px 40px -18px rgba(0, 0, 0, .65);
  transition: transform .4s var(--ease);
}
.ba-screen-frame img { width: 100%; height: 100%; object-fit: cover; object-position: top; }
.ba-screens-list li:hover .ba-screen-frame { transform: translateY(-6px); }

/* ---------- Entrevista ---------- */
.ba-interview { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, .65fr); gap: clamp(28px, 5vw, 64px); align-items: center; }
.ba-interview-copy h3 { font-family: var(--font-display); font-weight: 500; font-size: clamp(1.5rem, 2.6vw, 2rem); margin-bottom: .7rem; }
.ba-interview-copy > p:not(.eyebrow) { color: var(--muted); margin-bottom: 1.6rem; }
.ba-final-cta { display: grid; gap: 10px; }
.ba-final-cta .btn { justify-content: flex-start; }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .ba-showcase { grid-template-columns: minmax(240px, 300px) minmax(0, 1fr); gap: 40px; }
  .ba-screens { grid-template-columns: 1fr; }
}
@media (max-width: 960px) {
  .ba-head { grid-template-columns: 1fr; align-items: start; }
  .ba-head-actions { grid-template-columns: repeat(2, minmax(0, 1fr)); max-width: 520px; }
  .ba-showcase { grid-template-columns: 1fr; }
  .ba-interview { grid-template-columns: 1fr; }
  .ba-final-cta { grid-template-columns: repeat(2, minmax(0, 1fr)); max-width: 560px; }
  .ba-final-cta .btn { justify-content: center; }
}
@media (max-width: 640px) {
  .ba-banner { aspect-ratio: 1580 / 792; border-radius: var(--radius); }
  .ba-head-actions { grid-template-columns: 1fr 1fr; gap: 10px; }
  .ba-store { padding: 10px 12px; gap: 9px; min-height: 54px; }
  .ba-store .ic { width: 22px; height: 22px; }
  .ba-store > span:not(.visually-hidden) { font-size: .96rem; }
  .ba-phone { width: min(100%, 290px); }
  .ba-features { grid-template-columns: 1fr; gap: 10px; }
  .ba-feature { display: grid; grid-template-columns: 40px 1fr; column-gap: 14px; padding: 14px; }
  .ba-feature-icon { grid-row: span 2; margin: 0; }
  .ba-features-cta .btn { flex: 1 1 100%; }
  .ba-features-cta .link-arrow { min-height: 44px; }
  .ba-screens { padding: 24px 16px; border-radius: 24px; }
  /* Capturas: fila desplazable dentro de su propio contenedor */
  .ba-screens-list {
    grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: 46%;
    overflow-x: auto; scroll-snap-type: x mandatory; scroll-padding-inline: 4px; padding: 4px 4px 10px;
    scrollbar-width: none; overscroll-behavior-x: contain;
  }
  .ba-screens-list::-webkit-scrollbar { display: none; }
  .ba-screens-list li { scroll-snap-align: start; }
  .ba-play-btn { width: 64px; height: 64px; }
  .ba-final-cta { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  .ba-player.is-loading .ba-play-btn { animation: none; }
}
