/* ============================================================
   LOJINHA DO NB — design tokens
   Paleta inspirada no crachá NB (verde/azul/amarelo + preto)
   ============================================================ */
:root {
  --bg: #FFF6E1;
  --paper: #FFFFFF;
  --ink: #122043;
  --ink-soft: #4A5677;
  --blue: #1440C4;
  --blue-deep: #0B2A82;
  --yellow: #FFC531;
  --green: #128A4A;
  --red: #E23B32;
  --line: rgba(18, 32, 67, 0.14);
  --shadow: 0 18px 40px -22px rgba(18, 32, 67, 0.45);
  --radius: 22px;
  --radius-sm: 12px;

  --font-display: 'Fredoka', system-ui, sans-serif;
  --font-body: 'Manrope', system-ui, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

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

a { color: inherit; }

button { font-family: inherit; cursor: pointer; }

.container {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 24px;
}

/* -------------------- flag stripe -------------------- */
.flag-stripe {
  height: 10px;
  width: 100%;
  background: repeating-linear-gradient(
    90deg,
    var(--blue) 0 8%,
    var(--yellow) 8% 16%,
    var(--green) 16% 24%
  );
}

/* -------------------- topbar -------------------- */
.topbar {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px 0;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}
.brand img { width: 42px; height: 42px; }
.brand strong {
  font-family: var(--font-display);
  font-size: 1.15rem;
  letter-spacing: 0.02em;
}
/* -------------------- hero -------------------- */
.hero {
  padding: 56px 0 40px;
  text-align: center;
  position: relative;
}
.hero h1 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(2.4rem, 6vw, 4rem);
  line-height: 0.98;
  margin: 0 0 20px;
  color: var(--blue-deep);
}
.hero h1 span {
  color: var(--green);
  position: relative;
}
.hero p.lede {
  max-width: 560px;
  margin: 0 auto;
  color: var(--ink-soft);
  font-size: 1.02rem;
}
.hero .rule-note {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 22px;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--blue-deep);
  background: var(--yellow);
  padding: 8px 16px;
  border-radius: 999px;
  box-shadow: var(--shadow);
}

/* -------------------- product grid -------------------- */
.grid-section { padding: 20px 0 80px; }
.grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 26px;
}
@media (max-width: 920px) {
  .grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 620px) {
  .grid { grid-template-columns: 1fr; }
}

.card {
  background: var(--paper);
  border-radius: var(--radius);
  border: 1.5px solid var(--line);
  overflow: hidden;
  position: relative;
  display: flex;
  flex-direction: column;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow); }

