/* ============================================================================
   NQ Beauty — vitrine. Sistema visual: elegante, clean, rosé + dourado.
   Zero dependência externa (CSP-safe). Light/Dark via prefers-color-scheme,
   com override manual por [data-theme] no <html>.
   ============================================================================ */

:root {
  /* Paleta — Light */
  --bg: #fbf6f4;
  --bg-soft: #f5e9e6;
  --surface: #ffffff;
  --surface-2: #fdf4f2;
  --text: #3a2b2e;
  --muted: #8a7176;
  --line: #ecdcd8;
  --rose: #b76e79;
  --rose-strong: #9d5561;
  --gold: #be9a5a;
  --shadow: 0 6px 24px rgba(120, 74, 82, 0.12);
  --shadow-sm: 0 2px 8px rgba(120, 74, 82, 0.10);

  --ok: #4c8c6b;
  --ok-bg: #e5f1ea;
  --warn: #b9791f;
  --warn-bg: #f8ecd7;
  --off: #9a8f90;
  --off-bg: #efe9e9;

  --radius: 18px;
  --radius-sm: 12px;
  --serif: Georgia, 'Times New Roman', 'Noto Serif', serif;
  --sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --maxw: 1180px;
}

/* Dark por preferência do sistema… */
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #201a1b;
    --bg-soft: #2a2123;
    --surface: #2c2325;
    --surface-2: #332a2c;
    --text: #f3e7e9;
    --muted: #b79ea3;
    --line: #43373a;
    --rose: #d692a0;
    --rose-strong: #e6aab6;
    --gold: #d4b878;
    --shadow: 0 6px 24px rgba(0, 0, 0, 0.4);
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.35);
    --ok: #7ec7a1; --ok-bg: #23352c;
    --warn: #e0b06a; --warn-bg: #3a2f1e;
    --off: #a99ea0; --off-bg: #3a3033;
  }
}
/* …e override manual (o toggle vence os dois sentidos). */
:root[data-theme='light'] {
  --bg: #fbf6f4; --bg-soft: #f5e9e6; --surface: #fff; --surface-2: #fdf4f2;
  --text: #3a2b2e; --muted: #8a7176; --line: #ecdcd8; --rose: #b76e79;
  --rose-strong: #9d5561; --gold: #be9a5a; --shadow: 0 6px 24px rgba(120,74,82,.12);
  --shadow-sm: 0 2px 8px rgba(120,74,82,.10);
  --ok:#4c8c6b;--ok-bg:#e5f1ea;--warn:#b9791f;--warn-bg:#f8ecd7;--off:#9a8f90;--off-bg:#efe9e9;
}
:root[data-theme='dark'] {
  --bg:#201a1b;--bg-soft:#2a2123;--surface:#2c2325;--surface-2:#332a2c;--text:#f3e7e9;
  --muted:#b79ea3;--line:#43373a;--rose:#d692a0;--rose-strong:#e6aab6;--gold:#d4b878;
  --shadow:0 6px 24px rgba(0,0,0,.4);--shadow-sm:0 2px 8px rgba(0,0,0,.35);
  --ok:#7ec7a1;--ok-bg:#23352c;--warn:#e0b06a;--warn-bg:#3a2f1e;--off:#a99ea0;--off-bg:#3a3033;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { max-width: 100%; display: block; }
button { font-family: inherit; cursor: pointer; }

/* ---------- Header ---------- */
.topbar {
  position: sticky; top: 0; z-index: 40;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--line);
}
.topbar__inner {
  max-width: var(--maxw); margin: 0 auto; padding: 12px 18px;
  display: flex; align-items: center; gap: 14px;
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: inherit; }
.brand__mark {
  width: 40px; height: 40px; border-radius: 11px; flex: 0 0 auto;
  display: grid; place-items: center;
  background: linear-gradient(135deg, var(--rose), var(--rose-strong));
  color: #fff; font-family: var(--serif); font-weight: 700; font-size: 15px; letter-spacing: -.5px;
}
.brand__name { font-family: var(--serif); font-size: 20px; font-weight: 700; letter-spacing: .3px; }
.brand__tag { font-size: 11px; color: var(--muted); letter-spacing: 2px; text-transform: uppercase; }

