/* ==========================================================================
   Chiqi — folha de estilos
   Paleta da marca: amarelo #F6C667 · castanho #5A4632 · creme #FDF6EC · branco
   ========================================================================== */

:root {
  --amarelo: #F6C667;
  --castanho: #5A4632;
  --creme: #FDF6EC;
  --branco: #FFFFFF;
  --linha: #EDE3D3;
  --texto-suave: #8A7A66;
  --raio: 16px;
  --sombra: 0 2px 10px rgba(90, 70, 50, 0.08);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--creme);
  color: var(--castanho);
  -webkit-font-smoothing: antialiased;
}

body.no-scroll { overflow: hidden; }

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

/* ---------- Cabeçalho ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: var(--branco);
  border-bottom: 1px solid var(--linha);
}

.logo { text-decoration: none; display: inline-flex; }

.logo-img { height: 32px; width: auto; display: block; }

.header-actions { display: flex; align-items: center; gap: 14px; }

.icon-link {
  color: var(--castanho);
  background: none;
  border: none;
  padding: 6px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}

.cart-btn { position: relative; }

.cart-count {
  position: absolute;
  top: -2px;
  right: -2px;
  background: var(--amarelo);
  color: var(--castanho);
  font-size: 11px;
  font-weight: 700;
  min-width: 18px;
  height: 18px;
  border-radius: 999px;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
}

/* ---------- Capa (hero) ---------- */
.hero {
  position: relative;
  overflow: hidden;
  height: 46vw;
  min-height: 260px;
  max-height: 440px;
  background: linear-gradient(135deg, var(--creme) 0%, #FBEBCB 55%, var(--amarelo) 100%);
}

.hero-sparkle {
  position: absolute;
  width: 64px;
  height: 64px;
  color: var(--castanho);
  opacity: 0.1;
  pointer-events: none;
}
.hero-sparkle-1 { top: 8%; left: 6%; width: 46px; height: 46px; transform: rotate(-12deg); }
.hero-sparkle-2 { bottom: 10%; right: 8%; width: 84px; height: 84px; color: var(--branco); opacity: 0.35; transform: rotate(18deg); }
.hero-sparkle-3 { top: 14%; right: 14%; width: 28px; height: 28px; opacity: 0.18; transform: rotate(6deg); }
@media (min-width: 700px) {
  .hero-sparkle-1 { width: 64px; height: 64px; }
  .hero-sparkle-2 { width: 120px; height: 120px; }
  .hero-sparkle-3 { width: 40px; height: 40px; }
}

.hero-content {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  text-align: center;
  padding: 20px;
}

.hero-logo-img {
  height: clamp(56px, 12vw, 88px);
}

.hero-divider {
  display: block;
  width: 34px;
  height: 2px;
  background: var(--castanho);
  opacity: 0.35;
  border-radius: 2px;
}

.hero-tagline {
  margin: 0;
  color: var(--castanho);
  font-family: 'Cormorant Garamond', 'Georgia', serif;
  font-style: italic;
  font-weight: 600;
  font-size: 19px;
}

@media (min-width: 700px) {
  .hero-tagline { font-size: 24px; }
}

/* ---------- Introdução ---------- */
.intro {
  text-align: center;
  padding: 22px 20px 6px;
  max-width: 560px;
  margin: 0 auto;
}
.intro p {
  font-size: 16px;
  line-height: 1.5;
  margin: 0;
}

/* ---------- Filtros ---------- */
.category-filters {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 16px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.category-filters::-webkit-scrollbar { display: none; }

.filter-btn {
  flex: 0 0 auto;
  padding: 9px 16px;
  border-radius: 999px;
  border: 1px solid var(--linha);
  background: var(--branco);
  color: var(--castanho);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}
.filter-btn.active {
  background: var(--castanho);
  border-color: var(--castanho);
  color: var(--branco);
}

/* ---------- Grelha de produtos ---------- */
.product-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
  padding: 4px 16px 24px;
  max-width: 1100px;
  margin: 0 auto;
}
@media (min-width: 700px) {
  .product-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (min-width: 1000px) {
  .product-grid { grid-template-columns: repeat(4, 1fr); }
}

.product-card {
  background: var(--branco);
  border-radius: var(--raio);
  overflow: hidden;
  box-shadow: var(--sombra);
  display: flex;
  flex-direction: column;
}

.product-card-img-wrap { position: relative; }

.product-card-img-btn {
  display: block;
  width: 100%;
  border: none;
  padding: 0;
  margin: 0;
  background: var(--linha);
  cursor: pointer;
  aspect-ratio: 1 / 1;
  overflow: hidden;
}
.product-card-img-btn img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.img-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 26px;
  height: 26px;
  border: none;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.85);
  color: var(--castanho);
  font-size: 18px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.15s;
}
.product-card-img-wrap:hover .img-nav { opacity: 1; }
@media (hover: none) {
  .img-nav { opacity: 0.85; }
}
.img-nav-prev { left: 6px; }
.img-nav-next { right: 6px; }

.product-card-body { padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 6px; flex: 1; }

.product-card-body h3 {
  font-size: 14px;
  line-height: 1.3;
  margin: 0;
  font-weight: 700;
  min-height: 2.6em;
}

