/* ALLUME FLEUR — shop.css
   Estilos da loja.html. Carregado após style.css; usa as mesmas variáveis de design.
   ─────────────────────────────────────────────────────────────────────────────── */


/* ── Nav: link ativo + botão do carrinho ──────────────────────────────────────── */

.nav-link-active { color: var(--gold) !important; }

.nav-right {
  display: flex;
  align-items: center;
  gap: 14px;
}

nav .nav-links { margin-left: auto; }

.nav-cart {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--gold);
  color: var(--white);
  transition: background 0.3s, transform 0.2s;
  box-shadow: 0 4px 16px rgba(184, 135, 42, 0.25);
}
.nav-cart:hover {
  background: var(--gold-light);
  transform: translateY(-1px);
}

/* Badge de contagem: começa scale(0); .is-visible anima para scale(1) com efeito "pop" */
.nav-cart-count {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  border-radius: 50px;
  background: var(--brown);
  color: var(--gold-light);
  font-size: 0.65rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  letter-spacing: 0.03em;
  border: 2px solid var(--cream);
  transform: scale(0);
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1); /* elástico */
}
.nav-cart-count.is-visible { transform: scale(1); }


/* ── Shop Hero ─────────────────────────────────────────────────────────────────── */

.shop-hero {
  padding: 140px 48px 48px;
  text-align: center;
  background: linear-gradient(180deg, var(--cream) 0%, var(--cream-dark) 100%);
}
.shop-hero-title {
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 5vw, 4rem);
  font-weight: 300;
  color: var(--brown);
  margin: 8px 0 16px;
  line-height: var(--leading-tight);
}
.shop-hero-title em {
  font-style: italic;
  color: var(--gold);
}
.shop-hero-desc {
  font-size: var(--text-base);
  font-weight: 300;
  color: var(--text-muted);
  max-width: 560px;
  margin: 0 auto;
  line-height: var(--leading-loose);
}


/* ── Layout: sidebar + grade ────────────────────────────────────────────────────── */

.shop-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 48px;
  max-width: 1280px;
  margin: 0 auto;
  padding: 56px 48px 100px;
  align-items: flex-start;
}

.shop-sidebar {
  position: sticky;
  top: 100px;
  padding: 24px;
  background: var(--white);
  border: 1px solid rgba(184, 135, 42, 0.12);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.sidebar-title {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 500;
  color: var(--brown);
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(184, 135, 42, 0.15);
}
.sidebar-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.sidebar-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: var(--text-sm);
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--text);
  background: transparent;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
  text-align: left;
}
.sidebar-item:hover               { background: var(--gold-pale); color: var(--brown); }
.sidebar-item.is-active           { background: var(--gold); color: var(--white); }
.sidebar-item.is-active .sidebar-count { background: rgba(255, 255, 255, 0.25); color: var(--white); }
.sidebar-count {
  font-size: 0.7rem;
  font-weight: 600;
  background: var(--cream-dark);
  color: var(--text-muted);
  padding: 2px 8px;
  border-radius: 50px;
  min-width: 24px;
  text-align: center;
  transition: background 0.2s, color 0.2s;
}


/* ── Toolbar ────────────────────────────────────────────────────────────────────── */

.shop-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(184, 135, 42, 0.15);
}
.shop-result          { font-size: var(--text-sm); font-weight: 400; color: var(--text-muted); letter-spacing: 0.04em; }
.shop-result strong   { color: var(--brown); font-weight: 600; }


/* ── Grade de Produtos + Cards ──────────────────────────────────────────────────── */

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

.product-card {
  background: var(--cream);
  border: 1px solid rgba(184, 135, 42, 0.10);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow);
  transition: var(--transition);
  animation: cardIn 0.4s ease both;
}
.product-card:hover             { transform: translateY(-4px); box-shadow: var(--shadow-lg); }

@keyframes cardIn {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

.product-image {
  aspect-ratio: 4 / 3;
  overflow: hidden;
  position: relative;
}
.product-image img              { width: 100%; height: 100%; object-fit: cover; transition: transform 0.7s ease; }
.product-card:hover .product-image img { transform: scale(1.05); }

.product-collection {
  position: absolute;
  top: 10px;
  left: 10px;
  background: rgba(250, 246, 240, 0.92);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px); /* Safari */
  padding: 4px 10px;
  border-radius: 50px;
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold);
  border: 1px solid rgba(184, 135, 42, 0.18);
}

.product-body {
  padding: 18px 18px 20px;
  display: flex;
  flex-direction: column;
  flex: 1;
}
.product-name { font-family: var(--font-display); font-size: 1.15rem; font-weight: 500; color: var(--brown); margin-bottom: 4px; }
.product-desc { font-size: var(--text-xs); font-weight: 300; color: var(--text-muted); line-height: 1.55; margin-bottom: 16px; }


