/* ── Variáveis ─────────────────────────────────────────────── */
:root {
  --primary:       #16a34a;
  --primary-dark:  #15803d;
  --primary-light: #dcfce7;
  --danger:        #ef4444;
  --text:          #111827;
  --muted:         #6b7280;
  --border:        #e5e7eb;
  --bg:            #f9fafb;
  --white:         #ffffff;
  --shadow-sm:     0 1px 3px rgba(0,0,0,0.10);
  --shadow-md:     0 4px 16px rgba(0,0,0,0.12);
  --shadow-green:  0 4px 20px rgba(22,163,74,0.35);
  --radius:        12px;
  --h-header:      56px;
  --h-search:      52px;
  --h-cats:        48px;
  --h-fab:         58px;
  /* Safe area (notch / barra de gestos) */
  --safe-top:    env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --h-header-total: calc(var(--h-header) + var(--safe-top));
}

/* ── Reset ─────────────────────────────────────────────────── */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
[hidden] { display: none !important; }

html, body {
  height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior: none;
}

button { font-family: inherit; }

/* ── Tela de Seleção de Vendedor ───────────────────────────── */
.vendor-screen {
  position: fixed;
  inset: 0;
  background: linear-gradient(160deg, #15803d 0%, #16a34a 60%, #4ade80 100%);
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
  transition: opacity 0.3s, visibility 0.3s;
}

.vendor-screen.open {
  opacity: 1;
  pointer-events: auto;
  visibility: visible;
}

.vendor-card {
  background: var(--white);
  border-radius: 24px;
  padding: 36px 28px 28px;
  width: 100%;
  max-width: 360px;
  text-align: center;
  box-shadow: 0 24px 64px rgba(0,0,0,0.25);
  max-height: calc(100vh - 96px);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.vendor-logo  { font-size: 52px; margin-bottom: 8px; }
.vendor-title { font-size: 26px; font-weight: 800; color: var(--primary-dark); margin-bottom: 6px; }
.vendor-subtitle {
  font-size: 16px;
  color: var(--muted);
  margin-bottom: 28px;
}

.vendor-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.vendor-btn {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 14px 18px;
  border: 2px solid var(--border);
  border-radius: 14px;
  background: var(--white);
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  text-align: left;
  transition: all 0.2s;
}

.vendor-btn:hover, .vendor-btn:active {
  border-color: var(--primary);
  background: var(--primary-light);
  color: var(--primary-dark);
}

.vendor-avatar {
  width: 40px; height: 40px;
  background: var(--primary);
  color: var(--white);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
  font-weight: 700;
  flex-shrink: 0;
}

/* ── Header ─────────────────────────────────────────────────── */
.header {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--h-header-total);
  padding-top: var(--safe-top);
  background: var(--primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px 0 16px;
  z-index: 100;
  box-shadow: var(--shadow-md);
}

.header-left {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex: 1;
}

.logo { font-size: 18px; font-weight: 700; white-space: nowrap; }

.header-logo-icon {
  font-size: 22px;
  line-height: 1;
  display: flex;
  align-items: center;
}

.vendor-badge {
  font-size: 13px;
  font-weight: 600;
  background: rgba(255,255,255,0.2);
  padding: 3px 10px;
  border-radius: 20px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 160px;
}

.header-right { display: flex; gap: 6px; flex-shrink: 0; }

.btn-icon {
  background: rgba(255,255,255,0.18);
  border: none;
  border-radius: 10px;
  width: 44px; height: 44px;
  font-size: 18px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  color: white;
  text-decoration: none;
  transition: background 0.15s;
}
.btn-icon:active { background: rgba(255,255,255,0.35); }

/* ── Busca ──────────────────────────────────────────────────── */
.search-bar {
  position: fixed;
  top: var(--h-header-total);
  left: 0; right: 0;
  height: var(--h-search);
  padding: 8px 12px;
  background: var(--white);
  z-index: 90;
  border-bottom: 1px solid var(--border);
}

.search-bar input {
  width: 100%;
  height: 36px;
  border: 1.5px solid var(--border);
  border-radius: 20px;
  padding: 0 16px;
  font-size: 16px;
  outline: none;
  background: var(--bg);
  color: var(--text);
  transition: border-color 0.2s;
}
.search-bar input:focus { border-color: var(--primary); background: var(--white); }

/* ── Categorias ─────────────────────────────────────────────── */
.categories {
  position: fixed;
  top: calc(var(--h-header-total) + var(--h-search));
  left: 0; right: 0;
  height: var(--h-cats);
  background: var(--white);
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  overflow-x: auto;
  z-index: 90;
  border-bottom: 1px solid var(--border);
  scrollbar-width: none;
}
.categories::-webkit-scrollbar { display: none; }

.cat-btn {
  border: 1.5px solid var(--border);
  background: var(--white);
  border-radius: 20px;
  padding: 5px 18px;
  font-size: 14px;
  cursor: pointer;
  white-space: nowrap;
  color: var(--muted);
  font-weight: 500;
  transition: all 0.2s;
  flex-shrink: 0;
  height: 34px;
}
.cat-btn.active { background: var(--primary); border-color: var(--primary); color: var(--white); }

/* ── Grid de Produtos ───────────────────────────────────────── */
.products-grid {
  margin-top: calc(var(--h-header-total) + var(--h-search) + var(--h-cats));
  padding: 12px;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  padding-bottom: calc(var(--h-fab) + 28px);
  min-height: calc(100vh - var(--h-header) - var(--h-search) - var(--h-cats));
}

@media (min-width: 420px)  { .products-grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 640px)  { .products-grid { grid-template-columns: repeat(4, 1fr); } }
@media (min-width: 960px)  { .products-grid { grid-template-columns: repeat(5, 1fr); } }

/* ── Card de produto ────────────────────────────────────────── */
.product-card {
  background: var(--white);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  position: relative;
  border: 2px solid transparent;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.product-card.in-cart { border-color: var(--primary); }

.qty-badge {
  position: absolute;
  top: 8px; right: 8px;
  background: var(--primary);
  color: var(--white);
  border-radius: 50%;
  width: 26px; height: 26px;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700;
  z-index: 10;
  box-shadow: 0 2px 6px rgba(22,163,74,0.4);
}

.product-img-wrap {
  width: 100%;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background: var(--bg);
  cursor: pointer;
}

.product-img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 0.2s;
  display: block;
}
.product-img-wrap:active .product-img { transform: scale(1.06); }

.product-info  { padding: 8px 10px 4px; }

.product-name {
  font-size: 13px;
  font-weight: 500;
  line-height: 1.35;
  color: var(--text);
  min-height: 35px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.product-price { font-size: 16px; font-weight: 700; color: var(--primary); margin-top: 4px; }

.product-actions {
  padding: 6px 8px 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn-add {
  width: 100%;
  background: var(--primary-light);
  color: var(--primary);
  border: none;
  border-radius: 8px;
  padding: 8px 4px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.btn-add:active { background: var(--primary); color: var(--white); }

.btn-qty {
  width: 34px; height: 34px;
  border-radius: 50%;
  border: 1.5px solid var(--primary);
  background: var(--white);
  color: var(--primary);
  font-size: 22px;
  font-weight: 700;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  line-height: 1;
  flex-shrink: 0;
  transition: all 0.15s;
}
.btn-qty:active { background: var(--primary); color: var(--white); }

.qty-num { font-size: 17px; font-weight: 700; min-width: 22px; text-align: center; }

.empty-state {
  grid-column: 1 / -1;
  text-align: center;
  color: var(--muted);
  padding: 48px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  font-size: 16px;
}

/* ── FAB ────────────────────────────────────────────────────── */
.cart-fab {
  position: fixed;
  bottom: max(16px, calc(var(--safe-bottom) + 8px)); left: 12px; right: 12px;
  z-index: 100;
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px);
  transition: opacity 0.25s, transform 0.25s;
}
.cart-fab.visible { opacity: 1; pointer-events: auto; transform: translateY(0); }

.btn-cart {
  width: 100%;
  height: var(--h-fab);
  background: var(--primary);
  color: var(--white);
  border: none;
  border-radius: 16px;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  box-shadow: var(--shadow-green);
  transition: transform 0.15s;
}
.btn-cart:active { transform: scale(0.98); }
.fab-total { font-size: 18px; }

/* ── Overlay / Painel ───────────────────────────────────────── */
.panel-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 200;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s;
}
.panel-overlay.open { opacity: 1; pointer-events: auto; }

.panel {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  background: var(--white);
  border-radius: 20px 20px 0 0;
  max-height: 92vh;
  overflow-y: auto;
  transform: translateY(100%);
  transition: transform 0.3s cubic-bezier(0.32,0.72,0,1);
}
.panel-overlay.open .panel { transform: translateY(0); }

.panel::before {
  content: '';
  display: block;
  width: 40px;
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  margin: 12px auto 0;
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0;
  background: var(--white);
  z-index: 10;
}
.panel-header h2 { font-size: 18px; font-weight: 700; }

.btn-close {
  background: var(--bg);
  border: none;
  border-radius: 50%;
  width: 44px; height: 44px;
  font-size: 16px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  color: var(--muted);
  flex-shrink: 0;
}

/* ── Seção de cliente ───────────────────────────────────────── */
.client-section {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}

.section-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin-bottom: 10px;
}

.client-section input {
  width: 100%;
  height: 46px;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  padding: 0 14px;
  font-size: 15px;
  margin-bottom: 10px;
  outline: none;
  color: var(--text);
  background: var(--white);
  transition: border-color 0.2s;
}
.client-section input:last-child { margin-bottom: 0; }
.client-section input:focus { border-color: var(--primary); }

/* ── Itens do carrinho ──────────────────────────────────────── */
.cart-items { padding: 4px 0; }

.cart-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 20px;
  border-bottom: 1px solid var(--border);
}

.cart-item-info  { flex: 1; min-width: 0; }
.cart-item-name  { font-size: 15px; font-weight: 500; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cart-item-price { font-size: 13px; color: var(--muted); display: block; margin-top: 3px; }
.cart-item-price strong { color: var(--primary); }

.cart-item-ctrl { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.cart-item-ctrl span { font-size: 17px; font-weight: 700; min-width: 20px; text-align: center; }

.empty-cart {
  text-align: center;
  color: var(--muted);
  padding: 32px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  font-size: 15px;
}

/* ── Pagamento ──────────────────────────────────────────────── */
.payment-section { padding: 16px 20px; border-top: 1px solid var(--border); }

.payment-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.pay-btn {
  height: 46px;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  background: var(--white);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  color: var(--text);
  transition: all 0.2s;
}
.pay-btn.active { background: var(--primary); border-color: var(--primary); color: var(--white); font-weight: 700; }

/* ── Rodapé do carrinho ─────────────────────────────────────── */
.cart-footer {
  padding: 16px 20px;
  padding-bottom: max(20px, env(safe-area-inset-bottom));
  border-top: 2px solid var(--border);
  background: var(--white);
  position: sticky; bottom: 0;
}

.total-display {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 15px;
  color: var(--muted);
  margin-bottom: 14px;
  font-weight: 500;
}
.total-display strong { font-size: 26px; font-weight: 800; color: var(--primary); }

.btn-confirm {
  width: 100%;
  height: 54px;
  background: var(--primary);
  color: var(--white);
  border: none;
  border-radius: 14px;
  font-size: 18px;
  font-weight: 700;
  cursor: pointer;
  margin-bottom: 10px;
}
.btn-confirm:active { opacity: 0.88; }

.btn-clear-cart {
  width: 100%;
  height: 42px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 14px;
  color: var(--danger);
  cursor: pointer;
  font-weight: 500;
}

/* ── Histórico ──────────────────────────────────────────────── */
.history-summary { padding: 16px 20px; border-bottom: 1px solid var(--border); }

.summary-card {
  background: var(--primary-light);
  border-radius: var(--radius);
  padding: 14px 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.summary-count { font-size: 16px; font-weight: 600; color: var(--primary-dark); }
.summary-date  { font-size: 13px; color: var(--primary); margin-top: 2px; }
.summary-mine  { font-size: 13px; color: var(--primary-dark); margin-top: 4px; font-weight: 600; }
.summary-total { font-size: 24px; font-weight: 800; color: var(--primary-dark); }

.history-list { padding: 4px 0; }

.history-item {
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  border-left: 3px solid transparent;
}
.history-item.mine { border-left-color: var(--primary); background: #f0fdf4; }

.history-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 4px; }
.history-time   { font-size: 13px; color: var(--muted); }
.history-seller { font-size: 13px; color: var(--primary-dark); font-weight: 600; }
.history-total  { font-size: 16px; font-weight: 700; color: var(--primary); }
.history-itens  { font-size: 13px; color: var(--muted); margin-bottom: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.history-cliente { font-size: 13px; color: var(--text); margin-bottom: 6px; }
.history-pay    { font-size: 12px; color: var(--muted); background: var(--bg); border: 1px solid var(--border); border-radius: 20px; padding: 2px 10px; display: inline-block; }

.panel-footer {
  padding: 14px 20px;
  padding-bottom: max(16px, env(safe-area-inset-bottom));
  border-top: 1px solid var(--border);
  position: sticky; bottom: 0;
  background: var(--white);
}

.btn-export {
  width: 100%;
  height: 48px;
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: 12px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  color: var(--text);
}
.btn-export:active { background: var(--border); }

/* ── Sucesso ────────────────────────────────────────────────── */
.success-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.55);
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s;
}
.success-overlay.open { opacity: 1; pointer-events: auto; }

.success-card {
  background: var(--white);
  border-radius: 20px;
  padding: 40px 28px;
  text-align: center;
  width: 100%;
  max-width: 320px;
  box-shadow: 0 24px 64px rgba(0,0,0,0.25);
  transform: scale(0.9);
  transition: transform 0.25s;
}
.success-overlay.open .success-card { transform: scale(1); }
.success-icon { font-size: 68px; margin-bottom: 14px; }
.success-card h2 { font-size: 22px; font-weight: 800; color: var(--primary); margin-bottom: 14px; }
.success-card p  { font-size: 16px; color: var(--muted); margin-bottom: 6px; min-height: 22px; }
#success-info-total { font-size: 28px; font-weight: 800; color: var(--text); }

.btn-new-sale {
  margin-top: 24px;
  width: 100%;
  height: 52px;
  background: var(--primary);
  color: var(--white);
  border: none;
  border-radius: 14px;
  font-size: 18px;
  font-weight: 700;
  cursor: pointer;
}

/* ── Toast ──────────────────────────────────────────────────── */
.toast {
  position: fixed;
  bottom: max(88px, calc(var(--safe-bottom) + 80px));
  left: 50%;
  transform: translateX(-50%) translateY(12px);
  background: rgba(17,24,39,0.85);
  backdrop-filter: blur(8px);
  color: var(--white);
  padding: 10px 22px;
  border-radius: 24px;
  font-size: 14px;
  font-weight: 500;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s, transform 0.25s;
  z-index: 999;
  white-space: nowrap;
  max-width: calc(100vw - 40px);
  overflow: hidden;
  text-overflow: ellipsis;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ── Auth Overlay (PDV Light Pro) ──────────────────────────── */
.auth-overlay {
  position: fixed; inset: 0;
  background: linear-gradient(160deg, #16a34a 0%, #166534 100%);
  z-index: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: max(24px, calc(var(--safe-top) + 16px)) 24px
           max(24px, calc(var(--safe-bottom) + 16px));
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}
.auth-overlay.open { opacity: 1; pointer-events: auto; }

.auth-card {
  background: var(--white);
  border-radius: 24px;
  padding: 28px 24px 24px;
  width: 100%;
  max-width: 360px;
  box-shadow: 0 24px 64px rgba(0,0,0,0.35);
}

.auth-logo    { font-size: 48px; text-align: center; margin-bottom: 8px; }
.auth-title   { font-size: 22px; font-weight: 800; color: var(--text); text-align: center; margin-bottom: 4px; }
.auth-subtitle {
  font-size: 14px; color: var(--muted); text-align: center;
  margin-bottom: 20px; line-height: 1.4;
}

.auth-tabs {
  display: flex; gap: 4px;
  background: var(--bg); border-radius: 12px;
  padding: 4px; margin-bottom: 20px;
}
.auth-tab {
  flex: 1; height: 40px; border: none; border-radius: 9px;
  font-size: 14px; font-weight: 600; cursor: pointer;
  background: transparent; color: var(--muted); transition: all 0.2s;
}
.auth-tab.active {
  background: var(--white); color: var(--primary);
  box-shadow: 0 1px 4px rgba(0,0,0,0.12);
}

.auth-form { display: flex; flex-direction: column; gap: 12px; }
.auth-form input {
  height: 48px; border: 1.5px solid var(--border); border-radius: 12px;
  padding: 0 16px; font-size: 16px; background: var(--white);
  color: var(--text); outline: none; transition: border-color 0.2s;
}
.auth-form input:focus { border-color: var(--primary); }

.btn-auth-primary {
  height: 52px; background: var(--primary); color: var(--white);
  border: none; border-radius: 14px; font-size: 17px; font-weight: 700;
  cursor: pointer; transition: opacity 0.2s; margin-top: 4px;
}
.btn-auth-primary:disabled  { opacity: 0.6; }
.btn-auth-primary:active:not(:disabled) { opacity: 0.85; }

.auth-error {
  color: #dc2626; font-size: 13px; text-align: center;
  min-height: 18px; margin-top: 8px; display: block;
}

.btn-auth-skip {
  display: block; width: 100%; margin-top: 16px;
  background: none; border: none; color: var(--muted);
  font-size: 14px; font-weight: 500; cursor: pointer;
  text-align: center; padding: 8px;
}
.btn-auth-skip:active { color: var(--text); }

/* ── Setup Guide (primeira configuração) ────────────────────── */
.setup-guide {
  display: flex; flex-direction: column; gap: 10px;
  text-align: left;
}
.setup-guide-msg {
  font-size: 13px; color: var(--muted);
  text-align: center; margin-bottom: 4px; line-height: 1.4;
}
.setup-step-btn {
  display: flex; align-items: center; gap: 12px;
  background: #f0fdf4; border: 1.5px solid #bbf7d0;
  border-radius: 14px; padding: 14px 16px;
  text-decoration: none; color: var(--text);
  font-size: 14px; font-weight: 600;
  transition: background 0.15s;
}
.setup-step-btn:active { background: #dcfce7; }
.setup-step-btn.done   { border-color: var(--primary); color: var(--primary); }
.setup-step-install    { background: #fffbeb; border-color: #fde68a; cursor: pointer; }
.setup-step-install:active { background: #fef3c7; }

.setup-contact {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  text-align: center;
}
.setup-contact-link {
  font-size: 13px;
  color: var(--muted);
  text-decoration: none;
  display: inline-block;
  padding: 4px 8px;
}
.setup-contact-link:active { color: var(--primary); }
.setup-step-num {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--primary); color: #fff;
  font-size: 13px; font-weight: 700;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.setup-step-txt  { flex: 1; }
.setup-step-arrow { color: var(--muted); }

/* ── Botão de empty state (produtos) ────────────────────────── */
.btn-empty-add {
  display: inline-block; padding: 12px 22px;
  background: var(--primary); color: #fff;
  border-radius: 12px; font-size: 15px; font-weight: 700;
  text-decoration: none; margin-top: 4px;
}
.btn-empty-add:active { opacity: 0.85; }

/* ── Aviso: navegador in-app (WhatsApp/Instagram) ──────────── */
.iab-warning {
  position: fixed; top: 0; left: 0; right: 0;
  background: #fef3c7;
  border-bottom: 2px solid #f59e0b;
  padding: 12px 16px;
  padding-top: max(12px, var(--safe-top));
  z-index: 800;
  display: flex; align-items: flex-start; gap: 12px;
}
.iab-icon  { font-size: 28px; flex-shrink: 0; line-height: 1; }
.iab-text  { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.iab-text strong { font-size: 14px; color: #92400e; font-weight: 700; }
.iab-instrucao   { font-size: 13px; color: #78350f; line-height: 1.4; }
.iab-actions     { display: flex; flex-direction: column; gap: 6px; align-items: flex-end; flex-shrink: 0; }
.btn-iab-copiar {
  height: 34px; padding: 0 12px;
  background: #f59e0b; border: none; border-radius: 8px;
  font-size: 13px; font-weight: 700; color: #fff; cursor: pointer; white-space: nowrap;
}
.btn-iab-fechar {
  width: 28px; height: 28px; background: none; border: none;
  font-size: 16px; color: #92400e; cursor: pointer;
}

/* ── Banner: instalar Android Chrome ───────────────────────── */
.install-banner {
  position: fixed; bottom: 0; left: 0; right: 0;
  background: var(--white);
  border-top: 2px solid var(--primary);
  padding: 14px 16px;
  padding-bottom: max(20px, calc(env(safe-area-inset-bottom, 0px) + 16px));
  z-index: 600;
  box-shadow: 0 -6px 24px rgba(0,0,0,0.15);
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.ib-left { display: flex; align-items: center; gap: 12px; flex: 1; min-width: 0; }
.ib-icon { font-size: 32px; flex-shrink: 0; }
.ib-left div { display: flex; flex-direction: column; }
.ib-left strong { font-size: 15px; color: var(--text); font-weight: 700; }
.ib-left small  { font-size: 12px; color: var(--muted); line-height: 1.3; }
.ib-right { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.btn-ib-instalar {
  height: 40px; padding: 0 18px;
  background: var(--primary); color: var(--white);
  border: none; border-radius: 10px; font-size: 14px; font-weight: 700;
  cursor: pointer;
}
.btn-ib-fechar {
  width: 36px; height: 36px; background: var(--bg); border: none;
  border-radius: 50%; font-size: 14px; color: var(--muted); cursor: pointer;
}

/* ── Guia iOS Safari ────────────────────────────────────────── */
.ios-guide-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(3px);
  z-index: 700;
  display: flex; flex-direction: column;
  align-items: center; justify-content: flex-end;
  padding: 0 16px 80px;  /* 80px: acima da barra de tabs do Safari */
  padding-bottom: max(80px, calc(var(--safe-bottom) + 72px));
}
.ios-guide-card {
  background: var(--white);
  border-radius: 20px;
  padding: 24px 20px 20px;
  width: 100%; max-width: 380px;
  box-shadow: 0 16px 48px rgba(0,0,0,0.3);
}
.ios-guide-title {
  font-size: 18px; font-weight: 800; color: var(--text);
  text-align: center; margin-bottom: 8px;
}
.ios-guide-desc {
  font-size: 14px; color: var(--muted); text-align: center;
  line-height: 1.4; margin-bottom: 20px;
}
.ios-steps {
  list-style: none; display: flex; flex-direction: column; gap: 14px;
  margin-bottom: 20px;
}
.ios-steps li {
  display: flex; align-items: flex-start; gap: 12px;
  font-size: 14px; color: var(--text); line-height: 1.4;
}
.ios-step-badge {
  width: 26px; height: 26px; border-radius: 50%;
  background: var(--primary); color: #fff;
  font-size: 13px; font-weight: 700;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.btn-ios-ok {
  width: 100%; height: 50px; background: var(--primary); color: var(--white);
  border: none; border-radius: 14px; font-size: 17px; font-weight: 700;
  cursor: pointer;
}
.ios-guide-arrow {
  font-size: 28px; color: rgba(255,255,255,0.7);
  margin-top: 10px; animation: bounce 1.4s ease-in-out infinite;
}
@keyframes bounce {
  0%, 100% { transform: translateY(0);    }
  50%       { transform: translateY(6px); }
}

/* ── Paywall Pro ─────────────────────────────────────────────── */
.paywall-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.65);
  backdrop-filter: blur(4px);
  z-index: 700;
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
}
.paywall-card {
  background: var(--white);
  border-radius: 20px;
  padding: 32px 24px 24px;
  width: 100%; max-width: 360px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.35);
  position: relative;
  text-align: center;
}
.paywall-close {
  position: absolute; top: 14px; right: 14px;
  width: 36px; height: 36px;
  background: var(--bg); border: none; border-radius: 50%;
  font-size: 16px; color: var(--muted); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.paywall-icon  { font-size: 48px; margin-bottom: 8px; }
.paywall-title { font-size: 22px; font-weight: 800; color: var(--text); margin-bottom: 4px; }
.paywall-price {
  font-size: 32px; color: var(--primary-dark);
  margin-bottom: 20px;
}
.paywall-price strong { font-weight: 900; }
.paywall-price span   { font-size: 16px; color: var(--muted); font-weight: 500; }
.paywall-benefits {
  list-style: none; text-align: left;
  display: flex; flex-direction: column; gap: 10px;
  margin-bottom: 24px;
}
.paywall-benefits li {
  font-size: 15px; color: var(--text);
  display: flex; align-items: center; gap: 8px;
}
.btn-paywall-assinar {
  width: 100%; height: 54px;
  background: var(--primary);
  color: #fff; border: none; border-radius: 14px;
  font-size: 17px; font-weight: 800;
  cursor: pointer; margin-bottom: 10px;
  transition: opacity 0.15s;
}
.btn-paywall-assinar:active   { opacity: 0.88; }
.btn-paywall-assinar:disabled { opacity: 0.55; cursor: not-allowed; }
.paywall-hint {
  font-size: 12px; color: var(--muted);
}