.search {
  flex: 1 1 auto; max-width: 420px; margin-left: auto;
  position: relative; display: flex; align-items: center;
}
.search input {
  width: 100%; padding: 10px 14px 10px 38px;
  border: 1px solid var(--line); border-radius: 999px;
  background: var(--surface); color: var(--text); font-size: 14px; outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.search input:focus { border-color: var(--rose); box-shadow: 0 0 0 3px color-mix(in srgb, var(--rose) 22%, transparent); }
.search__icon { position: absolute; left: 13px; color: var(--muted); pointer-events: none; }

.iconbtn {
  position: relative; width: 42px; height: 42px; flex: 0 0 auto;
  border: 1px solid var(--line); border-radius: 12px; background: var(--surface);
  color: var(--text); display: grid; place-items: center; transition: background .15s, border-color .15s;
}
.iconbtn:hover { border-color: var(--rose); background: var(--surface-2); }
.cart-count {
  position: absolute; top: -7px; right: -7px; min-width: 20px; height: 20px; padding: 0 5px;
  background: var(--rose-strong); color: #fff; border-radius: 999px;
  font-size: 11px; font-weight: 700; display: none; place-items: center; line-height: 20px; text-align: center;
}
.cart-count.show { display: grid; }

/* ---------- Hero ---------- */
.hero {
  max-width: var(--maxw); margin: 22px auto 6px; padding: 0 18px;
}
.hero__card {
  border-radius: var(--radius); padding: 30px 28px;
  background: linear-gradient(120deg, var(--bg-soft), var(--surface));
  border: 1px solid var(--line); box-shadow: var(--shadow-sm);
}
.hero h1 { font-family: var(--serif); font-size: clamp(24px, 5vw, 36px); margin: 0 0 6px; font-weight: 700; }
.hero p { margin: 0; color: var(--muted); max-width: 46ch; }

/* ---------- Categorias (nav pills) ---------- */
.cats {
  position: sticky; top: 66px; z-index: 30;
  background: color-mix(in srgb, var(--bg) 90%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
  margin-top: 18px;
}
.cats__inner {
  max-width: var(--maxw); margin: 0 auto; padding: 12px 18px;
  display: flex; gap: 9px; overflow-x: auto; scrollbar-width: none;
}
.cats__inner::-webkit-scrollbar { display: none; }
.pill {
  white-space: nowrap; padding: 8px 16px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--surface); color: var(--text);
  font-size: 14px; font-weight: 500; transition: all .15s;
}
.pill:hover { border-color: var(--rose); }
.pill.active {
  background: linear-gradient(135deg, var(--rose), var(--rose-strong));
  color: #fff; border-color: transparent;
}
.pill__count { opacity: .7; font-size: 12px; margin-left: 4px; }

/* ---------- Grade de produtos ---------- */
main { max-width: var(--maxw); margin: 0 auto; padding: 22px 18px 120px; }
.section-title {
  font-family: var(--serif); font-size: 22px; margin: 26px 0 14px; font-weight: 700;
  display: flex; align-items: center; gap: 10px;
}
.section-title::after { content: ''; flex: 1; height: 1px; background: var(--line); }

.grid {
  display: grid; gap: 18px;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
}
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; display: flex; flex-direction: column;
  transition: transform .18s, box-shadow .18s, border-color .18s;
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow); border-color: color-mix(in srgb, var(--rose) 40%, var(--line)); }
.card__media { position: relative; aspect-ratio: 1/1; background: var(--surface-2); }
.card__media img { width: 100%; height: 100%; object-fit: cover; }
.badge {
  position: absolute; top: 10px; left: 10px; padding: 4px 10px; border-radius: 999px;
  font-size: 11px; font-weight: 700; letter-spacing: .3px;
}
.badge--ultimas { background: var(--warn-bg); color: var(--warn); }
.badge--esgotado { background: var(--off-bg); color: var(--off); }
.card__body { padding: 14px 15px 16px; display: flex; flex-direction: column; flex: 1; gap: 8px; }
/* nome: reserva 2 linhas fixas (nome de 1 ou 3 linhas nao desloca o preco) */
.card__name { font-weight: 600; font-size: 15px; line-height: 1.35; min-height: 2.7em;
  display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card__desc { font-size: 12.5px; color: var(--muted); line-height: 1.4; }
.card__sku { font-size: 11px; color: var(--muted); letter-spacing: .3px; }
/* margin-top:auto cola o rodape na base do card => preco/botao sempre alinhados,
   inclusive nos produtos SEM descricao (que antes deixavam o preco subir) */
.card__foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: auto; padding-top: 8px; }
.price { font-family: var(--serif); font-size: 20px; font-weight: 700; color: var(--rose-strong); }
.add {
  border: none; border-radius: 11px; padding: 9px 14px; font-weight: 600; font-size: 13px;
  background: linear-gradient(135deg, var(--rose), var(--rose-strong)); color: #fff;
  display: flex; align-items: center; gap: 6px; transition: filter .15s, transform .1s;
}
.add:hover { filter: brightness(1.06); }
.add:active { transform: scale(.96); }
.add:disabled { background: var(--off-bg); color: var(--off); cursor: not-allowed; }

