:root {
  --olive: #ACB85B;
  --olive-dark: #8f9a48;
  --offwhite: #F5F2EC;
  --gray: #D8D5CF;
  --ink: #22221f;
  --ink-soft: #6f6c64;
  --radius: 2px;
  --display: 'Jost', var(--sans);
  --sans: 'Questrial', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

.consent-overlay {
  position: fixed;
  inset: 0;
  background: rgba(34, 34, 31, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 1000;
}

.consent-modal {
  background: #fff;
  border-radius: var(--radius);
  padding: 32px 28px;
  max-width: 440px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
}
.consent-modal__logo { height: 20px; width: auto; display: block; margin-bottom: 20px; }
.consent-modal h2 {
  font-family: var(--display);
  font-weight: 500;
  font-size: 20px;
  margin: 0 0 14px;
}
.consent-modal p { font-size: 14px; color: var(--ink-soft); margin: 0 0 12px; line-height: 1.6; }
.consent-modal p strong { color: var(--ink); }
.consent-modal__actions { display: flex; gap: 12px; margin-top: 20px; }
.consent-modal__actions .btn-secondary,
.consent-modal__actions .btn-primary { flex: 1; text-align: center; }

html {
  background: var(--offwhite);
}

/* Fundo do site tipo "papel de parede": fica fixo atras de tudo enquanto rola,
   os cards dos passos 1/2/3 (opacos, pintam por cima) flutuam em cima.
   IMPORTANTE: url() aqui dentro do CSS resolve relativo a /css/style.css, entao
   precisa ser /assets/3.png (absoluto) - "assets/3.png" vira /css/assets/3.png
   (404) e nao carrega nada, foi o bug das tentativas anteriores.
   size:contain pra nunca cortar a imagem (cover estourava o zoom em pagina alta). */
body {
  margin: 0;
  color: var(--ink);
  font-family: var(--sans);
  line-height: 1.55;
  background-image: url('/assets/3.png');
  background-repeat: no-repeat;
  background-position: top center;
  background-size: contain;
  background-attachment: fixed;
}

.topbar {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 8px 14px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--gray);
  background: var(--offwhite);
  position: sticky;
  top: 0;
  z-index: 100;
}

@keyframes logo-in {
  0% { opacity: 0; transform: translateY(-6px) scale(0.94); }
  60% { opacity: 1; transform: translateY(0) scale(1.03); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}

.logo {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  animation: logo-in 0.7s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}
.logo img { height: 22px; width: auto; display: block; }

.topbar__tag {
  font-family: var(--display);
  font-size: 11px;
  color: var(--ink-soft);
  text-transform: uppercase;
  letter-spacing: 2px;
}

.wrap {
  max-width: 640px;
  margin: 0 auto;
  padding: 28px 16px 60px;
}

.hero {
  text-align: left;
  margin-bottom: 32px;
  max-width: 460px;
  background: rgba(245, 242, 236, 0.9);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  padding: 20px 24px;
  border-radius: var(--radius);
}
.hero h1 {
  font-family: var(--display);
  font-weight: 500;
  letter-spacing: 0.5px;
  font-size: clamp(24px, 4.5vw, 32px);
  margin: 0 0 12px;
  color: var(--ink);
}
.hero p { color: var(--ink-soft); margin: 0; }
.help-toggle { margin-top: 12px; }

.help-panel {
  background: #fff;
  border: 1px solid var(--gray);
  border-radius: var(--radius);
  padding: 20px 22px;
  margin-bottom: 20px;
}
.help-panel__steps {
  margin: 0 0 14px;
  padding-left: 18px;
  font-size: 14px;
  line-height: 1.7;
}
.help-panel__steps strong { font-weight: 600; }
.help-panel__note {
  font-size: 12px;
  color: var(--ink-soft);
  margin: 0;
  padding-top: 14px;
  border-top: 1px solid var(--gray);
}

.steps { margin: 0; padding: 0; display: flex; flex-direction: column; gap: 20px; }
.steps-col { display: flex; flex-direction: column; gap: 20px; }

.step {
  display: flex;
  gap: 18px;
  background: #fff;
  border: 1px solid var(--gray);
  border-radius: var(--radius);
  padding: 24px;
}

.step__num {
  flex: 0 0 auto;
  font-family: var(--display);
  font-weight: 500;
  font-size: 13px;
  letter-spacing: 1px;
  color: var(--olive-dark);
  padding-top: 2px;
}

.step__body { flex: 1; min-width: 0; }
.step__body h2 {
  font-family: var(--display);
  font-weight: 500;
  letter-spacing: 0.5px;
  font-size: 17px;
  margin: 0 0 14px;
  text-transform: uppercase;
}
.hint { font-size: 13px; color: var(--ink-soft); margin: -8px 0 14px; }

.picker-collection {
  font-family: var(--display);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--olive-dark);
  margin: -6px 0 12px;
}

.picker-tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.picker-tab {
  font-family: var(--display);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--ink-soft);
  background: #fff;
  border: 1px solid var(--gray);
  border-radius: 999px;
  padding: 7px 14px;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.picker-tab:hover { border-color: var(--olive); }
.picker-tab.active { background: var(--olive-dark); border-color: var(--olive-dark); color: #fff; }

.product-picker-wrap {
  position: relative;
  overflow: hidden;
  max-height: 4000px;
  transition: max-height 0.35s ease;
}
.product-picker-wrap.collapsed { max-height: 360px; }
.product-picker-wrap.collapsed::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 64px;
  background: linear-gradient(to bottom, transparent, #fff);
  pointer-events: none;
}

.product-picker {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 10px;
}

.picker-toggle {
  display: block;
  margin: 12px 0 0;
}

.product-card {
  border: 1px solid var(--gray);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  background: var(--offwhite);
  text-align: left;
  padding: 0;
}
.product-card img { width: 100%; aspect-ratio: 3/4; object-fit: cover; display: block; }
.product-card span { display: block; font-size: 12px; padding: 7px 8px; color: var(--ink); }
.product-card.selected { border-color: var(--olive); border-width: 2px; }

.product-selected {
  display: flex;
  gap: 12px;
  align-items: center;
}
.product-selected img { width: 64px; height: 84px; object-fit: cover; border-radius: 2px; }
.product-selected p { margin: 0 0 4px; font-weight: 500; }
.size-link { display: block; margin: 0 0 6px; }

.dropzone {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 8px;
  border: 1px dashed var(--gray);
  border-radius: var(--radius);
  padding: 30px;
  text-align: center;
  color: var(--ink-soft);
  cursor: pointer;
  min-height: 140px;
}
.dropzone.dragover { border-color: var(--olive); background: #f9faf2; }
.dropzone img { max-height: 220px; border-radius: 2px; object-fit: cover; }

.btn-primary {
  background: var(--olive);
  color: #fff;
  border: none;
  padding: 14px 24px;
  border-radius: var(--radius);
  font-family: var(--display);
  font-size: 13px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  cursor: pointer;
  width: 100%;
}
.btn-primary:disabled { opacity: 0.35; cursor: not-allowed; }
.btn-primary:not(:disabled):hover { background: var(--olive-dark); }

.btn-secondary {
  display: inline-block;
  background: var(--ink);
  color: #fff;
  text-decoration: none;
  padding: 11px 20px;
  border-radius: var(--radius);
  font-family: var(--display);
  font-size: 12px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
}

.btn-link {
  background: none;
  border: none;
  color: var(--olive-dark);
  text-decoration: underline;
  cursor: pointer;
  font-size: 13px;
  padding: 0;
}

.result { margin-top: 20px; }
.result img { width: 100%; border-radius: var(--radius); display: block; background: var(--gray); }
.result__actions { display: flex; flex-direction: column; gap: 12px; margin-top: 14px; }
.result__actions-row { display: flex; align-items: center; gap: 18px; }
.btn-buy { display: block; text-align: center; text-decoration: none; }

.suggestions { margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--gray); }
.suggestions__title {
  font-family: var(--display);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--olive-dark);
  margin: 0 0 10px;
}
.suggestions__list { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
.suggestion-card {
  border: 1px solid var(--gray);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  background: var(--offwhite);
  padding: 0;
  text-align: left;
}
.suggestion-card img { width: 100%; aspect-ratio: 3/4; object-fit: cover; display: block; }
.suggestion-card span { display: block; font-size: 11px; padding: 6px 7px; color: var(--ink); }
.suggestion-card:hover { border-color: var(--olive); }

.loading { margin-top: 20px; text-align: center; color: var(--ink-soft); }
.loading__preview {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 16px;
}
.loading__preview img {
  width: 72px;
  height: 96px;
  object-fit: cover;
  border-radius: var(--radius);
  border: 1px solid var(--gray);
  background: var(--gray);
}
.loading__plus {
  font-family: var(--display);
  font-size: 16px;
  color: var(--olive-dark);
}
.spinner {
  width: 32px; height: 32px; margin: 0 auto 12px;
  border: 2px solid var(--gray);
  border-top-color: var(--olive);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.error {
  color: #8a4a1e;
  background: #f7efe4;
  border: 1px solid #e6d4b8;
  padding: 10px 12px;
  font-size: 13px;
  margin-top: 12px;
  border-radius: var(--radius);
}

.hidden { display: none !important; }

.footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  text-align: center;
  font-family: var(--display);
  font-size: 11px;
  letter-spacing: 1.5px;
  color: var(--ink-soft);
  padding: 28px;
}
.footer__mark { height: 13px; width: auto; opacity: 0.75; }

/* Desktop: peca + foto na esquerda, resultado grande fixo na direita (evita coluna unica esticada). */
@media (min-width: 900px) {
  .wrap { max-width: 1080px; padding: 48px 32px 80px; }
  .hero { margin-bottom: 40px; }

  .steps {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(360px, 440px);
    align-items: start;
    gap: 24px;
  }

  /* Colunas independentes: a coluna da esquerda cresce so com o proprio conteudo
     (passo 1 + passo 2), sem herdar altura do resultado na direita. Sem isso, o grid
     inflava a linha pra caber o resultado e sobrava espaco vazio embaixo do passo 1. */
  .step[data-step="3"] {
    position: sticky;
    top: 88px; /* abaixo do topbar, que agora tambem e sticky (~64px de altura) */
  }
}

/* Abaixo do breakpoint desktop (900px), sem banner de fundo. */
@media (max-width: 899px) {
  body { background-image: none; }
}

@media (max-width: 480px) {
  .topbar { padding: 14px 16px; }
  .logo img { height: 19px; }
  .topbar__tag { font-size: 10px; letter-spacing: 1.5px; }

  .wrap { padding: 20px 14px 48px; }
  .hero { margin-bottom: 24px; }

  .step { padding: 16px; gap: 14px; }
  .step__body h2 { font-size: 15px; margin-bottom: 10px; }

  .product-picker { grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 8px; }

  .dropzone { padding: 20px; min-height: 120px; }
  .dropzone img { max-height: 180px; }

  .result__actions-row { flex-wrap: wrap; gap: 12px 18px; }
}
