/* =========================================================
   ELE & ELA: Joias & Personalizados
   Design tokens + base + componentes globais
   ========================================================= */

:root {
  /* Paleta extraída da identidade visual (anel dourado + marfim) */
  --ivory-rgb: 250, 246, 236;
  --ivory: #FAF6EC;
  --ivory-deep: #F1EADA;
  --ink: #423C2F;
  --ink-soft: #6B6252;
  --taupe: #B39B63;       /* tom das letras E&E do logo */
  --gold-deep: #A9790D;
  --gold: #DDA520;
  --gold-light: #F0CE6B;
  --line: #E2D8BF;
  --white: #FFFFFF;
  --surface: #FFFFFF;
  /* Faixas propositalmente escuras (rodape, cabecalho do chat) que devem
     continuar escuras nos dois temas, em vez de trocar com --ink/--ivory. */
  --ink-fixed: #423C2F;
  --cream-fixed: #FAF6EC;
  --error: #A3402F;
  --success: #4C6B4F;
  --success-bg: #E7EEE3;
  --success-border: #C7D8BF;
  --error-bg: #F4E3DE;
  --error-border: #E5C1B4;

  --font-display: 'Cormorant Garamond', serif;
  --font-body: 'Jost', sans-serif;

  --radius: 2px;
  --shadow-soft: 0 12px 30px -18px rgba(66, 60, 47, 0.35);
  --max-width: 1180px;
}

/* Modo escuro: segue a preferencia do sistema por padrao, ou a escolha
   manual salva pelo botao de tema (data-theme no <html>, ver theme.js). */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ivory-rgb: 28, 25, 18;
    --ivory: #1C1912;
    --ivory-deep: #14120D;
    --ink: #F1EADA;
    --ink-soft: #C4BAA4;
    --taupe: #D6C48C;
    --gold-deep: #F0CE6B;
    --gold: #DDA520;
    --gold-light: #A9790D;
    --line: #3A3527;
    --surface: #26221A;
    --error: #E08B76;
    --success: #8FBF95;
    --success-bg: #23301F;
    --success-border: #3B4E36;
    --error-bg: #3A2620;
    --error-border: #5A362C;
    --shadow-soft: 0 12px 30px -18px rgba(0, 0, 0, 0.6);
  }
}
:root[data-theme="dark"] {
  --ivory-rgb: 28, 25, 18;
  --ivory: #1C1912;
  --ivory-deep: #14120D;
  --ink: #F1EADA;
  --ink-soft: #C4BAA4;
  --taupe: #D6C48C;
  --gold-deep: #F0CE6B;
  --gold: #DDA520;
  --gold-light: #A9790D;
  --line: #3A3527;
  --surface: #26221A;
  --error: #E08B76;
  --success: #8FBF95;
  --success-bg: #23301F;
  --success-border: #3B4E36;
  --error-bg: #3A2620;
  --error-border: #5A362C;
  --shadow-soft: 0 12px 30px -18px rgba(0, 0, 0, 0.6);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; color-scheme: light; }
@media (prefers-color-scheme: dark) {
  html:not([data-theme="light"]) { color-scheme: dark; }
}
html[data-theme="dark"] { color-scheme: dark; }

body {
  margin: 0;
  background: var(--ivory);
  color: var(--ink);
  font-family: var(--font-body);
  font-weight: 300;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 500;
  color: var(--ink);
  margin: 0 0 0.5em;
  line-height: 1.15;
}

h1 { font-size: clamp(2.4rem, 4vw, 3.6rem); font-weight: 600; }
h2 { font-size: clamp(1.8rem, 2.6vw, 2.4rem); }
h3 { font-size: 1.4rem; }

p { margin: 0 0 1em; color: var(--ink-soft); max-width: 62ch; }

a { color: inherit; text-decoration: none; }

img { max-width: 100%; display: block; }

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
}

.section { padding: 5rem 0; }
.section--tight { padding: 3rem 0; }

.eyebrow {
  font-family: var(--font-body);
  letter-spacing: 0.04em;
  color: var(--gold-deep);
  font-size: 0.95rem;
  margin-bottom: 0.6rem;
  display: inline-block;
}

.divider-mark {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  color: var(--gold);
  margin: 1.4rem 0;
}
.divider-mark::before,
.divider-mark::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--line);
}
.divider-mark span {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.3rem;
}

/* ---------- Botões ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.85rem 1.9rem;
  border: 1px solid transparent;
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-size: 0.95rem;
  cursor: pointer;
  transition: transform 0.25s ease, box-shadow 0.25s ease, background 0.25s ease, color 0.25s ease;
}
.btn-primary {
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, var(--gold-deep), var(--gold) 55%, var(--gold-light));
  color: var(--white);
}
.btn-primary:hover { box-shadow: var(--shadow-soft); transform: translateY(-1px); }
/* Brilho sutil que "varre" o botão no hover, efeito comum em sites com
   acabamento mais premium. */
