/* =========================================================
   Estilos específicos por página
   ========================================================= */

/* ---------- Hero (home) ---------- */
.hero {
  position: relative;
  padding: 5.5rem 0 4.5rem;
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute;
  top: -30%;
  right: -10%;
  width: 620px;
  height: 620px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(201,161,59,0.16), transparent 70%);
  pointer-events: none;
}
.hero__grid {
  position: relative;
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 3rem;
  align-items: center;
}
.hero__copy p { font-size: 1.05rem; }
.hero__actions { display: flex; gap: 1rem; margin-top: 1.8rem; flex-wrap: wrap; }
.hero__figure {
  position: relative;
  border: 1px solid var(--line);
  padding: 1.2rem;
}
/* Entrada em cascata ao carregar a página, só na hero (acima da dobra) - o
   resto do conteúdo usa .reveal (scroll) em vez de tocar sozinho no load. */
.hero__copy .eyebrow,
.hero__copy h1,
.hero__copy p,
.hero__copy .hero__actions,
.hero__figure {
  animation: fadeInUp 0.7s ease both;
}
.hero__copy .eyebrow { animation-delay: 0.05s; }
.hero__copy h1 { animation-delay: 0.15s; }
.hero__copy p { animation-delay: 0.25s; }
.hero__copy .hero__actions { animation-delay: 0.35s; }
.hero__figure { animation-delay: 0.25s; }
.hero__figure img { width: 100%; height: 420px; object-fit: cover; }
.hero__figure figcaption {
  font-family: var(--font-display);
  font-style: italic;
  color: var(--gold-deep);
  margin-top: 0.8rem;
  text-align: center;
}

/* ---------- Página legal (política de privacidade etc.) ---------- */
.legal-page { max-width: 760px; }
.legal-page h1 { margin-top: 0.4rem; }
.legal-updated { color: var(--ink-soft); font-size: 0.9rem; margin-top: -0.3rem; }
.legal-page h2 { font-family: var(--font-display); font-size: 1.3rem; margin: 2.2rem 0 0.6rem; }
.legal-page p, .legal-page li { line-height: 1.65; }
.legal-page ul { padding-left: 1.2rem; }
.legal-page li { margin: 0.35rem 0; }

/* ---------- Categorias ---------- */
.category-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1rem;
}
.category-card {
  border: 1px solid var(--line);
  padding: 1.6rem 1rem;
  text-align: center;
  background: var(--surface);
  transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
  animation: fadeInUp 0.5s ease both;
}
.category-card:hover { border-color: var(--gold); transform: translateY(-4px); box-shadow: var(--shadow-soft); }
.category-card span {
  display: block;
  font-family: var(--font-display);
  font-size: 1.1rem;
  margin-top: 0.3rem;
}

/* ---------- Grid de produtos ---------- */
.product-toolbar {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  align-items: flex-end;
  margin-bottom: 2.2rem;
  padding-bottom: 1.6rem;
  border-bottom: 1px solid var(--line);
}
.product-toolbar .form-field { margin-bottom: 0; min-width: 190px; }
.product-toolbar .form-field--search { flex: 1; min-width: 220px; }
.product-toolbar .form-field--checkbox {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: auto;
}
.product-toolbar .form-field--checkbox input { width: auto; }
@media (max-width: 480px) {
  .product-toolbar .form-field,
  .product-toolbar .form-field--search { min-width: 100%; }
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.8rem;
}
.product-card {
  background: var(--surface);
  border: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  animation: fadeInUp 0.5s ease both;
}
.product-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-soft); }
.product-card__media { aspect-ratio: 1 / 1; overflow: hidden; position: relative; }
.product-card__media img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.4s ease; }
.product-card:hover .product-card__media img { transform: scale(1.04); }
/* Escalona a entrada dos primeiros cards pra não "piscar" tudo junto -
   funciona tanto pros category-card (estáticos) quanto product-card
   (renderizados via JS), já que é animação CSS pura, dispara sozinha
   assim que o elemento entra no DOM. */
