/* Juh Fest · tokens tirados do logotipo */
:root {
  --ameixa: #3B1250;      /* contorno do coração */
  --violeta: #9B2BD6;     /* "Juh" */
  --ceu: #2E9BF0;         /* "Fest" */
  --glace: #F7A8D8;       /* laço / cupcake */
  --manteiga: #F5C22E;    /* batedor */
  --fundo: #FBF7FF;
  --lilas: #F1E6FB;
  --linha: #E4D3F2;
  --texto: #2A0F38;
  --suave: #6E5480;
  --whats: #1FA855;

  --f-display: "Bricolage Grotesque", "Trebuchet MS", system-ui, sans-serif;
  --f-texto: "Figtree", system-ui, -apple-system, "Segoe UI", sans-serif;

  --r-s: 10px;
  --r-m: 18px;
  --r-l: 32px;
  --sombra: 0 2px 0 var(--ameixa);
  --pad: clamp(18px, 4vw, 40px);
  --max: 1160px;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; scroll-padding-top: 84px; }
body {
  margin: 0;
  font-family: var(--f-texto);
  font-size: 1.0625rem;
  line-height: 1.55;
  color: var(--texto);
  background: var(--fundo);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: var(--violeta); }
h1, h2, h3 { font-family: var(--f-display); line-height: 1.08; margin: 0; letter-spacing: -0.015em; color: var(--ameixa); }
h2 { font-size: clamp(1.9rem, 4.4vw, 2.9rem); font-weight: 800; }
h3 { font-size: 1.25rem; font-weight: 700; }
p { margin: 0; }
:focus-visible { outline: 3px solid var(--ceu); outline-offset: 3px; border-radius: 6px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--ameixa); color: #fff; padding: 8px 14px; border-radius: 8px; z-index: 100; }
.skip:focus { left: 8px; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 52px; padding: 0 26px;
  font: 700 1rem/1 var(--f-texto);
  border-radius: 999px; border: 2px solid var(--ameixa);
  text-decoration: none; cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease, background .15s;
}
.btn:active { transform: translateY(2px); box-shadow: none; }
.btn--primary { background: var(--violeta); color: #fff; box-shadow: 0 4px 0 var(--ameixa); }
.btn--primary:hover { background: #8A1FC4; }
.btn--ghost { background: #fff; color: var(--ameixa); box-shadow: 0 4px 0 var(--ameixa); }
.btn--whats { background: var(--whats); color: #fff; width: 100%; box-shadow: 0 4px 0 #0E6B33; border-color: #0E6B33; }
.btn--whats svg { width: 22px; height: 22px; fill: #fff; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

/* Topbar */
.topbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 20px;
  padding: 10px var(--pad);
  background: color-mix(in srgb, var(--fundo) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--linha);
}
.topbar__brand img { width: 56px; height: auto; }
.topbar__nav { display: none; gap: 26px; margin-left: auto; }
.topbar__nav a { color: var(--ameixa); text-decoration: none; font-weight: 600; }
.topbar__nav a:hover { color: var(--violeta); }
.cart-btn {
  margin-left: auto; display: inline-flex; align-items: center; gap: 8px;
  height: 44px; padding: 0 14px 0 12px; border-radius: 999px;
  background: var(--ameixa); color: #fff; border: 0; cursor: pointer;
  font: 600 .95rem var(--f-texto);
}
.cart-btn svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.cart-btn__label { display: none; }
.cart-btn__count {
  min-width: 22px; height: 22px; padding: 0 6px; border-radius: 999px;
  background: var(--manteiga); color: var(--ameixa); font-weight: 800; font-size: .8rem;
  display: grid; place-items: center;
}
.cart-btn.bump { animation: bump .45s ease; }
@keyframes bump { 40% { transform: scale(1.15); } }
@media (min-width: 900px) {
  .topbar__nav { display: flex; }
  .cart-btn { margin-left: 12px; }
  .cart-btn__label { display: inline; }
}

/* Hero */
.hero {
  max-width: var(--max); margin: 0 auto;
  display: grid; gap: 8px;
  padding: 20px var(--pad) 40px;
  align-items: center;
}
.hero__text { display: grid; gap: 18px; justify-items: start; order: 2; }
.hero__logo { display: none; width: 220px; height: auto; }
@media (min-width: 900px) { .hero__logo { display: block; } }
.hero__title { font-size: clamp(2.4rem, 8.4vw, 4.6rem); font-weight: 800; max-width: 13ch; }
.hero__lead { font-size: clamp(1.05rem, 2.2vw, 1.25rem); color: var(--suave); max-width: 44ch; }
.hero__actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 6px; }
.hero__art { position: relative; order: 1; height: clamp(340px, 92vw, 460px); display: grid; place-items: center; }
.hero__blob {
  position: absolute; inset: 8% 6% 4%;
  background: var(--lilas);
  border-radius: 46% 54% 42% 58% / 52% 44% 56% 48%;
  border: 2px solid var(--linha);
}
.hero__mascote {
  position: absolute; bottom: 0; left: 50%; translate: -50% 0;
  height: 100%; width: auto; max-width: none;
  filter: drop-shadow(0 10px 12px rgba(59,18,80,.18));
  animation: sway 6s ease-in-out infinite;
  transform-origin: 50% 100%;
}
@keyframes sway { 50% { transform: rotate(-1.6deg) translateY(-4px); } }
.sprinkle { position: absolute; width: 14px; height: 6px; border-radius: 6px; }
.s1 { background: var(--ceu); top: 14%; left: 14%; transform: rotate(30deg); }
.s2 { background: var(--manteiga); top: 24%; right: 12%; transform: rotate(-20deg); }
.s3 { background: var(--glace); bottom: 22%; left: 8%; transform: rotate(70deg); }
.s4 { background: var(--violeta); bottom: 12%; right: 16%; transform: rotate(10deg); }
@media (min-width: 900px) {
  .hero { grid-template-columns: 1.1fr .9fr; padding-top: 40px; padding-bottom: 72px; }
  .hero__text { order: 1; }
  .hero__art { order: 2; height: 560px; }
}

/* Sections */
.section { max-width: var(--max); margin: 0 auto; padding: 56px var(--pad); }
.section__head { display: grid; gap: 10px; margin-bottom: 28px; max-width: 62ch; }
.section__head p { color: var(--suave); }

/* Portfolio: colunas tipo mural */
.portfolio { padding-top: 24px; }
.gallery { columns: 2 160px; column-gap: 12px; }
.gallery a {
  display: block; position: relative; margin: 0 0 12px; break-inside: avoid;
  border-radius: var(--r-m); overflow: hidden; border: 2px solid var(--ameixa);
  background: var(--lilas);
}
.gallery img { width: 100%; height: auto; transition: transform .4s ease; }
.gallery a:hover img { transform: scale(1.04); }
.gallery figcaption {
  position: absolute; left: 8px; bottom: 8px; right: 8px;
  font-size: .82rem; font-weight: 600; color: var(--ameixa);
  background: rgba(255,255,255,.92); padding: 5px 10px; border-radius: 999px;
  width: fit-content; max-width: calc(100% - 16px);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.portfolio__more { margin-top: 18px; }
@media (min-width: 700px) { .gallery { columns: 3; column-gap: 16px; } .gallery a { margin-bottom: 16px; } }
@media (min-width: 1000px) { .gallery { columns: 4; } }

/* Builder */
.builder { background: none; }
.builder__grid { display: grid; gap: 24px; }
.preview {
  background: #fff; border: 2px solid var(--ameixa); border-radius: var(--r-l);
  padding: 18px; box-shadow: 0 6px 0 var(--ameixa);
  display: grid; gap: 14px; align-self: start;
}
.preview__stage {
  border-radius: calc(var(--r-l) - 12px);
  background:
    radial-gradient(circle at 20% 20%, #fff 0 2px, transparent 3px) 0 0 / 28px 28px,
    var(--lilas);
  display: grid; place-items: center;
}
.cake { width: 100%; max-width: 340px; height: auto; }
.cake * { transition: all .35s ease; }
.preview__facts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 0; }
.preview__facts div { display: grid; gap: 2px; }
.preview__facts dt { font-size: .85rem; color: var(--suave); }
.preview__facts dd { margin: 0; font-weight: 700; font-family: var(--f-display); font-size: 1.15rem; color: var(--ameixa); }
.preview__price { font-size: 1.6rem !important; color: var(--violeta) !important; }
.preview__breakdown { list-style: none; margin: 0; padding: 12px 0 0; border-top: 1px dashed var(--linha); display: grid; gap: 4px; font-size: .9rem; color: var(--suave); }
.preview__breakdown li { display: flex; justify-content: space-between; gap: 12px; }
.preview__breakdown li span:last-child { white-space: nowrap; font-variant-numeric: tabular-nums; color: var(--texto); }

.steps { display: grid; gap: 14px; }
.step {
  margin: 0; padding: 18px; border: 1.5px solid var(--linha); border-radius: var(--r-m);
  background: #fff; min-width: 0;
}
.step legend {
  display: flex; align-items: center; gap: 10px; padding: 0;
  font: 700 1.2rem var(--f-display); color: var(--ameixa); float: left; width: 100%; margin-bottom: 12px;
}
.step legend small { font: 500 .85rem var(--f-texto); color: var(--suave); }
.step legend + * { clear: both; }
.step__n {
  width: 30px; height: 30px; border-radius: 50%; flex: none;
  display: grid; place-items: center; font-size: .95rem;
  background: var(--manteiga); color: var(--ameixa); border: 2px solid var(--ameixa);
}
.step__hint { font-size: .9rem; color: var(--suave); margin: 0 0 10px; }
.step__hint:empty { display: none; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { position: relative; }
.chip input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.chip span {
  display: inline-flex; align-items: center; gap: 6px; min-height: 44px;
  padding: 8px 14px; border-radius: 999px;
  border: 1.5px solid var(--linha); background: var(--fundo);
  font-weight: 600; font-size: .95rem; color: var(--texto);
  transition: background .15s, border-color .15s, color .15s;
}
.chip span em { font-style: normal; font-weight: 700; font-size: .78rem; color: var(--violeta); background: var(--lilas); padding: 2px 7px; border-radius: 999px; }
.chip span i { width: 14px; height: 14px; border-radius: 50%; border: 1.5px solid rgba(59,18,80,.35); flex: none; }
.chip input:hover + span { border-color: var(--violeta); }
.chip input:checked + span { background: var(--ameixa); border-color: var(--ameixa); color: #fff; }
.chip input:checked + span em { background: var(--manteiga); color: var(--ameixa); }
.chip input:focus-visible + span { outline: 3px solid var(--ceu); outline-offset: 2px; }
.chip input:disabled + span { opacity: .4; cursor: not-allowed; }
.chips--wide { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
.chips--wide .chip span { width: 100%; justify-content: center; }

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.cards .chip span {
  border-radius: var(--r-s); flex-direction: column; align-items: flex-start; gap: 2px;
  padding: 12px 14px; width: 100%; height: 100%;
}
.cards .chip small { font-weight: 500; font-size: .82rem; opacity: .8; }
.cards .chip b { margin-top: 4px; font-family: var(--f-display); }

.andares { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 10px 16px; margin-top: 14px; padding-top: 14px; border-top: 1px dashed var(--linha); }
.andares .step__hint { grid-column: 1 / -1; margin: 0; }
.andares__label { font-weight: 600; }
.stepper { display: inline-flex; align-items: center; border: 1.5px solid var(--ameixa); border-radius: 999px; overflow: hidden; width: fit-content; background: #fff; }
.stepper button { width: 44px; height: 42px; border: 0; background: none; font-size: 1.3rem; color: var(--ameixa); cursor: pointer; }
.stepper button:hover { background: var(--lilas); }
.stepper button:disabled { opacity: .3; cursor: not-allowed; }
.stepper output, .stepper input { min-width: 44px; text-align: center; font-weight: 700; font-variant-numeric: tabular-nums; }

.field { display: grid; gap: 6px; margin: 0; padding: 0; border: 0; min-width: 0; }
.field > span, .field legend { font-weight: 600; font-size: .95rem; padding: 0; margin-bottom: 4px; }
.field input, .field textarea {
  width: 100%; font: inherit; color: inherit;
  padding: 12px 14px; border-radius: var(--r-s); border: 1.5px solid var(--linha); background: var(--fundo);
}
.field input:focus, .field textarea:focus { outline: none; border-color: var(--violeta); box-shadow: 0 0 0 3px var(--lilas); }
.step .field { margin-top: 12px; }
.step > .field:first-of-type:only-child { margin-top: 0; }

/* barra fixa no celular */
.builder__bar {
  position: sticky; bottom: 0; z-index: 10;
  display: flex; align-items: center; gap: 12px;
  margin: 6px calc(var(--pad) * -1) 0; padding: 12px var(--pad) calc(12px + env(safe-area-inset-bottom));
  background: #fff; border-top: 2px solid var(--ameixa);
}
.builder__bar-total { display: grid; line-height: 1.1; }
.builder__bar-total span { font-size: .8rem; color: var(--suave); }
.builder__bar-total strong { font-family: var(--f-display); font-size: 1.35rem; color: var(--violeta); white-space: nowrap; }
.builder__bar .btn { flex: 1; padding: 0 16px; }

@media (min-width: 900px) {
  .builder__grid { grid-template-columns: 380px 1fr; gap: 32px; align-items: start; }
  .preview { position: sticky; top: 92px; }
  .builder__bar { margin: 6px 0 0; border: 2px solid var(--ameixa); border-radius: var(--r-m); bottom: 16px; box-shadow: 0 4px 0 var(--ameixa); }
}

/* Produtos */
.produtos__cat { margin-bottom: 28px; }
.produtos__cat h3 { margin-bottom: 4px; }
.produtos__cat > p { color: var(--suave); font-size: .92rem; margin-bottom: 14px; }
.produtos__grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.prod {
  display: grid; grid-template-columns: 1fr auto; gap: 10px 12px; align-items: center;
  padding: 14px 16px; background: #fff; border: 1.5px solid var(--linha); border-radius: var(--r-m);
}
.prod__name { font-weight: 700; }
.prod__price { font-size: .88rem; color: var(--suave); }
.prod__actions { grid-column: 1 / -1; display: flex; gap: 10px; align-items: center; justify-content: space-between; }
.prod__actions .stepper input { width: 56px; border: 0; background: none; font: inherit; font-weight: 700; color: var(--ameixa); -moz-appearance: textfield; }
.prod__actions .stepper input::-webkit-inner-spin-button { -webkit-appearance: none; }
.prod__add { min-height: 42px; padding: 0 16px; font-size: .92rem; box-shadow: 0 3px 0 var(--ameixa); }
.prod__dot { width: 34px; height: 34px; border-radius: 50%; border: 2px solid var(--ameixa); }

/* Como funciona: é uma sequência, por isso numerada */
.how__list { list-style: none; padding: 0; margin: 0; display: grid; gap: 14px; counter-reset: passo; }
.how__list li {
  counter-increment: passo; position: relative;
  padding: 20px 20px 20px 74px; background: #fff; border-radius: var(--r-m); border: 1.5px solid var(--linha);
}
.how__list li::before {
  content: counter(passo); position: absolute; left: 20px; top: 18px;
  width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center;
  font: 800 1.1rem var(--f-display); background: var(--ceu); color: #fff; border: 2px solid var(--ameixa);
}
.how__list p { color: var(--suave); margin-top: 4px; }
.how__note { margin-top: 18px; color: var(--suave); }
@media (min-width: 900px) { .how__list { grid-template-columns: repeat(4, 1fr); } }

/* Footer */
.footer {
  margin-top: 40px; padding: 48px var(--pad) calc(40px + env(safe-area-inset-bottom));
  background: var(--ameixa); color: #E9D9F5; text-align: center;
  display: grid; justify-items: center; gap: 10px;
}
.footer img { width: 120px; height: auto; border-radius: 16px; }
.footer__links { display: flex; gap: 20px; }
.footer a { color: #fff; font-weight: 700; }
.footer__small { font-size: .85rem; opacity: .7; }

/* Drawer */
.drawer { position: fixed; inset: 0; z-index: 50; }
.drawer[hidden] { display: none; }
.drawer__backdrop { position: absolute; inset: 0; background: rgba(42,15,56,.5); animation: fade .2s ease; }
.drawer__panel {
  position: absolute; right: 0; top: 0; bottom: 0; width: min(460px, 100%);
  background: var(--fundo); display: grid; grid-template-rows: auto 1fr auto;
  animation: slide .28s cubic-bezier(.2,.8,.2,1);
}
@keyframes fade { from { opacity: 0; } }
@keyframes slide { from { transform: translateX(100%); } }
.drawer__head { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--linha); }
.drawer__head h2 { font-size: 1.6rem; }
.icon-btn { width: 44px; height: 44px; border-radius: 50%; border: 1.5px solid var(--linha); background: #fff; font-size: 1.6rem; line-height: 1; cursor: pointer; color: var(--ameixa); }
.drawer__body { overflow-y: auto; padding: 16px 20px; display: grid; gap: 18px; align-content: start; }
.drawer__foot { padding: 14px 20px calc(14px + env(safe-area-inset-bottom)); border-top: 2px solid var(--ameixa); background: #fff; display: grid; gap: 10px; }
.drawer__total { display: flex; justify-content: space-between; align-items: baseline; }
.drawer__total strong { font: 800 1.6rem var(--f-display); color: var(--violeta); }
.drawer__small { font-size: .8rem; color: var(--suave); text-align: center; }

.cart-empty { text-align: center; padding: 28px 0; display: grid; gap: 14px; justify-items: center; color: var(--suave); }
.cart-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.cart-item { background: #fff; border: 1.5px solid var(--linha); border-radius: var(--r-m); padding: 14px; display: grid; gap: 6px; }
.cart-item__top { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; }
.cart-item__top strong { font-family: var(--f-display); color: var(--ameixa); }
.cart-item__price { font-weight: 700; white-space: nowrap; }
.cart-item ul { margin: 0; padding-left: 18px; font-size: .88rem; color: var(--suave); }
.cart-item__rm { justify-self: start; background: none; border: 0; padding: 4px 0; color: #B0275A; font-weight: 600; cursor: pointer; font-size: .88rem; text-decoration: underline; }
.checkout { display: grid; gap: 12px; }
.checkout h3 { font-size: 1.15rem; }
.form-error { color: #B0275A; font-weight: 600; font-size: .9rem; }
.form-error:empty { display: none; }

/* Toast */
.toast {
  position: fixed; left: 50%; top: 76px; z-index: 60;
  transform: translate(-50%, -12px); opacity: 0; pointer-events: none;
  background: var(--ameixa); color: #fff; padding: 12px 18px; border-radius: 999px; font-weight: 600;
  transition: all .25s ease; max-width: calc(100% - 32px); text-align: center;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  html { scroll-behavior: auto; }
}
.prod__dot { object-fit: cover; }