.empty { text-align: center; color: var(--muted); padding: 60px 20px; }

/* ---------- Carrinho (drawer) ---------- */
.overlay {
  position: fixed; inset: 0; background: rgba(30, 18, 21, .45); backdrop-filter: blur(2px);
  opacity: 0; visibility: hidden; transition: opacity .2s; z-index: 50;
}
.overlay.open { opacity: 1; visibility: visible; }
.drawer {
  position: fixed; top: 0; right: 0; height: 100%; width: min(420px, 100%);
  background: var(--bg); z-index: 60; box-shadow: -10px 0 40px rgba(0,0,0,.25);
  transform: translateX(100%); transition: transform .25s ease;
  display: flex; flex-direction: column;
}
.drawer.open { transform: translateX(0); }
.drawer__head {
  padding: 18px; border-bottom: 1px solid var(--line);
  display: flex; align-items: center; justify-content: space-between;
}
.drawer__head h2 { font-family: var(--serif); font-size: 20px; margin: 0; }
.drawer__items { flex: 1; overflow-y: auto; padding: 12px 18px; }
.citem { display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.citem__img { width: 60px; height: 60px; border-radius: 10px; background: var(--surface-2); flex: 0 0 auto; object-fit: cover; }
.citem__info { flex: 1; min-width: 0; }
.citem__name { font-weight: 600; font-size: 14px; }
.citem__meta { font-size: 11px; color: var(--muted); }
.citem__price { font-weight: 700; color: var(--rose-strong); font-size: 14px; margin-top: 2px; }
.qty { display: inline-flex; align-items: center; gap: 0; margin-top: 8px; border: 1px solid var(--line); border-radius: 9px; overflow: hidden; }
.qty button { width: 28px; height: 28px; border: none; background: var(--surface); color: var(--text); font-size: 16px; line-height: 1; display: grid; place-items: center; }
.qty button:hover { background: var(--surface-2); color: var(--rose-strong); }
.qty span { min-width: 30px; text-align: center; font-size: 13px; font-weight: 600; }
.citem__rm { align-self: flex-start; border: none; background: none; color: var(--muted); font-size: 12px; text-decoration: underline; padding: 0; margin-top: 2px; }
.citem__rm:hover { color: var(--rose-strong); }

.drawer__foot { padding: 16px 18px 20px; border-top: 1px solid var(--line); background: var(--surface); }
.subtotal { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 4px; }
.subtotal span:first-child { color: var(--muted); font-size: 14px; }
.subtotal .total { font-family: var(--serif); font-size: 26px; font-weight: 700; }
.drawer__note { font-size: 11.5px; color: var(--muted); margin: 6px 0 14px; }
.checkout {
  width: 100%; border: none; border-radius: 13px; padding: 15px; font-size: 15px; font-weight: 700;
  background: #25d366; color: #fff; display: flex; align-items: center; justify-content: center; gap: 9px;
  transition: filter .15s, transform .1s;
}
.checkout:hover { filter: brightness(1.05); }
.checkout:active { transform: scale(.99); }
.checkout:disabled { background: var(--off-bg); color: var(--off); cursor: not-allowed; }
.cart-empty { text-align: center; color: var(--muted); padding: 50px 20px; }

/* ---------- Toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px);
  background: var(--rose-strong); color: #fff; padding: 11px 20px; border-radius: 999px;
  font-size: 14px; font-weight: 600; box-shadow: var(--shadow); z-index: 70;
  opacity: 0; visibility: hidden; transition: all .25s;
}
.toast.show { opacity: 1; visibility: visible; transform: translate(-50%, 0); }

footer { text-align: center; color: var(--muted); font-size: 12px; padding: 30px 18px 40px; }

@media (max-width: 560px) {
  .brand__tag { display: none; }
  .search { order: 3; flex-basis: 100%; max-width: none; margin: 0; }
  .topbar__inner { flex-wrap: wrap; }
  .cats { top: 60px; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
  .price { font-size: 17px; }
}

/* ============================================================================
   Adições: logo, card clicável, modal (detalhe + pagamento), frete, orçamento
   ============================================================================ */

/* Logo do header (arquivo único: assets/icon.svg — ver README §Logo) */
.brand__logo { width: 40px; height: 40px; border-radius: 11px; flex: 0 0 auto; display: block; }

.linkbtn { border: none; background: none; color: var(--rose-strong); font: inherit; text-decoration: underline; cursor: pointer; padding: 0; }
.linkbtn:hover { color: var(--rose); }

/* Card clicável (o clique abre o detalhe) */
.card { cursor: pointer; }
.card__sku { margin-top: -2px; }

.add--lg { width: 100%; padding: 13px; font-size: 15px; justify-content: center; margin-top: 14px; }

/* ---------- Modal genérico (detalhe + pagamento) ---------- */
.modal { position: fixed; inset: 0; z-index: 80; display: none; }
.modal.open { display: block; }
.modal__backdrop { position: absolute; inset: 0; background: rgba(30, 18, 21, .5); backdrop-filter: blur(2px); }
.modal__panel {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  width: min(860px, 94vw); max-height: 92vh; overflow-y: auto;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: 0 20px 60px rgba(0,0,0,.35); padding: 22px;
}
.modal__panel--sm { width: min(440px, 94vw); }
.modal__close {
  position: absolute; top: 14px; right: 14px; width: 36px; height: 36px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--surface); color: var(--text);
  display: grid; place-items: center; z-index: 2;
}
.modal__close:hover { border-color: var(--rose); background: var(--surface-2); }

