/* ==========================================================
   TOPHARMA — Overlays: Intro (1x sessão), Modal 6 Abas, Teatro
   ========================================================== */

/* ---------- INTRO ---------- */
.intro {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  place-items: center;
  background: #070604;
  color: #f4ecd8;
  transition: opacity .45s var(--ease);
}
.intro canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.intro__center { position: relative; z-index: 2; text-align: center; padding: 24px; }
.crest--intro { width: 84px; height: 94px; margin: 0 auto 20px; }
.intro__brand {
  font-family: var(--f-display);
  font-weight: 900;
  font-size: clamp(28px, 5.5vw, 50px);
  letter-spacing: .16em;
  color: #e0be59;
}
.intro__meta {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  width: min(260px, 70vw);
  margin: 18px auto 8px;
  font-size: 11px;
  letter-spacing: .24em;
  color: #b2aca3;
}
.intro__pct { font-variant-numeric: tabular-nums; color: #e0be59; }
.intro__bar {
  width: min(260px, 70vw);
  height: 2px;
  margin: 0 auto 18px;
  background: rgba(212, 175, 55, .2);
  overflow: hidden;
  border-radius: 2px;
}
.intro__bar i { display: block; height: 100%; width: 0; background: #e0be59; }
.intro__skip {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 6px 14px;
  border-radius: var(--r-btn);
  border: 1px solid rgba(212, 175, 55, .4);
  font-size: 12px;
  font-weight: 600;
  color: #f4ecd8;
}
.intro__skip:hover { border-color: #e0be59; color: #e0be59; }
.intro.is-done { opacity: 0; pointer-events: none; }
.intro.is-gone { display: none; }

/* ---------- MODAL DE PRODUTO (com focus trap via inert) ---------- */
.modal {
  position: fixed;
  inset: 0;
  z-index: 150;
  display: grid;
  place-items: center;
  padding: 16px;
  visibility: hidden;
  pointer-events: none;
}
.modal.is-open { visibility: visible; pointer-events: auto; }
.modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(5, 4, 2, .74);
  backdrop-filter: blur(8px);
  opacity: 0;
  transition: opacity .35s var(--ease);
}
.modal.is-open .modal__backdrop { opacity: 1; }
.modal__panel {
  position: relative;
  width: min(980px, 100%);
  max-height: calc(100svh - 32px);
  overflow: auto;
  display: grid;
  grid-template-columns: 1fr 1.1fr;
  border-radius: var(--r-panel);
  border: 1px solid var(--line-strong);
  background: var(--bg);
  box-shadow: var(--shadow-lg);
  opacity: 0;
  transform: translateY(20px) scale(.98);
  transition: opacity .35s var(--ease), transform .45s var(--ease);
}
.modal.is-open .modal__panel { opacity: 1; transform: none; }
.modal__close {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 3;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid var(--line-strong);
  background: var(--bg);
  color: var(--fg);
  font-size: 16px;
  transition: border-color .25s, color .25s;
}
.modal__close:hover { border-color: var(--gold); color: var(--gold); }

.modal__stage {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 400px;
  padding: 40px 26px;
  background: var(--bg-2);
  border-right: 1px solid var(--line);
}
.modal__photo { width: min(100%, 440px); height: auto; }

.modal__body { padding: 40px 36px 32px; }
.modal__cat {
  margin: 0 0 10px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--gold);
}
.modal__body h3 { margin: 0 0 8px; font-family: var(--f-serif); font-size: clamp(26px, 3vw, 36px); font-weight: 800; line-height: 1.08; }
.modal__subtitle { margin: 0 0 16px; font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--gold); line-height: 1.45; }
.modal__desc { color: var(--muted); margin: 0 0 20px; font-size: 15px; }
.modal__table { width: 100%; border-collapse: collapse; font-size: 14px; margin-bottom: 18px; }
.modal__table th { text-align: left; font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--gold); font-weight: 700; padding: 0 0 10px; border-bottom: 1px solid var(--line-strong); }
.modal__table th:last-child,
.modal__table td:last-child { text-align: right; }
.modal__table td { padding: 10px 0; border-bottom: 1px solid var(--line); }
.modal__tags { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; padding: 0; margin: 0 0 22px; }
.modal__tags li { padding: 5px 11px; border-radius: var(--r-btn); border: 1px solid var(--line-strong); font-size: 12px; color: var(--muted); }
.modal__foot { display: flex; flex-direction: column; gap: 14px; font-size: 13px; color: var(--muted); }
.modal__links { display: flex; flex-wrap: wrap; gap: 10px; }
.modal__links .btn { flex: 1 1 auto; }

