/* Runtime PWA dos apps criados (mobile-first). As cores vêm da Aba 3 via variáveis no <html>. */
:root {
  --bar-bg: #2563eb; --bar-fg: #fff; --drawer-bg: #fff; --drawer-fg: #111827;
  --tile-bg: #2563eb; --tile-fg: #fff; --label: #111827; --accent: #2563eb;
  --ink: #111827; --muted: #6b7280; --line: #e5e7eb; --bg: #f3f4f6; --card: #fff; --danger: #dc2626; --ok: #059669;
  --safe-top: env(safe-area-inset-top, 0px); --safe-bottom: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; height: 100%; }
body { font-family: -apple-system, "Segoe UI", Roboto, system-ui, sans-serif; color: var(--ink); background: var(--bg);
  font-size: 15px; line-height: 1.5; overscroll-behavior-y: contain; }
a { color: var(--accent); }
img { max-width: 100%; }
button { font: inherit; }
[x-cloak] { display: none !important; }
i[x-icon] { display: inline-flex; align-items: center; justify-content: center; flex: none; }
i[x-icon][style] > svg { width: 100%; height: 100%; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.center { text-align: center; }
.rich { word-break: break-word; }
.rich img { height: auto; border-radius: 10px; }
.rich table { width: 100%; border-collapse: collapse; }
.rich td, .rich th { border: 1px solid var(--line); padding: 6px; }

/* ------------------------------------------------------------ estrutura */
.app { min-height: 100%; display: flex; flex-direction: column; max-width: 760px; margin: 0 auto; background: var(--bg);
  position: relative; }
.bar { position: sticky; top: 0; z-index: 20; background: var(--bar-bg); color: var(--bar-fg); display: flex; align-items: center;
  gap: 8px; min-height: 56px; padding: var(--safe-top) 8px 0; box-shadow: 0 1px 4px rgba(0, 0, 0, .12); }
.bar .bar-title { flex: 1; font-size: 18px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar img.bar-logo { height: 42px; max-width: 60%; object-fit: contain; }
.bar img.bar-logo-right { margin-left: auto; }
/* Fora do fluxo: fica no centro da barra, com ou sem botão de carrinho à direita. */
.bar img.bar-logo-center { position: absolute; top: var(--safe-top); bottom: 0; left: 0; right: 0; margin: auto; pointer-events: none; }
.icon-btn { width: 42px; height: 42px; border: 0; background: transparent; color: inherit; border-radius: 50%; display: grid;
  place-items: center; cursor: pointer; position: relative; flex: none; }
.icon-btn svg { width: 22px; height: 22px; }
.icon-btn .count { position: absolute; top: 3px; right: 2px; min-width: 18px; height: 18px; border-radius: 9px; background: #ef4444;
  color: #fff; font-size: 11px; font-weight: 700; display: grid; place-items: center; padding: 0 4px; }
.main.no-bar .page { padding-top: calc(60px + var(--safe-top)); }
.float-menu { position: fixed; top: calc(10px + var(--safe-top)); left: 10px; z-index: 20; background: rgba(0, 0, 0, .35); color: #fff; }
.float-cart { left: auto; }
.main { flex: 1; padding-bottom: calc(24px + var(--safe-bottom)); }
.main.with-player { padding-bottom: calc(96px + var(--safe-bottom)); }
.home { min-height: calc(100vh - 56px); background-size: cover; background-repeat: no-repeat; }
.page { padding: 16px; }
.page h1 { font-size: 1.4rem; margin: 0 0 12px; }
.page h2 { font-size: 1.1rem; margin: 18px 0 8px; }

/* ------------------------------------------------------------ início */
.slider { position: relative; aspect-ratio: 730 / 560; overflow: hidden; background: #e5e7eb; }
.slide { position: absolute; inset: 0; background-size: cover; background-position: center; transition: transform .6s ease, opacity .6s ease; }
.slider .dots { position: absolute; bottom: 8px; left: 0; right: 0; display: flex; justify-content: center; gap: 6px; }
.slider .dots span { width: 7px; height: 7px; border-radius: 50%; background: rgba(255, 255, 255, .55); }
.slider .dots span.on { background: #fff; }
.home-logo { display: flex; justify-content: center; padding: 18px 0 6px; }
.home-logo img { width: 200px; height: 133px; object-fit: contain; }
.grid { display: grid; padding: 18px 16px; }
.tile { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; text-decoration: none;
  min-width: 0; border: 0; background: transparent; cursor: pointer; padding: 0; }
.tile-icon { display: grid; place-items: center; overflow: hidden; background-size: cover; background-position: center;
  box-shadow: 0 2px 6px rgba(0, 0, 0, .12); }
.tile-label { line-height: 1.2; word-break: break-word; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden; max-width: 100%; }
.list { display: flex; flex-direction: column; padding: 14px; }
.list .tile { flex-direction: row; text-align: left; padding: 10px 12px; border-radius: 14px; background: rgba(255, 255, 255, .14); }
.list .tile .chev { margin-left: auto; opacity: .6; }
.ad { margin: 10px 16px; padding: 10px 12px; border-radius: 10px; background: rgba(255, 255, 255, .92); border: 1px solid var(--line);
  font-size: 12px; color: var(--muted); display: flex; justify-content: space-between; gap: 8px; align-items: center; }
.ad a { font-weight: 600; white-space: nowrap; }
.install { margin: 10px 16px; }

/* ------------------------------------------------------------ menu lateral */
.backdrop { position: fixed; inset: 0; background: rgba(0, 0, 0, .45); z-index: 40; }
.drawer { position: fixed; top: 0; bottom: 0; left: 0; width: min(82vw, 330px); z-index: 41; background: var(--drawer-bg);
  color: var(--drawer-fg); overflow-y: auto; padding: calc(18px + var(--safe-top)) 0 18px; box-shadow: 4px 0 24px rgba(0, 0, 0, .25); }
.drawer .dh { display: flex; gap: 12px; align-items: center; padding: 0 20px 16px; font-weight: 700; font-size: 18px; }
.drawer .dh img { width: 44px; height: 44px; border-radius: 12px; }
.drawer a, .drawer button.di { display: flex; gap: 14px; align-items: center; padding: 12px 20px; color: inherit; text-decoration: none;
  width: 100%; border: 0; background: transparent; text-align: left; cursor: pointer; font-size: 15px; }
.drawer a svg, .drawer button.di svg { width: 20px; height: 20px; }
.drawer hr { border: 0; border-top: 1px solid rgba(127, 127, 127, .25); margin: 8px 0; }

/* ------------------------------------------------------------ componentes */
.card { background: var(--card); border-radius: 14px; padding: 14px; box-shadow: 0 1px 3px rgba(0, 0, 0, .08); }
.card + .card { margin-top: 12px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; border-radius: 12px; padding: 13px 18px;
  background: var(--accent); color: #fff; font-weight: 600; cursor: pointer; text-decoration: none; font-size: 15px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn svg { width: 18px; height: 18px; }
.btn-block { width: 100%; }
.btn-ghost { background: transparent; color: var(--ink); border: 1px solid var(--line); }
.btn-wa { background: #25d366; }
.btn-sm { padding: 8px 12px; font-size: 13px; border-radius: 10px; }
.field { display: flex; flex-direction: column; gap: 5px; margin-bottom: 12px; }
.field label { font-weight: 600; font-size: .86rem; }
.input { width: 100%; border: 1px solid #d1d5db; border-radius: 12px; padding: 12px; font: inherit; background: #fff; color: var(--ink); }
.input:focus { outline: 2px solid var(--accent); outline-offset: 0; border-color: transparent; }
textarea.input { min-height: 110px; resize: vertical; }
.row { display: flex; gap: 10px; align-items: center; }
.row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: .9rem; }
.check input { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--accent); }
.alert { padding: 12px; border-radius: 12px; font-size: .9rem; margin-bottom: 12px; background: #eff6ff; color: #1e3a8a; }
.alert-warn { background: #fffbeb; color: #78350f; }
.alert-danger { background: #fef2f2; color: #7f1d1d; }
.alert-ok { background: #ecfdf5; color: #064e3b; }
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 2px 0 10px; }
.chip { border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 7px 14px; white-space: nowrap; cursor: pointer;
  font-size: 13px; font-weight: 600; color: var(--ink); }
.chip.on { background: var(--accent); color: #fff; border-color: var(--accent); }
.search { position: relative; margin-bottom: 10px; }
.search .input { padding-left: 40px; }
.search svg { position: absolute; left: 12px; top: 13px; width: 18px; height: 18px; color: var(--muted); }
.empty { text-align: center; color: var(--muted); padding: 40px 16px; }
.empty svg { width: 42px; height: 42px; opacity: .6; margin-bottom: 8px; }
.loading { text-align: center; padding: 40px; color: var(--muted); }

/* ------------------------------------------------------------ produtos e itens */
.products { display: grid; gap: 12px; }
.product { background: #fff; border-radius: 14px; overflow: hidden; box-shadow: 0 1px 3px rgba(0, 0, 0, .08); cursor: pointer;
  display: flex; flex-direction: column; text-align: left; border: 0; padding: 0; }
.product img, .product .ph { width: 100%; aspect-ratio: 1; object-fit: cover; background: #e5e7eb; display: block; }
.product .pb { padding: 10px; }
.product strong { display: block; font-size: 14px; line-height: 1.3; }
.price { font-weight: 700; color: var(--accent); }
.price s { color: var(--muted); font-weight: 400; font-size: .85em; margin-right: 6px; }
.menu-item { display: flex; gap: 12px; background: #fff; border-radius: 14px; padding: 12px; box-shadow: 0 1px 3px rgba(0, 0, 0, .08);
  cursor: pointer; border: 0; text-align: left; width: 100%; }
.menu-item img, .menu-item .ph { width: 84px; height: 84px; border-radius: 10px; object-fit: cover; background: #e5e7eb; flex: none; }
.menu-item .mi { flex: 1; min-width: 0; }
.menu-item p { margin: 2px 0 6px; color: var(--muted); font-size: 13px; display: -webkit-box; -webkit-line-clamp: 2;
  -webkit-box-orient: vertical; overflow: hidden; }
.stack > * + * { margin-top: 10px; }
.gallery { display: grid; gap: 4px; }
.gallery img { width: 100%; aspect-ratio: 1; object-fit: cover; cursor: pointer; display: block; }
.carousel { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; gap: 0; background: #fff; }
.carousel img { width: 100%; flex: none; scroll-snap-align: center; aspect-ratio: 1; object-fit: cover; }
.group { border-top: 1px solid var(--line); padding-top: 12px; margin-top: 12px; }
.group-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-bottom: 6px; }
.group-head span { font-size: 12px; color: var(--muted); }
.opt { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 0; border-bottom: 1px solid #f3f4f6; }
.qty { display: inline-flex; align-items: center; gap: 10px; }
.qty button { width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--line); background: #fff; cursor: pointer;
  font-size: 18px; line-height: 1; color: var(--ink); }
.sticky-foot { position: sticky; bottom: 0; background: linear-gradient(to top, var(--bg) 70%, transparent); padding: 14px 16px
  calc(14px + var(--safe-bottom)); }
.line { display: flex; justify-content: space-between; gap: 10px; padding: 6px 0; }
.line.total { font-weight: 700; font-size: 1.05rem; border-top: 1px solid var(--line); margin-top: 6px; padding-top: 10px; }
.entry { display: flex; gap: 12px; background: #fff; border-radius: 14px; padding: 12px; box-shadow: 0 1px 3px rgba(0, 0, 0, .08);
  text-decoration: none; color: inherit; cursor: pointer; border: 0; width: 100%; text-align: left; }
.entry img { width: 72px; height: 72px; border-radius: 10px; object-fit: cover; flex: none; }
.entry .date { width: 56px; flex: none; text-align: center; background: var(--accent); color: #fff; border-radius: 10px; padding: 6px 0; }
.entry .date strong { display: block; font-size: 20px; line-height: 1.1; }
.entry .date span { font-size: 11px; text-transform: uppercase; }
.hero { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; display: block; }
.contact-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; }
.frame { width: 100%; border: 0; display: block; background: #fff; }
.frame-full { height: calc(100vh - 56px); }
.video { width: 100%; aspect-ratio: 16 / 9; border: 0; display: block; background: #000; }
.stamps { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; margin-top: 14px; }
.stamp { aspect-ratio: 1; border-radius: 50%; border: 2px dashed rgba(255, 255, 255, .75); display: grid; place-items: center; }
.stamp.on { background: rgba(255, 255, 255, .95); border-style: solid; color: #111; }
.stamp svg { width: 60%; height: 60%; }
.status-steps { display: flex; gap: 6px; margin: 12px 0; }
.status-steps span { flex: 1; height: 6px; border-radius: 3px; background: var(--line); }
.status-steps span.on { background: var(--accent); }
.message { background: #fff; border-radius: 14px; padding: 12px; box-shadow: 0 1px 3px rgba(0, 0, 0, .08); }
.message strong { font-size: 13px; }

/* ------------------------------------------------------------ sobreposições */
.splash { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; background-size: cover; background-position: center;
  transition: opacity .35s ease; }
.splash .splash-icon { width: 128px; height: 128px; border-radius: 30px; box-shadow: 0 10px 30px rgba(0, 0, 0, .25); }
.popup { position: fixed; inset: 0; z-index: 90; background: rgba(0, 0, 0, .6); display: grid; place-items: center; padding: 20px; }
.popup .pbox { position: relative; width: min(86vw, 360px); aspect-ratio: 320 / 480; border-radius: 16px; overflow: hidden;
  background: #fff center / cover no-repeat; box-shadow: 0 20px 40px rgba(0, 0, 0, .4); cursor: pointer; border: 0; padding: 0; }
.popup .pclose { position: absolute; top: -14px; right: -14px; width: 36px; height: 36px; border-radius: 50%; border: 0; background: #fff;
  color: #111; display: grid; place-items: center; cursor: pointer; box-shadow: 0 2px 8px rgba(0, 0, 0, .3); }
.popup .pwrap { position: relative; }
.lightbox { position: fixed; inset: 0; z-index: 95; background: rgba(0, 0, 0, .92); display: grid; place-items: center; padding: 16px; }
.lightbox img { max-height: 86vh; border-radius: 8px; }
.lightbox p { color: #fff; text-align: center; }
.auth { min-height: 100vh; display: flex; flex-direction: column; justify-content: center; padding: 28px 22px;
  background-size: cover; background-position: center; }
.auth .box { background: rgba(255, 255, 255, .96); border-radius: 18px; padding: 20px; color: #111827; }
.auth img.logo { display: block; margin: 0 auto 14px; width: 180px; height: 120px; object-fit: contain; }
.tabs { display: flex; gap: 6px; margin-bottom: 14px; }
.tabs button { flex: 1; border: 0; border-radius: 10px; padding: 10px; background: #f3f4f6; font-weight: 600; cursor: pointer; color: #374151; }
.tabs button.on { background: var(--accent); color: #fff; }
.toast { position: fixed; left: 50%; bottom: calc(24px + var(--safe-bottom)); transform: translateX(-50%); z-index: 120; background: #111827;
  color: #fff; padding: 12px 16px; border-radius: 12px; max-width: 90vw; font-size: 14px; box-shadow: 0 10px 30px rgba(0, 0, 0, .3); }
.toast.error { background: #991b1b; }
.player { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; background: #111827; color: #fff; display: flex; align-items: center;
  gap: 12px; padding: 10px 14px calc(10px + var(--safe-bottom)); max-width: 760px; margin: 0 auto; }
.player img { width: 46px; height: 46px; border-radius: 8px; object-fit: cover; }
.player .pt { flex: 1; min-width: 0; }
.player .pt strong { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.player .icon-btn { background: #fff; color: #111827; }
.radio-cover { width: 220px; height: 220px; border-radius: 20px; object-fit: cover; display: block; margin: 10px auto 18px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .2); background: #e5e7eb; }
@media (min-width: 600px) { .app { box-shadow: 0 0 0 1px var(--line); } }

/* Bíblia Sagrada */
.bible-search { display: flex; gap: 8px; margin-bottom: 14px; }
.bible-search .input { flex: 1; min-width: 0; }
.bible-part { font-size: 15px; margin: 16px 0 8px; }
.bible-books { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 6px; }
.bible-books button, .bible-chapters button { border: 1px solid var(--line); background: var(--card); color: var(--ink); border-radius: 10px; padding: 11px 10px;
  font: inherit; font-size: 14px; text-align: left; cursor: pointer; }
.bible-chapters { display: grid; grid-template-columns: repeat(auto-fill, minmax(52px, 1fr)); gap: 6px; }
.bible-chapters button { text-align: center; padding: 12px 0; }
.bible-head { display: flex; align-items: center; gap: 10px; margin: 4px 0 12px; }
.bible-head h2 { flex: 1; min-width: 0; margin: 0; font-size: 17px; }
.bible-head .btn, .bible-size .btn, .bible-nav .btn { width: auto; padding: 8px 12px; font-size: 14px; }
.bible-size { display: flex; gap: 4px; }
.bible-text { line-height: 1.6; }
.bible-text p { margin: 0 0 8px; padding: 2px 4px; border-radius: 6px; }
.bible-text p.on { background: #fef3c7; }
.bible-text sup { font-size: .68em; margin-right: 4px; font-weight: 600; opacity: .65; }
.bible-nav { display: flex; justify-content: space-between; gap: 8px; margin-top: 12px; }
.bible-result { display: block; width: 100%; text-align: left; border: 0; border-bottom: 1px solid var(--line); background: transparent; color: var(--ink);
  font: inherit; font-size: 14px; padding: 10px 0; cursor: pointer; }
.bible-result strong { display: block; margin-bottom: 2px; }
.bible-license { margin-top: 18px; }