/* ---------- Detalhe do produto ---------- */
.detail { display: grid; grid-template-columns: 1fr 1fr; gap: 26px; }
.detail__media { display: flex; flex-direction: column; gap: 12px; }
.detail__img { width: 100%; aspect-ratio: 1/1; object-fit: cover; border-radius: var(--radius-sm); background: var(--surface-2); border: 1px solid var(--line); }
.gallery__thumbs { display: flex; gap: 8px; flex-wrap: wrap; }
.gallery__thumb { width: 60px; height: 60px; padding: 0; border: 2px solid var(--line); border-radius: 9px; overflow: hidden; background: var(--surface-2); }
.gallery__thumb.active { border-color: var(--rose); }
.gallery__thumb img { width: 100%; height: 100%; object-fit: cover; }
.detail__info { display: flex; flex-direction: column; }
.detail__name { font-family: var(--serif); font-size: 24px; margin: 8px 0 4px; }
.detail__sku { font-size: 12px; color: var(--muted); margin-bottom: 8px; }
.detail__price { font-family: var(--serif); font-size: 30px; font-weight: 700; color: var(--rose-strong); margin: 6px 0 14px; }
.detail__desc { font-size: 14px; color: var(--text); line-height: 1.55; white-space: normal; }
.detail__desc em { color: var(--muted); }

/* ---------- Formas de pagamento ---------- */
.pay h2 { font-family: var(--serif); font-size: 22px; margin: 0 0 8px; }
.pay__intro { color: var(--muted); font-size: 14px; margin: 0 0 16px; }
.pay__list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 14px; }
.pay__list li { display: flex; gap: 14px; align-items: flex-start; }
.pay__ic { font-size: 26px; line-height: 1; flex: 0 0 auto; }
.pay__list strong { font-size: 15px; }
.pay__list span { font-size: 13px; color: var(--muted); }
.pay__note { margin: 18px 0 0; font-size: 12px; color: var(--muted); border-top: 1px solid var(--line); padding-top: 12px; }

