/* The shop and its cart, in the site's own dusk colours (tokens come from the page's :root) */

/* ---------- the shop in the village ---------- */
.kada[hidden] { display: none; }
.kada { padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
.kada-stage { height: 300px; }
.kada-items { display: grid; gap: 24px; max-width: 360px; margin: 26px auto 0; }
.item {
  overflow: hidden; background: linear-gradient(180deg, #2a3262, #232a52); border: 1px solid var(--card-line); border-radius: 22px;
  box-shadow: 0 18px 44px rgba(10, 12, 32, .38);
}
.item-pic { position: relative; aspect-ratio: 4 / 3; background: #4a3128; }
.item-pic img { width: 100%; height: 100%; object-fit: cover; }
.item-pic .tag {
  position: absolute; left: 12px; top: 12px; padding: 6px 12px 4px; border-radius: 999px; font-family: var(--display); font-weight: 700; font-size: 13px; line-height: 1.2;
  color: var(--cream); background: rgba(31, 37, 70, .78); border: 1px solid rgba(251, 241, 220, .35);
}
.item-body { display: flex; flex-direction: column; padding: 18px 18px 20px; }
.item h3 { margin: 0; font-family: var(--display); font-weight: 700; font-size: 25px; line-height: 1.3; color: var(--cream); text-wrap: balance; }
.item .line { margin-top: 8px; font-size: 16px; line-height: 1.65; color: var(--text-2); text-wrap: pretty; }
.sizes { display: grid; grid-template-columns: repeat(auto-fit, minmax(84px, 1fr)); gap: 8px; margin: 16px 0 0; padding: 0; border: 0; }
.sizes legend { padding: 0; margin-bottom: 8px; font-size: 14px; font-weight: 700; color: var(--muted); }
.sizes label { position: relative; display: block; cursor: pointer; }
.sizes input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.sizes span {
  display: block; padding: 12px 4px 9px; border-radius: 14px; text-align: center; font-family: var(--display); font-weight: 700; font-size: 15px; line-height: 1.15; color: var(--cream);
  background: rgba(251, 241, 220, .06); border: 1.5px solid rgba(226, 194, 126, .28); transition: background-color .15s, border-color .15s, color .15s;
}
.sizes input:checked + span { color: var(--outline); background: var(--gold); border-color: var(--gold); }
.sizes input:disabled { cursor: not-allowed; }
.sizes input:disabled + span { color: var(--muted); background: none; border-style: dashed; }
.sizes span small { display: block; font-size: 12px; font-weight: 400; }
.sizes input:focus-visible + span { outline: 3px solid var(--cream); outline-offset: 2px; }
.buy { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 16px; }
.price { font: 700 31px/1 system-ui, "Segoe UI", Roboto, sans-serif; color: var(--gold); font-variant-numeric: tabular-nums; }
.qty { display: inline-flex; align-items: center; border: 1.5px solid rgba(226, 194, 126, .4); border-radius: 999px; }
.qty button { display: grid; place-items: center; width: 46px; height: 46px; padding: 0; border: 0; border-radius: 50%; background: none; color: var(--cream); cursor: pointer; }
.qty button svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.6; stroke-linecap: round; }
.qty button:disabled { opacity: .35; cursor: default; }
.qty output { min-width: 28px; text-align: center; font: 700 18px/1 system-ui, "Segoe UI", Roboto, sans-serif; color: var(--cream); font-variant-numeric: tabular-nums; }
.item .btn { width: 100%; margin-top: 16px; padding: 16px 20px 13px; border: 0; cursor: pointer; font-size: 19px; }
.item .btn:disabled { opacity: .5; cursor: not-allowed; }
.item .small { margin-top: 12px; font-size: 14px; line-height: 1.5; text-align: center; color: var(--muted); }
.qty button:focus-visible, .bag:focus-visible, .cart button:focus-visible, .cart a:focus-visible { outline: 3px solid var(--cream); outline-offset: 2px; }

/* ---------- the bag that is always at hand ---------- */
.bag {
  position: fixed; z-index: 30; top: calc(14px + env(safe-area-inset-top, 0px)); right: calc(14px + env(safe-area-inset-right, 0px));
  display: grid; place-items: center; width: 48px; height: 48px; padding: 0; border-radius: 50%; cursor: pointer;
  color: var(--cream); background: rgba(28, 34, 68, .78); border: 1.5px solid rgba(226, 194, 126, .55); box-shadow: 0 8px 20px rgba(14, 14, 40, .35);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
}
.bag svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.bag b {
  position: absolute; top: -5px; right: -5px; min-width: 23px; height: 23px; padding: 0 5px; border-radius: 12px; text-align: center;
  font: 700 13px/23px system-ui, "Segoe UI", Roboto, sans-serif; color: var(--outline); background: var(--gold); box-shadow: 0 2px 6px rgba(14, 14, 40, .45);
}
.bag b[hidden] { display: none; }
.fly { position: fixed; z-index: 40; width: 42px; height: 42px; border-radius: 50%; object-fit: cover; pointer-events: none; box-shadow: 0 6px 16px rgba(10, 12, 32, .5); }

/* ---------- the cart ---------- */
.cart {
  width: 100%; max-width: 520px; max-height: 92vh; max-height: 92dvh; margin: auto auto 0; padding: 0; overflow: hidden;
  color: var(--text); background: #222a50; border: 1px solid rgba(226, 194, 126, .34); border-bottom: 0; border-radius: 26px 26px 0 0;
  font-family: var(--body); box-shadow: 0 -18px 60px rgba(8, 10, 30, .55);
}
.cart::backdrop { background: rgba(14, 17, 40, .66); }
.cart[open] { display: flex; flex-direction: column; }
.cart-top { display: flex; align-items: center; justify-content: space-between; flex: none; padding: 16px 12px 10px 20px; border-bottom: 1px solid rgba(226, 194, 126, .16); }
.cart-top h2 { margin: 0; font-family: var(--display); font-weight: 700; font-size: 24px; line-height: 1.2; color: var(--cream); }
.cart-top h2:focus { outline: none; }
.cart .x { display: grid; place-items: center; width: 46px; height: 46px; padding: 0; border: 0; border-radius: 50%; background: none; color: var(--cream); cursor: pointer; }
.cart .x svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; }
.cart-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 6px 20px 20px; }
.lines { list-style: none; margin: 0; padding: 0; }
.lines li { display: grid; grid-template-columns: 62px minmax(0, 1fr) auto; gap: 4px 14px; align-items: center; padding: 16px 0; border-bottom: 1px solid rgba(226, 194, 126, .16); }
.lines img { grid-row: 1 / 3; width: 62px; height: 62px; border-radius: 14px; object-fit: cover; }
.lines li > i { grid-row: 1 / 3; width: 62px; height: 62px; border-radius: 14px; background: rgba(251, 241, 220, .08); }
.lines .name { font-weight: 700; font-size: 17px; line-height: 1.35; color: var(--cream); }
.lines .name small { display: block; font-size: 14px; font-weight: 400; color: var(--muted); }
.lines .sum { text-align: right; font: 700 18px/1 system-ui, "Segoe UI", Roboto, sans-serif; color: var(--cream); font-variant-numeric: tabular-nums; }
.lines .under { grid-column: 2 / 4; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.lines .qty button { width: 40px; height: 40px; }
.lines .qty output { font-size: 16px; }
.lines .out { padding: 10px 4px; border: 0; background: none; font-family: var(--display); font-size: 14px; color: var(--muted); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.totals { margin: 14px 0 0; }
.totals div { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 5px 0; font-size: 16px; color: var(--text-2); }
.totals dd { margin: 0; font: 500 17px/1.2 system-ui, "Segoe UI", Roboto, sans-serif; font-variant-numeric: tabular-nums; }
.totals .all { margin-top: 6px; padding-top: 12px; border-top: 1px solid rgba(226, 194, 126, .24); font-weight: 700; font-size: 19px; color: var(--cream); }
.totals .all dd { font-weight: 700; font-size: 25px; color: var(--gold); }
.who { display: grid; gap: 14px; margin-top: 22px; }
.who h3 { margin: 0; font-family: var(--display); font-weight: 700; font-size: 19px; line-height: 1.3; color: var(--cream); }
.who label { display: block; font-size: 15px; font-weight: 700; line-height: 1.4; color: var(--text-2); }
.who label small { font-weight: 400; color: var(--muted); }
.who input, .who textarea {
  display: block; width: 100%; margin-top: 5px; padding: 13px 14px 11px; border-radius: 14px; font: 400 17px/1.4 var(--body); color: var(--text);
  background: #1a2042; border: 1.5px solid rgba(226, 194, 126, .28); -webkit-appearance: none; appearance: none;
}
.who textarea { min-height: 84px; resize: vertical; }
.who input:focus, .who textarea:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(240, 192, 98, .22); }
.who [aria-invalid="true"] { border-color: #ff9d8a; }
.who .err { min-height: 0; margin-top: 5px; font-size: 14px; line-height: 1.4; color: #ffb3a3; }
.who .err:empty { display: none; }
.who .two { display: grid; grid-template-columns: 1.35fr 1fr; gap: 12px; }
.cart-foot { flex: none; padding: 12px 20px calc(16px + env(safe-area-inset-bottom, 0px)); border-top: 1px solid rgba(226, 194, 126, .2); background: #1e2549; }
.wa {
  display: flex; align-items: center; justify-content: center; gap: 12px; width: 100%; padding: 17px 18px 14px; border: 0; border-radius: 999px; cursor: pointer;
  font-family: var(--display); font-weight: 700; font-size: 19px; line-height: 1.1; color: #fff; background: #12803c; box-shadow: 0 8px 22px rgba(8, 20, 20, .4), inset 0 1px 0 rgba(255, 255, 255, .22);
}
.wa svg { width: 25px; height: 25px; flex: none; margin-top: -3px; }
.wa:active { transform: translateY(1px); }
.cart .hint { margin-top: 9px; font-size: 13.5px; line-height: 1.45; text-align: center; color: var(--muted); }
.empty { padding: 34px 0 26px; text-align: center; font-size: 17px; color: var(--text-2); }
.empty .btn { margin-top: 18px; border: 0; cursor: pointer; }

/* after the chat has been opened */
.done { display: grid; gap: 14px; padding: 18px 0 6px; text-align: center; }
.done p { font-size: 18px; line-height: 1.65; color: var(--text-2); text-wrap: balance; }
.done .wa { text-decoration: none; }
.done .btn { border: 0; cursor: pointer; padding: 16px 20px 13px; }
.done .pay { text-decoration: none; text-align: center; }
.done .hint { margin-top: -6px; font-size: 14.5px; }
.done .again { padding: 12px; border: 0; background: none; font-family: var(--display); font-size: 16px; color: var(--muted); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }

/* the order as it reaches the chat (shown only in the sample, while there is no number) */
.msg { margin-top: 16px; padding: 16px 16px 14px; border-radius: 4px 18px 18px 18px; background: #1d4a3a; color: #f3f6ee; font-size: 16px; line-height: 1.65; white-space: pre-wrap; overflow-wrap: anywhere; }
.msg b { font-weight: 700; }
.note { margin-top: 14px; padding: 12px 14px 10px; border-radius: 14px; font-size: 15px; line-height: 1.55; color: var(--pale-gold); background: rgba(240, 192, 98, .1); border: 1px solid rgba(240, 192, 98, .3); }

@media (min-width: 700px) {
  .kada-stage { height: 410px; }
  .cart { max-width: 470px; width: 470px; height: 100vh; height: 100dvh; max-height: none; margin: 0 0 0 auto; border: 0; border-left: 1px solid rgba(226, 194, 126, .34); border-radius: 26px 0 0 26px; }
}
@media (min-width: 900px) {
  .kada-items { max-width: 800px; }
  .item { display: grid; grid-template-columns: 1.02fr 1fr; }
  .item-pic { aspect-ratio: auto; min-height: 100%; }
  .item-body { padding: 26px 28px 26px; }
  .item h3 { font-size: 29px; }
  .bag { top: 22px; right: 26px; width: 54px; height: 54px; }
  .bag svg { width: 27px; height: 27px; }
}
@media (prefers-reduced-motion: reduce) { .sizes span { transition: none; } }
