/* ===========================
   MGX SITE - ESTILOS GLOBAIS
   Compartilhado por todas as páginas
   =========================== */

/* Fontes carregadas via JS (js/global.js) para nao bloquear o render.
   O @import aqui bloqueava o FCP em todas as paginas. font-display:swap
   mostra o texto na fonte fallback e troca quando a fonte chega. */

/* CSS Variables */
:root {
  --gold: #FFAA19;
  --black: #000000;
  --white: #FFFFFF;
  --dark-text: #2B2B2B;
  --gray-text: #999999;
  --red-btn: #C0392B;
  --green-btn: #25D366;
  --font-heading: 'Kaisei Decol', serif;
  --font-body: 'Kantumruy', 'Noto Sans', sans-serif;
  --font-ui: 'Jomhuria', cursive;
}

/* Scroll Animation Classes */
.scroll-animate {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1), transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: opacity, transform;
}

.scroll-visible {
  opacity: 1 !important;
  transform: translateY(0) !important;
}

/* Reset */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  background-color: var(--black);
  color: var(--white);
  overflow-x: hidden;
}

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

ul, ol {
  list-style: none;
}

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

/* ===========================
   HEADER / NAVIGATION
   =========================== */
.header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
  background-color: var(--black);
}

.header__menu {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 44px;
  height: 78px;
  max-width: 1920px;
  margin: 0 auto;
}

.header__logo img {
  height: 70px;
  width: auto;
}

.header__nav {
  display: flex;
  align-items: center;
  gap: 30px;
}

.header__nav a {
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 1.8px;
  text-transform: uppercase;
  color: var(--white);
  transition: color 0.3s ease;
  line-height: 1;
}

.header__nav a:hover,
.header__nav a.active {
  color: var(--gold);
}

.header__line {
  height: 2px;
  background-color: var(--gold);
  width: 100%;
}

/* Mobile hamburger */
.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  background: none;
  border: none;
  padding: 10px;
}

.hamburger span {
  display: block;
  width: 28px;
  height: 3px;
  background-color: var(--gold);
  border-radius: 2px;
  transition: all 0.3s ease;
}

/* ===========================
   FOOTER
   =========================== */
.footer {
  width: 100%;
  background-color: var(--black);
}

.footer__gold-line {
  height: 2px;
  background-color: var(--gold);
  width: 100%;
}

.footer__content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 44px;
  max-width: 1920px;
  margin: 0 auto;
}

.footer__logo img {
  height: 60px;
  width: auto;
}

.footer__social {
  display: flex;
  align-items: center;
  gap: 14px;
}

.footer__social a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  transition: transform 0.25s ease;
}

.footer__social a:hover { transform: translateY(-2px); }

.footer__social a img,
.footer__social a svg {
  width: 22px;
  height: 22px;
}

.footer__email {
  font-family: var(--font-body);
  font-size: 13px;
  color: var(--gray-text);
}

.footer__bottom {
  background-color: transparent;
  border-top: 1px solid rgba(255,255,255,0.08);
  text-align: center;
  padding: 10px 0;
}

.footer__bottom p {
  font-family: var(--font-body);
  font-size: 12px;
  letter-spacing: 0.5px;
  color: var(--gray-text);
}

.footer__credit {
  margin-top: 4px;
}

.footer__credit a {
  color: var(--gray-text);
  text-decoration: none;
  transition: color 0.2s ease;
}

.footer__credit a:hover {
  color: #d4af37;
  text-decoration: underline;
}

/* ===========================
   WHATSAPP FLUTUANTE
   =========================== */
.whatsapp-float {
  position: fixed;
  bottom: 28px;
  right: 28px;
  width: 60px;
  height: 60px;
  background: #25D366;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999;
  box-shadow: 0 4px 14px rgba(37, 211, 102, 0.4);
  transition: transform 0.25s ease, box-shadow 0.3s ease;
}

.whatsapp-float:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 20px rgba(37, 211, 102, 0.6);
}

.whatsapp-float:active {
  transform: scale(0.95);
}

.whatsapp-float svg {
  width: 32px;
  height: 32px;
  fill: white;
}

/* ===========================
   BOTÕES COMPARTILHADOS
   =========================== */
.page-content {
  margin-top: 100px;
  padding-bottom: 40px;
}

.section-title {
  font-family: var(--font-heading);
  font-size: 60px;
  color: var(--white);
  text-align: center;
  margin-bottom: 20px;
}

.section-title--gold {
  color: var(--gold);
  position: relative;
  padding-bottom: 18px;
}

/* Sublinhado dourado que "desenha" quando o título aparece na tela */
.section-title--gold::after {
  content: '';
  position: absolute;
  left: 50%;
  bottom: 0;
  width: 90px;
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
  transform: translateX(-50%) scaleX(1);
  transform-origin: center;
  transition: transform .7s cubic-bezier(0.16, 1, 0.3, 1) .15s;
}
/* Se o título entra com reveal, o sublinhado fica escondido até ele aparecer */
.section-title--gold.scroll-animate:not(.scroll-visible)::after {
  transform: translateX(-50%) scaleX(0);
}

