/* ==========================================================
   GRANATO JOIAS — GLOBAL CSS
   Reset, base, tipografia, utilities gerais
   ========================================================== */

/* Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,300;0,400;0,500;0,600;1,300;1,400;1,500&family=DM+Sans:wght@300;400;500;600&display=swap');

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

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

body {
  font-family: var(--font-body);
  font-size: var(--text-base);
  font-weight: var(--fw-regular);
  line-height: var(--lh-normal);
  color: var(--c-text);
  background-color: var(--c-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

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

img {
  height: auto;
  object-fit: cover;
}

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

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

input, textarea, select {
  font: inherit;
  border: none;
  outline: none;
  background: none;
}

ul, ol {
  list-style: none;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: var(--fw-light);
  line-height: var(--lh-tight);
  color: var(--c-dark);
  letter-spacing: var(--ls-tight);
}

/* Per-element refinements — letter-spacing e line-height precisos */
h1 { letter-spacing: -0.038em; line-height: 1.06; }
h2 { letter-spacing: -0.025em; line-height: 1.18; }
h3 { letter-spacing: -0.015em; line-height: 1.28; font-weight: var(--fw-regular); }

p {
  line-height: var(--lh-normal);
}

/* ----------------------------------------------------------
   TIPOGRAFIA DISPLAY
---------------------------------------------------------- */
.t-display-1 {
  font-family: var(--font-display);
  font-size: var(--text-5xl);
  font-weight: var(--fw-light);
  letter-spacing: var(--ls-tight);
  line-height: var(--lh-tight);
}
.t-display-2 {
  font-family: var(--font-display);
  font-size: var(--text-4xl);
  font-weight: var(--fw-light);
  letter-spacing: var(--ls-tight);
  line-height: var(--lh-snug);
}
.t-display-3 {
  font-family: var(--font-display);
  font-size: var(--text-3xl);
  font-weight: var(--fw-light);
  line-height: var(--lh-snug);
}
.t-heading {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: var(--fw-regular);
  letter-spacing: var(--ls-tight);
}
.t-subheading {
  font-family: var(--font-body);
  font-size: var(--text-xs);
  font-weight: var(--fw-semibold);
  letter-spacing: var(--ls-widest);
  text-transform: uppercase;
  color: var(--c-gold);
}
.t-label {
  font-size: var(--text-xs);
  font-weight: var(--fw-medium);
  letter-spacing: var(--ls-wider);
  text-transform: uppercase;
}
.t-body   { font-size: var(--text-base); line-height: var(--lh-normal); }
.t-small  { font-size: var(--text-sm);   line-height: var(--lh-normal); }
.t-muted  { color: var(--c-text-muted); }
.t-gold   { color: var(--c-gold); }
.t-wine   { color: var(--c-burgundy); }
.t-italic { font-style: italic; }
.t-center { text-align: center; }

/* ----------------------------------------------------------
   CONTAINER
---------------------------------------------------------- */
.container {
  width: 100%;
  max-width: var(--max-w-2xl);
  margin-inline: auto;
  padding-inline: var(--container-px-mobile);
}

@media (min-width: 768px) {
  .container { padding-inline: var(--container-px-tablet); }
}
@media (min-width: 1024px) {
  .container { padding-inline: var(--container-px-desktop); }
}

.container--narrow { max-width: var(--max-w-lg); }
.container--wide   { max-width: 1600px; }

/* ----------------------------------------------------------
   SPACING UTILITIES
---------------------------------------------------------- */
.mt-auto { margin-top: auto; }
.ml-auto { margin-left: auto; }
.mr-auto { margin-right: auto; }
.mx-auto { margin-inline: auto; }

/* ----------------------------------------------------------
   FLEX / GRID UTILITIES
---------------------------------------------------------- */
.flex            { display: flex; }
.flex-col        { flex-direction: column; }
.flex-wrap       { flex-wrap: wrap; }
.items-center    { align-items: center; }
.items-start     { align-items: flex-start; }
.items-end       { align-items: flex-end; }
.justify-center  { justify-content: center; }
.justify-between { justify-content: space-between; }
.justify-end     { justify-content: flex-end; }
.gap-2           { gap: var(--sp-2); }
.gap-4           { gap: var(--sp-4); }
.gap-6           { gap: var(--sp-6); }
.gap-8           { gap: var(--sp-8); }

