/* ============================================================
   MAIANDI SOLUTIONS — Base Styles (reset, tokens, typography)
   ============================================================ */

/* ---- Theme tokens (clear) ---- */
:root {
  --navy-deep: #0c1a4d;
  --royal-blue: #173ea6;
  --royal-blue-light: #2b52c9;
  --gold: #e3bd74;
  --gold-dark: #c99a48;
  --red: #e0473e;
  --green: #2d8a4e;
  --cream: #faf9f6;
  --ink: #15171d;
  --ink-soft: #6c7080;
  --line: #e7e5df;
  --line-dark: #2a2d38;
  --radius: 8px;
  --radius-sm: 4px;
  --radius-lg: 12px;
  --bg: #faf9f6;
  --bg-panel: #ffffff;
  --bg-panel-light: #ffffff;
  --hero-overlay: rgba(255,255,255,.03);
  --shadow-sm: 0 1px 4px rgba(0,0,0,.06);
  --shadow-md: 0 4px 16px rgba(12,26,77,.10);
  --shadow-lg: 0 8px 28px rgba(12,26,77,.14);
  --font-serif: 'Cormorant Garamond', serif;
  --font-sans: 'Inter', sans-serif;
  --font-condensed: 'Inter', sans-serif;
  --nav-height: 56px;
  --sidebar-width: 240px;
  --header-height: 84px;
  --product-gap: 8px;
  --product-radius: 6px;
}

/* ---- Theme tokens (dark) ---- */
.dark {
  --navy-deep: #1a1a2e;
  --royal-blue: #3a5fcf;
  --royal-blue-light: #5a7fe0;
  --gold: #e3bd74;
  --gold-dark: #d4a85a;
  --red: #e85a52;
  --green: #3da066;
  --cream: #1a1a2e;
  --ink: #e8e6e3;
  --ink-soft: #9a97a0;
  --line: #2a2d38;
  --line-dark: #2a2d38;
  --bg: #0b0c10;
  --bg-panel: #15171d;
  --bg-panel-light: #1c1f28;
  --hero-overlay: rgba(0,0,0,.1);
  --shadow-sm: 0 1px 4px rgba(0,0,0,.3);
  --shadow-md: 0 4px 16px rgba(0,0,0,.4);
  --shadow-lg: 0 8px 28px rgba(0,0,0,.5);
}