.btn-gold {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background-color: var(--gold);
  color: var(--dark-text);
  font-family: var(--font-ui);
  font-size: 42px;
  padding: 18px 50px;
  border-radius: 62px;
  border: none;
  cursor: pointer;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  line-height: 1;
  text-align: center;
  white-space: nowrap;
}

.btn-gold:hover {
  transform: translateY(-3px) scale(1.05);
  box-shadow: 0 10px 30px rgba(255, 170, 25, 0.5);
}

.btn-gold:active {
  transform: translateY(-1px) scale(1.02);
  box-shadow: 0 4px 14px rgba(255, 170, 25, 0.4);
  transition-duration: 0.08s;
}

.btn-gold--small {
  font-size: 40px;
  padding: 12px 40px;
}

/* ===========================
   RESPONSIVE - GLOBAL
   =========================== */
@media (max-width: 768px) {
  .header__menu {
    padding: 0 20px;
  }

  .header__nav {
    position: fixed;
    top: 80px;
    left: 0;
    width: 100%;
    height: calc(100vh - 80px);
    background: rgba(10, 10, 10, 0.98);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: 0;
    padding: 22px 24px 40px;
    transform: translateX(100%);
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    border: none;
    z-index: 1002;
    overflow-y: auto;
  }

  .header__nav a {
    font-size: 16px;
    letter-spacing: 2.5px;
    width: 100%;
    max-width: 360px;
    text-align: center;
    padding: 18px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  }
  .header__nav a::after { display: none; }
  .header__nav a.active { color: var(--gold); }

  .header__nav .lang-switch { margin-top: 30px; gap: 14px; }
  .header__nav .lang-switch a { width: 30px; height: 22px; opacity: 0.85; }

  .header__nav.open {
    transform: translateX(0);
  }

  .hamburger {
    display: flex;
  }

  .hamburger.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 6px);
  }
  .hamburger.active span:nth-child(2) {
    opacity: 0;
  }
  .hamburger.active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -6px);
  }

  .btn-gold {
    font-size: 36px;
    padding: 12px 30px;
  }

  .btn-gold--small {
    font-size: 30px;
    padding: 10px 30px;
  }

  .footer__content {
    flex-direction: column;
    gap: 12px;
    text-align: center;
    padding: 12px 20px;
  }

  .footer__social {
    justify-content: center;
  }
}

/* ===========================
   EFEITOS FESTIVOS GLOBAIS
   (injetados via js/global.js)
   =========================== */

/* Cordão de luzes piscando sob o header */
.festive-lights {
  position: absolute;
  top: 100%;
  left: 0;
  width: 100%;
  height: 20px;
  display: flex;
  justify-content: space-around;
  align-items: flex-start;
  pointer-events: none;
  z-index: 1001;
  overflow: hidden;
}

.festive-lights__bulb {
  width: 8px;
  height: 8px;
  margin-top: 4px;
  border-radius: 50%;
  background: currentColor;
  position: relative;
  animation: bulbTwinkle 1.8s infinite ease-in-out;
}

.festive-lights__bulb::before {
  content: '';
  position: absolute;
  top: -4px;
  left: 50%;
  transform: translateX(-50%);
  width: 3px;
  height: 5px;
  background: #4a3d22;
  border-radius: 1px;
}

@keyframes bulbTwinkle {
  0%, 100% { opacity: .25; box-shadow: 0 0 2px currentColor; }
  50%      { opacity: 1;   box-shadow: 0 0 9px currentColor, 0 0 16px currentColor; }
}

/* Neve em canvas */
.festive-snow {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 998;
}

/* Botão voltar ao topo */
.back-to-top {
  position: fixed;
  bottom: 100px;
  right: 30px;
  width: 48px;
  height: 48px;
  border: none;
  border-radius: 50%;
  background: var(--gold);
  color: var(--black);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px);
  transition: opacity .3s ease, transform .3s ease, visibility .3s, box-shadow .3s ease;
  z-index: 999;
  box-shadow: 0 4px 14px rgba(255, 170, 25, 0.35);
}

.back-to-top.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.back-to-top:hover {
  transform: translateY(-4px) scale(1.08);
  box-shadow: 0 6px 22px rgba(255, 170, 25, 0.55);
}

.back-to-top svg {
  width: 24px;
  height: 24px;
  fill: var(--black);
}

/* Quando existe carrinho flutuante, sobe para não sobrepor */
.back-to-top--with-cart { bottom: 172px; }

/* Variações de reveal por scroll */
.scroll-animate--left  { transform: translateX(-40px); }
.scroll-animate--right { transform: translateX(40px); }
.scroll-animate--zoom  { transform: scale(.9); }
.scroll-animate--left.scroll-visible,
.scroll-animate--right.scroll-visible,
.scroll-animate--zoom.scroll-visible { transform: none !important; }