/* ── Botão "Adicionar" / Stepper ────────────────────────────────────────────────
   .product-action é o "slot" de 44px que alterna entre .btn-add e .qty-stepper.
   JS adiciona/remove .is-adding no pai para fazer a troca via CSS.             */

.product-action {
  position: relative;
  height: 44px;
  margin-top: auto;
}
.btn-add {
  width: 100%;
  height: 100%;
  border: 1.5px solid var(--gold);
  background: transparent;
  color: var(--gold);
  font-family: var(--font-body);
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  border-radius: 50px;
  cursor: pointer;
  transition: background 0.25s, color 0.25s, transform 0.2s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.btn-add:hover                  { background: var(--gold); color: var(--white); transform: translateY(-1px); }

.qty-stepper {
  display: none;
  width: 100%;
  height: 100%;
  border: 1.5px solid var(--gold);
  border-radius: 50px;
  background: var(--gold);
  color: var(--white);
  overflow: hidden;
  align-items: center;
  justify-content: space-between;
}
.qty-stepper button             { width: 44px; height: 100%; background: transparent; color: var(--white); font-size: 1.2rem; font-weight: 600; cursor: pointer; transition: background 0.2s; }
.qty-stepper button:hover       { background: rgba(255, 255, 255, 0.18); }
.qty-stepper .qty-value         { flex: 1; text-align: center; font-weight: 600; font-size: 0.95rem; letter-spacing: 0.05em; }

.product-action.is-adding .btn-add     { display: none; }
.product-action.is-adding .qty-stepper{ display: flex; }


/* ── Seletores de Aroma e Variação ──────────────────────────────────────────────
   Injetados pelo JS acima de .product-action. margin-top:auto alinha todo o
   bloco (seletores + botão) ao fundo do card, mantendo cards de alturas
   diferentes alinhados pela ação.                                               */

.product-variants {
  margin-top: auto;
  margin-bottom: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.variant-field          { display: flex; flex-direction: column; gap: 5px; }
.variant-label-text     { font-size: 0.62rem; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-muted); }

/* appearance:none remove a seta nativa; substituída por chevron dourado via SVG inline */
.product-variants select {
  width: 100%;
  padding: 9px 34px 9px 12px;
  font-family: var(--font-body);
  font-size: var(--text-xs);
  font-weight: 500;
  color: var(--brown);
  background-color: var(--white);
  border: 1px solid rgba(184, 135, 42, 0.25);
  border-radius: 10px;
  cursor: pointer;
  transition: border-color 0.2s, box-shadow 0.2s;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23b8872a' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 12px;
}
.product-variants select:hover        { border-color: var(--gold); }
.product-variants select:focus-visible{ outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px var(--gold-pale); }


/* ── Estado vazio da grade ─────────────────────────────────────────────────────── */

.product-empty {
  padding: 80px 24px;
  text-align: center;
  font-family: var(--font-display);
  font-size: 1.2rem;
  color: var(--text-muted);
  font-style: italic;
}


/* ── Carrinho (Drawer) ──────────────────────────────────────────────────────────── */

.cart-drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: min(420px, 100vw);
  height: 100vh;
  background: var(--cream);
  display: flex;
  flex-direction: column;
  z-index: 200;
  transform: translateX(100%);
  transition: transform 0.45s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  box-shadow: -12px 0 48px rgba(45, 27, 14, 0.18);
}
.cart-drawer.is-open { transform: translateX(0); }

.cart-overlay {
  position: fixed;
  inset: 0;
  background: rgba(45, 27, 14, 0.45);
  z-index: 199;
  opacity: 0;
  pointer-events: none; /* não captura cliques enquanto invisível */
  transition: opacity 0.4s;
}
.cart-overlay.is-open { opacity: 1; pointer-events: all; }

.cart-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 28px;
  border-bottom: 1px solid rgba(184, 135, 42, 0.15);
  flex-shrink: 0;
}
.cart-title { font-family: var(--font-display); font-size: 1.5rem; font-weight: 500; color: var(--brown); letter-spacing: 0.02em; }
.cart-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  color: var(--brown-mid);
  transition: background 0.2s, color 0.2s;
}
.cart-close:hover { background: rgba(184, 135, 42, 0.10); color: var(--gold); }

.cart-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px 24px;
}

.cart-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 60px 16px;
  color: var(--text-muted);
}
.cart-empty svg  { color: var(--gold-light); margin-bottom: 16px; }
.cart-empty p    { font-family: var(--font-display); font-size: 1.2rem; color: var(--brown); margin-bottom: 6px; }
.cart-empty span { font-size: var(--text-sm); font-weight: 300; line-height: var(--leading-normal); max-width: 260px; }

.cart-items { list-style: none; display: flex; flex-direction: column; gap: 16px; }