.btn-primary::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(115deg, transparent 30%, rgba(255,255,255,0.35) 48%, transparent 66%);
  transform: translateX(-120%);
  transition: transform 0.6s ease;
  pointer-events: none;
}
.btn-primary:hover::after { transform: translateX(120%); }
.btn-outline {
  background: transparent;
  border-color: var(--ink);
  color: var(--ink);
}
.btn-outline:hover { background: var(--ink); color: var(--ivory); }
.btn-ghost {
  background: transparent;
  color: var(--gold-deep);
  padding: 0.6rem 0.2rem;
  border-bottom: 1px solid var(--gold-deep);
  border-radius: 0;
}
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-block { width: 100%; justify-content: center; }
.btn-danger { color: var(--error); border-color: var(--error); background: transparent; }

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(var(--ivory-rgb), 0.92);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--line);
}
.site-update-banner {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.7rem;
  padding: 0.6rem 1rem;
  background: linear-gradient(135deg, var(--gold-deep), var(--gold));
  color: var(--white);
  font-size: 0.85rem;
  font-weight: 500;
  text-align: center;
}
.site-update-banner button {
  background: var(--white);
  color: var(--gold-deep);
  border: none;
  border-radius: 999px;
  padding: 0.3rem 0.9rem;
  font-weight: 600;
  font-size: 0.8rem;
  cursor: pointer;
  font-family: var(--font-body);
}
.site-update-banner button:hover { filter: brightness(0.97); }

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.9rem 1.5rem;
  max-width: var(--max-width);
  margin: 0 auto;
}
.brand {
  display: flex;
  align-items: center;
  gap: 0.7rem;
}
.brand img { height: 48px; width: 48px; object-fit: contain; }
.brand-text {
  font-family: var(--font-display);
  font-size: 1.25rem;
  color: var(--ink);
  line-height: 1.1;
}
.brand-text small {
  display: block;
  font-family: var(--font-body);
  font-size: 0.62rem;
  letter-spacing: 0.12em;
  color: var(--gold-deep);
}
/* Menu lateral (sidebar) - usado em todos os tamanhos de tela, aberto pelo
   botao hamburguer (.nav-toggle) no cabecalho. Fica fora do fluxo normal,
   deslizando de fora da tela quando fechado. */
.main-nav {
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  width: min(300px, 82vw);
  background: var(--ivory);
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0;
  padding: 0 1.6rem 2rem;
  transform: translateX(-100%);
  transition: transform 0.3s ease;
  z-index: 80;
  box-shadow: var(--shadow-soft);
  overflow-y: auto;
}
.main-nav.is-open { transform: translateX(0); }
.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.4rem 0 1rem;
  margin-bottom: 0.5rem;
  border-bottom: 1px solid var(--line);
}
.sidebar-header__brand { font-family: var(--font-display); font-size: 1.2rem; color: var(--ink); }
.sidebar-close {
  background: none;
  border: none;
  color: var(--ink-soft);
  cursor: pointer;
  display: inline-flex;
  padding: 0.3rem;
}
.sidebar-close:hover { color: var(--ink); }
.main-nav a {
  font-size: 1.05rem;
  color: var(--ink-soft);
  position: relative;
  padding: 0.95rem 0;
  border-bottom: 1px solid var(--line);
}
.main-nav a:hover,
.main-nav a[aria-current="page"] { color: var(--ink); }
.main-nav a[aria-current="page"] { color: var(--gold-deep); }
.nav-overlay {
  position: fixed;
  inset: 0;
  background: rgba(20, 17, 10, 0.45);
  z-index: 75;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}
.nav-overlay.is-open { opacity: 1; pointer-events: auto; }

.sidebar-extras {
  margin-top: auto;
  padding-top: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  border-top: 1px solid var(--line);
}
.lang-switcher { display: inline-flex; gap: 0.35rem; }
.lang-switcher button {
  border: 1px solid var(--line);
  background: transparent;
  font-size: 1.15rem;
  line-height: 1;
  width: 2.1rem;
  height: 2.1rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border-radius: 50%;
  cursor: pointer;
  opacity: 0.55;
  transition: opacity 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}
.lang-switcher button:hover { opacity: 0.85; transform: translateY(-1px); }
.lang-switcher button.is-active { opacity: 1; border-color: var(--gold-deep); box-shadow: 0 0 0 1px var(--gold-deep); }
.theme-toggle {
  border: 1px solid var(--line);
  background: transparent;
  color: var(--ink-soft);
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
}
.theme-toggle:hover { color: var(--gold-deep); border-color: var(--gold-deep); }
.header-actions { display: flex; align-items: center; gap: 1.1rem; }
.install-app-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 0.9rem;
  border: none;
  border-radius: var(--radius);
  background: linear-gradient(135deg, var(--gold-deep), var(--gold) 55%, var(--gold-light));
  color: var(--white);
  font-family: var(--font-body);
  font-size: 0.82rem;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.install-app-btn svg { flex-shrink: 0; }
