/* ============================================================
   ZÉ MOCHILEIRO — GLOBAL STYLES
   Variáveis de marca + Dark mode + Utilities + Acessibilidade
   v1.2 — consolidado para evitar duplicação entre páginas
   ============================================================ */

/* ---------- VARIÁVEIS DE MARCA (light mode default) ---------- */
:root {
  /* Cores primárias */
  --primary:        #2D6A2E;
  --primary-light:  #4a9e4c;
  --primary-dark:   #1f4a20;
  --gold:           #F5C518;
  --gold-dark:      #c79e0e;

  /* Aliases legados (mantidos p/ compatibilidade) */
  --primary-green:  #2D6A2E;
  --dark:           #1a1a1a;
  --dark-gray:      #1a1a1a;
  --soft:           #f5f5f5;
  --soft-gray:      #f5f5f5;
  --border:         #e0e0e0;

  /* Dark mode tokens */
  --dm-bg:       #ffffff;
  --dm-surface:  #f5f5f5;
  --dm-text:     #1a1a1a;
  --dm-text-sec: #555555;       /* contraste AA em fundo branco */
  --dm-border:   #e0e0e0;
  --dm-card:     #ffffff;
  --dm-nav-bg:   rgba(45, 106, 46, 0.92);
  --dm-shadow:   0 2px 12px rgba(0,0,0,0.08);

  /* Tipografia */
  --font-heading: 'Poppins', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  --font-body:    'Inter', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
}

[data-theme="dark"] {
  --dm-bg:       #0f1117;
  --dm-surface:  #1a1f2e;
  --dm-text:     #e8eaf0;
  --dm-text-sec: #b8bdcc;       /* mais claro p/ contraste AA em fundo escuro */
  --dm-border:   #2a3040;
  --dm-card:     #1e2534;
  --dm-nav-bg:   rgba(20, 40, 22, 0.97);
  --dm-shadow:   0 2px 16px rgba(0,0,0,0.4);
}

/* ---------- DARK MODE — APLICAÇÃO ---------- */
[data-theme="dark"] body {
  background: var(--dm-bg) !important;
  color: var(--dm-text) !important;
}

[data-theme="dark"] nav {
  background: var(--dm-nav-bg) !important;
}

[data-theme="dark"] .exp-card,
[data-theme="dark"] .dest-card,
[data-theme="dark"] .offer-card,
[data-theme="dark"] .how-card,
[data-theme="dark"] .stat-card {
  background: var(--dm-card) !important;
  border-color: var(--dm-border) !important;
  color: var(--dm-text) !important;
}

[data-theme="dark"] .exp-card p,
[data-theme="dark"] .dest-card p,
[data-theme="dark"] .offer-card p,
[data-theme="dark"] .how-card p {
  color: var(--dm-text-sec) !important;
}

[data-theme="dark"] .drawer,
[data-theme="dark"] .modal,
[data-theme="dark"] .admin-content,
[data-theme="dark"] .admin-tabs {
  background: var(--dm-card) !important;
  color: var(--dm-text) !important;
}

[data-theme="dark"] .drawer-header,
[data-theme="dark"] .checkout-summary,
[data-theme="dark"] .form-group input,
[data-theme="dark"] .form-group select,
[data-theme="dark"] .form-group textarea,
[data-theme="dark"] .modal input,
[data-theme="dark"] .modal select,
[data-theme="dark"] .modal textarea {
  background: var(--dm-surface) !important;
  border-color: var(--dm-border) !important;
  color: var(--dm-text) !important;
}

[data-theme="dark"] .payment-tabs,
[data-theme="dark"] .pay-tab {
  background: var(--dm-surface) !important;
  border-color: var(--dm-border) !important;
  color: var(--dm-text-sec) !important;
}

[data-theme="dark"] .pay-tab.active {
  background: var(--primary) !important;
  color: white !important;
}

[data-theme="dark"] .filter-btn {
  background: var(--dm-surface) !important;
  border-color: var(--dm-border) !important;
  color: var(--dm-text-sec) !important;
}

[data-theme="dark"] .filter-btn.active {
  background: var(--primary) !important;
  color: white !important;
  border-color: var(--primary) !important;
}

[data-theme="dark"] .pix-box,
[data-theme="dark"] .trust-section,
[data-theme="dark"] .data-actions {
  background: var(--dm-surface) !important;
}

[data-theme="dark"] .admin-table th {
  background: var(--dm-surface) !important;
  color: var(--dm-text-sec) !important;
}

[data-theme="dark"] .admin-table td {
  border-color: var(--dm-border) !important;
  color: var(--dm-text) !important;
}

[data-theme="dark"] .admin-table tr:hover td {
  background: rgba(45,106,46,0.08) !important;
}