.category-card:nth-child(1), .product-card:nth-child(1) { animation-delay: 0.02s; }
.category-card:nth-child(2), .product-card:nth-child(2) { animation-delay: 0.08s; }
.category-card:nth-child(3), .product-card:nth-child(3) { animation-delay: 0.14s; }
.category-card:nth-child(4), .product-card:nth-child(4) { animation-delay: 0.20s; }
.category-card:nth-child(5), .product-card:nth-child(5) { animation-delay: 0.26s; }
.category-card:nth-child(6), .product-card:nth-child(6) { animation-delay: 0.32s; }
.category-card:nth-child(7), .product-card:nth-child(7) { animation-delay: 0.38s; }
.category-card:nth-child(8), .product-card:nth-child(8) { animation-delay: 0.44s; }
.product-card__discount-tag {
  position: absolute;
  top: 0.7rem;
  left: 0.7rem;
  background: var(--error);
  color: var(--white);
  font-size: 0.72rem;
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius);
  letter-spacing: 0.03em;
}
.product-card__body { padding: 1.1rem 1.1rem 1.3rem; display: flex; flex-direction: column; flex: 1; }
.product-card__body h3 { font-size: 1.15rem; margin-bottom: 0.3rem; }
.product-card__cat { font-size: 0.78rem; color: var(--taupe); margin-bottom: 0.5rem; }
.product-card__price { font-family: var(--font-display); font-size: 1.25rem; color: var(--gold-deep); margin: 0.4rem 0 0.2rem; }
.product-card__price-old { font-family: var(--font-body); font-size: 0.85rem; color: var(--ink-soft); text-decoration: line-through; margin-right: 0.5rem; }
.product-card__installment { font-size: 0.78rem; color: var(--ink-soft); margin: 0 0 0.9rem; }
.product-card__badge {
  font-size: 0.7rem;
  color: var(--gold-deep);
  border: 1px solid var(--gold-light);
  padding: 0.15rem 0.5rem;
  align-self: flex-start;
  margin-bottom: 0.5rem;
}
.product-card .btn { margin-top: auto; }
.empty-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: 3rem 1rem;
  color: var(--ink-soft);
  border: 1px dashed var(--line);
}
.empty-state.empty-state--error { border-color: var(--error-border); color: var(--error); }
.empty-state .btn { margin-top: 1rem; }

/* ---------- Esqueleto de carregamento ---------- */
.skeleton-card {
  background: var(--surface);
  border: 1px solid var(--line);
  overflow: hidden;
}
.skeleton-card__media { aspect-ratio: 1 / 1; }
.skeleton-card__media, .skeleton-line {
  background: linear-gradient(90deg, var(--line) 25%, var(--ivory-deep) 37%, var(--line) 63%);
  background-size: 400% 100%;
  animation: skeleton-pulse 1.4s ease infinite;
}
.skeleton-card__body { padding: 1.1rem; display: grid; gap: 0.6rem; }
.skeleton-line { height: 0.8rem; border-radius: 2px; }
.skeleton-line--wide { width: 100%; }
.skeleton-line--medium { width: 70%; }
.skeleton-line--narrow { width: 40%; }
@keyframes skeleton-pulse {
  0% { background-position: 100% 50%; }
  100% { background-position: 0 50%; }
}
@media (prefers-reduced-motion: reduce) {
  .skeleton-card__media, .skeleton-line { animation: none; }
}

/* ---------- Página de produto ---------- */
.product-detail {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3.5rem;
  align-items: start;
}
.product-detail__media {
  border: 1px solid var(--line);
  padding: 1rem;
}
.product-detail__media img { width: 100%; aspect-ratio: 1/1; object-fit: cover; }
.product-detail__material { color: var(--ink-soft); font-size: 0.9rem; margin: 0.2rem 0 0; }
.product-detail__price {
  font-family: var(--font-display);
  font-size: 2rem;
  color: var(--gold-deep);
  margin: 0.6rem 0 0.2rem;
}
.product-detail__price-old {
  font-family: var(--font-body);
  font-size: 1.1rem;
  color: var(--ink-soft);
  text-decoration: line-through;
  margin-right: 0.6rem;
}
.product-detail__installment { color: var(--ink-soft); font-size: 0.88rem; margin: 0 0 1rem; }
.product-detail__meta { display: flex; gap: 0.6rem; margin-bottom: 1.2rem; flex-wrap: wrap; }
.tag-pill {
  font-size: 0.75rem;
  padding: 0.25rem 0.7rem;
  border: 1px solid var(--line);
  color: var(--ink-soft);
}
.qty-row { display: flex; align-items: center; gap: 1rem; margin: 1.4rem 0; }
.qty-control { display: flex; align-items: center; border: 1px solid var(--line); }
.qty-control button {
  width: 36px; height: 36px;
  background: none; border: none; cursor: pointer;
  font-size: 1.1rem; color: var(--ink);
}
.qty-control input {
  width: 44px; text-align: center; border: none;
  font-family: var(--font-body); font-size: 0.95rem;
  border-left: 1px solid var(--line); border-right: 1px solid var(--line);
  padding: 0.4rem 0;
}
.product-actions { display: flex; gap: 1rem; margin-top: 1.6rem; flex-wrap: wrap; }
.stock-note { font-size: 0.85rem; color: var(--ink-soft); margin-top: 0.6rem; }