.price { font-weight: 700; color: var(--castanho); margin: 0; }
.price-lg { font-size: 18px; }
.price-original { font-weight: 600; color: var(--texto-suave); text-decoration: line-through; margin-right: 6px; }
.price-promo { font-weight: 700; color: #B4523B; }

.empty-msg { color: var(--texto-suave); padding: 30px 0; text-align: center; grid-column: 1 / -1; }

/* ---------- Botões ---------- */
.btn {
  border: none;
  border-radius: 999px;
  padding: 10px 18px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  text-align: center;
}
.btn-primary { background: var(--amarelo); color: var(--castanho); }
.btn-primary:active { opacity: 0.85; }
.btn-secondary { background: var(--creme); color: var(--castanho); border: 1px solid var(--linha); }
.btn-checkout { width: 100%; font-size: 16px; padding: 14px; }

/* ---------- Como encomendar ---------- */
.how-to-order {
  max-width: 640px;
  margin: 10px auto 30px;
  padding: 20px;
  background: var(--branco);
  border-radius: var(--raio);
  box-shadow: var(--sombra);
}
.how-to-order h2 { margin-top: 0; font-size: 18px; font-family: 'Baloo 2', sans-serif; font-weight: 800; }
.how-to-order p { line-height: 1.6; margin-bottom: 0; }

/* ---------- Rodapé ---------- */
.site-footer {
  text-align: center;
  padding: 24px 16px 40px;
  color: var(--texto-suave);
  font-size: 14px;
}
.site-footer a { color: var(--castanho); font-weight: 600; text-decoration: none; }
.footer-note { font-size: 12px; opacity: 0.8; }

/* ---------- Painéis (detalhes / carrinho) ---------- */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(90, 70, 50, 0.4);
  display: none;
  z-index: 50;
}
.overlay.open { display: flex; justify-content: flex-end; }

.panel {
  background: var(--branco);
  width: 100%;
  max-width: 460px;
  height: 100%;
  overflow-y: auto;
  position: relative;
  padding: 20px;
  animation: slide-in 0.2s ease-out;
}
@keyframes slide-in {
  from { transform: translateX(24px); opacity: 0.6; }
  to { transform: translateX(0); opacity: 1; }
}

.details-close {
  position: sticky;
  top: 0;
  float: right;
  background: var(--creme);
  border: none;
  border-radius: 999px;
  width: 34px;
  height: 34px;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  color: var(--castanho);
}

.details-images { display: flex; flex-direction: column; gap: 10px; margin-bottom: 16px; clear: both; }
.details-images img,
.details-images video { border-radius: var(--raio); width: 100%; }

.details-body h2 { font-size: 20px; margin: 0 0 6px; }
.details-desc { line-height: 1.55; color: var(--castanho); }

.field-label { display: block; font-size: 13px; font-weight: 700; margin: 14px 0 6px; }
.field-input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--linha);
  border-radius: 10px;
  font-size: 14px;
  font-family: inherit;
  background: var(--creme);
  color: var(--castanho);
}
.field-qty { max-width: 90px; }
.field-hint { font-size: 12px; color: var(--texto-suave); margin-top: 6px; }

.ref-photos-preview { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.ref-photo-thumb { position: relative; width: 64px; height: 64px; border-radius: 10px; overflow: hidden; }
.ref-photo-thumb img { width: 100%; height: 100%; object-fit: cover; }
.ref-photo-remove {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 20px;
  height: 20px;
  border-radius: 999px;
  border: none;
  background: rgba(90, 70, 50, 0.75);
  color: var(--branco);
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
}

.btn-add-cart { width: 100%; margin-top: 18px; }
.btn-add-cart:disabled { opacity: 0.7; cursor: default; }

/* ---------- Carrinho ---------- */
.cart-panel h2 { font-size: 20px; margin: 0 0 16px; clear: both; }
.cart-items { display: flex; flex-direction: column; gap: 14px; margin-bottom: 20px; }

.cart-line { display: flex; gap: 12px; border-bottom: 1px solid var(--linha); padding-bottom: 14px; }
.cart-line img { width: 64px; height: 64px; object-fit: cover; border-radius: 10px; flex-shrink: 0; }
.cart-line-body { flex: 1; }
.cart-line-name { font-weight: 700; font-size: 14px; margin: 0 0 2px; }
.cart-line-meta { font-size: 12px; color: var(--texto-suave); margin: 0 0 2px; }
.cart-line-price { font-weight: 700; margin: 4px 0; }

.cart-line-qty { display: flex; align-items: center; gap: 10px; margin-top: 4px; }
.qty-btn {
  width: 26px; height: 26px;
  border-radius: 999px;
  border: 1px solid var(--linha);
  background: var(--creme);
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
}
.cart-remove-btn {
  margin-left: auto;
  background: none;
  border: none;
  color: #B4523B;
  font-size: 12px;
  text-decoration: underline;
  cursor: pointer;
}

.cart-footer {
  position: sticky;
  bottom: 0;
  background: var(--branco);
  padding-top: 10px;
}
.cart-subtotal-row {
  display: flex;
  justify-content: space-between;
  font-size: 16px;
  margin-bottom: 8px;
}
.cart-note { font-size: 12px; color: var(--texto-suave); line-height: 1.5; margin-bottom: 14px; }

/* ---------- Telemóvel: painéis a ecrã inteiro ---------- */
@media (max-width: 480px) {
  .panel { max-width: 100%; }
}
