/* ===================================================================
   Isa Grauncke — Link-in-Bio
   styles.css — Estilos não-críticos (carregados assincronamente)
   =================================================================== */

/* ------------------------------------------------------------------
   Lista de links (botões de navegação)
   ------------------------------------------------------------------ */

/* Sem marcadores e sem padding padrão de lista */
.links-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 0;
  margin: 0;
}

.links-list__item {
  width: 100%;
}

/* ------------------------------------------------------------------
   Base de todos os botões
   ------------------------------------------------------------------ */
.btn {
  display: flex;
  align-items: center;
  width: 100%;
  height: 56px;
  padding: 0 20px;
  border-radius: var(--radius-btn);
  text-decoration: none;
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  font-size: 15px;
  font-weight: 500;
  color: var(--text-primary);
  position: relative;
  outline-offset: 3px;
  /* Remove highlight azul nativo no mobile */
  -webkit-tap-highlight-color: transparent;
  /* Estado inicial para animação de entrada (requer JS) */
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 400ms ease-out, transform 400ms ease-out,
              box-shadow 200ms ease, background-color 200ms ease, border-color 200ms ease;
}

/* ------------------------------------------------------------------
   Variantes de botão
   ------------------------------------------------------------------ */

/* CTA principal — fundo dourado */
.btn--accent {
  background-color: var(--accent);
  color: #FFFFFF;
  font-weight: 600;
  font-size: 15px;
  box-shadow: 0 4px 16px rgba(212, 165, 116, 0.35);
}

/* Botão padrão — fundo branco com borda sutil */
.btn--default {
  background-color: var(--bg-card);
  color: var(--text-primary);
  border: 1px solid var(--border);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

/* ------------------------------------------------------------------
   Partes internas do botão
   ------------------------------------------------------------------ */

/* Ícone à esquerda */
.btn__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 24px;
  height: 24px;
}

/* Texto: ocupa o espaço restante e fica centralizado */
.btn__text {
  flex: 1;
  text-align: center;
}

/* Seta sutil à direita */
.btn__arrow {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  opacity: 0.35;
  transition: opacity 200ms ease;
}

.btn--accent .btn__arrow {
  opacity: 0.65;
}

/* ------------------------------------------------------------------
   Hover (apenas em dispositivos com ponteiro preciso — desktop)
   ------------------------------------------------------------------ */
@media (hover: hover) and (pointer: fine) {
  .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.10);
  }

  .btn--accent:hover {
    background-color: var(--accent-hover);
    box-shadow: 0 8px 24px rgba(184, 137, 90, 0.40);
  }

  .btn--default:hover {
    border-color: rgba(212, 165, 116, 0.50);
  }

  .btn:hover .btn__arrow {
    opacity: 0.6;
  }
}

/* ------------------------------------------------------------------
   Active state — leve compressão ao tocar (funciona em mobile e desktop)
   ------------------------------------------------------------------ */
.btn:active {
  transform: scale(0.98) !important;
  transition: transform 100ms ease !important;
}

/* ------------------------------------------------------------------
   Foco via teclado — outline dourado personalizado
   ------------------------------------------------------------------ */
.btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  box-shadow: 0 0 0 4px rgba(212, 165, 116, 0.20);
}

/* ------------------------------------------------------------------
   Seção de newsletter (CTA ancora)
   ------------------------------------------------------------------ */
.newsletter-section {
  margin-top: 32px;
  padding: 20px;
  background-color: var(--bg-card);
  border-radius: var(--radius-btn);
  border: 1px solid var(--border);
  text-align: center;
}

.newsletter-section p {
  font-size: 14px;
  color: var(--text-secondary);
}

/* ------------------------------------------------------------------
   Rodapé
   ------------------------------------------------------------------ */
.footer {
  padding: 48px 0 32px;
  text-align: center;
}

