/* ---------------- buttons ---------------- */

.btn {
  --btn-bg: var(--ink);
  --btn-fg: var(--cream);
  display: inline-flex; align-items: center; justify-content: center; gap: var(--sp-2);
  padding: 0.8em 1.5em;
  border: 0; border-radius: var(--r-pill);
  background: var(--btn-bg); color: var(--btn-fg);
  font-family: var(--font-text); font-size: var(--t-sm); font-weight: 600;
  letter-spacing: .01em; text-decoration: none; cursor: pointer;
  transition: transform var(--dur-fast) var(--ease-out),
              box-shadow var(--dur) var(--ease-out),
              background-color var(--dur) var(--ease-out);
  box-shadow: var(--shadow-sm);
}
.btn:hover { transform: translateY(-1px); box-shadow: var(--shadow-md); }
.btn:active { transform: translateY(0); }
.btn[disabled], .btn[aria-disabled='true'] {
  opacity: .45; cursor: not-allowed; transform: none; box-shadow: none;
}
.btn--lg { padding: 1em 1.9em; font-size: 1rem; }
.btn--sea { --btn-bg: var(--sea-deep); --btn-fg: #fff; }
.btn--ghost {
  --btn-bg: transparent; --btn-fg: var(--ink);
  box-shadow: inset 0 0 0 1.5px var(--line);
}
.btn--ghost:hover { box-shadow: inset 0 0 0 1.5px var(--ink); }
.btn--cream { --btn-bg: var(--cream); --btn-fg: var(--ink); }
.btn--sun { --btn-bg: var(--sun); --btn-fg: var(--ink); }
.btn--sun:hover { --btn-bg: var(--sun-deep); }
.btn--block { width: 100%; }
.btn--danger { --btn-bg: var(--bad); --btn-fg: #fff; }

.linkish {
  background: none; border: 0; padding: 0; cursor: pointer;
  font-size: var(--t-sm); color: var(--ink-mute);
  text-decoration: underline; text-underline-offset: 3px;
}
.linkish:hover { color: var(--ink); }

/* ---------------- header ---------------- */

.site-header {
  position: sticky; top: 0; z-index: 100;
  background: color-mix(in srgb, var(--ink) 96%, transparent);
  backdrop-filter: saturate(140%) blur(10px);
  color: var(--cream);
}
.site-header__inner {
  height: var(--header-h);
  display: flex; align-items: center; gap: var(--sp-5);
}
.brand { display: flex; align-items: center; gap: var(--sp-3); text-decoration: none; flex: none; }
.brand img { height: 30px; width: auto; }

/* Back office: brand, a label that says where you are, and a way back out. */
.admin-badge {
  font-size: var(--t-xs); font-weight: 600; letter-spacing: .06em;
  text-transform: uppercase;
  padding: 4px 10px; border-radius: var(--r-pill);
  color: var(--cream);
  background: color-mix(in srgb, var(--cream) 16%, transparent);
}
.admin-back {
  margin-left: auto;
  font-size: var(--t-sm); text-decoration: none;
  color: color-mix(in srgb, var(--cream) 78%, transparent);
}
.admin-back:hover { color: var(--cream); text-decoration: underline; }

.nav { display: flex; gap: var(--sp-1); margin-left: auto; align-items: center; }
.nav a {
  padding: var(--sp-2) var(--sp-3); border-radius: var(--r-pill);
  font-size: var(--t-sm); font-weight: 500; text-decoration: none;
  color: color-mix(in srgb, var(--cream) 82%, transparent);
  transition: background-color var(--dur) var(--ease-out), color var(--dur) var(--ease-out);
}
.nav a:hover { background: rgba(255, 255, 255, .09); color: var(--cream); }
.nav a[aria-current='page'] { color: var(--cream); background: rgba(255, 255, 255, .13); }

.nav-toggle { display: none; }

/* Account sits as a filled yellow pill so it reads as the one action in an
   otherwise flat row of links. */
.nav.nav a.nav-account {
  background: var(--sun);
  color: var(--ink);
  font-weight: 700;
  padding: var(--sp-2) var(--sp-4);
  margin-left: var(--sp-2);
}
.nav.nav a.nav-account:hover { background: var(--sun-deep); color: var(--ink); }

.cart-link {
  position: relative;
  display: grid;
  place-items: center;
  width: 40px; height: 40px;
  padding: 0;
  margin-left: var(--sp-1);
}
.cart-icon { display: grid; place-items: center; }
.cart-count {
  position: absolute; top: 1px; right: 0;
  min-width: 18px; height: 18px; padding: 0 4px;
  display: grid; place-items: center;
  border-radius: var(--r-pill);
  background: var(--sun); color: var(--ink);
  font-size: 11px; font-weight: 700; line-height: 1;
  box-shadow: 0 0 0 2px var(--ink);
}
.cart-count[hidden] { display: none; }

@media (max-width: 900px) {
  /* Stacked drawer: the icon alone is too ambiguous in a vertical list. */
  .cart-link { width: auto; height: auto; justify-content: flex-start; }
  .cart-link { display: flex; align-items: center; gap: var(--sp-3); padding: var(--sp-3) var(--sp-4); }
  /* Order explicitly: icon, label, then the count pushed to the right edge.
     The ::after label is last in the box tree, so without this it lands after
     the count and the row reads "icon 3 Carrinho". */
  .cart-icon { order: 1; }
  .cart-link::after { content: 'Carrinho'; order: 2; }
  .cart-count { order: 3; position: static; margin-left: auto; box-shadow: none; }
  .nav.nav a.nav-account { margin: var(--sp-2) 0 0; text-align: center; }
}

@media (max-width: 900px) {
  .nav-toggle {
    display: grid; place-items: center; margin-left: auto;
    width: 40px; height: 40px; border-radius: var(--r-sm);
    background: rgba(255, 255, 255, .1); border: 0; color: var(--cream); cursor: pointer;
  }
  .nav {
    position: absolute; inset: var(--header-h) 0 auto 0;
    flex-direction: column; align-items: stretch; margin: 0;
    background: var(--ink); padding: var(--sp-3);
    border-top: 1px solid rgba(255, 255, 255, .08);
  }
  .nav[hidden] { display: none; }
  .nav a { padding: var(--sp-3) var(--sp-4); }
}

/* ---------------- footer ---------------- */

.site-footer { background: var(--ink); color: color-mix(in srgb, var(--cream) 72%, transparent); padding-block: var(--sp-7) var(--sp-5); }
.site-footer h4 { color: var(--cream); font-size: 1rem; margin-bottom: var(--sp-3); }
.site-footer a { text-decoration: none; }
.site-footer a:hover { color: var(--cream); text-decoration: underline; }
.site-footer ul { list-style: none; padding: 0; }
.site-footer li { margin-bottom: var(--sp-2); font-size: var(--t-sm); }
.footer-grid { display: grid; gap: var(--sp-6); grid-template-columns: 1.6fr repeat(3, 1fr); }
@media (max-width: 820px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
.footer-bottom {
  margin-top: var(--sp-6); padding-top: var(--sp-4);
  border-top: 1px solid rgba(255, 255, 255, .1);
  display: flex; gap: var(--sp-4); flex-wrap: wrap; justify-content: space-between;
  font-size: var(--t-xs);
}

/* ---------------- cards ---------------- */

.card {
  background: var(--paper); border: 1px solid var(--line-soft);
  border-radius: var(--r-lg); overflow: hidden;
  display: flex; flex-direction: column;
  transition: transform var(--dur) var(--ease-out), box-shadow var(--dur) var(--ease-out),
              border-color var(--dur) var(--ease-out);
}
a.card { text-decoration: none; }
a.card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: var(--line); }
.card__media { background: var(--cream); aspect-ratio: 1; display: grid; place-items: center; padding: var(--sp-4); }
.card__media img { width: 100%; height: 100%; object-fit: contain; }
.card__body { padding: var(--sp-4); display: flex; flex-direction: column; gap: var(--sp-2); flex: 1; }
.card__title { font-family: var(--font-display); font-weight: 600; font-size: 1.05rem; }
.card__meta { font-size: var(--t-xs); color: var(--ink-mute); }
.card__foot { margin-top: auto; display: flex; align-items: baseline; gap: var(--sp-2); }

.price { font-family: var(--font-display); font-weight: 800; font-size: 1.25rem; }
.price--was { font-family: var(--font-text); font-weight: 400; font-size: var(--t-sm); color: var(--ink-mute); text-decoration: line-through; }

.tag {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 10px; border-radius: var(--r-pill);
  background: var(--cream-deep); color: var(--ink-soft);
  font-size: var(--t-xs); font-weight: 600;
}
.tag--sea { background: var(--sea); color: var(--sea-ink); }
.tag--ok { background: color-mix(in srgb, var(--ok) 18%, var(--cream)); color: var(--ok); }
.tag--warn { background: color-mix(in srgb, var(--warn) 20%, var(--cream)); color: var(--warn); }
.tag--bad { background: color-mix(in srgb, var(--bad) 16%, var(--cream)); color: var(--bad); }

/* ---------------- colour swatches ---------------- */

.swatches { display: flex; gap: 6px; flex-wrap: wrap; }
.swatch {
  width: 20px; height: 20px; border-radius: 50%; padding: 0; cursor: pointer;
  border: 2px solid transparent; background-clip: padding-box;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .22);
  transition: transform var(--dur-fast) var(--ease-out), border-color var(--dur-fast) var(--ease-out);
}
.swatch:hover { transform: scale(1.14); }
.swatch[aria-pressed='true'] { border-color: var(--ink); transform: scale(1.1); }
.swatch--lg { width: 34px; height: 34px; }

/* ---------------- forms ---------------- */

.field { display: flex; flex-direction: column; gap: var(--sp-2); }
/* The field wrapper is itself a <label> in most places, with the caption in a
   leading <span>; a few older spots nest a <label>. Style both. */
.field > label,
.field > span:first-child { font-size: var(--t-sm); font-weight: 600; }
.field > .hint, .field > .err { font-weight: 400; }
.field .hint { font-size: var(--t-xs); color: var(--ink-mute); }
.field .err { font-size: var(--t-xs); color: var(--bad); font-weight: 600; }

input[type='text'], input[type='email'], input[type='tel'], input[type='password'],
input[type='number'], select, textarea {
  width: 100%; padding: 0.7em 0.9em;
  border: 1.5px solid var(--line); border-radius: var(--r-md);
  background: var(--paper);
  transition: border-color var(--dur) var(--ease-out), box-shadow var(--dur) var(--ease-out);
}
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--sea-deep);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--sea) 40%, transparent);
}
input[aria-invalid='true'], textarea[aria-invalid='true'] { border-color: var(--bad); }
textarea { resize: vertical; min-height: 120px; }