.install-app-btn:hover { box-shadow: var(--shadow-soft); transform: translateY(-1px); }
@media (max-width: 640px) {
  .install-app-btn span { display: none; }
  .install-app-btn { padding: 0.55rem; }
}
@media (max-width: 480px) {
  /* Cabecalho apertado no celular - some com a tagline e encolhe a logo/o
     titulo pra sobrar espaco pros botoes de acao sem embolar tudo junto. */
  .brand-text small { display: none; }
  .brand-text { font-size: 1.05rem; }
  .brand img { height: 38px; width: 38px; }
  .site-header__inner { padding: 0.7rem 1rem; gap: 0.5rem; }
  .header-actions { gap: 0.6rem; }
}
.cart-link {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.9rem;
}
.cart-count {
  background: var(--gold-deep);
  color: var(--white);
  font-size: 0.72rem;
  min-width: 18px;
  height: 18px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
}
.nav-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.4rem;
}
.nav-toggle span, .nav-toggle span::before, .nav-toggle span::after {
  content: '';
  display: block;
  width: 22px;
  height: 1px;
  background: var(--ink);
  position: relative;
  transition: 0.2s;
}
.nav-toggle span::before { position: absolute; top: -7px; width: 22px; }
.nav-toggle span::after { position: absolute; top: 7px; width: 22px; }

/* ---------- Footer ---------- */
.site-footer {
  background: var(--ink-fixed);
  color: #D9D2BE;
  padding: 3.5rem 0 1.5rem;
  margin-top: 5rem;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 2.5rem;
  margin-bottom: 2.5rem;
}
.footer-grid h4 { color: var(--cream-fixed); font-size: 1.05rem; }
.footer-grid p, .footer-grid a { color: #C9C1AE; font-size: 0.92rem; }
.footer-grid ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.5rem; }
.footer-grid a:hover { color: var(--gold-light); }
.footer-grid .info-list { gap: 0.55rem; }
.footer-grid .info-list li { display: flex; flex-wrap: wrap; gap: 0.4rem; color: #C9C1AE; font-size: 0.92rem; }
.footer-grid .info-list strong { color: var(--cream-fixed); min-width: 78px; font-weight: 500; }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.12);
  padding-top: 1.3rem;
  font-size: 0.8rem;
  color: #9C947F;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.footer-bottom a { color: #9C947F; text-decoration: underline; text-underline-offset: 2px; }
.footer-bottom a:hover { color: var(--gold-light); }

/* ---------- Formulários ---------- */
.form-field { margin-bottom: 1.3rem; }
.form-field label {
  display: block;
  font-size: 0.85rem;
  color: var(--ink-soft);
  margin-bottom: 0.4rem;
}
.form-field input,
.form-field select,
.form-field textarea {
  width: 100%;
  padding: 0.75rem 0.9rem;
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-size: 0.95rem;
  color: var(--ink);
}
.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(201, 161, 59, 0.18);
}
.form-field textarea { resize: vertical; min-height: 110px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.form-error {
  color: var(--error);
  font-size: 0.82rem;
  margin-top: 0.3rem;
  display: none;
}
.form-field.has-error input,
.form-field.has-error textarea,
.form-field.has-error select { border-color: var(--error); }
.form-field.has-error .form-error { display: block; }
.form-hint {
  color: var(--ink-soft);
  font-size: 0.82rem;
  margin-top: 0.3rem;
}

.alert {
  padding: 1rem 1.2rem;
  border-radius: var(--radius);
  font-size: 0.92rem;
  margin-bottom: 1.5rem;
  display: none;
}
.alert.is-visible { display: block; }
.alert-success { background: var(--success-bg); color: var(--success); border: 1px solid var(--success-border); }
.alert-error { background: var(--error-bg); color: var(--error); border: 1px solid var(--error-border); }

/* Foco visível para acessibilidade */
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible {
  outline: 2px solid var(--gold-deep);
  outline-offset: 2px;
}

/* ---------- Animações e microinterações ---------- */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Cabeçalho ganha uma sombra mais forte depois que a página rola, como se
   "flutuasse" sobre o conteúdo (main.js alterna a classe no scroll). */
.site-header { transition: box-shadow 0.25s ease; }
.site-header.is-scrolled { box-shadow: 0 8px 24px -16px rgba(66, 60, 47, 0.35); }

/* Blocos de conteúdo revelados com fade + leve deslize conforme entram na
   tela (ver initScrollReveal em main.js). A classe .reveal só é aplicada
   via JS, então sem JS o conteúdo já nasce visível normalmente. */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
.reveal.is-revealed { opacity: 1; transform: translateY(0); }

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
  html { scroll-behavior: auto; }
  .reveal { opacity: 1 !important; transform: none !important; }
}

@media (max-width: 860px) {
  .footer-grid { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
}
