/* ==========================================================================
   GLOBAL.CSS — Reset, tipografia, utilitários e estilos base
   BellaMiss Saúde Estética v2
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. GOOGLE FONTS
   -------------------------------------------------------------------------- */
@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,400;0,500;0,600;0,700;1,400;1,600&family=Inter:wght@300;400;500;600&display=swap');

/* --------------------------------------------------------------------------
   2. RESET BASE
   -------------------------------------------------------------------------- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--bm-font-body);
  font-size: var(--bm-text-base);
  font-weight: 400;
  line-height: 1.7;
  color: var(--bm-text);
  background-color: var(--bm-bg-page);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

/* Ocultar botão "voltar ao topo" do Astra */
.ast-scroll-top,
#ast-scroll-top,
.ast-back-to-top {
  display: none !important;
}

a {
  color: inherit;
  text-decoration: none;
  transition: color var(--bm-transition);
}

ul, ol {
  list-style: none;
}

button, input, select, textarea {
  font-family: var(--bm-font-body);
  font-size: inherit;
}

button {
  cursor: pointer;
  border: none;
  background: none;
}

/* --------------------------------------------------------------------------
   3. TIPOGRAFIA
   -------------------------------------------------------------------------- */

/* Títulos com Cormorant Garamond */
h1, h2, h3, h4, h5, h6,
.bm-display, .bm-heading {
  font-family: var(--bm-font-display);
  font-weight: 600;
  line-height: 1.2;
  color: var(--bm-primary);
}

h1 { font-size: var(--bm-text-4xl); }
h2 { font-size: var(--bm-text-3xl); }
h3 { font-size: var(--bm-text-xl); }
h4 { font-size: var(--bm-text-lg); }
h5 { font-size: var(--bm-text-base); }
h6 { font-size: var(--bm-text-sm); }

p {
  font-size: var(--bm-text-base);
  line-height: 1.75;
  color: var(--bm-text-sec);
  margin-bottom: 1em;
}
p:last-child { margin-bottom: 0; }

strong { font-weight: 600; color: var(--bm-text); }
em     { font-style: italic; }

/* Responsividade tipográfica */
@media (max-width: 768px) {
  h1 { font-size: var(--bm-text-2xl); }
  h2 { font-size: 28px; }
  h3 { font-size: var(--bm-text-lg); }
}

/* --------------------------------------------------------------------------
   4. EYEBROW / LABEL
   -------------------------------------------------------------------------- */
.bm-eyebrow {
  font-family: var(--bm-font-body);
  font-size: var(--bm-text-xs);
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--bm-secondary);
  display: block;
  margin-bottom: 12px;
}

/* --------------------------------------------------------------------------
   5. CONTAINER
   -------------------------------------------------------------------------- */
.bm-container {
  max-width: var(--bm-container-max);
  margin: 0 auto;
  padding: 0 var(--bm-container-px);
}

.bm-container-sm {
  max-width: var(--bm-container-max-sm);
  margin: 0 auto;
  padding: 0 var(--bm-container-px);
}

@media (max-width: 480px) {
  .bm-container,
  .bm-container-sm {
    padding: 0 16px;
  }
}

/* --------------------------------------------------------------------------
   6. SEÇÕES
   -------------------------------------------------------------------------- */
.bm-section {
  padding: var(--bm-section-py) 0;
}

.bm-section-sm {
  padding: var(--bm-section-py-sm) 0;
}

.bm-section-dark {
  background: var(--bm-bg-dark);
  color: var(--bm-white);
}
.bm-section-dark h1,
.bm-section-dark h2,
.bm-section-dark h3,
.bm-section-dark h4 {
  color: var(--bm-white);
}
.bm-section-dark p {
  color: rgba(221, 187, 177, 0.9);
}

.bm-section-darker {
  background: var(--bm-bg-darker);
  color: var(--bm-white);
}
.bm-section-darker h1,
.bm-section-darker h2,
.bm-section-darker h3 {
  color: var(--bm-white);
}
.bm-section-darker p {
  color: rgba(221, 187, 177, 0.85);
}

.bm-section-rose {
  background: var(--bm-bg-section-3);
}

.bm-section-soft {
  background: var(--bm-bg-section-2);
}

.bm-section-white {
  background: var(--bm-bg-section-1);
}

@media (max-width: 768px) {
  .bm-section     { padding: var(--bm-section-py-sm) 0; }
  .bm-section-sm  { padding: 32px 0; }
}

/* --------------------------------------------------------------------------
   7. SEPARADOR DECORATIVO
   -------------------------------------------------------------------------- */
.bm-divider {
  height: 2px;
  background: var(--bm-gradient-rose);
  border: none;
  max-width: 80px;
  margin: 20px 0;
}

.bm-divider-center {
  margin: 20px auto;
}

/* --------------------------------------------------------------------------
   8. SEÇÃO — CABEÇALHO PADRÃO
   -------------------------------------------------------------------------- */
.bm-section-header {
  margin-bottom: 48px;
}

.bm-section-header.center {
  text-align: center;
}
.bm-section-header.center .bm-divider {
  margin: 20px auto;
}

/* --------------------------------------------------------------------------
   9. GRID UTILITÁRIOS
   -------------------------------------------------------------------------- */
.bm-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
}

.bm-grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.bm-grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
}

