/* ════════════════════════════════════════════════════
   CASA MARGARIDA — Interações de jornada
   selo de estoque · barra mobile · favoritos drawer · toast · fade
   ════════════════════════════════════════════════════ */

/* ─── PAGE FADE-IN (chegada suave, como a home) ─────── */
@keyframes cmPageIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
body.cm-inner .site-main,
body.cm-inner main,
body.cm-inner #content,
body.cm-inner .woocommerce { animation: cmPageIn .6s var(--ease) both; }
@media (prefers-reduced-motion: reduce) {
  body.cm-inner .site-main, body.cm-inner main, body.cm-inner #content, body.cm-inner .woocommerce { animation: none; }
}

/* ─── SELO DE ESCASSEZ ──────────────────────────────── */
.cm-stock-badge[hidden] { display: none !important; }
.cm-stock-badge {
  display: inline-block;
  font-family: var(--sans);
  font-size: .55rem;
  letter-spacing: .28em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--terra);
  background: rgba(154,77,46,.08);
  border: 1px solid rgba(154,77,46,.22);
  padding: .4rem .8rem;
  margin: 0 0 1rem !important;
}

/* ─── BARRA DE COMPRA FIXA (mobile) ─────────────────── */
.cm-buybar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 1300;
  display: none; align-items: center; justify-content: space-between; gap: 1rem;
  padding: .7rem 1rem calc(.7rem + env(safe-area-inset-bottom));
  background: rgba(250,243,239,.96);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  border-top: 1px solid rgba(154,77,46,.14);
  transform: translateY(100%);
  transition: transform .45s var(--ease);
}
.cm-buybar.show { transform: translateY(0); }
.cm-buybar-info { display: flex; flex-direction: column; min-width: 0; }
.cm-buybar-name {
  font-family: var(--serif); font-size: .95rem; color: var(--ink);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 48vw;
}
.cm-buybar-price { font-family: var(--serif); font-size: .9rem; color: var(--terra); }
.cm-buybar-price .woocommerce-Price-amount { color: var(--terra); }
.cm-buybar-btn,
.cm-inner button.cm-buybar-btn {
  flex: 0 0 auto;
  background: var(--terra) !important; color: var(--cream) !important;
  border: none !important; border-radius: 0 !important;
  font-family: var(--sans) !important; font-size: .58rem !important; letter-spacing: .3em !important;
  text-transform: uppercase !important; font-weight: 600 !important;
  padding: .95rem 1.6rem !important; cursor: pointer; box-shadow: none !important;
}
.cm-buybar-btn:active { background: var(--terra-warm) !important; }
/* só aparece no mobile */
@media (min-width: 861px) { .cm-buybar { display: none !important; } }
@media (max-width: 860px) { .cm-buybar { display: flex; } }

/* ─── FAVORITOS — itens do drawer ───────────────────── */
.cm-fav-item {
  display: grid; grid-template-columns: 60px 1fr auto; gap: .9rem;
  align-items: center; padding: 1rem 0; border-bottom: 1px solid rgba(154,77,46,.1);
}
.cm-fav-thumb {
  display: block; width: 60px; height: 75px;
  background: var(--bone) center/cover no-repeat;
  border: 1px solid rgba(154,77,46,.1);
}
.cm-fav-meta { min-width: 0; }
.cm-fav-iname {
  display: block; font-family: var(--serif); font-size: 1rem; color: var(--ink);
  text-decoration: none; line-height: 1.3;
}
.cm-fav-iname:hover { color: var(--terra); }
.cm-fav-iprice { font-family: var(--serif); font-size: .9rem; color: var(--terra); }
.cm-fav-remove,
.cm-inner button.cm-fav-remove {
  background: transparent !important; border: none !important; box-shadow: none !important;
  color: var(--mid) !important; font-size: 1.3rem; cursor: pointer; padding: .2rem .4rem !important;
  width: auto !important; height: auto !important; line-height: 1; transition: color .3s var(--ease);
}
.cm-fav-remove:hover { color: var(--terra) !important; }
.cm-fav-empty {
  font-family: var(--serif); font-style: italic; color: var(--mid); text-align: center;
  padding: 3rem 1rem; font-size: 1.05rem; line-height: 1.6;
}
.cm-fav-empty span { font-size: .85rem; opacity: .8; }

/* ─── TOAST (feedback de favorito) ──────────────────── */
.cm-toast {
  position: fixed; left: 50%; bottom: 2rem; transform: translateX(-50%) translateY(20px);
  background: var(--ink); color: var(--bone);
  font-family: var(--sans); font-size: .62rem; letter-spacing: .25em; text-transform: uppercase;
  padding: .9rem 1.6rem; z-index: 1500; opacity: 0; pointer-events: none;
  transition: opacity .4s var(--ease), transform .4s var(--ease);
}
.cm-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
@media (max-width: 860px) { .cm-toast { bottom: 6rem; } }
