/* ==========================================================================
   DOHA CLOUD DESIGN SYSTEM — BASE
   Reset, tipografia, acessibilidade e utilitários mínimos.
   ========================================================================== */

*,
*::before,
*::after {
  box-sizing: border-box;
}

* {
  margin: 0;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  /* Compensa o header fixo ao pular por âncora */
  scroll-padding-top: calc(var(--header-h) + var(--space-4));
}

body {
  min-height: 100dvh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: var(--leading-normal);
  font-weight: var(--weight-regular);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  /* Preços e quantidades não podem "dançar" ao mudar de valor */
  font-variant-numeric: tabular-nums;
  /* Remove o atraso de 300ms no toque */
  touch-action: manipulation;
  overflow-x: hidden;
  transition: background-color var(--dur-base) var(--ease-std),
              color var(--dur-base) var(--ease-std);
}

img,
picture,
svg,
video {
  display: block;
  max-width: 100%;
}

/* Todo SVG do sprite nasce com tamanho definido. Sem isto um ícone dentro de
   um bloco sem largura fixa se estica até preencher o contêiner. */
.icon {
  width: var(--icon-md);
  height: var(--icon-md);
  flex: none;
  display: inline-block;
  vertical-align: -0.18em;
}

.icon--sm { width: var(--icon-sm); height: var(--icon-sm); }
.icon--lg { width: var(--icon-lg); height: var(--icon-lg); }

/* Ícone dentro de texto corrido acompanha a escala da fonte */
.field__hint .icon,
.footer__legal .icon,
.option__desc .icon {
  width: var(--icon-sm);
  height: var(--icon-sm);
}

img {
  height: auto;
}

input,
button,
textarea,
select {
  font: inherit;
  color: inherit;
}

button {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
}

a {
  color: inherit;
  text-decoration: none;
}

ul,
ol {
  list-style: none;
  padding: 0;
}

/* --------------------------------------------------------------------------
   Tipografia
   -------------------------------------------------------------------------- */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: var(--weight-extra);
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-tight);
  color: var(--text-strong);
  text-wrap: balance;
}

h1 { font-size: var(--text-3xl); font-weight: var(--weight-extra); }
h2 { font-size: var(--text-2xl); }
h3 { font-size: var(--text-xl); }
h4 { font-size: var(--text-lg); }
h5 { font-size: var(--text-md); }
h6 { font-size: var(--text-base); }

p {
  text-wrap: pretty;
}

::selection { background: var(--p-gold-300); color: var(--p-gray-900); }

/* Título de peso: Manrope extra-bold, sem apertar a letra. É o que as
   artes da marca usam no texto de apoio dos banners. */
.poster,
.display {
  font-family: var(--font-display);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.1;
}

/* Rótulo pequeno em caixa alta */
.mono,
.eyebrow {
  font-family: var(--font-body);
  font-size: var(--text-2xs);
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  line-height: 1.35;
}

.eyebrow { color: var(--text-muted); display: inline-block; }
.eyebrow--light { color: #c9c9c4; }

/* Palavra em destaque: o amarelo das chamadas dos banners */
.gold-text { color: var(--brand-text); }

.ulink { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.ulink:hover { text-decoration-thickness: 2px; }

/* Rótulo de seção em caixa alta — usado nos títulos de categoria */
.overline {
  font-size: var(--text-2xs);
  font-weight: var(--weight-bold);
  letter-spacing: var(--tracking-caps);
  text-transform: uppercase;
  color: var(--text-muted);
}

.text-muted  { color: var(--text-muted); }
.text-subtle { color: var(--text-subtle); }

/* Preço: sempre tabular, sempre com hierarquia clara */
.price {
  font-family: var(--font-display);
  font-weight: var(--weight-extra);
  letter-spacing: var(--tracking-snug);
  font-variant-numeric: tabular-nums;
  color: var(--text-strong);
}

.price--old {
  font-family: var(--font-body);
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  color: var(--text-subtle);
  text-decoration: line-through;
  text-decoration-thickness: 1.5px;
}

.price--unit {
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  color: var(--text-muted);
}

/* --------------------------------------------------------------------------
   Acessibilidade
   -------------------------------------------------------------------------- */

/* Foco visível em tudo que é operável — nunca remover, só estilizar */
:where(a, button, input, select, textarea, [tabindex]):focus-visible {
  outline: 2px solid var(--focus-color);
  outline-offset: 2px;
  border-radius: var(--radius-xs);
}

/* Some com o foco no clique de mouse, mantém no teclado */
:where(a, button):focus:not(:focus-visible) {
  outline: none;
}

.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;
}

/* Pular para o conteúdo — primeiro tab da página */
.skip-link {
  position: absolute;
  top: var(--space-2);
  left: var(--space-2);
  z-index: var(--z-toast);
  padding: var(--space-3) var(--space-4);
  background: var(--brand);
  color: var(--on-brand);
  border-radius: var(--radius-sm);
  font-weight: var(--weight-semibold);
  transform: translateY(-160%);
  transition: transform var(--dur-fast) var(--ease-out);
}

.skip-link:focus-visible {
  transform: translateY(0);
}

[hidden] {
  display: none !important;
}

[aria-disabled='true'],
:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  pointer-events: none;
}

/* --------------------------------------------------------------------------
   Movimento reduzido — desliga animação, mantém a informação
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* --------------------------------------------------------------------------
   Barra de rolagem
   -------------------------------------------------------------------------- */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--border-strong) transparent;
}

*::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

*::-webkit-scrollbar-track {
  background: transparent;
}

*::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border-radius: var(--radius-full);
  border: 3px solid transparent;
  background-clip: content-box;
}

*::-webkit-scrollbar-thumb:hover {
  background: var(--text-subtle);
  background-clip: content-box;
}

/* Esconde a barra sem perder o scroll — usado nos trilhos horizontais */
.no-scrollbar {
  scrollbar-width: none;
}

.no-scrollbar::-webkit-scrollbar {
  display: none;
}

/* --------------------------------------------------------------------------
   Utilitários de layout usados pelo DS
   -------------------------------------------------------------------------- */
.stack     { display: flex; flex-direction: column; }
.row       { display: flex; align-items: center; }
.row-between { display: flex; align-items: center; justify-content: space-between; }
.gap-1 { gap: var(--space-1); }
.gap-2 { gap: var(--space-2); }
.gap-3 { gap: var(--space-3); }
.gap-4 { gap: var(--space-4); }
.gap-6 { gap: var(--space-6); }
.grow  { flex: 1 1 auto; min-width: 0; }

/* Trunca em 1 ou 2 linhas — preferimos quebrar, mas card tem altura fixa */
.clamp-1,
.clamp-2 {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.clamp-1 { -webkit-line-clamp: 1; line-clamp: 1; }
.clamp-2 { -webkit-line-clamp: 2; line-clamp: 2; }