/* ---------- DARK MODE TOGGLE BUTTON ---------- */
.dm-toggle {
  position: fixed;
  bottom: 2rem;
  right: 1.2rem;
  z-index: 999;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: none;
  background: var(--primary);
  color: white;
  font-size: 1.2rem;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(0,0,0,0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  -webkit-tap-highlight-color: rgba(0,0,0,0);
  touch-action: manipulation;
}
.dm-toggle:hover { transform: scale(1.1); background: var(--primary-light); }
.dm-toggle:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 3px;
}
[data-theme="dark"] .dm-toggle { background: var(--gold); color: #1a1a1a; }

/* ---------- ACESSIBILIDADE — UTILITIES ---------- */

/* Skip link para usuários de teclado / leitores de tela */
.skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  background: var(--primary);
  color: #fff;
  padding: 8px 16px;
  text-decoration: none;
  font-weight: 700;
  z-index: 10000;
  border-radius: 0 0 8px 0;
}
.skip-link:focus {
  top: 0;
  outline: 3px solid var(--gold);
  outline-offset: -3px;
}

/* Visually hidden — só leitor de tela enxerga */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Foco visível padrão — não remover outline indiscriminadamente */
:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

/* Restaurar foco visível em <summary> que muitos sites zeram */
summary:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

/* ---------- prefers-reduced-motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

/* ---------- SKELETON LOADING ---------- */
@keyframes shimmer {
  0%   { background-position: -600px 0; }
  100% { background-position: 600px 0; }
}

.skeleton {
  background: linear-gradient(90deg, #e8e8e8 25%, #f5f5f5 50%, #e8e8e8 75%);
  background-size: 600px 100%;
  animation: shimmer 1.4s infinite linear;
  border-radius: 8px;
}

[data-theme="dark"] .skeleton {
  background: linear-gradient(90deg, #252b3b 25%, #2e3548 50%, #252b3b 75%);
  background-size: 600px 100%;
}

.skel-card {
  background: white;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid #e0e0e0;
}
[data-theme="dark"] .skel-card {
  background: #1e2534;
  border-color: #2a3040;
}
.skel-image { height: 200px; }
.skel-body { padding: 1.4rem; }
.skel-line { height: 14px; margin-bottom: 10px; border-radius: 6px; }
.skel-line.short { width: 60%; }
.skel-line.medium { width: 80%; }

/* ---------- SOCIAL PROOF BADGE ---------- */
.social-proof-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: rgba(245, 197, 24, 0.15);
  border: 1px solid rgba(245, 197, 24, 0.4);
  border-radius: 50px;
  padding: 0.25rem 0.8rem;
  font-size: 0.78rem;
  font-weight: 600;
  color: #664d00;
  margin-bottom: 0.5rem;
}
[data-theme="dark"] .social-proof-badge {
  background: rgba(245, 197, 24, 0.1);
  color: var(--gold);
}

/* ---------- COMPARISON PANEL ---------- */
.compare-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: #1a1a1a;
  color: white;
  padding: 0.8rem 1.5rem;
  z-index: 800;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transform: translateY(100%);
  transition: transform 0.3s ease;
  gap: 1rem;
  flex-wrap: wrap;
}
.compare-bar.visible { transform: translateY(0); }
.compare-bar .compare-items { display: flex; gap: 0.8rem; flex-wrap: wrap; flex: 1; }
.compare-chip {
  background: rgba(255,255,255,0.15);
  border-radius: 50px;
  padding: 0.3rem 0.8rem;
  font-size: 0.82rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.compare-chip button {
  background: none;
  border: none;
  color: white;
  cursor: pointer;
  font-size: 0.9rem;
  padding: 0;
  line-height: 1;
}
.compare-bar .compare-btn {
  background: var(--gold);
  color: #1a1a1a;
  border: none;
  padding: 0.5rem 1.2rem;
  border-radius: 50px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  font-size: 0.88rem;
}

/* ---------- COMPARE MODAL ---------- */
.compare-modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.7);
  z-index: 5000;
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding: 2rem 1rem;
  overflow-y: auto;
}
.compare-modal-overlay.active { display: flex; }
.compare-modal {
  background: white;
  border-radius: 16px;
  padding: 2rem;
  width: 100%;
  max-width: 900px;
  margin: auto;
}
[data-theme="dark"] .compare-modal { background: #1e2534; color: #e8eaf0; }
.compare-modal h3 { margin-bottom: 1.5rem; }
.compare-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.compare-table th {
  background: #f5f5f5;
  padding: 0.8rem;
  text-align: left;
  border-bottom: 2px solid #e0e0e0;
}
[data-theme="dark"] .compare-table th { background: #252b3b; border-color: #2a3040; }
.compare-table td { padding: 0.7rem 0.8rem; border-bottom: 1px solid #e0e0e0; vertical-align: middle; }
[data-theme="dark"] .compare-table td { border-color: #2a3040; }
.compare-table .highlight td { background: rgba(45,106,46,0.06); }
[data-theme="dark"] .compare-table .highlight td { background: rgba(45,106,46,0.15); }
.compare-close {
  background: none; border: none; font-size: 1.5rem;
  cursor: pointer; float: right; color: #666;
}
.compare-close:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
  border-radius: 4px;
}