/* ---- Reset ---- */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-sans);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  transition: background .35s ease, color .35s ease;
}
h1, h2, h3, h4, h5, h6, .brand-name { font-family: var(--font-serif); font-weight: 700; }
main { padding-top: var(--header-height); }
a { text-decoration: none; color: inherit; }
img { max-width: 100%; display: block; height: auto; }
ul, ol { list-style: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }
input, select, textarea { font-family: inherit; font-size: inherit; }
table { border-collapse: collapse; width: 100%; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

/* ---- Selection ---- */
::selection{background:var(--gold);color:#15171d;}
.dark ::selection{background:var(--gold-dark);color:#fff;}

/* ---- Scrollbar ---- */
::-webkit-scrollbar{width:8px;height:8px;}
::-webkit-scrollbar-track{background:var(--bg);}
::-webkit-scrollbar-thumb{background:var(--line);border-radius:4px;}
::-webkit-scrollbar-thumb:hover{background:var(--ink-soft);}
.dark ::-webkit-scrollbar-thumb{background:#3a3a3a;}
.dark ::-webkit-scrollbar-thumb:hover{background:#555;}

/* ---- Utilities ---- */
.wrap,
.container { width: 100%; max-width: 1280px; margin: 0 auto; padding: 0 20px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; }
.text-center { text-align: center; }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-sm { gap: 8px; }
.gap-md { gap: 16px; }
.gap-lg { gap: 24px; }
.mt-sm { margin-top: 8px; }
.mt-md { margin-top: 16px; }
.mt-lg { margin-top: 24px; }
.mb-md { margin-bottom: 16px; }
.mb-lg { margin-bottom: 24px; }
.block-section { padding: 24px 0; }

/* ---- Page Loader ---- */
.page-loader{position:fixed;inset:0;z-index:9999;display:flex;align-items:center;justify-content:center;background:var(--bg);transition:opacity .5s ease,visibility .5s ease;}
.page-loader.hidden{opacity:0;visibility:hidden;pointer-events:none;}
.loader-spinner{width:48px;height:48px;border:4px solid var(--line);border-top-color:var(--gold);border-radius:50%;animation:spin .8s linear infinite;}
.loader-text{margin-top:16px;font-size:.82rem;color:var(--ink-soft);font-weight:500;letter-spacing:.08em;text-transform:uppercase;}
.loader-inner{display:flex;flex-direction:column;align-items:center;}
@keyframes spin{to{transform:rotate(360deg)}}

/* ---- Page Transitions ---- */
.page-fade-in{animation:fadeIn .45s ease forwards;}

/* ---- Animations ---- */
@keyframes fadeInUp { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: translateY(0); } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes float { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }
@keyframes pulseGlow { 0%,100% { box-shadow: 0 0 0 0 rgba(227,189,116,.4); } 50% { box-shadow: 0 0 0 12px rgba(227,189,116,0); } }
@keyframes shimmer { 0% { background-position: -200% 0; } 100% { background-position: 200% 0; } }
@keyframes slideInRight { from { transform: translateX(100%); } to { transform: translateX(0); } }
@keyframes slideOutRight { from { transform: translateX(0); } to { transform: translateX(100%); } }
@keyframes scaleIn { from { transform: scale(.94); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes skeletonPulse { 0%,100% { opacity: .6; } 50% { opacity: 1; } }
.skeleton { background: var(--line); border-radius: var(--radius-sm); animation: skeletonPulse 1.2s ease-in-out infinite; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
  html { scroll-behavior: auto; }
  .reveal, .stagger > * { opacity: 1; transform: none; transition: none; }
}

/* ---- Entrada suave ao rolar (scroll-triggered stagger — um a um) ----
   Os filhos começam invisíveis; quando o bloco entra no viewport, o
   animations.js adiciona .entrada-feita e a animação corre em cascata. */
.animar-entrada > * {
  opacity: 0;
  transform: translateY(18px);
}
.animar-entrada.entrada-feita > * {
  animation: fadeInUp .65s cubic-bezier(.22,.61,.36,1) forwards;
}
.animar-entrada.entrada-feita > *:nth-child(1) { animation-delay: .05s; }
.animar-entrada.entrada-feita > *:nth-child(2) { animation-delay: .12s; }
.animar-entrada.entrada-feita > *:nth-child(3) { animation-delay: .19s; }
.animar-entrada.entrada-feita > *:nth-child(4) { animation-delay: .26s; }
.animar-entrada.entrada-feita > *:nth-child(5) { animation-delay: .33s; }
.animar-entrada.entrada-feita > *:nth-child(6) { animation-delay: .40s; }
.animar-entrada.entrada-feita > *:nth-child(7) { animation-delay: .47s; }
.animar-entrada.entrada-feita > *:nth-child(8) { animation-delay: .54s; }
.animar-entrada.entrada-feita > *:nth-child(9) { animation-delay: .61s; }
.animar-entrada.entrada-feita > *:nth-child(10) { animation-delay: .68s; }
.animar-entrada.entrada-feita > *:nth-child(n+11) { animation-delay: .75s; }
/* Sem JS: conteúdo sempre visível (evita "piscar"/conteúdo invisível) */
html.no-js .animar-entrada > * { opacity: 1; transform: none; animation: none; }

/* ---- Scroll Reveal (sem flicker: fallback visível sem JS) ---- */
.reveal { opacity: 1; transform: none; transition: opacity .6s cubic-bezier(.25,.46,.45,.94), transform .6s cubic-bezier(.25,.46,.45,.94); }
.reveal.show { opacity: 1; transform: translateY(0); }
html.js .reveal:not(.show) { opacity: 0; transform: translateY(18px); }
.reveal-d1 { transition-delay: .1s; }
.reveal-d2 { transition-delay: .2s; }
.reveal-d3 { transition-delay: .3s; }
.reveal-d4 { transition-delay: .4s; }
.reveal-d5 { transition-delay: .5s; }

/* ---- Responsive ---- */
@media (max-width: 1180px) { :root { --sidebar-width: 220px; } }
.wrap, .container { padding: 0 12px; }
@media (min-width: 768px) { .wrap, .container { padding: 0 24px; } }
@media (min-width: 1024px) { .wrap, .container { padding: 0 32px; } }

/* Admin layout uses fixed sidebar, no wrap */
.admin-sidebar,
.admin-topbar,
.admin-main{box-sizing:border-box;}