/* ---------- Frete ---------- */
.frete { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 12px 13px; margin-bottom: 14px; background: var(--surface-2); }
.frete__label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 8px; }
.frete__row { display: flex; gap: 8px; }
.frete__row input {
  flex: 1; padding: 9px 12px; border: 1px solid var(--line); border-radius: 9px;
  background: var(--surface); color: var(--text); font-size: 14px; outline: none;
}
.frete__row input:focus { border-color: var(--rose); }
.frete__btn { border: none; border-radius: 9px; padding: 9px 16px; font-weight: 600; font-size: 13px; background: var(--rose-strong); color: #fff; }
.frete__btn:hover { filter: brightness(1.06); }
.frete__result { margin-top: 10px; }
.frete__err { color: #c0392b; font-size: 12.5px; margin: 4px 0 0; }
.frete__loading { color: var(--muted); font-size: 13px; margin: 4px 0 0; }
.frete__prov { font-size: 11.5px; color: var(--muted); margin: 2px 0 8px; }
.fopt { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border: 1px solid var(--line); border-radius: 9px; margin-bottom: 7px; cursor: pointer; background: var(--surface); }
.fopt:has(input:checked) { border-color: var(--rose); background: var(--surface-2); }
.fopt input { accent-color: var(--rose-strong); }
.fopt__main { flex: 1; display: flex; flex-direction: column; }
.fopt__main strong { font-size: 13.5px; }
.fopt__prazo { font-size: 11.5px; color: var(--muted); }
.fopt__val { font-weight: 700; color: var(--rose-strong); font-size: 14px; }

/* ---------- Resumo / orçamento ---------- */
.resumo { margin-bottom: 10px; }
.resumo__row { display: flex; justify-content: space-between; align-items: baseline; font-size: 14px; padding: 3px 0; color: var(--muted); }
.resumo__row span:last-child { color: var(--text); font-weight: 600; }
.resumo__row--total { border-top: 1px solid var(--line); margin-top: 6px; padding-top: 10px; }
.resumo__row--total span { color: var(--text); font-weight: 700; }
.resumo__row--total span:last-child { font-family: var(--serif); font-size: 24px; color: var(--text); }

/* item do carrinho: coluna direita (preço + remover) */
.citem__right { display: flex; flex-direction: column; align-items: flex-end; justify-content: space-between; gap: 6px; }

/* ---------- Banner: instalar / adicionar à tela inicial ---------- */
.install {
  position: fixed; left: 50%; bottom: 16px; transform: translate(-50%, 130%);
  z-index: 75; width: min(440px, calc(100vw - 24px));
  display: flex; align-items: center; gap: 12px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 16px; padding: 12px 14px; box-shadow: var(--shadow);
  transition: transform .32s cubic-bezier(.2,.8,.2,1), opacity .32s; opacity: 0;
}
.install.show { transform: translate(-50%, 0); opacity: 1; }
.install__icon { width: 42px; height: 42px; border-radius: 11px; flex: 0 0 auto; }
.install__body { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.install__title { font-size: 14px; font-weight: 700; }
.install__sub { font-size: 12px; color: var(--muted); line-height: 1.35; }
.install__btn {
  align-self: flex-start; margin-top: 8px; border: none; border-radius: 10px;
  padding: 8px 16px; font-weight: 600; font-size: 13px; color: #fff;
  background: linear-gradient(135deg, var(--rose), var(--rose-strong));
}
.install__btn:hover { filter: brightness(1.06); }
.install__close {
  flex: 0 0 auto; width: 30px; height: 30px; align-self: flex-start;
  border: 1px solid var(--line); border-radius: 8px; background: var(--surface);
  color: var(--muted); display: grid; place-items: center;
}
.install__close:hover { border-color: var(--rose); color: var(--rose-strong); }
/* Ícone "compartilhar" inline do passo a passo iOS + destaque dourado */
.ios-share {
  display: inline-flex; vertical-align: -3px; color: var(--gold);
  padding: 1px 3px; border: 1px solid var(--gold); border-radius: 5px; margin: 0 1px;
}
/* iOS: a barra do Safari fica embaixo no iPhone -> uma setinha apontando para baixo */
.install--ios .install__arrow {
  position: absolute; left: 50%; bottom: -14px; transform: translateX(-50%);
  color: var(--rose-strong); font-size: 26px; line-height: 1;
  animation: bob 1.2s ease-in-out infinite;
}
@keyframes bob { 0%,100% { transform: translate(-50%, 0); } 50% { transform: translate(-50%, 4px); } }

@media (max-width: 560px) {
  .detail { grid-template-columns: 1fr; gap: 16px; }
  .modal__panel { padding: 18px; }
  .detail__price { font-size: 26px; }
  .install { left: 12px; right: 12px; transform: translateY(130%); width: auto; }
  .install.show { transform: translateY(0); }
}
