/* =========================================================
   SUA LOJA AQUI — Design System
   Paleta: tinta profunda + latão envelhecido + marfim
   Tipografia: Fraunces (display) + Inter (texto)
   ========================================================= */

@import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,400;9..144,500;9..144,600;9..144,700&family=Inter:wght@400;500;600;700&display=swap');

:root {
  --ink: #16211d;
  --ink-soft: #2a3630;
  --paper: #f6f4ef;
  --paper-alt: #efece3;
  --brass: #a9793f;
  --brass-dark: #8a6130;
  --pine: #24493c;
  --pine-light: #e7efe9;
  --line: #ddd7c9;
  --white: #ffffff;
  --danger: #b23a34;
  --success: #2f6b4f;
  --radius-sm: 4px;
  --radius-md: 8px;
  --shadow: 0 8px 24px rgba(22, 33, 29, 0.08);
  --shadow-sm: 0 2px 8px rgba(22, 33, 29, 0.06);
  --maxw: 1240px;

  /* "Chrome" do site: topbar, header e footer ficam sempre nesse tom escuro,
     independente do tema claro/escuro escolhido pelo cliente (só o conteúdo
     das páginas muda de tema). */
  --chrome-bg: #14171a;
  --chrome-bg-soft: #1b1e21;
  --chrome-text: #f4f2ec;
  --chrome-text-mute: #a9b0a3;
  --chrome-border: rgba(255, 255, 255, 0.09);

  /* Barra de categorias: acompanha o tema (fica mais clara/suave no escuro) */
  --navbar-bg: var(--pine);
  --navbar-text: var(--pine-light);
}

body.tema-escuro {
  --ink: #ece9e2;
  --ink-soft: #bdc3ba;
  --paper: #1b1d1c;
  --paper-alt: #232625;
  --pine-light: #202b26;
  --line: #343836;
  --white: #232625;

  /* Barra de categorias num tom mais suave no escuro, sem perder identidade */
  --navbar-bg: #26332d;
  --navbar-text: #d7ddd2;
}
body.tema-escuro .header,
body.tema-escuro .produto-card,
body.tema-escuro .categoria-card,
body.tema-escuro .card,
body.tema-escuro input,
body.tema-escuro select,
body.tema-escuro textarea { background: var(--white); color: var(--ink); }
body.tema-escuro .galeria-principal { background: var(--white); }

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: 'Inter', -apple-system, sans-serif;
  color: var(--ink);
  background: var(--paper);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4, .display {
  font-family: 'Fraunces', Georgia, serif;
  font-weight: 600;
  line-height: 1.15;
  margin: 0 0 0.5em;
  letter-spacing: -0.01em;
}
p { margin: 0 0 1em; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
ul { list-style: none; margin: 0; padding: 0; }
button { font-family: inherit; cursor: pointer; }
input, select, textarea {
  font-family: inherit;
  font-size: 15px;
  padding: 11px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--white);
  color: var(--ink);
  width: 100%;
}
input:focus, select:focus, textarea:focus {
  outline: 2px solid var(--brass);
  outline-offset: 1px;
  border-color: var(--brass);
}
label { font-size: 13px; font-weight: 600; color: var(--ink-soft); display: block; margin-bottom: 6px; }
.container { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 26px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 14.5px;
  border: 1px solid transparent;
  transition: all .18s ease;
}
.btn-primary { background: var(--ink); color: var(--paper); }
.btn-primary:hover { background: var(--pine); }
.btn-brass { background: var(--brass); color: var(--white); }
.btn-brass:hover { background: var(--brass-dark); }
.btn-outline { background: transparent; border-color: var(--ink); color: var(--ink); }
.btn-outline:hover { background: var(--ink); color: var(--paper); }
.btn-block { width: 100%; }
.btn-sm { padding: 8px 16px; font-size: 13px; }

/* ---------- HEADER ---------- */
.topbar {
  background: var(--chrome-bg);
  color: var(--chrome-text);
  font-size: 12.5px;
  padding: 7px 0;
}
.topbar .container { display: flex; justify-content: space-between; align-items: center; }
.topbar a { opacity: .85; color: var(--chrome-text); }
.topbar a:hover { opacity: 1; }

