/* ==========================================================================
   Casa do Baralho — Design tokens
   Paleta: fundo quase-preto arroxeado, dourado envelhecido, vinho, roxo.
   Tipografia: Cinzel (display, gravado/luxo) + Manrope (corpo, utilitária).
   ========================================================================== */
:root{
  --bg: #0F0A14;
  --bg-soft: #150D1C;
  --card: #1C1424;
  --card-hover: #241830;
  --card-border: rgba(212,175,55,0.16);
  --gold: #D4AF37;
  --gold-light: #F2D06B;
  --wine: #6E0D25;
  --wine-light: #8C1030;
  --purple: #3D1650;
  --purple-light: #5C1F73;
  --text: #F1E9DC;
  --text-muted: #A99BB0;
  --text-dim: #7C6E88;

  --font-display: "Cinzel", serif;
  --font-body: "Manrope", sans-serif;

  --radius-lg: 22px;
  --radius-md: 14px;
  --radius-sm: 8px;

  --shadow-soft: 0 20px 45px rgba(0,0,0,0.45);
  --shadow-card: 0 10px 30px rgba(0,0,0,0.35);

  --header-h: 76px;
}

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

*, *::before, *::after{ box-sizing: border-box; }
html{ scroll-behavior: smooth; scroll-padding-top: var(--header-h); }
body{
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img{ max-width: 100%; display: block; }
a{ color: inherit; text-decoration: none; }
h1, h2, h3{ font-family: var(--font-display); margin: 0; letter-spacing: 0.02em; }
button{ font-family: inherit; cursor: pointer; }

.skip-link{
  position: absolute; left: -9999px; top: 0; z-index: 999;
  background: var(--gold); color: #17101F; padding: 12px 18px; border-radius: 0 0 8px 0;
}
.skip-link:focus{ left: 0; }

:focus-visible{ outline: 2px solid var(--gold-light); outline-offset: 3px; }

/* ==========================================================================
   Header
   ========================================================================== */
.header{
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  height: var(--header-h);
  background: rgba(15,10,20,0.78);
  backdrop-filter: blur(14px) saturate(140%);
  border-bottom: 1px solid rgba(212,175,55,0.14);
  transition: background 0.3s ease, box-shadow 0.3s ease;
}
.header.is-scrolled{ box-shadow: 0 10px 30px rgba(0,0,0,0.4); }
.header__inner{
  max-width: 1280px; margin: 0 auto; height: 100%;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 28px; gap: 24px;
}
.brand{ display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.brand__mark{
  font-size: 1.4rem; color: var(--gold-light);
  text-shadow: 0 0 14px rgba(242,208,107,0.5);
}
.brand__name{
  font-family: var(--font-display); font-size: 1.15rem; font-weight: 600;
  letter-spacing: 0.06em; color: var(--text);
}
.nav{ display: flex; gap: 30px; }
.nav a{
  font-size: 0.92rem; font-weight: 600; color: var(--text-muted);
  position: relative; padding: 6px 2px; transition: color 0.25s ease;
  text-transform: uppercase; letter-spacing: 0.05em;
}
.nav a::after{
  content: ""; position: absolute; left: 0; right: 0; bottom: -2px; height: 2px;
  background: linear-gradient(90deg, var(--gold), var(--gold-light));
  transform: scaleX(0); transform-origin: left; transition: transform 0.3s ease;
}
.nav a:hover, .nav a:focus-visible{ color: var(--gold-light); }
.nav a:hover::after, .nav a:focus-visible::after{ transform: scaleX(1); }

.header__actions{ display: flex; align-items: center; gap: 16px; }
.search{ position: relative; display: flex; align-items: center; }
.search input{
  background: rgba(255,255,255,0.04); border: 1px solid rgba(212,175,55,0.22);
  border-radius: 999px; color: var(--text); padding: 9px 16px 9px 38px;
  font-size: 0.88rem; width: 190px; transition: width 0.3s ease, border-color 0.3s ease;
}
.search input::placeholder{ color: var(--text-dim); }
.search input:focus{ border-color: var(--gold); width: 230px; }
.search__icon{
  position: absolute; left: 12px; width: 15px; height: 15px;
  fill: none; stroke: var(--text-dim); stroke-width: 2;
}

.btn{
  display: inline-flex; align-items: center; justify-content: center;
  padding: 10px 22px; border-radius: 999px; font-weight: 700; font-size: 0.88rem;
  border: 1px solid transparent; transition: transform 0.25s ease, box-shadow 0.25s ease, background 0.25s ease;
  white-space: nowrap;
}
.btn--gold{
  background: linear-gradient(135deg, var(--gold-light), var(--gold));
  color: #1B1000;
  box-shadow: 0 8px 22px rgba(212,175,55,0.25);
}
.btn--gold:hover{ transform: translateY(-2px); box-shadow: 0 12px 28px rgba(212,175,55,0.4); }
.btn--lg{ padding: 15px 34px; font-size: 1rem; }

.nav-toggle{
  display: none; flex-direction: column; gap: 5px; background: none; border: none; padding: 8px;
}
.nav-toggle span{ width: 24px; height: 2px; background: var(--gold-light); border-radius: 2px; transition: transform 0.3s ease, opacity 0.3s ease; }
.nav-toggle.is-open span:nth-child(1){ transform: translateY(7px) rotate(45deg); }
.nav-toggle.is-open span:nth-child(2){ opacity: 0; }
.nav-toggle.is-open span:nth-child(3){ transform: translateY(-7px) rotate(-45deg); }

/* ==========================================================================
   Hero
   ========================================================================== */
.hero{
  position: relative; min-height: 92vh; display: flex; align-items: center;
  padding: calc(var(--header-h) + 40px) 28px 80px; overflow: hidden;
}
.hero__glow{
  position: absolute; inset: 0; z-index: 0;
  background:
    radial-gradient(60% 50% at 70% 20%, rgba(61,22,80,0.55), transparent 70%),
    radial-gradient(50% 40% at 15% 85%, rgba(110,13,37,0.35), transparent 70%);
}
.hero__cards{
  position: absolute; right: -6%; bottom: -8%; width: min(60vw, 780px); z-index: 0;
  opacity: 0.92; filter: drop-shadow(0 30px 40px rgba(0,0,0,0.55));
  animation: floatCards 7s ease-in-out infinite;
}
@keyframes floatCards{
  0%, 100%{ transform: translateY(0) rotate(0deg); }
  50%{ transform: translateY(-14px) rotate(1deg); }
}
.hero__content{ position: relative; z-index: 1; max-width: 680px; }
.eyebrow{
  font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.18em;
  color: var(--gold-light); font-weight: 700; margin: 0 0 18px;
}
.hero h1{
  font-size: clamp(2.1rem, 4.6vw, 3.6rem); line-height: 1.15; color: var(--text);
  margin-bottom: 20px;
}
.hero__subtitle{
  font-size: 1.1rem; color: var(--text-muted); max-width: 480px; margin-bottom: 34px;
}

/* ==========================================================================
   Sections
   ========================================================================== */
.section{ padding: 90px 28px; max-width: 1320px; margin: 0 auto; }
.section__head{ margin-bottom: 40px; max-width: 640px; }
.section__eyebrow{
  display: inline-block; font-family: var(--font-display); font-size: 0.85rem;
  color: var(--gold); letter-spacing: 0.2em; margin-bottom: 10px;
}
.section__head h2{ font-size: clamp(1.7rem, 3vw, 2.3rem); margin-bottom: 10px; }
.section__head p{ color: var(--text-muted); margin: 0; }
.section__head p.notice{
  color: var(--gold-light); background: rgba(110,13,37,0.25);
  border: 1px solid rgba(212,175,55,0.25); padding: 10px 16px; border-radius: var(--radius-sm);
  display: inline-block; font-weight: 600; font-size: 0.9rem;
}
.section__empty{
  color: var(--text-dim); font-size: 0.92rem; padding: 30px 0; border-top: 1px dashed rgba(212,175,55,0.2);
}

/* Tingimento opcional de seção: definido por categoria via data/categorias.json
   (campo "cor"), aplicado inline como --tema-cor. Nenhuma edição de CSS é
   necessária para novas categorias usarem essa cor de fundo suave. */
.section[style*="--tema-cor"]{
  background: linear-gradient(180deg, color-mix(in srgb, var(--tema-cor) 14%, transparent), transparent 65%);
}
.section[style*="--tema-cor"] .section__eyebrow{ color: var(--tema-cor); }

.reveal{ opacity: 0; transform: translateY(24px); transition: opacity 0.7s ease, transform 0.7s ease; }
.reveal.is-visible{ opacity: 1; transform: translateY(0); }

/* ==========================================================================
   Carousel (mobile-first) / Grid (desktop)
   ========================================================================== */
.carousel{ position: relative; }
.carousel__track{
  display: flex; gap: 18px; overflow-x: auto; scroll-snap-type: x mandatory;
  padding: 6px 6px 20px; -webkit-overflow-scrolling: touch; scrollbar-width: none;
}
.carousel__track::-webkit-scrollbar{ display: none; }
.carousel__track > .card{ flex: 0 0 82%; scroll-snap-align: center; }

.carousel__dots{ display: flex; justify-content: center; gap: 8px; margin-top: 4px; }
.carousel__dots button{
  width: 8px; height: 8px; border-radius: 50%; border: none;
  background: rgba(212,175,55,0.25); padding: 0; transition: background 0.25s ease, transform 0.25s ease;
}
.carousel__dots button.is-active{ background: var(--gold-light); transform: scale(1.3); }

.carousel__arrow{
  display: none; position: absolute; top: 40%; transform: translateY(-50%);
  width: 42px; height: 42px; border-radius: 50%; border: 1px solid var(--card-border);
  background: rgba(28,20,36,0.9); color: var(--gold-light); font-size: 1.4rem; align-items: center; justify-content: center;
}
.carousel__arrow--prev{ left: -6px; }
.carousel__arrow--next{ right: -6px; }

@media (min-width: 640px){
  .carousel__track > .card{ flex-basis: 46%; }
}

@media (min-width: 720px){
  .carousel__arrow{ display: flex; }
}

@media (min-width: 1024px){
  .carousel__dots, .carousel__arrow{ display: none; }
  .carousel__track{
    display: grid; grid-template-columns: repeat(4, 1fr); overflow: visible;
    padding: 6px 0 0; gap: 26px;
  }
  .carousel__track > .card{ flex-basis: auto; }
}

/* ==========================================================================
   Product card
   ========================================================================== */
.card{
  background: linear-gradient(160deg, var(--card), #150E1C);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-card);
  cursor: pointer;
  transition: transform 0.4s ease, box-shadow 0.4s ease, border-color 0.4s ease;
  transform-style: preserve-3d;
  perspective: 800px;
  display: flex; flex-direction: column;
}
.card:hover, .card:focus-visible{
  transform: translateY(-8px) rotateX(2deg);
  border-color: rgba(212,175,55,0.45);
  box-shadow: 0 26px 50px rgba(0,0,0,0.5), 0 0 0 1px rgba(212,175,55,0.15);
}
.card__media{
  position: relative; aspect-ratio: 5/6; overflow: hidden;
  background: radial-gradient(circle at 50% 20%, rgba(212,175,55,0.08), transparent 65%);
}
.card__media img{
  width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s ease;
}
.card:hover .card__media img{ transform: scale(1.06); }
.card__badge{
  position: absolute; top: 12px; left: 12px; font-size: 0.68rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.06em; color: #1B1000;
  background: linear-gradient(135deg, var(--gold-light), var(--gold));
  padding: 5px 10px; border-radius: 999px;
}
.card__body{ padding: 18px 18px 20px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.card__name{ font-family: var(--font-display); font-size: 1.02rem; color: var(--text); line-height: 1.3; }
.card__desc{ font-size: 0.86rem; color: var(--text-muted); margin: 0; flex: 1; }
.card__meta{
  display: flex; align-items: center; justify-content: space-between;
  font-size: 0.76rem; color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.04em;
}
.card__cta{
  margin-top: 10px; text-align: center; padding: 10px; border-radius: var(--radius-sm);
  border: 1px solid var(--gold); color: var(--gold-light); font-weight: 700; font-size: 0.86rem;
  transition: background 0.25s ease, color 0.25s ease;
}
.card:hover .card__cta{ background: var(--gold); color: #1B1000; }

.empty-state{
  text-align: center; color: var(--text-muted); padding: 60px 20px; display: none;
}
.empty-state:not([hidden]){ display: block; }

/* ==========================================================================
   Footer
   ========================================================================== */
.footer{
  background: var(--bg-soft); border-top: 1px solid rgba(212,175,55,0.12);
  padding: 64px 28px 28px;
}
.footer__inner{
  max-width: 1280px; margin: 0 auto; display: grid;
  grid-template-columns: 2fr 1fr 1fr; gap: 40px; margin-bottom: 40px;
}
.footer__col h3{
  font-family: var(--font-display); font-size: 0.95rem; color: var(--gold-light);
  margin-bottom: 14px; letter-spacing: 0.04em;
}
.footer__col p{ color: var(--text-muted); font-size: 0.9rem; max-width: 380px; }
.footer__col a{
  display: block; color: var(--text-muted); font-size: 0.9rem; margin-bottom: 10px;
  transition: color 0.2s ease;
}
.footer__col a:hover{ color: var(--gold-light); }
.brand--footer{ margin-bottom: 14px; }
.social{ display: flex; flex-direction: column; }
.footer__bottom{
  max-width: 1280px; margin: 0 auto; border-top: 1px solid rgba(255,255,255,0.06);
  padding-top: 22px; display: flex; flex-wrap: wrap; gap: 10px 24px; justify-content: space-between;
  color: var(--text-dim); font-size: 0.8rem;
}
.footer__notice{ color: var(--text-dim); }

/* ==========================================================================
   Back to top
   ========================================================================== */
.to-top{
  position: fixed; right: 22px; bottom: 22px; width: 46px; height: 46px; border-radius: 50%;
  background: linear-gradient(135deg, var(--gold-light), var(--gold)); color: #1B1000;
  border: none; font-size: 1.2rem; box-shadow: 0 10px 26px rgba(0,0,0,0.45);
  opacity: 0; visibility: hidden; transform: translateY(12px);
  transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s ease;
  z-index: 90;
}
.to-top.is-visible{ opacity: 1; visibility: visible; transform: translateY(0); }

/* ==========================================================================
   Responsive: header collapses to mobile menu
   ========================================================================== */
@media (max-width: 900px){
  .nav{
    position: fixed; top: var(--header-h); left: 0; right: 0; bottom: 0;
    background: rgba(15,10,20,0.98); flex-direction: column; align-items: center;
    justify-content: center; gap: 28px;
    transform: translateX(100%); transition: transform 0.35s ease;
  }
  .nav.is-open{ transform: translateX(0); }
  .nav a{ font-size: 1.1rem; }
  .header__actions .search{ display: none; }
  .nav-toggle{ display: flex; }
}
@media (max-width: 640px){
  .footer__inner{ grid-template-columns: 1fr; gap: 30px; }
}
