/* ==========================================================================
   styles.css — Bellezza Glow
   --------------------------------------------------------------------------
   Organização (use Ctrl+F nos títulos numerados):
     1. Variáveis (cores, fontes, medidas)  ← mude o visual por aqui
     2. Reset e base
     3. Utilitários (container, sr-only, skip-link)
     4. Botões
     5. Header e navegação
     6. Hero
     7. Seções (títulos)
     8. Categorias
     9. Filtros e grade de produtos
    10. Chamada final (CTA)
    11. Rodapé
    12. Animações
   Abordagem "mobile first": o CSS base serve o celular; os @media (min-width)
   ampliam o layout para tablet e desktop.
   ========================================================================== */


/* ==========================================================================
   1. VARIÁVEIS
   ========================================================================== */
:root {
  /* Cores (tiradas do catálogo e do logo) */
  --peach:        #ffc1b6;  /* barra do topo do catálogo / header / rodapé */
  --peach-soft:   #ffe3dd;  /* fundos suaves */
  --cream:        #fefaf0;  /* fundo da página (mesmo tom do logo) */
  --cream-deep:   #fcf1e3;  /* faixa alternada de seção */
  --ink:          #1e1716;  /* texto principal (quase preto) */
  --ink-soft:     #5b4a47;  /* texto secundário */
  --coral:        #c44b3d;  /* ação principal (contraste AA com texto branco) */
  --coral-dark:   #a93c30;  /* hover / textos coral sobre fundo claro */
  --rose:         #e5a29a;  /* detalhes decorativos */
  --rose-text:    #a84e44;  /* rosa escuro legível para texto pequeno */
  --white:        #ffffff;

  /* Cores de cada card de categoria (ids definidos em js/produtos.js) */
  --cat-pele:   #fff4e0;
  --cat-olhos:  #ffe6d0;
  --cat-labios: #ffe8e0;

  /* Fontes */
  --font-display: 'Chewy', 'Comic Sans MS', system-ui, sans-serif;
  --font-body:    'Open Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;

  /* Medidas */
  --gutter:      20px;           /* margem lateral */
  --maxw:        1120px;         /* largura máxima do conteúdo */
  --header-h:    68px;           /* altura do header (também usada no scroll-margin) */
  --radius:      20px;
  --radius-lg:   28px;
  --shadow-sm:   0 2px 10px rgba(120, 60, 50, .08);
  --shadow-md:   0 12px 32px rgba(120, 60, 50, .14);
  --ease:        cubic-bezier(.2, .7, .2, 1);
}


/* ==========================================================================
   2. RESET E BASE
   ========================================================================== */
*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;  /* evita zoom automático de fonte no iOS */
}

body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img { display: block; max-width: 100%; height: auto; }
ul  { margin: 0; padding: 0; list-style: none; }
h1, h2, h3, p, figure { margin: 0; }
a   { color: inherit; }
button { font: inherit; color: inherit; cursor: pointer; }

/* Foco visível para quem navega com teclado */
:focus-visible {
  outline: 3px solid var(--ink);
  outline-offset: 3px;
  border-radius: 6px;
}


/* ==========================================================================
   3. UTILITÁRIOS
   ========================================================================== */
.container {
  width: min(100% - (var(--gutter) * 2), var(--maxw));
  margin-inline: auto;
}

/* Esconde visualmente, mas mantém para leitores de tela */
.sr-only {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

/* "Pular para o conteúdo": só aparece ao receber foco do teclado */
.skip-link {
  position: absolute; left: 12px; top: -60px; z-index: 100;
  padding: .6rem 1rem; background: var(--ink); color: var(--cream);
  border-radius: 8px; text-decoration: none; transition: top .2s;
}
.skip-link:focus { top: 12px; }

.icon { width: 1.25em; height: 1.25em; flex: none; }


/* ==========================================================================
   4. BOTÕES
   ========================================================================== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .55rem;
  min-height: 50px; padding: 0 1.6rem;
  border: 2px solid transparent; border-radius: 999px;
  font-weight: 700; font-size: 1rem; line-height: 1; text-decoration: none;
  transition: transform .2s var(--ease), background-color .2s, box-shadow .2s, color .2s;
}
.btn:hover  { transform: translateY(-2px); }
.btn:active { transform: translateY(0); }

.btn--primary { background: var(--coral); color: var(--white); box-shadow: 0 6px 16px rgba(196, 75, 61, .28); }
.btn--primary:hover { background: var(--coral-dark); }

.btn--ghost { border-color: var(--coral); color: var(--coral-dark); background: transparent; }
.btn--ghost:hover { background: var(--coral); color: var(--white); }

.btn--dark { background: var(--ink); color: var(--cream); }
.btn--dark:hover { background: #3a2c2a; }

.btn--small { min-height: 42px; padding: 0 1.2rem; font-size: .92rem; }
.btn--large { min-height: 58px; padding: 0 2.2rem; font-size: 1.1rem; }


/* ==========================================================================
   5. HEADER E NAVEGAÇÃO
   ========================================================================== */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: var(--peach);
  transition: box-shadow .25s;
}
.site-header.is-scrolled { box-shadow: 0 4px 18px rgba(120, 60, 50, .18); } /* classe adicionada pelo main.js */