.header {
  background: var(--chrome-bg);
  border-bottom: 1px solid var(--chrome-border);
  position: sticky; top: 0; z-index: 50;
}
.header .container {
  display: flex;
  align-items: center;
  gap: 32px;
  padding-top: 16px;
  padding-bottom: 16px;
}
.logo { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.logo img { height: 42px; }
.logo-text { font-family: 'Fraunces', serif; font-size: 22px; font-weight: 700; color: var(--chrome-text); }
.logo-text span { color: var(--brass); }

.searchbar { flex: 1; display: flex; max-width: 620px; }
.searchbar input {
  border-radius: var(--radius-sm) 0 0 var(--radius-sm); border-right: none;
  background: var(--chrome-bg-soft); border-color: var(--chrome-border); color: var(--chrome-text);
}
.searchbar input::placeholder { color: var(--chrome-text-mute); }
.searchbar button {
  background: var(--brass); color: var(--white); border: none;
  padding: 0 20px; border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}
.header-actions { display: flex; align-items: center; gap: 22px; flex-shrink: 0; }
.theme-switch {
  width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--chrome-border);
  background: var(--chrome-bg-soft); color: var(--chrome-text);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.theme-switch svg { width: 18px; height: 18px; }
.header-action { display: flex; flex-direction: column; align-items: center; font-size: 11.5px; font-weight: 600; gap: 3px; position: relative; color: var(--chrome-text); }
.header-action svg { width: 22px; height: 22px; }
.cart-badge {
  position: absolute; top: -6px; right: -10px;
  background: var(--brass); color: var(--white);
  font-size: 10px; font-weight: 700;
  width: 18px; height: 18px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
}

.navbar { background: var(--navbar-bg); }
.navbar ul { display: flex; gap: 4px; padding: 0 24px; max-width: var(--maxw); margin: 0 auto; flex-wrap: wrap; }
.navbar a { display: block; padding: 12px 16px; color: var(--navbar-text); font-size: 14px; font-weight: 500; }
.navbar a:hover { background: rgba(255,255,255,.08); }

/* ---------- BANNER CARROSSEL ---------- */
.hero-carousel { position: relative; overflow: hidden; background: var(--paper-alt); }
.hero-slides { display: flex; transition: transform .5s cubic-bezier(.4,0,.2,1); }
.hero-slide { min-width: 100%; position: relative; aspect-ratio: 21 / 7; }
.hero-slide img { width: 100%; height: 100%; object-fit: cover; }
.hero-caption {
  position: absolute; left: 6%; top: 50%; transform: translateY(-50%);
  max-width: 460px; color: var(--white);
  text-shadow: 0 2px 12px rgba(0,0,0,.35);
}
.hero-caption h2 { font-size: clamp(24px, 3.4vw, 42px); color: var(--white); }
.hero-caption p { font-size: 16px; margin-bottom: 20px; }
.hero-dots { position: absolute; bottom: 18px; left: 50%; transform: translateX(-50%); display: flex; gap: 8px; }
.hero-dot { width: 9px; height: 9px; border-radius: 50%; background: rgba(255,255,255,.5); border: none; padding: 0; cursor: pointer; }
.hero-dot.active { background: var(--white); width: 26px; border-radius: 5px; }
.hero-arrow {
  position: absolute; top: 50%; transform: translateY(-50%);
  background: rgba(255,255,255,.85); border: none; width: 42px; height: 42px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; cursor: pointer; z-index: 5;
}
.hero-arrow.prev { left: 18px; } .hero-arrow.next { right: 18px; }

/* ---------- SEÇÕES ---------- */
.section { padding: 52px 0; }
.section-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 28px; }
.section-head h2 { font-size: 28px; }
.section-head a { font-size: 13.5px; font-weight: 600; color: var(--brass); border-bottom: 1px solid var(--brass); padding-bottom: 2px; }

.categorias-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 16px; }
.categoria-card {
  background: var(--white); border: 1px solid var(--line); border-radius: var(--radius-md);
  padding: 22px 14px; text-align: center; transition: all .2s;
}
.categoria-card:hover { border-color: var(--brass); transform: translateY(-3px); box-shadow: var(--shadow-sm); }
.categoria-card img { width: 52px; height: 52px; object-fit: contain; margin: 0 auto 12px; }
.categoria-card span { font-size: 13.5px; font-weight: 600; }

