/**
 * COOPERE BR — Apresentação Mobile (Modo Stories)
 * Estilos exclusivos da versão mobile em Apresentação/mobile/
 */

body.mobile-app {
  background: #0a0f14;
  height: 100dvh;
  overflow: hidden;
}

.mobile-shell {
  height: 100dvh;
  display: flex;
  flex-direction: column;
}

body.mobile-app .slides-wrap {
  flex: 1;
  position: relative;
  overflow: hidden;
  padding: 0;
  background: linear-gradient(165deg, #0d1b2a 0%, #1b2838 40%, #0a0f14 100%);
}

body.mobile-app .slides-track {
  display: flex;
  height: 100%;
  will-change: transform;
}

body.mobile-app .slide {
  position: relative;
  flex: 0 0 100%;
  opacity: 1;
  visibility: visible;
  transform: none;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: calc(env(safe-area-inset-top, 0px) + 3.5rem) .65rem calc(env(safe-area-inset-bottom, 0px) + 4.5rem);
}

body.mobile-app .slide-panel {
  min-height: auto;
  border: none;
  box-shadow: 0 8px 32px rgba(0, 0, 0, .25);
  border-radius: 20px;
  padding: 1rem .9rem 1.1rem;
  background: rgba(255, 255, 255, .97);
  backdrop-filter: blur(12px);
}

body.mobile-app h1 { font-size: 1.75rem; }
body.mobile-app h2 { font-size: 1.1rem; }
body.mobile-app .lead { font-size: .82rem; margin-bottom: .85rem; }

body.mobile-app .compare-row {
  grid-template-columns: 1fr;
}

body.mobile-app .compare-arrow {
  transform: rotate(90deg);
  text-align: center;
}

/* Barra de progresso estilo Stories */
.story-chrome {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  padding: calc(env(safe-area-inset-top, 0px) + .45rem) .65rem .35rem;
  pointer-events: none;
}

.story-progress {
  display: flex;
  gap: 3px;
  margin-bottom: .45rem;
}

.story-progress__seg {
  flex: 1;
  height: 3px;
  background: rgba(255, 255, 255, .25);
  border-radius: 999px;
  overflow: hidden;
}

.story-progress__fill {
  height: 100%;
  width: 0%;
  background: #fff;
  border-radius: 999px;
  transition: width .35s ease;
}

.story-progress__seg.done .story-progress__fill { width: 100%; }

.story-progress__seg.active .story-progress__fill {
  width: 100%;
  animation: storyFill .5s ease forwards;
}

@keyframes storyFill {
  from { width: 0%; }
  to { width: 100%; }
}

.story-header {
  display: flex;
  align-items: center;
  gap: .45rem;
}

.story-header__logo {
  height: 26px;
  border-radius: 6px;
  background: #fff;
  padding: 2px 4px;
}

.story-header__title {
  flex: 1;
  font-size: .78rem;
  font-weight: 700;
  color: #fff;
  text-shadow: 0 1px 4px rgba(0, 0, 0, .4);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.story-header__count {
  font-size: .68rem;
  font-weight: 600;
  color: rgba(255, 255, 255, .75);
  background: rgba(0, 0, 0, .25);
  padding: .2rem .45rem;
  border-radius: 999px;
}

.story-tap {
  position: absolute;
  top: 0;
  bottom: 0;
  z-index: 30;
  width: 30%;
  pointer-events: none;
}

.story-tap--prev { left: 0; }
.story-tap--next { right: 0; width: 70%; }

.story-hint {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 1rem;
  padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 5rem);
  background: rgba(0, 0, 0, .45);
  backdrop-filter: blur(4px);
  animation: fadeIn .4s ease;
}

.story-hint[hidden] { display: none !important; }

.story-hint__card {
  background: #fff;
  border-radius: 16px;
  padding: 1.1rem 1.2rem;
  text-align: center;
  max-width: 300px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, .3);
}

.story-hint__card .ms {
  font-size: 2rem;
  color: var(--green);
  display: block;
  margin-bottom: .35rem;
  animation: swipeHint 1.2s ease-in-out infinite;
}

@keyframes swipeHint {
  0%, 100% { transform: translateX(0); }
  50% { transform: translateX(12px); }
}

.story-hint__card p {
  font-size: .82rem;
  color: var(--muted);
  line-height: 1.45;
  margin-bottom: .75rem;
}

.story-hint__card button {
  width: 100%;
  padding: .6rem;
  border: none;
  border-radius: 10px;
  background: var(--green);
  color: #fff;
  font: inherit;
  font-weight: 700;
  font-size: .85rem;
  cursor: pointer;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.fab-nav {
  position: fixed;
  right: calc(env(safe-area-inset-right, 0px) + 1rem);
  bottom: calc(env(safe-area-inset-bottom, 0px) + 1rem);
  z-index: 45;
  width: 52px;
  height: 52px;
  border: none;
  border-radius: 16px;
  background: var(--green);
  color: #fff;
  box-shadow: 0 6px 24px rgba(0, 177, 82, .45);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform .2s ease;
}

.fab-nav:active { transform: scale(.92); }
.fab-nav .ms { font-size: 1.4rem; }

.sheet-backdrop {
  position: fixed;
  inset: 0;
  z-index: 55;
  background: rgba(0, 0, 0, .4);
  opacity: 0;
  visibility: hidden;
  transition: opacity .3s ease, visibility .3s;
}

.sheet-backdrop.open {
  opacity: 1;
  visibility: visible;
}

.bottom-sheet {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 60;
  background: #fff;
  border-radius: 20px 20px 0 0;
  padding: .5rem 1rem calc(env(safe-area-inset-bottom, 0px) + 1rem);
  max-height: 70dvh;
  transform: translateY(100%);
  transition: transform .38s cubic-bezier(.32, .72, .24, 1);
  box-shadow: 0 -8px 40px rgba(0, 0, 0, .15);
}

.bottom-sheet.open { transform: translateY(0); }

.bottom-sheet__handle {
  width: 36px;
  height: 4px;
  background: #d1d5db;
  border-radius: 999px;
  margin: .35rem auto .65rem;
}

.bottom-sheet__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: .75rem;
}

.bottom-sheet__title { font-size: .9rem; font-weight: 700; }

.bottom-sheet__close {
  width: 32px;
  height: 32px;
  border: none;
  background: #f3f4f6;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
}

.bottom-sheet__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: .5rem;
  overflow-y: auto;
  max-height: calc(70dvh - 5rem);
}

.sheet-pill {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .25rem;
  padding: .65rem .35rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fafbfc;
  font: inherit;
  font-size: .65rem;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
}

.sheet-pill .ms { font-size: 1.2rem; color: var(--green); }

.sheet-pill.active {
  background: var(--green-l);
  border-color: rgba(0, 177, 82, .3);
  color: var(--green-d);
}

.sheet-pill:active { transform: scale(.95); }

body.sheet-open .fab-nav {
  opacity: 0;
  pointer-events: none;
}

.mobile-link-desktop {
  position: fixed;
  left: calc(env(safe-area-inset-left, 0px) + 1rem);
  bottom: calc(env(safe-area-inset-bottom, 0px) + 1rem);
  z-index: 44;
  font-size: .68rem;
  color: rgba(255, 255, 255, .7);
  text-decoration: none;
  padding: .35rem .5rem;
  background: rgba(0, 0, 0, .3);
  border-radius: 8px;
}

body.sheet-open .mobile-link-desktop { opacity: 0; }