/* Vista completa (6 abas) */
.modal__full { display: none; }
.modal.is-full .modal__summary { display: none; }
.modal.is-full .modal__panel {
  width: min(1140px, 100%);
  height: min(840px, calc(100svh - 32px));
  grid-template-columns: 320px minmax(0, 1fr);
  overflow: hidden;
}
.modal.is-full .modal__body { display: flex; flex-direction: column; min-width: 0; min-height: 0; padding: 0; }
.modal.is-full .modal__full { display: flex; flex-direction: column; flex: 1; min-height: 0; padding: 34px 34px 0; }
.modal__full-head { display: flex; align-items: center; gap: 16px; flex: none; padding-right: 54px; margin-bottom: 16px; }
.modal__full-head > div { min-width: 0; }
.modal__body .modal__full-title { margin: 0; font-size: clamp(24px, 2.6vw, 32px); line-height: 1.08; }
.modal__full-sub { margin: 6px 0 0; font-size: 13px; font-weight: 500; color: var(--muted); }
.modal__back {
  flex: none;
  min-height: 40px;
  padding: 8px 14px;
  border-radius: var(--r-btn);
  border: 1px solid var(--line-strong);
  font-size: 12px;
  font-weight: 700;
  color: var(--fg);
}
.modal__back:hover { color: var(--gold); border-color: var(--gold); }

.modal__tabbar {
  flex: none;
  display: flex;
  gap: 4px;
  overflow-x: auto;
  scrollbar-width: none;
  border-bottom: 1px solid var(--line);
}
.modal__tabbar::-webkit-scrollbar { display: none; }
.modal__tabbar button {
  position: relative;
  flex: 1 0 auto;
  min-height: 44px;
  padding: 12px 10px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
}
.modal__tabbar button::after {
  content: "";
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 0;
  height: 2px;
  background: var(--gold);
  transform: scaleX(0);
  transition: transform .35s var(--ease);
}
.modal__tabbar button:hover,
.modal__tabbar button.is-active { color: var(--fg); }
.modal__tabbar button.is-active::after { transform: scaleX(1); }

.modal__tabpanels { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 24px 12px 36px 0; }
.modal__tabpanel { display: none; }
.modal__tabpanel.is-active { display: block; }
.modal__lead { margin: 0 0 14px; font-family: var(--f-serif); font-weight: 700; font-size: 24px; line-height: 1.25; }
.modal__text { margin: 0 0 14px; color: var(--muted); font-size: 15px; }
.modal__note { margin: 14px 0 0; font-size: 13px; color: var(--muted); }
.modal__bar { padding: 14px 0; border-top: 1px solid var(--line); }
.modal__bar-row { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 8px; font-size: 15px; }
.modal__bar-row b { font-family: var(--f-display); color: var(--gold); font-weight: 800; white-space: nowrap; }
.modal__bar-track { height: 5px; border-radius: 4px; background: var(--line); overflow: hidden; }
.modal__bar-track i { display: block; height: 100%; width: 0; border-radius: 4px; background: var(--gold); transition: width .8s var(--ease); }

.modal__benefits { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.modal__benefit { padding: 20px; border-radius: var(--r-card); border: 1px solid var(--line); background: var(--card); }
.modal__benefit svg { width: 40px; height: 40px; padding: 9px; border-radius: 10px; border: 1px solid var(--line-strong); fill: none; stroke: var(--gold); stroke-width: 1.6; margin-bottom: 12px; }
.modal__benefit h4 { margin: 0 0 6px; font-family: var(--f-serif); font-size: 21px; font-weight: 800; line-height: 1.15; }
.modal__benefit p { margin: 0; font-size: 14px; color: var(--muted); }

.modal__steps { list-style: none; margin: 0; padding: 0; counter-reset: s; }
.modal__steps li { counter-increment: s; position: relative; padding: 0 0 20px 48px; color: var(--muted); font-size: 15px; }
.modal__steps li::before {
  content: counter(s, decimal-leading-zero);
  position: absolute;
  left: 0;
  top: 0;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid var(--line-strong);
  display: grid;
  place-items: center;
  font-family: var(--f-display);
  font-size: 12px;
  color: var(--gold);
}
.modal__steps b { display: block; margin-bottom: 4px; color: var(--fg); }

.modal__specs { display: grid; grid-template-columns: 1fr 1fr; gap: 0 24px; margin: 0; }
.modal__specs div { padding: 12px 0; border-bottom: 1px solid var(--line); }
.modal__specs dt { font-size: 11px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--gold); }
.modal__specs dd { margin: 3px 0 0; font-weight: 500; font-size: 15px; }