/* ----------------------------------------------------------
   DIVIDERS
---------------------------------------------------------- */
.divider {
  width: 100%;
  height: 1px;
  background: var(--c-border);
  border: none;
}

.divider--gold {
  background: linear-gradient(
    90deg,
    transparent 0%,
    var(--c-gold) 30%,
    var(--c-gold) 70%,
    transparent 100%
  );
  height: 1px;
  opacity: 0.6;
}

/* Ornamento central */
.ornament {
  display: flex;
  align-items: center;
  gap: var(--sp-4);
  color: var(--c-gold-muted);
}
.ornament::before,
.ornament::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--c-gold-muted);
  opacity: 0.4;
}

/* ----------------------------------------------------------
   BADGES
---------------------------------------------------------- */
.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 var(--sp-1);
  border-radius: var(--radius-full);
  font-size: 10px;
  font-weight: var(--fw-semibold);
  line-height: 1;
  letter-spacing: 0;
  background: var(--c-burgundy);
  color: var(--c-white);
  font-variant-numeric: tabular-nums;
}
.badge--gold {
  background: var(--c-gold);
  color: var(--c-dark);
}
.badge--hidden { display: none; }

/* ----------------------------------------------------------
   BUTTONS — transições específicas por propriedade
---------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  height: var(--btn-h-base);
  padding-inline: var(--sp-6);
  font-family: var(--font-body);
  font-size: var(--text-xs);
  font-weight: var(--fw-medium);
  letter-spacing: var(--ls-wider);
  text-transform: uppercase;
  border-radius: 0;
  cursor: pointer;
  white-space: nowrap;
  position: relative;
  overflow: hidden;
  /* Transições específicas — sem "all" */
  transition:
    background-color var(--t-base),
    border-color     var(--t-base),
    color            var(--t-base),
    box-shadow       var(--t-base),
    opacity          var(--t-fast);
}

/* Ripple sutil — overlay de currentColor */
.btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: currentColor;
  opacity: 0;
  transition: opacity var(--t-fast);
  pointer-events: none;
}
.btn:hover::after  { opacity: 0.06; }
.btn:active::after { opacity: 0.12; }

/* Disabled */
.btn:disabled,
.btn[aria-disabled="true"] {
  opacity: var(--disabled-opacity);
  pointer-events: none;
  cursor: not-allowed;
}

/* Focus */
.btn:focus-visible {
  outline: 2px solid var(--c-gold);
  outline-offset: var(--focus-ring-offset);
}

/* ------ Variantes ------ */
.btn--primary {
  background: var(--c-burgundy);
  color: var(--c-cream);
  border: 1px solid var(--c-burgundy);
}
.btn--primary:hover {
  background: var(--c-burgundy-light);
  border-color: var(--c-burgundy-light);
  box-shadow: var(--shadow-md);
}
.btn--primary:active {
  background: var(--c-burgundy-dark);
  border-color: var(--c-burgundy-dark);
}

.btn--outline {
  background: transparent;
  color: var(--c-burgundy);
  border: 1px solid var(--c-burgundy);
}
.btn--outline:hover {
  background: var(--c-burgundy);
  color: var(--c-cream);
}
.btn--outline:active {
  background: var(--c-burgundy-dark);
  border-color: var(--c-burgundy-dark);
  color: var(--c-cream);
}

.btn--gold {
  background: var(--c-gold);
  color: var(--c-dark);
  border: 1px solid var(--c-gold);
}
.btn--gold:hover {
  background: var(--c-gold-light);
  border-color: var(--c-gold-light);
  box-shadow: var(--shadow-gold);
}
.btn--gold:active {
  background: var(--c-gold-dark);
  border-color: var(--c-gold-dark);
}

.btn--ghost {
  background: transparent;
  color: var(--c-text);
  border: 1px solid transparent;
}
.btn--ghost:hover {
  background: var(--hover-surface);
  border-color: var(--c-border);
}

/* Hero ghost — para fundos escuros */
.btn--hero-ghost {
  background: transparent;
  border: 1px solid rgba(238,222,196,0.4);
  color: var(--c-cream);
}
.btn--hero-ghost:hover {
  background: rgba(238,222,196,0.1);
  border-color: rgba(238,222,196,0.65);
}
.btn--hero-ghost:active {
  background: rgba(238,222,196,0.18);
}