fieldset { border: 0; padding: 0; margin: 0; }
legend { font-size: var(--t-sm); font-weight: 600; padding: 0; margin-bottom: var(--sp-3); }

.choice {
  display: flex; gap: var(--sp-3); align-items: flex-start;
  padding: var(--sp-4); border: 1.5px solid var(--line); border-radius: var(--r-md);
  cursor: pointer; background: var(--paper);
  transition: border-color var(--dur) var(--ease-out), background-color var(--dur) var(--ease-out);
}
.choice:hover { border-color: var(--sea); }
.choice:has(input:checked) { border-color: var(--ink); background: var(--cream); }
.choice input { margin-top: 4px; flex: none; accent-color: var(--sea-deep); }
.choice__title { font-weight: 600; }
.choice__desc { font-size: var(--t-sm); color: var(--ink-mute); }

/* ---------------- panels, tables, notices ---------------- */

.panel {
  background: var(--paper); border: 1px solid var(--line-soft);
  border-radius: var(--r-lg); padding: var(--sp-5);
}
.panel--cream { background: var(--cream); border-color: var(--line); }

table.data { width: 100%; border-collapse: collapse; font-size: var(--t-sm); }
table.data th, table.data td { text-align: left; padding: var(--sp-3); border-bottom: 1px solid var(--line-soft); vertical-align: top; }
table.data th { font-size: var(--t-xs); text-transform: uppercase; letter-spacing: .08em; color: var(--ink-mute); font-weight: 700; white-space: nowrap; }
table.data tbody tr:hover { background: var(--cream); }

