/* onboarding.css — overlay de bienvenida SOLO para instalaciones nuevas de la app
   (Capacitor). Los banners (img/onboarding/ob-*.png) traen título/copy horneados;
   los dots, el CTA "Ingresa" y los botones de auth son HTML real (la franja
   horneada se recortó de los PNG para que los dots avancen y los botones tengan
   logo + tap real). Markup inyectado por js/onboarding.js únicamente en index.html. */

#obWelcome {
  --ob-green: #81c408;
  --ob-ink: #1f2a24;
  --ob-head: 'Raleway', 'Open Sans', sans-serif;
  --ob-body: 'Open Sans', sans-serif;
  --ob-safe: env(safe-area-inset-bottom, 0px);
  position: fixed;
  inset: 0;
  z-index: 10065; /* sobre nav móvil (10050) y avatar sheet (10060), bajo auth sheet (10070) */
  background: #fff;
  transition: opacity .35s ease;
}
#obWelcome.is-leaving { opacity: 0; pointer-events: none; }

/* ───────── carrusel (scroll-snap nativo) ───────── */
.ob-track {
  display: flex;
  height: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.ob-track::-webkit-scrollbar { display: none; width: 0; height: 0; }

.ob-slide {
  flex: 0 0 100%;
  height: 100%;
  scroll-snap-align: start;
  scroll-snap-stop: always;
  padding-bottom: calc(118px + var(--ob-safe));
}
.ob-slide--auth { padding-bottom: calc(250px + var(--ob-safe)); } /* 2 provs (Google/Apple) — copy más abajo, sin gap; Facebook oculto hasta Meta; con FB volver a ~326px */
.ob-art {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: bottom center; /* el copy vive abajo del PNG: nunca se corta */
}

/* ───────── footer fijo: dots + CTA ⇄ botones de auth (crossfade) ───────── */
.ob-footer {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  display: grid;
  padding: 0 22px calc(14px + var(--ob-safe));
  pointer-events: none; /* deja pasar el swipe horizontal al carrusel; solo los controles capturan el tap */
}
.ob-step, .ob-auth { grid-area: 1 / 1; align-self: end; }
.ob-cta, .ob-prov, .ob-guest, .ob-legal a { pointer-events: auto; }

.ob-step {
  transition: opacity .25s ease, transform .25s ease;
}
.ob-auth {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(10px);
  transition: opacity .25s ease, transform .25s ease, visibility 0s linear .25s;
}
#obWelcome.is-auth .ob-step {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(10px);
  transition: opacity .25s ease, transform .25s ease, visibility 0s linear .25s;
}
#obWelcome.is-auth .ob-auth {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: none;
  transition: opacity .25s ease, transform .25s ease;
}

/* dots (5, avanzan con el swipe) */
.ob-dots { display: flex; justify-content: center; gap: 7px; margin-bottom: 16px; }
.ob-dot {
  width: 7px; height: 7px; border-radius: 999px;
  background: #e1e6da;
  transition: all .25s ease;
}
.ob-dot.is-on { width: 20px; background: var(--ob-green); }

/* CTA "Ingresa" (mismo pill verde del banner) */
.ob-cta {
  width: 100%; height: 54px;
  border: none; border-radius: 999px;
  background: var(--ob-green); color: #fff;
  font-family: var(--ob-head); font-weight: 800; font-size: 17px; letter-spacing: -.01em;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  box-shadow: 0 10px 24px -10px rgba(129, 196, 8, .55);
  transition: transform .14s ease, box-shadow .2s ease;
}
.ob-cta:active { transform: scale(.978); }