/* ------ Tamanhos ------ */
.btn--sm {
  height: var(--btn-h-sm);
  padding-inline: var(--sp-4);
  font-size: var(--text-2xs);
}
.btn--lg {
  height: var(--btn-h-lg);
  padding-inline: var(--sp-8);
  font-size: var(--text-sm);
}
.btn--full { width: 100%; }

/* ----------------------------------------------------------
   LINKS COM UNDERLINE ANIMADO
---------------------------------------------------------- */
.link-animated {
  position: relative;
  display: inline-block;
}
.link-animated::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  width: 0;
  height: 1px;
  background: currentColor;
  transition: width var(--t-base);
}
.link-animated:hover::after { width: 100%; }

/* ----------------------------------------------------------
   OVERLAY GLOBAL
---------------------------------------------------------- */
.overlay {
  position: fixed;
  inset: 0;
  top: var(--header-h-mobile);
  background: var(--overlay-dark);
  backdrop-filter: blur(1px);
  z-index: var(--z-overlay);
  opacity: 0;
  visibility: hidden;
  transition:
    opacity    var(--t-drawer),
    visibility var(--t-drawer);
}
.overlay.is-active {
  opacity: 1;
  visibility: visible;
}
@media (min-width: 1024px) {
  .overlay { top: var(--header-h-desktop); }
}

/* ----------------------------------------------------------
   SKELETON LOADER
---------------------------------------------------------- */
@keyframes shimmer {
  0%   { background-position: -400px 0; }
  100% { background-position:  400px 0; }
}
.skeleton {
  background: linear-gradient(
    90deg,
    var(--c-gray-100) 25%,
    var(--c-gray-200) 50%,
    var(--c-gray-100) 75%
  );
  background-size: 800px 100%;
  animation: shimmer 1.4s infinite linear;
  border-radius: var(--radius-sm);
}

/* ----------------------------------------------------------
   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-width: 0;
}

*:focus-visible {
  outline: 2px solid var(--c-gold);
  outline-offset: var(--focus-ring-offset);
}

/* ----------------------------------------------------------
   SCROLL BAR CUSTOMIZADA
---------------------------------------------------------- */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--c-gray-100); }
::-webkit-scrollbar-thumb {
  background: var(--c-gold-muted);
  border-radius: var(--radius-full);
}
::-webkit-scrollbar-thumb:hover { background: var(--c-gold-dark); }

/* ----------------------------------------------------------
   BODY STATE CLASSES
---------------------------------------------------------- */
body.sidebar-open,
body.cart-open {
  overflow: hidden;
}

/* ==========================================================
   GRANATO — ADIÇÕES PREMIUM: TIPOGRAFIA
   ========================================================== */

/* .section-title — classe editorial de destaque para h2/h3 especiais */
.section-title {
  font-family: var(--font-display);
  font-size: clamp(var(--text-2xl), 4vw, var(--text-4xl));
  font-weight: var(--fw-light);
  letter-spacing: -0.032em;
  line-height: 1.12;
  color: var(--c-dark);
}
.section-title em {
  font-style: italic;
  color: var(--c-gold-dark);
}
.section--dark .section-title    { color: var(--c-cream); }
.section--dark .section-title em { color: var(--c-gold-light); }

/* Botão: feedback tátil no active — afunda 1px */
.btn:active {
  transform: translateY(1px);
  transition:
    background-color var(--t-fast),
    border-color     var(--t-fast),
    color            var(--t-fast),
    box-shadow       var(--t-fast),
    transform        var(--t-fast);
}

/* ----------------------------------------------------------
   MOBILE — previne zoom automático do iOS ao focar inputs
   iOS Safari faz zoom quando font-size < 16px.
   Forçamos 16px no foco; visualmente o campo não muda
   pois o zoom que sumiria os botões ao redor não ocorre.
---------------------------------------------------------- */
@media (max-width: 1023px) {
  input[type="text"],
  input[type="search"],
  input[type="number"],
  input[type="email"],
  input[type="tel"],
  input[type="password"],
  select,
  textarea {
    font-size: 1rem; /* 16px — abaixo disso o iOS aplica zoom */
  }
}