.modal__faq details { border-bottom: 1px solid var(--line); }
.modal__faq details:first-child { border-top: 1px solid var(--line); }
.modal__faq summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 16px 0;
  cursor: pointer;
  list-style: none;
  font-family: var(--f-serif);
  font-size: 20px;
  font-weight: 700;
}
.modal__faq summary::-webkit-details-marker { display: none; }
.modal__faq summary::after {
  content: "+";
  flex: none;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 1px solid var(--line-strong);
  color: var(--gold);
  display: grid;
  place-items: center;
  font-size: 16px;
}
.modal__faq details[open] summary::after { content: "−"; background: var(--gold); color: var(--gold-ink); border-color: var(--gold); }
.modal__faq details p { margin: 0 0 18px; max-width: 560px; color: var(--muted); font-size: 15px; }

.modal__warn {
  margin: 20px 0 0;
  padding: 16px 18px;
  border-radius: var(--r-card);
  border: 1px solid var(--line-strong);
  background: color-mix(in srgb, var(--gold) 6%, transparent);
  font-size: 13px;
  color: var(--muted);
}
.modal__warn b { display: block; margin-bottom: 4px; font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--gold); }

/* ---------- TEATRO EM TELA CHEIA (Slider range acessível) ---------- */
.theater {
  position: fixed;
  inset: 0;
  z-index: 160;
  display: grid;
  place-items: center;
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
  transition: opacity .35s var(--ease), visibility 0s .35s;
}
.theater.is-open { visibility: visible; opacity: 1; pointer-events: auto; transition: opacity .35s var(--ease); }
.theater__backdrop { position: absolute; inset: 0; background: rgba(6, 5, 4, .9); backdrop-filter: blur(12px); }
.theater__panel {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: auto auto auto;
  align-items: center;
  gap: clamp(10px, 3vw, 36px);
  padding: 16px;
}
.theater__frame {
  position: relative;
  overflow: hidden;
  height: min(76svh, calc((100vw - 180px) * 4 / 3));
  aspect-ratio: 3 / 4;
  border-radius: var(--r-card);
  border: 1px solid rgba(212, 175, 55, .48);
  background: #000;
  box-shadow: var(--shadow-lg);
}
.theater__video { width: 100%; height: 100%; object-fit: cover; display: block; transition: opacity .28s; }
.theater__video.is-swapping { opacity: 0; }
.theater__nav,
.theater__close {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 1px solid rgba(243, 210, 122, .5);
  background: rgba(10, 9, 7, .72);
  color: #f3d27a;
}
.theater__nav:hover,
.theater__close:hover { border-color: #f3d27a; background: rgba(212, 175, 55, .24); }
.theater__nav svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.theater__close { position: fixed; top: 20px; right: 20px; z-index: 3; font-size: 16px; }

.theater__bar {
  grid-column: 1 / -1;
  justify-self: center;
  width: min(100%, 580px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  color: #f4ecd8;
}
.theater__info small { display: block; font-size: 11px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: #f3d27a; }
.theater__info b { display: block; font-family: var(--f-display); font-weight: 800; font-size: 22px; line-height: 1.15; }
.theater__ctrl { display: flex; align-items: center; gap: 10px; flex: 1; max-width: 340px; }
.theater__toggle .ico-play,
.theater__toggle.is-paused .ico-pause { display: none; }
.theater__toggle.is-paused .ico-play { display: block; }
.theater__toggle .ico-play { fill: currentColor; stroke: none; }
/* Slider nativo acessível por teclado e toque (≥ 36px altura) */
.theater__range {
  flex: 1;
  height: 36px;
  margin: 0;
  cursor: pointer;
  touch-action: none;
  accent-color: #e0be59;
}

@media (max-width: 900px) {
  .modal__panel { grid-template-columns: 1fr; }
  .modal__stage { min-height: 260px; border-right: 0; border-bottom: 1px solid var(--line); }
  .modal__body { padding: 26px 20px; }
  .modal.is-full .modal__panel { grid-template-columns: minmax(0, 1fr); height: calc(100svh - 32px); }
  .modal.is-full .modal__stage { display: none; }
  .modal.is-full .modal__full { padding: 24px 18px 0; }
  .modal__full-head { flex-wrap: wrap; }
  .modal__full-head > div { flex: 1 1 100%; }
  .modal__benefits,
  .modal__specs { grid-template-columns: 1fr; }
}
@media (max-width: 700px) {
  .theater__panel { grid-template-columns: 1fr 1fr; padding: 12px; gap: 14px; }
  .theater__frame { grid-column: 1 / -1; grid-row: 1; height: auto; width: min(92vw, calc(66svh * 3 / 4)); justify-self: center; }
  .theater__bar { grid-row: 2; flex-direction: column; align-items: stretch; gap: 12px; }
  .theater__ctrl { max-width: none; }
  .theater__nav { grid-row: 3; justify-self: center; }
}