.produtos-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(228px, 1fr)); gap: 20px; }
.produto-card {
  background: var(--white); border: 1px solid var(--line); border-radius: var(--radius-md);
  overflow: hidden; transition: box-shadow .2s, transform .2s; position: relative; display: flex; flex-direction: column;
}
.produto-card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.produto-thumb { aspect-ratio: 1/1; overflow: hidden; background: var(--paper-alt); }
.produto-thumb img { width: 100%; height: 100%; object-fit: cover; }
.produto-tag {
  position: absolute; top: 10px; left: 10px; background: var(--brass); color: var(--white);
  font-size: 11px; font-weight: 700; padding: 4px 9px; border-radius: 3px; letter-spacing: .02em;
}
.produto-info { padding: 14px 16px 18px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.produto-nome { font-size: 14.5px; font-weight: 500; color: var(--ink); min-height: 38px; }
.produto-preco-de { font-size: 12.5px; color: #9a9384; text-decoration: line-through; }
.produto-preco { font-family: 'Fraunces', serif; font-size: 21px; font-weight: 600; color: var(--ink); }
.produto-parcelas { font-size: 12px; color: var(--ink-soft); }
.produto-personaliza { font-size: 11.5px; color: var(--pine); font-weight: 600; display: flex; align-items: center; gap: 5px; margin-top: auto; }

.faixa-selo { background: var(--pine-light); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 22px 0; }
.selos-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px,1fr)); gap: 20px; }
.selo-item { display: flex; align-items: center; gap: 12px; font-size: 13.5px; font-weight: 600; color: var(--pine); }

/* ---------- FOOTER ---------- */
.footer { background: var(--chrome-bg); color: var(--chrome-text-mute); padding: 56px 0 0; font-size: 13.5px; }
.footer-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1.2fr; gap: 40px; padding-bottom: 40px; }
.footer h4 { color: var(--chrome-text); font-size: 13px; text-transform: uppercase; letter-spacing: .06em; font-family: Inter, sans-serif; font-weight: 700; margin-bottom: 16px; }
.footer li { margin-bottom: 10px; }
.footer a { color: var(--chrome-text-mute); }
.footer a:hover { color: var(--brass); }
.footer-bottom { border-top: 1px solid var(--chrome-border); padding: 18px 0; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; color: var(--chrome-text-mute); font-size: 12.5px; }
.footer-credito { display: flex; align-items: center; gap: 8px; }
.footer-credito img { height: 20px; width: auto; }
.footer-credito a { color: var(--chrome-text-mute); display: flex; align-items: center; gap: 8px; }
.footer-credito a:hover { color: var(--brass); }
.social-row { display: flex; gap: 10px; margin-top: 14px; }
.social-row a { width: 34px; height: 34px; border-radius: 50%; background: rgba(255,255,255,.08); display: flex; align-items: center; justify-content: center; }