.footer__copy {
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.footer__disclaimer {
  font-size: 11px;
  color: var(--text-secondary);
  opacity: 0.55;
}

/* ------------------------------------------------------------------
   Animações de entrada — estado "visível" adicionado pelo JS
   ------------------------------------------------------------------ */

/* Quando o JS adiciona .is-visible ao elemento */
.is-visible {
  opacity: 1 !important;
  transform: translateY(0) !important;
}

/* Garante que o hover funcione depois da animação (sem conflito de transform) */
@media (hover: hover) and (pointer: fine) {
  .btn.is-visible:hover {
    transform: translateY(-2px) !important;
  }
}

.btn.is-visible:active {
  transform: scale(0.98) !important;
}

/* ------------------------------------------------------------------
   Respeita preferência por movimento reduzido (acessibilidade)
   ------------------------------------------------------------------ */
@media (prefers-reduced-motion: reduce) {
  .btn,
  .hero,
  .avatar-wrapper,
  .hero__name,
  .hero__tagline {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
    animation: none !important;
  }

  .is-visible {
    transition: none !important;
  }

  .btn {
    transition: box-shadow 200ms ease, background-color 200ms ease !important;
  }
}

/* ==================================================================
   Seção Instagram — grid horizontal com lazy-loading
   ================================================================== */

.instagram-section {
  margin-top: 40px;
  padding-bottom: 4px;
  /* Animação de entrada (controlada pelo JS via IntersectionObserver) */
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 400ms ease-out, transform 400ms ease-out;
}

.instagram-section.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.section-title {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
  text-align: center;
  margin-bottom: 16px;
  letter-spacing: -0.2px;
}

/* Scroll horizontal snapping — 3 cards lado a lado */
.instagram-grid {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 12px;
  /* Esconde scrollbar mas mantém funcionalidade */
  scrollbar-width: none;
}
.instagram-grid::-webkit-scrollbar { display: none; }

.instagram-embed-wrapper {
  flex: 0 0 280px;
  scroll-snap-align: start;
  border-radius: 16px;
  overflow: hidden;
  background: var(--bg-card);
  border: 1px solid var(--border);
  min-height: 320px;
  display: flex;
  align-items: stretch;
}

/* Bloco do embed — remove margens padrão do Instagram */
.instagram-embed-wrapper .instagram-media {
  margin: 0 !important;
  min-width: unset !important;
  max-width: 100% !important;
  width: 100% !important;
  border-radius: 0 !important;
}

/* Placeholder visual enquanto o embed carrega */
.ig-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 200px;
  width: 100%;
  padding: 20px;
  color: var(--text-secondary);
  text-align: center;
  font-size: 13px;
}

/* Link "Ver todos" abaixo do grid */
.instagram-cta {
  display: block;
  text-align: center;
  font-size: 14px;
  font-weight: 500;
  color: var(--accent);
  text-decoration: none;
  padding: 12px 8px 4px;
  transition: color 200ms ease;
}
.instagram-cta:hover { color: var(--accent-hover); }
.instagram-cta:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

/* Reduzir movimento: sem animação */
@media (prefers-reduced-motion: reduce) {
  .instagram-section { opacity: 1 !important; transform: none !important; }
}

/* ==================================================================
   Popup de captura de e-mail
   ================================================================== */

.popup {
  position: fixed;
  inset: 0;
  z-index: 900;
  display: flex;
  align-items: flex-end;  /* Mobile: surge da parte inferior */
  justify-content: center;
  padding: 0;
}

/* Desktop: centralizado */
@media (min-width: 480px) {
  .popup {
    align-items: center;
    padding: 16px;
  }
}

/* Esconde quando hidden */
.popup[hidden] { display: none; }

/* Overlay escuro com blur */
.popup__overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  cursor: pointer;
  animation: fade-in 300ms ease both;
}

/* Card do popup */
.popup__card {
  position: relative;
  background: var(--bg-card);
  border-radius: 24px 24px 0 0;
  padding: 36px 24px 32px;
  width: 100%;
  max-width: 420px;
  z-index: 1;
  box-shadow: 0 -8px 48px rgba(0, 0, 0, 0.15);
  animation: popup-slide-up 380ms cubic-bezier(0.34, 1.10, 0.64, 1) both;
}

@media (min-width: 480px) {
  .popup__card {
    border-radius: 24px;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.18);
  }
}