.header__inner {
  display: flex; align-items: center; justify-content: space-between;
  height: var(--header-h);
}

.brand img { height: 46px; width: auto; }

/* --- Menu: no celular é um painel que abre abaixo do header --- */
.nav {
  position: absolute; left: 0; right: 0; top: 100%;
  display: none;
  padding: 1rem var(--gutter) 1.5rem;
  background: var(--peach);
  box-shadow: 0 14px 24px rgba(120, 60, 50, .15);
}
.nav.is-open { display: block; }

.nav__list { display: grid; gap: .4rem; }
.nav__link {
  display: block; padding: .8rem .2rem;
  font-weight: 700; text-decoration: none;
  border-bottom: 1px solid rgba(30, 23, 22, .12);
}
.nav__list li:last-child { padding-top: .8rem; }
.nav__list li:last-child .btn { width: 100%; }

/* --- Botão hambúrguer (vira "X" quando aberto) --- */
.nav-toggle {
  display: grid; place-content: center; gap: 5px;
  width: 46px; height: 46px; padding: 0;
  background: transparent; border: 0; border-radius: 12px;
}
.nav-toggle__bar {
  width: 24px; height: 2.5px; background: var(--ink); border-radius: 2px;
  transition: transform .25s var(--ease), opacity .2s;
}
.nav-toggle[aria-expanded='true'] .nav-toggle__bar:nth-child(1) { transform: translateY(7.5px) rotate(45deg); }
.nav-toggle[aria-expanded='true'] .nav-toggle__bar:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded='true'] .nav-toggle__bar:nth-child(3) { transform: translateY(-7.5px) rotate(-45deg); }

/* --- Desktop: menu em linha, sem hambúrguer --- */
@media (min-width: 800px) {
  :root { --header-h: 76px; }
  .brand img { height: 52px; }
  .nav-toggle { display: none; }

  .nav {
    position: static; display: block; padding: 0;
    background: transparent; box-shadow: none;
  }
  .nav__list { display: flex; align-items: center; gap: 2rem; }
  .nav__link { padding: .4rem 0; border: 0; position: relative; }
  .nav__link::after {                     /* sublinhado animado no hover */
    content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 2px;
    background: var(--ink); transform: scaleX(0); transform-origin: left;
    transition: transform .25s var(--ease);
  }
  .nav__link:hover::after { transform: scaleX(1); }
  .nav__list li:last-child { padding: 0; }
  .nav__list li:last-child .btn { width: auto; }
}


/* ==========================================================================
   6. HERO
   ========================================================================== */
.hero { padding-block: clamp(2rem, 6vw, 5rem); overflow: hidden; }

.hero__grid { display: grid; gap: 2.2rem; align-items: center; }

.hero__text { text-align: center; }

.eyebrow {
  display: inline-block; margin-bottom: 1rem; padding: .3rem .9rem;
  background: var(--peach-soft); color: var(--rose-text);
  border-radius: 999px; font-size: .8rem; font-weight: 700;
  letter-spacing: .08em; text-transform: uppercase;
}

.hero__title {
  font-family: var(--font-display); font-weight: 400; text-transform: uppercase;
  font-size: clamp(2.5rem, 9vw, 4.4rem); line-height: 1.04; letter-spacing: .01em;
}
.hero__accent { color: var(--coral); }

.hero__lead {
  max-width: 34rem; margin: 1.2rem auto 0;
  font-size: 1.08rem; color: var(--ink-soft);
}

.hero__actions {
  display: flex; flex-wrap: wrap; justify-content: center; gap: .8rem;
  margin-top: 1.8rem;
}

/* Foto com moldura deslocada (detalhe "rose gold") */
.hero__media {
  position: relative; width: min(100%, 380px); margin-inline: auto;
  aspect-ratio: 4 / 5; border-radius: var(--radius-lg);
}
.hero__media::before {
  content: ''; position: absolute; inset: 0; transform: translate(14px, 14px);
  border: 2px solid var(--rose); border-radius: var(--radius-lg);
}
.hero__media img {
  position: relative; width: 100%; height: 100%; object-fit: cover;
  border-radius: var(--radius-lg); box-shadow: var(--shadow-md);
}

@media (min-width: 900px) {
  .hero__grid { grid-template-columns: 1.1fr .9fr; gap: 4rem; }
  .hero__text { text-align: left; }
  .hero__lead { margin-inline: 0; }
  .hero__actions { justify-content: flex-start; }
  .hero__media { width: min(100%, 440px); margin-inline: auto 0; }
}


/* ==========================================================================
   7. SEÇÕES
   ========================================================================== */
.section { padding-block: clamp(3rem, 8vw, 5.5rem); }
.section--tint { background: var(--cream-deep); }

/* offset para o header fixo não cobrir o título ao navegar por âncora */
.section, .hero { scroll-margin-top: var(--header-h); }

.section__head { margin-bottom: 2rem; text-align: center; }
.section__title {
  font-family: var(--font-display); font-weight: 400; text-transform: uppercase;
  font-size: clamp(2rem, 6vw, 3rem); line-height: 1.1;
}
.section__sub { margin-top: .4rem; color: var(--ink-soft); }

