/* Bitacat store, V4 "app ceria" look: lime header, periwinkle ground, cream cards. */
:root {
  --lime: #D5F05C;
  --lime-2: #B5D93A;
  --peri: #5B5EE6;
  --peri-2: #3F42C9;
  --peri-3: #DCDDFB;
  --peri-4: #ECEDFF;
  --ink: #1E1B8F;
  --ink-2: #4A4870;
  --orange: #FF6B1A;
  --orange-2: #D9480A;
  --peach: #FF9D5C;
  --peach-2: #FFD9BF;
  --cream: #F4F0DC;
  --cream-2: #ECEEC4;
  --rule: #B9B48A;
  --green: #8DD35F;
  --ok: #2F6B12;
  --bad: #B3261E;
  --display: 'Bagel Fat One', system-ui, sans-serif;
  --body: 'Bricolage Grotesque', system-ui, sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  background: #2E2CB5;
  font-family: var(--body);
  color: var(--ink);
}
a { color: var(--ink); }
a:hover { color: var(--peri-2); }
img { max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 3px solid var(--orange); outline-offset: 2px;
}
[hidden] { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.display { font-family: var(--display); font-weight: 400; }

/* ---------- app column ---------- */
.app {
  position: relative;
  max-width: 520px;
  min-height: 100vh;
  margin: 0 auto;
  background: var(--cream);
  display: flex;
  flex-direction: column;
}
.app.peri { background: var(--peri); }
@media (min-width: 600px) {
  body { padding: 24px 0; background: #2E2CB5 radial-gradient(circle at 20% 10%, #3F42C9 0, transparent 40%) fixed; }
  .app { min-height: calc(100vh - 48px); border-radius: 36px; overflow: hidden; box-shadow: 0 24px 60px rgba(10, 8, 60, .45); }
}
main.page { flex: 1 1 auto; padding: 14px 14px 104px; }

/* ---------- header ---------- */
.top {
  position: sticky; top: 0; z-index: 20;
  background: var(--lime);
  border-radius: 0 0 26px 26px;
  padding: 16px 14px 12px 18px;
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
}
.top.back { padding-left: 10px; justify-content: flex-start; }
.logo { font-family: var(--display); font-size: 32px; line-height: 1; letter-spacing: -.5px; text-decoration: none; color: var(--ink); }
.top h1 { margin: 0; font-family: var(--display); font-weight: 400; font-size: 26px; line-height: 1; }
.top .acts { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.ic { width: 44px; height: 44px; border: 0; background: transparent; padding: 0; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; position: relative; text-decoration: none; transition: transform .15s ease; }
.ic:hover { transform: scale(1.08); }
.ic .ring { width: 36px; height: 36px; border-radius: 999px; background: var(--lime-2); border: 2px solid var(--ink); display: flex; align-items: center; justify-content: center; }
.ic.on .ring { background: var(--ink); }
.ic.on .ring svg { stroke: var(--lime); }
.badge { position: absolute; top: 0; right: 0; min-width: 18px; height: 18px; padding: 0 4px; border-radius: 999px; background: var(--orange); color: var(--ink); font-size: 11px; font-weight: 800; display: flex; align-items: center; justify-content: center; border: 2px solid var(--lime); }
.badge[hidden] { display: none; }
.bump { animation: bump .35s ease-out; }
@keyframes bump { 40% { transform: scale(1.35); } }

/* ---------- bottom nav ---------- */
.botnav {
  position: fixed; z-index: 20; bottom: 12px; left: 50%; transform: translateX(-50%);
  width: min(496px, calc(100% - 24px));
  height: 62px; background: var(--peri-4); border-radius: 31px;
  display: flex; align-items: center; justify-content: space-around;
  box-shadow: 0 8px 20px rgba(20, 18, 90, .28);
}
.botnav a { width: 52px; height: 48px; border-radius: 24px; display: flex; align-items: center; justify-content: center; position: relative; transition: transform .15s ease; }
.botnav a:hover { transform: scale(1.08); }
.botnav a[aria-current="page"] { background: var(--lime); }
.botnav .badge { top: 2px; right: 4px; border-color: var(--peri-4); }
@media (min-width: 600px) { .botnav { bottom: 36px; width: 496px; } }

/* ---------- common bits ---------- */
.tap { transition: transform .15s ease; }
.tap:hover { transform: translateY(-2px); }
.tap:active { transform: scale(.97); }
.btn { min-height: 52px; padding: 0 20px; border: 0; border-radius: 14px; font-weight: 800; font-size: 15px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; cursor: pointer; text-decoration: none; transition: transform .15s ease; }
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }
.btn.navy { background: var(--ink); color: var(--lime); }
.btn.navy:hover { color: var(--lime); }
.btn.lime { background: var(--lime); color: var(--ink); }
.btn.peri { background: var(--peri); color: #FFFFFF; }
.btn.peri:hover { color: #FFFFFF; }
.btn.orange { background: var(--orange); color: var(--ink); }
.btn.line { background: transparent; border: 2px solid var(--ink); color: var(--ink); }
.btn.big { font-family: var(--display); font-weight: 400; font-size: 20px; }
.btn.full { width: 100%; }
.pill { min-height: 36px; padding: 0 14px; border-radius: 999px; border: 2px solid var(--ink); background: transparent; color: var(--ink); font-size: 12.5px; font-weight: 800; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; text-decoration: none; }
.pill[aria-pressed="true"] { background: var(--ink); color: var(--lime); }
.pill.white { border-color: #FFFFFF; color: #FFFFFF; }
.chiprow { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; margin: 0 -14px; padding: 0 14px; }
.chiprow::-webkit-scrollbar { display: none; }
.h2 { margin: 0 0 8px 4px; font-family: var(--display); font-weight: 400; font-size: 20px; line-height: 1.1; }
.card { background: #FFFFFF; border-radius: 20px; padding: 16px 14px; }
.note { margin: 0; background: var(--peri-3); border-radius: 14px; padding: 12px 14px; font-size: 13px; font-weight: 700; line-height: 1.4; }
.muted { color: var(--ink-2); }
.clamp { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.price { color: var(--orange-2); font-weight: 800; }
.err { margin: 8px 0 0; color: var(--bad); font-size: 13px; font-weight: 800; }
.okmsg { margin: 6px 0 0 4px; color: var(--ok); font-size: 12.5px; font-weight: 800; }
.fade { animation: fade .25s ease-out both; }
@keyframes fade { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.bob { animation: bob 3.4s ease-in-out infinite; }
@keyframes bob { 0%, 100% { transform: translateY(0) rotate(-2deg); } 50% { transform: translateY(-8px) rotate(2deg); } }
.wob { animation: wob 3.2s ease-in-out infinite; }
@keyframes wob { 0%, 100% { transform: rotate(-9deg); } 50% { transform: rotate(-5deg) scale(1.04); } }
.sticker { position: absolute; margin: 0; border-radius: 50%; font-family: var(--display); line-height: 1.02; text-align: center; display: flex; align-items: center; justify-content: center; }
.spin { width: 56px; height: 56px; border-radius: 999px; border: 7px solid #8E90F0; border-top-color: var(--lime); animation: spin .9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.skel { background: linear-gradient(90deg, #E8E4CC 25%, #F7F4E6 50%, #E8E4CC 75%); background-size: 200% 100%; animation: skel 1.2s linear infinite; border-radius: 10px; }
@keyframes skel { to { background-position: -200% 0; } }

/* ---------- fields ---------- */
.field { display: flex; flex-direction: column; gap: 4px; }
.field label { font-size: 12.5px; font-weight: 800; }
.input { width: 100%; min-height: 46px; border: 2px solid var(--ink); border-radius: 12px; background: #FFFFFF; padding: 0 12px; font-size: 15px; font-weight: 600; color: var(--ink); }
textarea.input { padding: 10px 12px; min-height: 70px; resize: vertical; }
select.input { appearance: none; background: #FFFFFF url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%231E1B8F' stroke-width='3' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") no-repeat right 12px center; padding-right: 34px; }
.input[aria-invalid="true"] { border-color: var(--bad); }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }

/* ---------- products ---------- */
.pgrid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px 10px; }
.pgrid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 10px; }
.pmini { display: flex; flex-direction: column; gap: 5px; color: #FFFFFF; text-decoration: none; }
.pmini:hover { color: #FFFFFF; }
.pmini .ph { position: relative; display: block; background: var(--cream); border-radius: 10px; padding: 8px; aspect-ratio: 1 / 1; }
.pmini .ph img { display: block; width: 100%; height: 100%; object-fit: cover; border-radius: 6px; }
.pmini .tag { position: absolute; left: 0; top: 0; width: 28px; height: 11px; border-radius: 10px 0 8px 0; }
.pmini .nm { font-size: 11.5px; font-weight: 600; line-height: 1.2; min-height: 28px; }
.pmini .pr { font-size: 15px; font-weight: 800; line-height: 1; }
.pcard { background: var(--cream); border-radius: 16px; padding: 8px 8px 10px; display: flex; flex-direction: column; gap: 6px; text-decoration: none; color: var(--ink); }
.pcard .ph { position: relative; aspect-ratio: 1 / 1; }
.pcard .ph img { display: block; width: 100%; height: 100%; object-fit: cover; border-radius: 10px; }
.pcard .cat { position: absolute; left: 6px; top: 6px; padding: 3px 8px; border-radius: 999px; font-size: 10.5px; font-weight: 800; color: var(--ink); }
.pcard .out { position: absolute; inset: 0; border-radius: 10px; background: rgba(30, 27, 143, .55); color: #FFFFFF; font-weight: 800; display: flex; align-items: center; justify-content: center; }

/* ---------- toast ---------- */
.toast { position: fixed; z-index: 50; left: 50%; top: 86px; transform: translateX(-50%); margin: 0; white-space: nowrap; background: var(--ink); color: var(--lime); border-radius: 999px; padding: 10px 18px; font-size: 14px; font-weight: 800; box-shadow: 0 8px 18px rgba(20, 18, 90, .3); animation: toast .22s ease-out both; }
@keyframes toast { from { opacity: 0; transform: translate(-50%, -8px); } to { opacity: 1; transform: translate(-50%, 0); } }

/* ---------- bottom action bar ---------- */
.actionbar { position: fixed; z-index: 19; bottom: 84px; left: 50%; transform: translateX(-50%); width: min(500px, calc(100% - 20px)); }
.actionbar.low { bottom: 14px; }
@media (min-width: 600px) { .actionbar { bottom: 108px; } .actionbar.low { bottom: 38px; } }

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