/* Logo do header com leve brilho ao passar o mouse */
.header__logo img { transition: filter .3s ease, transform .3s ease; }
.header__logo:hover img {
  filter: drop-shadow(0 0 10px rgba(255, 170, 25, 0.5));
  transform: scale(1.03);
}

/* Links do menu com sublinhado dourado animado */
.header__nav a { position: relative; }
.header__nav a::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -4px;
  width: 0;
  height: 2px;
  background: var(--gold);
  transition: width .3s ease;
}
.header__nav a:hover::after,
.header__nav a.active::after { width: 100%; }

/* Barra de progresso de leitura (acompanha o scroll) */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  transform: scaleX(0);
  transform-origin: left center;
  background: linear-gradient(90deg, var(--gold), #ffd56b);
  box-shadow: 0 0 8px rgba(255, 170, 25, 0.5);
  z-index: 1200;
  pointer-events: none;
  will-change: transform;
}

/* Profundidade no parallax do hero */
.hero__bg { will-change: transform; }
.hero__content { will-change: transform, opacity; }

/* Transição suave entre páginas: só o fade-out ao navegar.
   O fade-in de opacity no <body> foi removido porque zerava o LCP
   (todo conteúdo nascia com opacity:0 -> Chrome descartava os candidatos
   a Largest Contentful Paint -> performance imensurável). */
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
  body.is-leaving { opacity: 0; transition: opacity 0.32s ease; }
}

/* Acessibilidade: respeitar quem prefere menos movimento */
@media (prefers-reduced-motion: reduce) {
  .festive-snow { display: none; }
  .festive-lights__bulb { animation: none; opacity: .8; }
  .hero__arrow { animation: none; }
  .scroll-animate { transition: opacity .2s ease; transform: none; }
  .scroll-progress { display: none; }
}

@media (max-width: 768px) {
  .festive-lights__bulb:nth-child(n+22) { display: none; }
  .back-to-top { bottom: 96px; right: 20px; width: 44px; height: 44px; }
  .back-to-top--with-cart { bottom: 168px; }
}

/* ===========================
   ACESSIBILIDADE
   =========================== */
/* Link "pular para o conteúdo" (aparece ao navegar por teclado) */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--gold);
  color: var(--black);
  padding: 10px 18px;
  z-index: 2000;
  border-radius: 0 0 8px 0;
  font-family: var(--font-body);
  font-weight: 700;
  text-decoration: none;
}
.skip-link:focus { left: 0; }

/* Foco visível para quem navega pelo teclado */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 2px;
  border-radius: 4px;
}
:focus:not(:focus-visible) { outline: none; }

/* Seletor de idioma (bandeiras) */
.lang-switch {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: 16px;
}
.lang-switch a {
  display: inline-flex;
  width: 22px;
  height: 16px;
  border-radius: 3px;
  overflow: hidden;
  opacity: 0.4;
  border: 1px solid rgba(255, 255, 255, 0.25);
  transition: opacity 0.2s ease, transform 0.2s ease;
}
.lang-switch a:hover { opacity: 1; transform: translateY(-1px); }
.lang-switch a.active { opacity: 1; border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold); }
.lang-switch a::after { display: none !important; }
.lang-switch svg { width: 100%; height: 100%; display: block; }
@media (max-width: 768px) {
  .lang-switch { margin: 16px auto 0; }
}

/* ===========================
   TIPOGRAFIA RESPONSIVA (mobile)
   Evita textos gigantes que tomam a tela toda
   =========================== */
@media (max-width: 600px) {
  .section-title,
  .about__title,
  .shop-title,
  .products-section__title,
  .portfolio-section__title,
  .portfolio-cta__title,
  .blog-hero__title,
  .article__title,
  .category-page-title,
  .countdown-section__label { font-size: 30px !important; line-height: 1.2; }

  .hero__title { font-size: 26px; }
  .stats__number { font-size: 40px !important; }

  .home-blog__body h3,
  .process__step h3,
  .segment-card__name,
  .home-shop__card span,
  .blog-card__title,
  .home-blog__card h3 { font-size: 20px !important; }

  .about__text,
  .process__intro,
  .home-shop__intro,
  .hero__subtitle,
  .countdown-section__cta-text,
  .blog-hero__subtitle,
  .article__body p,
  .article__body li { font-size: 16px !important; line-height: 1.6; }

  .btn-gold { font-size: 28px; padding: 12px 24px; }
  .btn-gold--small { font-size: 24px; padding: 10px 22px; }
}

@media (max-width: 380px) {
  .section-title,
  .about__title,
  .shop-title,
  .products-section__title,
  .portfolio-section__title,
  .portfolio-cta__title,
  .blog-hero__title,
  .article__title,
  .category-page-title { font-size: 25px !important; }

  .hero__title { font-size: 21px; }
  .btn-gold { font-size: 24px; }
}

/* Conteúdo só para leitores de tela / SEO (ex.: h1 invisível) */
.sr-only {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Honeypot anti-spam: fora da tela, sem foco, invisível a leitores de tela */
.hp-field {
  position: absolute !important;
  left: -9999px !important;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}