.cart-item {
  display: grid;
  grid-template-columns: 72px 1fr auto;
  gap: 14px;
  padding: 14px;
  background: var(--white);
  border-radius: var(--radius);
  border: 1px solid rgba(184, 135, 42, 0.10);
  align-items: start; /* topo: info pode ter 2–3 linhas */
  animation: cardIn 0.3s ease both;
}
.cart-item-image     { width: 72px; height: 72px; border-radius: 10px; overflow: hidden; }
.cart-item-image img { width: 100%; height: 100%; object-fit: cover; }
.cart-item-info      { min-width: 0; } /* necessário para text-overflow funcionar em grid */
.cart-item-name      { font-family: var(--font-display); font-size: 1rem; font-weight: 500; color: var(--brown); line-height: 1.2; margin-bottom: 4px; }
.cart-item-variant   { font-size: var(--text-xs); font-weight: 400; color: var(--text-muted); letter-spacing: 0.02em; line-height: 1.4; margin-bottom: 5px; }
.cart-item-price     { font-size: var(--text-sm); font-weight: 700; color: var(--brown); }

.cart-item-controls  { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.cart-stepper        { display: inline-flex; align-items: center; border: 1px solid rgba(184, 135, 42, 0.30); border-radius: 50px; overflow: hidden; background: var(--cream); }
.cart-stepper button { width: 26px; height: 26px; font-size: 0.95rem; font-weight: 600; color: var(--brown); transition: background 0.2s; }
.cart-stepper button:hover   { background: var(--gold-pale); }
.cart-stepper .qty-value     { min-width: 22px; text-align: center; font-size: 0.8rem; font-weight: 600; color: var(--brown); }
.cart-item-remove            { font-size: 0.7rem; color: var(--text-muted); letter-spacing: 0.08em; text-transform: uppercase; transition: color 0.2s; background: none; padding: 0; }
.cart-item-remove:hover      { color: var(--gold); }


/* ── Rodapé do drawer ───────────────────────────────────────────────────────────── */

.cart-footer {
  flex-shrink: 0;
  padding: 20px 28px 24px;
  border-top: 1px solid rgba(184, 135, 42, 0.15);
  background: var(--cream-dark);
}
.cart-summary          { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 16px; }
.cart-summary span     { font-size: var(--text-xs); font-weight: 500; letter-spacing: 0.15em; text-transform: uppercase; color: var(--text-muted); }
.cart-summary strong   { font-family: var(--font-display); font-size: 1.5rem; font-weight: 500; color: var(--brown); }

.cart-checkout {
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background: var(--color-whatsapp);
  color: var(--white);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 16px;
  border-radius: 50px;
  min-height: 52px;
  box-shadow: 0 4px 24px rgba(37, 211, 102, 0.30);
  transition: var(--transition);
}
.cart-checkout:not(:disabled):hover { background: var(--color-whatsapp-hover); transform: translateY(-2px); box-shadow: 0 8px 32px rgba(37, 211, 102, 0.45); }
.cart-checkout:disabled             { background: var(--cream); color: var(--text-muted); cursor: not-allowed; box-shadow: none; border: 1px solid rgba(184, 135, 42, 0.15); }


/* ── Footer da loja ─────────────────────────────────────────────────────────────── */

.shop-footer { background: var(--brown); color: rgba(255, 255, 255, 0.5); text-align: center; padding: 24px; font-size: 0.8rem; letter-spacing: 0.05em; }


/* ── Responsivo ─────────────────────────────────────────────────────────────────
   900px  — sidebar vira pills horizontais acima da grade
   600px  — drawer full-width, grade 2 colunas
   400px  — grade 1 coluna                                                       */

@media (max-width: 900px) {
  .shop-hero   { padding: 110px 24px 32px; }
  .shop-layout { grid-template-columns: 1fr; gap: 28px; padding: 32px 24px 80px; }
  .shop-sidebar{ position: static; padding: 16px; }
  .sidebar-list{ flex-direction: row; flex-wrap: wrap; gap: 8px; }
  .sidebar-item{ width: auto; padding: 8px 14px; font-size: 0.78rem; }
  .sidebar-title { display: none; }
  .nav-cart    { width: 38px; height: 38px; }
}

@media (max-width: 600px) {
  .shop-hero    { padding: 100px 16px 24px; }
  .shop-layout  { padding: 24px 16px 60px; }
  .product-grid { grid-template-columns: repeat(2, 1fr); gap: 14px; }
  .product-body { padding: 14px 14px 16px; }
  .product-name { font-size: 1rem; }
  .product-desc { font-size: 0.7rem; }
  .cart-drawer  { width: 100vw; }
  .cart-header  { padding: 18px 20px; }
  .cart-body    { padding: 12px 16px; }
  .cart-footer  { padding: 16px 20px 20px; }
}

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