/* ---------- PÁGINA DE PRODUTO ---------- */
.breadcrumb { font-size: 13px; color: #7d8378; padding: 16px 0; }
.breadcrumb a:hover { color: var(--brass); }
.produto-detalhe { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; padding: 24px 0 56px; }
.galeria-principal { aspect-ratio: 1/1; border-radius: var(--radius-md); overflow: hidden; background: var(--white); border: 1px solid var(--line); margin-bottom: 12px; }
.galeria-principal img { width: 100%; height: 100%; object-fit: cover; }
.galeria-thumbs { display: flex; gap: 10px; }
.galeria-thumbs img { width: 68px; height: 68px; object-fit: cover; border-radius: var(--radius-sm); border: 2px solid transparent; cursor: pointer; }
.galeria-thumbs img.active { border-color: var(--brass); }

.produto-detalhe h1 { font-size: 30px; }
.preco-box { margin: 18px 0; padding: 18px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.preco-atual { font-family: 'Fraunces', serif; font-size: 34px; font-weight: 700; }
.campo-personalizacao { margin-bottom: 18px; }
.qtd-selector { display: flex; align-items: center; border: 1px solid var(--line); border-radius: var(--radius-sm); width: fit-content; }
.qtd-selector button { width: 40px; height: 42px; background: var(--paper-alt); border: none; font-size: 18px; }
.qtd-selector input { width: 54px; text-align: center; border: none; }

.tabs { display: flex; gap: 24px; border-bottom: 1px solid var(--line); margin: 40px 0 24px; }
.tab-btn { padding: 12px 2px; font-weight: 600; font-size: 14px; color: #8b8f83; border-bottom: 2px solid transparent; background: none; border-top: none; border-left: none; border-right: none; }
.tab-btn.active { color: var(--ink); border-color: var(--brass); }

/* ---------- CARRINHO / CHECKOUT ---------- */
.checkout-grid { display: grid; grid-template-columns: 1.6fr 1fr; gap: 40px; align-items: start; }
.card { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius-md); padding: 24px; }
.cart-line { display: flex; gap: 16px; padding: 16px 0; border-bottom: 1px solid var(--line); }
.cart-line img { width: 84px; height: 84px; object-fit: cover; border-radius: var(--radius-sm); }
.resumo-linha { display: flex; justify-content: space-between; font-size: 14px; padding: 8px 0; }
.resumo-linha.total { font-weight: 700; font-size: 18px; border-top: 1px solid var(--line); padding-top: 14px; margin-top: 6px; }
.step-indicator { display: flex; gap: 8px; margin-bottom: 28px; }
.step-indicator span { flex: 1; height: 4px; background: var(--line); border-radius: 2px; }
.step-indicator span.done { background: var(--brass); }

.metodo-pagamento { display: flex; gap: 12px; margin: 16px 0; }
.metodo-pagamento label {
  flex: 1; border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 14px; text-align: center; cursor: pointer; font-size: 13px; font-weight: 600; margin: 0;
}
.metodo-pagamento input { width: auto; display: inline; }
.metodo-pagamento input:checked + span { color: var(--brass); }

/* ---------- FORMS GENÉRICOS / AUTH ---------- */
.auth-box { max-width: 420px; margin: 60px auto; }
.auth-box .card { }
.form-row { margin-bottom: 16px; }
.form-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.alert { padding: 12px 16px; border-radius: var(--radius-sm); font-size: 14px; margin-bottom: 16px; }
.alert-error { background: #fbeceb; color: var(--danger); border: 1px solid #f1cac7; }
.alert-success { background: #e9f3ee; color: var(--success); border: 1px solid #c6e2d4; }

.badge { display: inline-block; padding: 3px 10px; border-radius: 20px; font-size: 11.5px; font-weight: 700; }
.badge-pago { background: #e2f1e8; color: var(--success); }
.badge-pendente { background: #fdf1de; color: #9a6a12; }
.badge-cancelado { background: #fbeceb; color: var(--danger); }
.badge-enviado { background: #e3eaf5; color: #2d4f8f; }

/* ---------- RESPONSIVO ---------- */
@media (max-width: 960px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .produto-detalhe, .checkout-grid { grid-template-columns: 1fr; gap: 28px; }
  .form-grid-2 { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .searchbar { order: 3; max-width: 100%; flex-basis: 100%; }
  .header .container { flex-wrap: wrap; }
  .navbar ul { overflow-x: auto; flex-wrap: nowrap; -webkit-overflow-scrolling: touch; }
  .footer-grid { grid-template-columns: 1fr; }
  .hero-slide { aspect-ratio: 4/3; }
  .section { padding: 34px 0; }
  .section-head { flex-wrap: wrap; gap: 8px; }
  .section-head h2 { font-size: 22px; }
  .metodo-pagamento { flex-direction: column; }
  .produtos-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
  .produto-nome { min-height: auto; font-size: 13.5px; }
  .preco-atual { font-size: 26px; }
  .galeria-thumbs img { width: 54px; height: 54px; }
  .tabs { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .tabs .tab-btn { white-space: nowrap; }
  .container { padding: 0 16px; }
  .topbar .container { flex-direction: column; gap: 2px; text-align: center; font-size: 11.5px; }
  .header .container { padding-top: 12px; padding-bottom: 12px; gap: 12px; }
  .logo img { height: 34px; }
  .header-actions { gap: 14px; }
  .header-action span, .header-action { font-size: 10.5px; }
  .cart-line { flex-wrap: wrap; }
  .cart-line img { width: 64px; height: 64px; }
}
@media (max-width: 420px) {
  .categorias-grid { grid-template-columns: repeat(3, 1fr); }
  .produtos-grid { grid-template-columns: repeat(2, 1fr); }
  .btn { padding: 11px 18px; font-size: 13.5px; }
  .hero-caption { left: 5%; max-width: 80%; }
  .hero-caption h2 { font-size: 20px; }
  .hero-caption p { font-size: 13px; margin-bottom: 12px; }
}

/* ---------- Botão flutuante do WhatsApp ---------- */
.whatsapp-flutuante {
  position: fixed;
  right: 22px;
  bottom: 22px;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: #25D366;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 18px rgba(0,0,0,.25);
  z-index: 80;
  transition: transform .15s ease;
}
.whatsapp-flutuante:hover { transform: scale(1.07); }
@media (max-width: 720px) {
  .whatsapp-flutuante { right: 16px; bottom: 16px; width: 52px; height: 52px; }
}