.notice {
  display: flex; gap: var(--sp-3); align-items: flex-start;
  padding: var(--sp-4); border-radius: var(--r-md);
  background: var(--cream); border-left: 4px solid var(--sea-deep);
  font-size: var(--t-sm);
}
.notice--warn { background: color-mix(in srgb, var(--warn) 12%, var(--cream)); border-left-color: var(--warn); }
.notice--bad { background: color-mix(in srgb, var(--bad) 10%, var(--cream)); border-left-color: var(--bad); }
.notice--ok { background: color-mix(in srgb, var(--ok) 12%, var(--cream)); border-left-color: var(--ok); }

/* Permanent, unmissable marker that nothing here is real. Mock auth is not
   security and simulated payments take no money — see README. */
.demo-banner {
  background: repeating-linear-gradient(135deg, #2b2b2b 0 14px, #333 14px 28px);
  color: #ffd23f; text-align: center;
  font-size: var(--t-xs); font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
  padding: var(--sp-2) var(--sp-4);
}
.demo-banner a { color: #ffd23f; }
/* The warning stays word for word; only the tracking gives way, so it takes one
   line on a phone instead of three above the fold. */
@media (max-width: 700px) {
  .demo-banner { letter-spacing: .04em; font-size: .68rem; padding: 6px var(--sp-3); }
}

/* ---------------- toast ---------------- */

.toasts {
  position: fixed; z-index: 300; bottom: var(--sp-5); left: 50%; translate: -50% 0;
  display: flex; flex-direction: column; gap: var(--sp-2); align-items: center;
  pointer-events: none; width: min(420px, calc(100vw - 2rem));
}
.toast {
  pointer-events: auto; width: 100%;
  display: flex; align-items: center; gap: var(--sp-3);
  background: var(--ink); color: var(--cream);
  padding: var(--sp-3) var(--sp-4); border-radius: var(--r-md);
  box-shadow: var(--shadow-lg); font-size: var(--t-sm);
  animation: toast-in var(--dur-slow) var(--ease-out);
}
.toast--bad { background: var(--bad); }
.toast--ok { background: var(--ok); }
@keyframes toast-in { from { opacity: 0; translate: 0 12px; } to { opacity: 1; translate: 0 0; } }
@media (prefers-reduced-motion: reduce) { .toast { animation: none; } }

/* ---------------- steps / breadcrumb ---------------- */

.steps { display: flex; gap: var(--sp-2); flex-wrap: wrap; list-style: none; padding: 0; font-size: var(--t-xs); }
.steps li { display: flex; align-items: center; gap: var(--sp-2); color: var(--ink-mute); }
.steps li + li::before { content: '→'; opacity: .5; }
.steps li[aria-current] { color: var(--ink); font-weight: 700; }

/* ---------------- badge grid (static, non-interactive) ---------------- */

.badge-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: var(--sp-4); }
.badge-chip { text-align: center; display: flex; flex-direction: column; gap: 6px; align-items: center; }
.badge-chip img {
  width: 76px; height: 76px;
  filter: drop-shadow(0 2px 3px rgba(20, 20, 20, .28));
}
.badge-chip span { font-size: var(--t-xs); color: var(--ink-mute); line-height: 1.25; }

.qty { display: inline-flex; align-items: center; border: 1.5px solid var(--line); border-radius: var(--r-pill); overflow: hidden; }
.qty button { width: 34px; height: 34px; border: 0; background: transparent; cursor: pointer; font-size: 1.1rem; line-height: 1; }
.qty button:hover { background: var(--cream); }
.qty input { width: 44px; text-align: center; border: 0; padding: 0; background: transparent; -moz-appearance: textfield; appearance: textfield; }
.qty input::-webkit-outer-spin-button, .qty input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.qty input:focus { box-shadow: none; }

/* ── added-to-cart sheet ─────────────────────────────────────────────────── */

.sheet {
  border: 0;
  padding: 0;
  max-width: 420px;
  width: calc(100% - 2 * var(--sp-4));
  border-radius: var(--r-lg);
  background: var(--paper);
  color: var(--ink);
  box-shadow: var(--shadow-lg, 0 18px 50px rgba(0, 0, 0, .28));
}
.sheet::backdrop { background: rgba(20, 20, 22, .48); }
.sheet__head {
  display: flex; align-items: center; justify-content: space-between;
  padding: var(--sp-4) var(--sp-5) 0;
}
.sheet__x {
  border: 0; background: none; cursor: pointer;
  font-size: 1.5rem; line-height: 1; color: var(--ink-mute); padding: 0 4px;
}
.sheet__x:hover { color: var(--ink); }
.sheet__body {
  display: flex; gap: var(--sp-4); align-items: center;
  padding: var(--sp-4) var(--sp-5);
}
.sheet__img {
  width: 84px; height: 84px; flex: none;
  object-fit: contain;
  background: var(--cream); border-radius: var(--r-md); padding: 6px;
}
.sheet__foot {
  display: flex; gap: var(--sp-3); flex-wrap: wrap;
  padding: 0 var(--sp-5) var(--sp-5);
}
.sheet__foot > * { flex: 1 1 auto; justify-content: center; }

/* ── admin: what was actually ordered ────────────────────────────────────── */

.ord-thumb {
  width: 46px; height: 46px; flex: none;
  object-fit: contain;
  background: var(--cream); border-radius: var(--r-sm); padding: 3px;
}
.ord-badges { display: flex; gap: 3px; flex-wrap: wrap; margin-top: 5px; }
.ord-badges img { width: 22px; height: 22px; object-fit: contain; }