/* ---------- Visualizador 3D ---------- */
.viewer-3d {
  width: 100%;
  height: 320px;
  border: 1px solid var(--line);
  background: var(--ivory-deep);
  margin-top: 1.2rem;
  touch-action: none;
}
.viewer-3d-hint { font-size: 0.78rem; color: var(--taupe); text-align: center; margin-top: 0.4rem; }

/* ---------- Calculadora de MDF ---------- */
.mdf-calculator {
  border: 1px solid var(--gold-light);
  background: var(--surface);
  padding: 1.2rem 1.3rem;
  margin: 1.4rem 0;
}
.mdf-calculator h4 { margin-top: 0; font-size: 1rem; }
.mdf-calculator .form-row { grid-template-columns: 1fr 1fr 1fr; display: grid; gap: 0.8rem; }
.mdf-calculator .calculated-price {
  font-family: var(--font-display);
  font-size: 1.5rem;
  color: var(--gold-deep);
  margin-top: 1rem;
}

/* ---------- Carrinho ---------- */
.cart-layout { display: grid; grid-template-columns: 1.6fr 1fr; gap: 3rem; align-items: start; }
.cart-item {
  display: grid;
  grid-template-columns: 84px 1fr auto;
  gap: 1.1rem;
  padding: 1.2rem 0;
  border-bottom: 1px solid var(--line);
  align-items: center;
}
.cart-item img { width: 84px; height: 84px; object-fit: cover; }
.cart-item h4 { margin: 0 0 0.2rem; font-size: 1.05rem; }
.cart-item .note { font-size: 0.8rem; color: var(--taupe); }
.cart-item__price { font-family: var(--font-display); color: var(--gold-deep); }
.cart-item__remove {
  background: none; border: none; color: var(--error);
  font-size: 0.8rem; cursor: pointer; margin-top: 0.4rem;
}
.summary-box {
  border: 1px solid var(--line);
  padding: 1.8rem;
  background: var(--surface);
  position: sticky;
  top: 100px;
}
.summary-row { display: flex; justify-content: space-between; margin-bottom: 0.8rem; font-size: 0.95rem; color: var(--ink-soft); }
.summary-row.total {
  font-family: var(--font-display);
  font-size: 1.3rem;
  color: var(--ink);
  border-top: 1px solid var(--line);
  padding-top: 1rem;
  margin-top: 1rem;
}
.empty-cart { text-align: center; padding: 4rem 1rem; }

/* ---------- Checkout / confirmação ---------- */
.order-confirmation {
  text-align: center;
  padding: 4rem 1.5rem;
  border: 1px solid var(--gold-light);
  background: var(--surface);
}
.order-confirmation .order-id { font-family: var(--font-display); color: var(--gold-deep); font-size: 1.3rem; }

/* ---------- Página institucional / contato ---------- */
.split-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 3.5rem; }
.info-list { list-style: none; padding: 0; margin: 1.5rem 0; display: grid; gap: 0.9rem; }
.info-list li { display: flex; gap: 0.7rem; color: var(--ink-soft); font-size: 0.95rem; }
.info-list strong { color: var(--ink); min-width: 90px; display: inline-block; }