/* Animações do popup */
@keyframes popup-slide-up {
  from { opacity: 0; transform: translateY(32px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* Botão X de fechar */
.popup__close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: var(--bg-primary);
  border: none;
  border-radius: 50%;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-secondary);
  transition: background-color 150ms ease, color 150ms ease;
}
.popup__close:hover { background: var(--border); color: var(--text-primary); }
.popup__close:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Emoji de destaque */
.popup__emoji {
  font-size: 40px;
  display: block;
  margin-bottom: 14px;
  line-height: 1;
}

.popup__title {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 22px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 8px;
  line-height: 1.3;
}

.popup__desc {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 20px;
}

/* Formulário */
.popup__form {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 10px;
}

.popup__input {
  width: 100%;
  height: 50px;
  padding: 0 16px;
  border: 1.5px solid var(--border);
  border-radius: 12px;
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 15px;
  color: var(--text-primary);
  background: var(--bg-primary);
  outline: none;
  transition: border-color 200ms ease, box-shadow 200ms ease;
}
.popup__input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(212, 165, 116, 0.15);
}
.popup__input::placeholder { color: var(--text-secondary); opacity: 0.65; }
.popup__input:invalid:not(:placeholder-shown) { border-color: #e05c5c; }

/* Botão de submit — reutiliza classe .btn--accent mas sem animação de entrada */
.popup__submit {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 52px;
  border: none;
  border-radius: var(--radius-btn);
  background: var(--accent);
  color: #fff;
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 200ms ease, transform 100ms ease;
}
.popup__submit:hover { background: var(--accent-hover); }
.popup__submit:active { transform: scale(0.98); }
.popup__submit:disabled { opacity: 0.6; cursor: wait; }
.popup__submit:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

/* Variante: botão de fechar (estado sucesso) */
.popup__submit--outline {
  background: transparent;
  border: 1.5px solid var(--border);
  color: var(--text-secondary);
  margin-top: 8px;
}
.popup__submit--outline:hover { background: var(--bg-primary); }

/* Mensagem de erro */
.popup__error {
  font-size: 13px;
  color: #c0392b;
  text-align: center;
  padding: 6px 0 2px;
}
.popup__error[hidden] { display: none; }

.popup__privacy {
  font-size: 11px;
  color: var(--text-secondary);
  opacity: 0.55;
  text-align: center;
  padding-top: 2px;
}

/* Estado de sucesso */
.popup__state[hidden] { display: none; }
#popup-state-success { text-align: center; padding: 8px 0; }

/* Reduzir movimento: sem slide */
@media (prefers-reduced-motion: reduce) {
  .popup__card, .popup__overlay { animation: none !important; }
}

/* ==================================================================
   Highlight da seção newsletter (acionado pelo popup CTA)
   ================================================================== */
.newsletter-section--highlight {
  box-shadow: 0 0 0 2px var(--accent);
  transition: box-shadow 200ms ease;
}

/* ==================================================================
   Favoritos — grid de produtos (usado em favoritos/index.html)
   ================================================================== */

.produtos-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
  padding-bottom: 40px;
}

@media (max-width: 360px) {
  .produtos-grid { grid-template-columns: 1fr; }
}

.produto-card {
  background: var(--bg-card);
  border-radius: 16px;
  border: 1px solid var(--border);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 200ms ease, box-shadow 200ms ease;
}

@media (hover: hover) and (pointer: fine) {
  .produto-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
  }
}

.produto-card__img-wrapper {
  aspect-ratio: 1 / 1;
  background: var(--bg-primary);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.produto-card__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 300ms ease;
}

@media (hover: hover) and (pointer: fine) {
  .produto-card:hover .produto-card__img { transform: scale(1.04); }
}

.produto-card__img-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  color: var(--text-secondary);
  opacity: 0.4;
  font-size: 12px;
  width: 100%;
  height: 100%;
}

.produto-card__body {
  padding: 12px 12px 14px;
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: 6px;
}

.produto-card__badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 2px 8px;
  border-radius: 999px;
  align-self: flex-start;
  background: rgba(212, 165, 116, 0.15);
  color: var(--accent-hover);
}

.produto-card__nome {
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.35;
}

.produto-card__desc {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.5;
  flex: 1;
}

.produto-card__preco {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary);
}

.produto-card__btn {
  display: block;
  width: 100%;
  height: 38px;
  line-height: 38px;
  text-align: center;
  background: var(--accent);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  border-radius: 10px;
  text-decoration: none;
  transition: background-color 200ms ease;
  margin-top: 4px;
}
.produto-card__btn:hover { background: var(--accent-hover); }
.produto-card__btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

/* Filtros de categoria */
.filtros {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: none;
  margin-bottom: 20px;
}
.filtros::-webkit-scrollbar { display: none; }

.filtro-btn {
  flex: 0 0 auto;
  height: 36px;
  padding: 0 16px;
  border-radius: 999px;
  border: 1.5px solid var(--border);
  background: var(--bg-card);
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: border-color 200ms ease, background-color 200ms ease, color 200ms ease;
  white-space: nowrap;
}
.filtro-btn:hover { border-color: var(--accent); color: var(--accent-hover); }
.filtro-btn.ativo {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.filtro-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

/* Estado de loading */
.loading-state {
  text-align: center;
  padding: 40px 0;
  color: var(--text-secondary);
  font-size: 14px;
}

/* Volta ao topo — link de navegação na página de favoritos */
.page-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  text-decoration: none;
  padding: 20px 0 4px;
  transition: color 200ms ease;
}
.page-back:hover { color: var(--accent); }
.page-back:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

.page-header {
  padding: 12px 0 24px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 24px;
}

.page-header h1 {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 24px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.page-header p {
  font-size: 14px;
  color: var(--text-secondary);
}