.card .photo-wrap {
  aspect-ratio: 4 / 3.2;
  background: #F4F1E7;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
}
.card .photo-wrap img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 14px;
}
.card .photo-wrap.placeholder {
  background: linear-gradient(135deg, #12204320, #12844a20);
}

/* crest / stamp badge — signature element */
.stamp {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 78px;
  height: 78px;
  transform: rotate(-9deg);
  filter: drop-shadow(0 6px 10px rgba(18,32,67,0.28));
}
.stamp .stamp-bg { fill: var(--paper); stroke: var(--blue-deep); stroke-width: 3; }
.stamp text {
  font-family: var(--font-display);
  fill: var(--blue-deep);
  text-anchor: middle;
}
.stamp .stamp-num { font-size: 20px; font-weight: 700; }
.stamp .stamp-label { font-size: 7px; letter-spacing: 0.06em; }
.stamp.low .stamp-bg { stroke: var(--red); }
.stamp.low text { fill: var(--red); }
.stamp.out .stamp-bg { stroke: var(--ink-soft); fill: #ECEAE0; }
.stamp.out text { fill: var(--ink-soft); }

.card .body {
  padding: 18px 20px 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
}
.card h3 {
  font-family: var(--font-display);
  font-size: 1.08rem;
  margin: 0;
  line-height: 1.2;
}
.card .desc {
  font-size: 0.86rem;
  color: var(--ink-soft);
  margin: 0;
  flex: 1;
}
.btn {
  border: none;
  border-radius: 999px;
  padding: 12px 18px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.92rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: filter 0.15s ease, transform 0.1s ease;
}
.btn:active { transform: scale(0.97); }
.btn-primary {
  background: var(--blue);
  color: #fff;
}
.btn-primary:hover { filter: brightness(1.08); }
.btn-primary:disabled {
  background: #D9D6C8;
  color: #8B8877;
  cursor: not-allowed;
}
.btn-outline {
  background: transparent;
  border: 1.5px solid var(--line);
  color: var(--ink);
}
.btn-outline:hover { border-color: var(--blue); color: var(--blue); }
.btn-danger { background: var(--red); color: #fff; }
.btn-sm { padding: 8px 14px; font-size: 0.8rem; }

/* -------------------- modal -------------------- */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(18, 32, 67, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 50;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}
.overlay.open { opacity: 1; pointer-events: auto; }

.modal {
  background: var(--paper);
  border-radius: var(--radius);
  width: 100%;
  max-width: 460px;
  max-height: 90vh;
  overflow-y: auto;
  padding: 28px;
  position: relative;
  transform: translateY(14px) scale(0.98);
  transition: transform 0.2s ease;
}
.overlay.open .modal { transform: translateY(0) scale(1); }

.modal .close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: #F1EEE2;
  border: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 1rem;
  color: var(--ink-soft);
}

.modal-product {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
  padding-bottom: 16px;
  border-bottom: 1.5px dashed var(--line);
}
.modal-product img {
  width: 56px; height: 56px; object-fit: contain;
  background: #F4F1E7; border-radius: 10px; padding: 6px;
}
.modal-product .pname {
  font-family: var(--font-display);
  font-size: 1.05rem;
}
.modal-product .pstock { font-size: 0.8rem; color: var(--ink-soft); }

.field { margin-bottom: 14px; }
.field label {
  display: block;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--ink-soft);
  margin-bottom: 5px;
}
.field input, .field textarea, .field select {
  width: 100%;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 11px 13px;
  font-family: var(--font-body);
  font-size: 0.95rem;
  background: #FCFBF6;
  color: var(--ink);
}
.field input:focus, .field textarea:focus, .field select:focus {
  outline: none;
  border-color: var(--blue);
  background: #fff;
}
.field textarea { resize: vertical; min-height: 64px; }

.form-msg {
  font-size: 0.85rem;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  margin-bottom: 14px;
  display: none;
}
.form-msg.show { display: block; }
.form-msg.error { background: #FDEBEA; color: #A8281F; }
.form-msg.success { background: #E9F7EE; color: #0E6B37; }

/* ticket / success state */
.ticket {
  text-align: center;
  padding: 6px 0 4px;
}
.ticket .seal {
  width: 64px; height: 64px; margin: 0 auto 14px;
}
.ticket h4 {
  font-family: var(--font-display);
  font-size: 1.25rem;
  margin: 0 0 6px;
  color: var(--green);
}
.ticket p { color: var(--ink-soft); font-size: 0.92rem; margin: 0 0 18px; }
.ticket .stub {
  border: 1.5px dashed var(--line);
  border-radius: var(--radius-sm);
  padding: 16px;
  text-align: left;
  font-size: 0.85rem;
  background: #FCFBF6;
}
.ticket .stub div { margin-bottom: 4px; }
.ticket .stub strong { color: var(--ink); }

/* -------------------- footer -------------------- */
footer {
  padding: 30px 0 50px;
  text-align: center;
  color: var(--ink-soft);
  font-size: 0.82rem;
}
footer a { text-decoration: underline; }

/* -------------------- utility -------------------- */
.visually-hidden {
  position: absolute; width: 1px; height: 1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}

:focus-visible {
  outline: 3px solid var(--blue);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