.fineprint { margin-top: 2rem; text-align: center; font-size: .85rem; color: var(--ink-soft); }
.noscript  { text-align: center; padding: 1rem; }


/* ==========================================================================
   8. CATEGORIAS  (cards gerados por js/main.js)
   ========================================================================== */
.categories { display: grid; gap: 1rem; max-width: 960px; margin-inline: auto; }

.cat-card {
  display: grid; gap: .35rem; width: 100%; height: 100%;
  padding: 1.5rem 1.6rem; text-align: left;
  background: var(--cat-pele); border: 2px solid transparent; border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  transition: transform .25s var(--ease), box-shadow .25s, border-color .25s;
}
.cat-card--pele   { background: var(--cat-pele); }
.cat-card--olhos  { background: var(--cat-olhos); }
.cat-card--labios { background: var(--cat-labios); }

.cat-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); border-color: var(--rose); }

.cat-card__title {
  font-family: var(--font-display); font-size: 1.7rem; line-height: 1.1;
  text-transform: uppercase; color: var(--coral-dark);
}
.cat-card__desc  { color: var(--ink-soft); font-size: .95rem; }
.cat-card__count { margin-top: .4rem; font-weight: 700; font-size: .9rem; color: var(--rose-text); }

@media (min-width: 720px) {
  .categories { grid-template-columns: repeat(3, 1fr); }
}


/* ==========================================================================
   9. FILTROS E GRADE DE PRODUTOS
   ========================================================================== */
.filters { display: flex; flex-wrap: wrap; justify-content: center; gap: .6rem; margin-bottom: 2rem; }

.filter {
  min-height: 42px; padding: 0 1.2rem;
  background: var(--white); border: 2px solid var(--peach); border-radius: 999px;
  font-weight: 700; font-size: .92rem;
  transition: background-color .2s, color .2s, border-color .2s;
}
.filter:hover { border-color: var(--rose); }
.filter[aria-pressed='true'] { background: var(--ink); border-color: var(--ink); color: var(--cream); }

/* 2 colunas no celular -> 3 no tablet -> 4 no desktop */
.grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
@media (min-width: 700px)  { .grid { grid-template-columns: repeat(3, 1fr); gap: 20px; } }
@media (min-width: 1040px) { .grid { grid-template-columns: repeat(4, 1fr); gap: 24px; } }

.card {
  display: flex; flex-direction: column;
  background: var(--white); border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: transform .25s var(--ease), box-shadow .25s;
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }

.card__media { aspect-ratio: 3 / 4; overflow: hidden; background: var(--peach-soft); }
.card__media img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform .5s var(--ease);
}
.card:hover .card__media img { transform: scale(1.04); }

.card__body { display: flex; flex-direction: column; flex: 1; padding: .9rem .9rem 1rem; }
.card__brand {
  font-family: var(--font-display); font-size: 1.05rem; line-height: 1.1;
  text-transform: uppercase; color: var(--rose-text);
}
.card__name  { margin-top: .15rem; font-size: .98rem; font-weight: 700; line-height: 1.3; }
.card__price { margin: .4rem 0 .9rem; font-size: 1.35rem; font-weight: 800; color: var(--coral-dark); }
.card__cta   { width: 100%; margin-top: auto; }   /* botão sempre alinhado na base do card */


/* ==========================================================================
   10. CHAMADA FINAL (CTA)
   ========================================================================== */
.cta {
  display: grid; gap: 2rem; align-items: center;
  padding: clamp(1.6rem, 5vw, 3.5rem);
  background: var(--peach-soft); border-radius: var(--radius-lg);
}
.cta__text { text-align: center; }
.cta__title {
  margin-bottom: 1.6rem;
  font-family: var(--font-display); font-weight: 400; text-transform: uppercase;
  font-size: clamp(2rem, 7vw, 3.2rem); line-height: 1.08;
}
.cta__media { width: min(100%, 300px); margin-inline: auto; }
.cta__media img { border-radius: var(--radius); box-shadow: var(--shadow-md); aspect-ratio: 3 / 4; object-fit: cover; width: 100%; }

@media (min-width: 800px) {
  .cta { grid-template-columns: 1.2fr .8fr; }
  .cta__text { text-align: left; }
}


/* ==========================================================================
   11. RODAPÉ
   ========================================================================== */
.site-footer { background: var(--peach); padding-block: 2rem calc(2rem + env(safe-area-inset-bottom)); }
.footer__inner { display: grid; justify-items: center; gap: .8rem; text-align: center; }
.footer__logo { height: 54px; width: auto; }
.footer__text { font-size: .88rem; }


/* ==========================================================================
   12. ANIMAÇÕES  (classes aplicadas por main.js > animarEntrada)
   ========================================================================== */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .6s var(--ease), transform .6s var(--ease); }
.reveal.is-visible { opacity: 1; transform: none; }

/* Quem pede "reduzir movimento" no sistema vê tudo sem animação */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
  .reveal { opacity: 1; transform: none; }
}