/* ---------- Boas-vindas (home) ---------- */
.welcome-strip { background: var(--ivory-deep); }
.welcome-list {
  list-style: none;
  margin: 1.5rem 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.9rem;
}
.welcome-list li {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem 1.1rem;
  font-size: 0.95rem;
  color: var(--ink);
  display: flex;
  align-items: flex-start;
  gap: 0.8rem;
}
.welcome-list li svg { flex-shrink: 0; color: var(--gold-deep); margin-top: 0.15rem; }
.welcome-list li strong { display: block; font-size: 0.95rem; margin-bottom: 0.2rem; }
.welcome-list li span { display: block; color: var(--ink-soft); font-size: 0.83rem; line-height: 1.4; }
.welcome-payment {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1rem;
  align-items: center;
  margin: 1.2rem 0 0.6rem;
  font-size: 0.95rem;
  color: var(--ink-soft);
}
.welcome-payment strong { color: var(--ink); display: inline-flex; align-items: center; gap: 0.4rem; }
.welcome-payment strong svg { color: var(--gold-deep); }
.welcome-promo { font-weight: 500; color: var(--gold-deep); margin: 0 0 0.4rem; }
.welcome-promo a { text-decoration: underline; text-underline-offset: 2px; }

/* ---------- Chat de atendimento ---------- */
.chat-toggle {
  position: fixed;
  right: 1.5rem;
  bottom: 1.5rem;
  z-index: 60;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  border: 2px solid var(--gold-deep);
  background: var(--gold-deep);
  color: var(--white);
  font-size: 1.5rem;
  cursor: pointer;
  box-shadow: var(--shadow-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 0;
  transition: transform 0.15s ease;
}
.chat-toggle:hover { transform: scale(1.06); }
.chat-toggle__avatar { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; display: block; }

/* Bolha de aviso proativa (some sozinha uma vez por sessão) */
.chat-bubble-tip {
  position: fixed;
  right: 1.5rem;
  bottom: 6.2rem;
  z-index: 59;
  max-width: min(260px, calc(100vw - 3rem));
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
  padding: 0.8rem 1.9rem 0.8rem 0.9rem;
  font-size: 0.85rem;
  line-height: 1.4;
  color: var(--ink);
  cursor: pointer;
  display: none;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.25s ease, transform 0.25s ease;
}
.chat-bubble-tip.is-visible { display: block; opacity: 1; transform: translateY(0); }
.chat-bubble-tip strong { color: var(--gold-deep); }
.chat-bubble-tip__close {
  position: absolute;
  top: 0.3rem;
  right: 0.5rem;
  background: none;
  border: none;
  color: var(--ink-soft);
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  padding: 0.2rem;
}
@media (max-width: 480px) {
  .chat-bubble-tip { right: 1rem; bottom: 5.4rem; }
}

.chat-panel {
  position: fixed;
  right: 1.5rem;
  bottom: 5.5rem;
  z-index: 60;
  width: min(360px, calc(100vw - 2.4rem));
  height: min(520px, calc(100vh - 8rem));
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
  display: none;
  flex-direction: column;
  overflow: hidden;
}
.chat-panel.is-open { display: flex; }

.chat-panel__header {
  padding: 0.9rem 1.1rem;
  background: var(--ink-fixed);
  color: var(--cream-fixed);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.chat-panel__header strong { font-family: var(--font-display); font-size: 1.05rem; display: block; }
.chat-panel__subtitle { display: block; font-size: 0.72rem; color: #C9C1AE; margin-top: 0.15rem; }
.chat-panel__close { background: none; border: none; color: var(--cream-fixed); cursor: pointer; line-height: 1; display: inline-flex; align-items: center; flex-shrink: 0; }
.chat-panel__identity { display: flex; align-items: center; gap: 0.6rem; min-width: 0; }
.chat-panel__avatar {
  width: 2.4rem;
  height: 2.4rem;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  border: 1.5px solid var(--gold-deep);
}

.chat-featured {
  align-self: stretch;
  display: flex;
  gap: 0.6rem;
  overflow-x: auto;
  padding-bottom: 0.2rem;
  margin-top: 0.1rem;
}
.chat-featured__item {
  flex: 0 0 auto;
  width: 6.5rem;
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 10px;
  padding: 0.4rem;
  cursor: pointer;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  transition: border-color 0.15s ease;
}
.chat-featured__item:hover { border-color: var(--gold-deep); }
.chat-featured__item img {
  width: 100%;
  height: 5.2rem;
  object-fit: cover;
  border-radius: 6px;
  display: block;
}
.chat-featured__name {
  font-size: 0.72rem;
  line-height: 1.25;
  color: var(--ink);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.chat-featured__price { font-size: 0.72rem; font-weight: 600; color: var(--gold-deep); }

.chat-suggestions { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.2rem; }
.chat-suggestion {
  border: 1px solid var(--gold-deep);
  background: var(--surface);
  color: var(--gold-deep);
  font-family: var(--font-body);
  font-size: 0.8rem;
  padding: 0.45rem 0.75rem;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}
.chat-suggestion:hover { background: var(--gold-deep); color: var(--white); }

.chat-panel__messages {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  background: var(--ivory);
}

.chat-order-card {
  align-self: stretch;
  background: var(--surface);
  border: 1px solid var(--gold-deep);
  border-radius: 10px;
  padding: 0.8rem 0.9rem;
  font-size: 0.85rem;
}
.chat-order-card__loading { margin: 0; color: var(--ink-soft); font-style: italic; }
.chat-order-card__title { display: block; color: var(--gold-deep); font-family: var(--font-display); font-size: 1rem; margin-bottom: 0.5rem; }
.chat-order-card__items { list-style: none; margin: 0 0 0.5rem; padding: 0; display: grid; gap: 0.3rem; }
.chat-order-card__items li { display: flex; justify-content: space-between; gap: 0.6rem; }
.chat-order-card__total {
  display: flex;
  justify-content: space-between;
  font-weight: 600;
  padding-top: 0.5rem;
  margin-bottom: 0.7rem;
  border-top: 1px solid var(--line);
}
.chat-order-card__btn {
  width: 100%;
  border: none;
  background: #25D366;
  color: #fff;
  padding: 0.6rem;
  border-radius: var(--radius);
  cursor: pointer;
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 500;
}
.chat-order-card__btn:hover { filter: brightness(1.05); }
.chat-msg { max-width: 85%; padding: 0.55rem 0.8rem; border-radius: 10px; font-size: 0.88rem; line-height: 1.45; }
.chat-msg--user, .chat-msg--error, .chat-msg--typing { white-space: pre-wrap; }
.chat-msg--user { align-self: flex-end; background: var(--gold-deep); color: var(--white); border-bottom-right-radius: 2px; }
.chat-msg--assistant { align-self: flex-start; background: var(--surface); border: 1px solid var(--line); color: var(--ink); border-bottom-left-radius: 2px; }
.chat-msg--assistant p { margin: 0 0 0.5em; }
.chat-msg--assistant p:last-child { margin-bottom: 0; }
.chat-msg--assistant ul { margin: 0 0 0.5em; padding-left: 1.1em; }
.chat-msg--assistant ul:last-child { margin-bottom: 0; }
.chat-msg--assistant li { margin: 0.15em 0; }
.chat-msg--assistant a { color: var(--gold-deep); font-weight: 500; }
.chat-msg--assistant strong { color: var(--gold-deep); }
.chat-msg--error { align-self: center; color: var(--error); font-size: 0.82rem; }
.chat-msg--typing { align-self: flex-start; color: var(--ink-soft); font-style: italic; font-size: 0.85rem; }

.chat-panel__form {
  display: flex;
  gap: 0.5rem;
  padding: 0.7rem;
  border-top: 1px solid var(--line);
  background: var(--surface);
}
.chat-panel__form input {
  flex: 1;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.55rem 0.7rem;
  font-family: var(--font-body);
  font-size: 0.9rem;
}
.chat-panel__form button {
  border: none;
  background: var(--gold-deep);
  color: var(--white);
  padding: 0 1rem;
  border-radius: var(--radius);
  cursor: pointer;
  font-family: var(--font-body);
}
.chat-panel__form button:disabled { opacity: 0.6; cursor: default; }

@media (max-width: 480px) {
  .chat-panel { right: 0.7rem; bottom: 4.8rem; }
  .chat-toggle { right: 1rem; bottom: 1rem; }
}

@media (max-width: 960px) {
  .hero__grid, .product-detail, .cart-layout, .split-layout { grid-template-columns: 1fr; }
  .category-strip { grid-template-columns: repeat(2, 1fr); }
  .product-grid { grid-template-columns: repeat(2, 1fr); }
  .summary-box { position: static; }
}
@media (max-width: 560px) {
  .product-grid { grid-template-columns: 1fr 1fr; }
  .cart-item { grid-template-columns: 60px 1fr; }
  .cart-item__price { grid-column: 2; }
}