/* botones de proveedor — misma receta visual que .auth-prov del auth sheet */
.ob-provs { display: flex; flex-direction: column; gap: 11px; }
.ob-prov {
  position: relative; width: 100%; height: 58px; border-radius: 17px; cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 12px;
  font-family: var(--ob-head); font-weight: 700; font-size: 16.5px; letter-spacing: -.01em;
  border: 1.5px solid transparent; background: none;
  transition: transform .14s ease, box-shadow .2s ease, background .2s ease;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
.ob-prov:active { transform: scale(.978); }
.ob-prov .ob-ic { position: absolute; left: 20px; display: flex; align-items: center; }
.ob-prov--light {
  background: #fff; color: var(--ob-ink); border-color: #E7E9E4;
  box-shadow: 0 1px 2px rgba(31, 42, 36, .05), 0 8px 22px -12px rgba(31, 42, 36, .28);
}
.ob-prov--dark {
  background: #101411; color: #fff; border-color: #101411;
  box-shadow: 0 8px 22px -10px rgba(0, 0, 0, .55);
}
.ob-prov--fb {
  background: #1877F2; color: #fff; border-color: #1877F2;
  box-shadow: 0 8px 22px -10px rgba(24, 119, 242, .55);
}

/* "Continuar como invitado" — sin "Más opciones": abría el auth sheet sobre el
   onboarding y un tap bajo en Apple caía ahí (el modal viejo es solo post-registro) */
.ob-guest {
  display: block; margin: 12px auto 0; padding: 8px 14px;
  border: none; background: transparent; cursor: pointer;
  font-family: var(--ob-head); font-weight: 700; font-size: 15px; color: var(--ob-ink);
  text-decoration: underline; text-underline-offset: 3px;
  touch-action: manipulation; -webkit-tap-highlight-color: transparent;
}
.ob-legal {
  margin: 10px auto 0; max-width: 340px; text-align: center;
  font-family: var(--ob-body); font-size: 11.5px; line-height: 1.5; color: #98a29a;
}
.ob-legal a { color: #6CA50A; font-weight: 600; text-decoration: none; }

/* ═════════ pasos post-registro: ubicación → confirmar (mapa) → notificaciones ═════════
   Gate de cobertura: sin dirección dentro de la zona no se entra a la tienda. */
#obWelcome.ob-steps .ob-track,
#obWelcome.ob-steps .ob-footer { display: none; }

.ob-view {
  position: absolute; inset: 0; background: #fff;
  display: none; flex-direction: column;
}
.ob-view.is-on { display: flex; }

/* ── paso ubicación (diseño "¿A dónde llevamos tu súper?") ── */
.ob-loc { padding: calc(env(safe-area-inset-top, 0px) + 38px) 22px 0; }
.ob-loc-title {
  margin: 0; font-family: var(--ob-head); font-weight: 800; font-size: 26px;
  letter-spacing: -.02em; color: var(--ob-ink);
}
.ob-loc-sub { margin: 10px 0 0; font-family: var(--ob-body); font-size: 14.5px; line-height: 1.55; color: #5f6b63; }
.ob-search-box {
  margin-top: 18px; display: flex; align-items: center; gap: 10px;
  background: #f2f4ee; border-radius: 14px; padding: 0 16px; height: 52px;
  cursor: text; touch-action: manipulation;
}
.ob-search-box svg { flex-shrink: 0; }
.ob-search-box input {
  flex: 1; min-width: 0; border: none; background: transparent; outline: none;
  font-family: var(--ob-body); font-size: 15.5px; color: var(--ob-ink); height: 100%;
  touch-action: manipulation;
}
.ob-search-box input::placeholder { color: #a9b3aa; }
.ob-results { margin-top: 6px; flex: 1; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.ob-result {
  display: flex; align-items: center; gap: 13px; width: 100%; text-align: left;
  background: none; border: none; border-bottom: 1px solid #eef0ea;
  padding: 14px 2px; cursor: pointer;
  touch-action: manipulation; -webkit-tap-highlight-color: transparent;
  transition: background .15s ease;
}
.ob-result:active { background: #f6f8f2; }
.ob-result-ic {
  width: 38px; height: 38px; border-radius: 999px; background: #eef7dc;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.ob-result-t { font-family: var(--ob-body); font-weight: 700; font-size: 14.5px; color: var(--ob-ink); }
.ob-result-s { font-family: var(--ob-body); font-size: 12.5px; color: #8a948c; }
.ob-results-msg { padding: 18px 2px; font-family: var(--ob-body); font-size: 13.5px; color: #8a948c; }

/* ── paso confirmar: mapa + tarjeta (referencia Justo, colores de marca) ── */
.ob-map-head {
  display: flex; align-items: center; justify-content: center; position: relative;
  padding: calc(env(safe-area-inset-top, 0px) + 16px) 18px 12px;
}
.ob-map-back {
  position: absolute; left: 10px; bottom: 2px; width: 44px; height: 44px;
  border: none; background: transparent; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  touch-action: manipulation; -webkit-tap-highlight-color: transparent;
}
.ob-map-back:active { opacity: .55; }
.ob-map-title { margin: 0; font-family: var(--ob-head); font-weight: 800; font-size: 19px; color: var(--ob-ink); }
.ob-map-wrap { flex: 1; min-height: 0; position: relative; }
#obMap { position: absolute; inset: 0; }

/* marker: pin gota de marca (nuevopin) anclado por la punta; rojo si no hay cobertura.
   El fondo va en un hijo (.ob-pin-img) porque Mapbox pisa el transform del elemento. */
.ob-pin-marker { width: 62px; height: 74px; }
.ob-pin-marker .ob-pin-img {
  width: 100%; height: 100%;
  background: url('../img/onboarding/pin-verde.png') center bottom / contain no-repeat;
  filter: drop-shadow(0 3px 5px rgba(0, 0, 0, .25));
}
.ob-pin-marker.is-out .ob-pin-img { background-image: url('../img/onboarding/pin-rojo.png'); }

.ob-cov-bar {
  display: none; align-items: center; justify-content: center; gap: 9px;
  background: #e02d3c; color: #fff; padding: 13px 16px;
  font-family: var(--ob-head); font-weight: 700; font-size: 15.5px;
}
.ob-view.is-out .ob-cov-bar { display: flex; }

.ob-map-card { background: #fff; padding: 18px 22px calc(18px + var(--ob-safe)); }
.ob-map-card-t { margin: 0; font-family: var(--ob-head); font-weight: 800; font-size: 20px; color: var(--ob-ink); }
.ob-map-card-s { margin: 7px 0 0; font-family: var(--ob-body); font-size: 13.5px; line-height: 1.5; color: #6c776e; }
.ob-map-cta { margin-top: 16px; }
.ob-when-out { display: none; }
.ob-view.is-out .ob-when-ok { display: none; }
.ob-view.is-out .ob-when-out { display: block; }

/* ── paso notificaciones: el banner es la IMAGEN tal cual (ob-notifs.jpg, export
   HD de Canva recortado arriba del botón horneado); solo los botones son HTML.
   contain limitado por alto = TODO visible sin scroll (como el diseño original);
   el recorte sin márgenes laterales compensa el encogimiento del texto. ── */
.ob-ntf { align-items: center; }
.ob-ntf-art {
  flex: 1 1 auto; min-height: 0; width: 100%;
  object-fit: contain; object-position: top center;
  margin-top: calc(env(safe-area-inset-top, 0px) + 6px);
}
.ob-ntf-foot { width: 100%; padding: 6px 26px calc(14px + var(--ob-safe)); }
.ob-ntf-later {
  display: block; margin: 10px auto 0; padding: 8px 16px;
  border: none; background: transparent; cursor: pointer;
  font-family: var(--ob-head); font-weight: 700; font-size: 14.5px; color: #6CA50A;
  touch-action: manipulation; -webkit-tap-highlight-color: transparent;
}

/* ── pantalla final "¡Todo listo!": círculo + palomita con pop al entrar (como la
   animación de Canva del diseño); el texto es recorte del banner HD ── */
.ob-done { align-items: center; }
.ob-done-mid { margin: auto 0; width: 100%; display: flex; flex-direction: column; align-items: center; }
.ob-done-circle {
  width: 96px; height: 96px; border-radius: 999px; background: var(--ob-green);
  display: flex; align-items: center; justify-content: center;
  transform: scale(0);
  box-shadow: 0 16px 32px -14px rgba(129, 196, 8, .6);
}
.ob-done-circle svg { transform: scale(0); }
.ob-done-circle.is-pop { animation: obPop .5s cubic-bezier(.34, 1.56, .5, 1) .1s forwards; }
.ob-done-circle.is-pop svg { animation: obPop .4s cubic-bezier(.34, 1.56, .5, 1) .32s forwards; }
@keyframes obPop {
  0% { transform: scale(0); }
  72% { transform: scale(1.14); }
  100% { transform: scale(1); }
}
.ob-done-txt { width: 100%; height: auto; margin-top: 26px; }
.ob-done-foot { width: 100%; padding: 6px 26px calc(14px + var(--ob-safe)); }