@media (max-width: 1024px) {
  .bm-grid-4 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .bm-grid-2 { grid-template-columns: 1fr; }
  .bm-grid-3 { grid-template-columns: 1fr; }
  .bm-grid-4 { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 480px) {
  .bm-grid-4 { grid-template-columns: 1fr; }
}

/* --------------------------------------------------------------------------
   10. FLEXBOX UTILITÁRIOS
   -------------------------------------------------------------------------- */
.bm-flex         { display: flex; }
.bm-flex-center  { display: flex; align-items: center; justify-content: center; }
.bm-flex-between { display: flex; align-items: center; justify-content: space-between; }
.bm-flex-col     { display: flex; flex-direction: column; }
.bm-flex-wrap    { flex-wrap: wrap; }
.bm-gap-sm       { gap: 8px; }
.bm-gap-md       { gap: 16px; }
.bm-gap-lg       { gap: 24px; }

/* --------------------------------------------------------------------------
   11. ANIMAÇÕES DE ENTRADA
   -------------------------------------------------------------------------- */
@keyframes bm-fade-up {
  from {
    opacity: 0;
    transform: translateY(24px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes bm-fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes bm-slide-left {
  from {
    opacity: 0;
    transform: translateX(24px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Classe aplicada por IntersectionObserver no main.js */
.bm-animate {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.bm-animate.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* Delays escalonados */
.bm-animate[data-delay="1"] { transition-delay: 0.1s; }
.bm-animate[data-delay="2"] { transition-delay: 0.2s; }
.bm-animate[data-delay="3"] { transition-delay: 0.3s; }
.bm-animate[data-delay="4"] { transition-delay: 0.4s; }
.bm-animate[data-delay="5"] { transition-delay: 0.5s; }

/* --------------------------------------------------------------------------
   12. INPUTS E FORMULÁRIO BASE
   -------------------------------------------------------------------------- */
.bm-input,
.bm-select,
.bm-textarea {
  width: 100%;
  padding: 13px 16px;
  font-family: var(--bm-font-body);
  font-size: var(--bm-text-base);
  color: var(--bm-text);
  background: var(--bm-white);
  border: 1.5px solid var(--bm-border);
  border-radius: var(--bm-radius-sm);
  transition: border-color var(--bm-transition), box-shadow var(--bm-transition);
  outline: none;
  -webkit-appearance: none;
  appearance: none;
}

.bm-input::placeholder,
.bm-textarea::placeholder {
  color: var(--bm-ash-gray);
}

.bm-input:focus,
.bm-select:focus,
.bm-textarea:focus {
  border-color: var(--bm-secondary);
  box-shadow: 0 0 0 3px rgba(177, 115, 104, 0.12);
}

.bm-input.error,
.bm-select.error,
.bm-textarea.error {
  border-color: #E84545;
  box-shadow: 0 0 0 3px rgba(232, 69, 69, 0.10);
}

.bm-field-error {
  font-size: var(--bm-text-xs);
  color: #E84545;
  margin-top: 4px;
  display: none;
}

.bm-field-error.visible {
  display: block;
}

.bm-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236B4A52' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 44px;
  cursor: pointer;
}

.bm-textarea {
  resize: vertical;
  min-height: 100px;
}

.bm-form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
}

.bm-form-label {
  font-size: var(--bm-text-sm);
  font-weight: 500;
  color: var(--bm-text);
}

/* --------------------------------------------------------------------------
   13. UTILITÁRIOS DE TEXTO
   -------------------------------------------------------------------------- */
.text-center  { text-align: center; }
.text-left    { text-align: left; }
.text-right   { text-align: right; }
.text-white   { color: var(--bm-white) !important; }
.text-primary { color: var(--bm-primary) !important; }
.text-secondary { color: var(--bm-secondary) !important; }
.text-muted   { color: var(--bm-text-sec); }

/* --------------------------------------------------------------------------
   14. UTILITÁRIOS DE ESPAÇAMENTO
   -------------------------------------------------------------------------- */
.mt-0  { margin-top: 0; }
.mt-sm { margin-top: 12px; }
.mt-md { margin-top: 24px; }
.mt-lg { margin-top: 48px; }
.mb-sm { margin-bottom: 12px; }
.mb-md { margin-bottom: 24px; }
.mb-lg { margin-bottom: 48px; }

/* --------------------------------------------------------------------------
   15. ACESSIBILIDADE
   -------------------------------------------------------------------------- */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

:focus-visible {
  outline: 2px solid var(--bm-secondary);
  outline-offset: 3px;
  border-radius: 2px;
}

/* --------------------------------------------------------------------------
   16. SCROLL SUAVE — offset para header fixo
   -------------------------------------------------------------------------- */
:target {
  scroll-margin-top: 90px;
}

/* --------------------------------------------------------------------------
   17. SCROLLBAR PERSONALIZADA (webkit)
   -------------------------------------------------------------------------- */
::-webkit-scrollbar {
  width: 6px;
}
::-webkit-scrollbar-track {
  background: var(--bm-magnolia);
}
::-webkit-scrollbar-thumb {
  background: var(--bm-pale-dogwood);
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--bm-secondary);
}

/* --------------------------------------------------------------------------
   18. SELEÇÃO DE TEXTO
   -------------------------------------------------------------------------- */
::selection {
  background: rgba(177, 115, 104, 0.25);
  color: var(--bm-primary);
}
