/* LittleFin Kiosk Demo (HTML/CSS/JS) */

:root {
  --bg: #f6f7f9;
  --panel: #ffffff;
  --text: #1d1f23;
  --muted: #6b7280;
  --line: rgba(15, 23, 42, 0.12);
  --shadow: 0 18px 60px rgba(0, 0, 0, 0.12);
  --shadow2: 0 10px 30px rgba(0, 0, 0, 0.10);
  --radius: 22px;
  --radius2: 16px;
  --accent: #ff9f0a;
  --accent2: #ffb547;
  --good: #18a957;
  --danger: #e11d48;

  --tap: 64px;
  --max: 1200px;
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Apple SD Gothic Neo", "Noto Sans KR", sans-serif;
  color: var(--text);
  background: radial-gradient(1200px 800px at 70% -15%, rgba(255, 159, 10, 0.30), transparent 55%),
    radial-gradient(900px 600px at 10% 15%, rgba(255, 159, 10, 0.16), transparent 55%),
    var(--bg);
}

button,
input {
  font: inherit;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.app {
  min-height: 100%;
  display: flex;
  flex-direction: column;
}

/* topbar */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px;
  gap: 16px;
  max-width: var(--max);
  width: 100%;
  margin: 0 auto;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  user-select: none;
}

.brand__icon {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  background: rgba(255, 159, 10, 0.16);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 159, 10, 0.22);
}

.brand__name {
  font-weight: 800;
  font-size: 22px;
  letter-spacing: -0.02em;
  color: #ffb14b;
}

.brand__sub {
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
}

.topbar__right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.pill {
  height: 44px;
  border-radius: 14px;
  padding: 0 14px;
  border: 1px solid transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  user-select: none;
}

.pill--light {
  background: rgba(255, 159, 10, 0.14);
  border-color: rgba(255, 159, 10, 0.26);
  color: #b25f00;
}

.pill__chev {
  opacity: 0.9;
}

.userchip {
  height: 44px;
  border-radius: 999px;
  padding: 0 12px;
  border: 1px solid rgba(15, 23, 42, 0.10);
  background: rgba(255, 255, 255, 0.72);
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
}

.userchip__icon {
  width: 32px;
  height: 32px;
  border-radius: 999px;
  background: rgba(255, 159, 10, 0.14);
  display: flex;
  align-items: center;
  justify-content: center;
}

.userchip__text {
  color: #ffb14b;
  font-weight: 700;
}

/* screens */
.screen {
  flex: 1;
  display: none;
  width: 100%;
}

.screen--active {
  display: block;
}

/* shop layout */
.layout {
  max-width: var(--max);
  width: 100%;
  margin: 0 auto;
  padding: 10px 22px 24px;
  display: flex;
  gap: 18px;
  align-items: stretch;
}

.browse {
  flex: 1 1 0%;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.searchrow {
  display: flex;
}

.search {
  display: flex;
  align-items: stretch;
  width: 100%;
  gap: 10px;
}

.search__input {
  flex: 1 1 0%;
  height: 64px;
  border-radius: 18px;
  border: 1px solid rgba(15, 23, 42, 0.10);
  background: rgba(255, 255, 255, 0.78);
  padding: 0 18px;
  outline: none;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.06);
}

.search__input:focus {
  border-color: rgba(255, 159, 10, 0.48);
  box-shadow: 0 10px 26px rgba(255, 159, 10, 0.18);
}

.search__btn {
  width: 64px;
  height: 64px;
  border-radius: 18px;
  border: none;
  background: var(--accent);
  color: white;
  cursor: pointer;
  box-shadow: 0 12px 26px rgba(255, 159, 10, 0.35);
}

.search__btn:active {
  transform: translateY(1px);
}

.categorybar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.chip {
  height: 44px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid rgba(15, 23, 42, 0.10);
  background: rgba(255, 255, 255, 0.70);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  user-select: none;
}

.chip--active {
  border-color: rgba(255, 159, 10, 0.52);
  background: rgba(255, 159, 10, 0.14);
}

.chip__dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: rgba(255, 159, 10, 0.82);
}

.grid {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: stretch;
  align-content: flex-start;
}

.card {
  width: calc(33.333% - 9.4px);
  min-width: 220px;
  flex: 1 1 220px;
  background: rgba(255, 255, 255, 0.84);
  border: 1px solid rgba(15, 23, 42, 0.10);
  border-radius: var(--radius);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.08);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  position: relative;
  overflow: hidden;
}

.card__img {
  height: 120px;
  border-radius: 18px;
  background:
    radial-gradient(120px 120px at 30% 30%, rgba(255, 159, 10, 0.55), transparent 55%),
    radial-gradient(160px 160px at 70% 70%, rgba(255, 159, 10, 0.22), transparent 55%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.40), rgba(255, 255, 255, 0.0));
  border: 1px solid rgba(255, 159, 10, 0.22);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 42px;
}

.card__name {
  font-weight: 800;
  letter-spacing: -0.02em;
}

.card__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: auto;
}

.price {
  font-weight: 800;
}

.plusbtn {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  border: 1px solid rgba(255, 159, 10, 0.22);
  background: rgba(255, 159, 10, 0.16);
  color: #a35700;
  font-size: 22px;
  cursor: pointer;
}

.plusbtn--added {
  background: rgba(24, 169, 87, 0.12);
  border-color: rgba(24, 169, 87, 0.28);
  color: #117a3e;
}

/* cart */
.cart {
  width: 360px;
  max-width: 40vw;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(15, 23, 42, 0.10);
  border-radius: 26px;
  box-shadow: var(--shadow);
  padding: 14px;
  display: flex;
  flex-direction: column;
  min-height: 520px;
}

.cart__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 6px 10px;
}

.cart__title {
  font-size: 18px;
  font-weight: 900;
  letter-spacing: -0.02em;
}

.iconbtn {
  height: 36px;
  border-radius: 12px;
  border: 1px solid rgba(15, 23, 42, 0.10);
  background: rgba(255, 255, 255, 0.70);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 10px;
  cursor: pointer;
}

.iconbtn__text {
  font-size: 12px;
  color: var(--muted);
  font-weight: 700;
}

.cart__list {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.empty {
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  gap: 6px;
  padding: 20px;
}

.lineitem {
  display: flex;
  gap: 12px;
  align-items: center;
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid rgba(15, 23, 42, 0.10);
  border-radius: 18px;
  padding: 10px;
  box-shadow: var(--shadow2);
}

.thumb {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  background: rgba(255, 159, 10, 0.16);
  border: 1px solid rgba(255, 159, 10, 0.22);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
}

.li__main {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  flex: 1;
}

.li__name {
  font-weight: 900;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.li__sub {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.li__price {
  color: var(--muted);
  font-weight: 800;
  font-size: 13px;
}

.qty {
  display: flex;
  align-items: center;
  gap: 10px;
}

.qty__btn {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  border: 1px solid rgba(15, 23, 42, 0.10);
  background: rgba(255, 255, 255, 0.80);
  cursor: pointer;
  font-weight: 900;
}

.qty__num {
  width: 22px;
  text-align: center;
  font-weight: 900;
  color: var(--accent);
}

.cart__summary {
  border-top: 1px solid rgba(15, 23, 42, 0.10);
  padding: 12px 6px 6px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.sumrow {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.sumrow__label {
  font-weight: 900;
}

.sumrow__value {
  font-weight: 900;
  color: var(--accent);
  font-size: 20px;
}

.sumrow--sub .sumrow__label {
  color: var(--muted);
  font-size: 12px;
}

.sumrow--sub .sumrow__value {
  color: var(--muted);
  font-size: 12px;
}

.cart__actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.btn {
  height: var(--tap);
  border-radius: 20px;
  border: 1px solid transparent;
  cursor: pointer;
  font-weight: 900;
  letter-spacing: -0.01em;
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.btn--primary {
  background: var(--accent);
  color: white;
  box-shadow: 0 16px 40px rgba(255, 159, 10, 0.30);
}

.btn--primary:active:not(:disabled) {
  transform: translateY(1px);
}

.btn--ghost {
  background: rgba(255, 255, 255, 0.78);
  border-color: rgba(15, 23, 42, 0.12);
  color: var(--text);
}

.btn--lg {
  height: 72px;
  border-radius: 22px;
  font-size: 18px;
}

/* bottom bar (mobile) */
.bottombar {
  position: sticky;
  bottom: 0;
  width: 100%;
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px;
  background: rgba(255, 255, 255, 0.92);
  border-top: 1px solid rgba(15, 23, 42, 0.10);
  backdrop-filter: blur(8px);
}

.bottombar__left {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.bottombar__label {
  color: var(--muted);
  font-weight: 800;
  font-size: 12px;
}

.bottombar__value {
  font-weight: 900;
  color: var(--accent);
  font-size: 22px;
}

.btn--lg.btn--primary.btn--lg {
  min-width: 180px;
}

/* sheet screens */
.sheet {
  max-width: 720px;
  margin: 0 auto;
  padding: 18px 22px 26px;
}

.sheet__top {
  display: flex;
  justify-content: center;
  padding-top: 10px;
}

.xbtn {
  width: 46px;
  height: 46px;
  border-radius: 999px;
  border: 1px solid rgba(255, 159, 10, 0.22);
  background: rgba(255, 159, 10, 0.12);
  color: #b25f00;
  font-size: 26px;
  cursor: pointer;
}

.sheet__body {
  margin-top: 8px;
  border-radius: 34px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(15, 23, 42, 0.10);
  box-shadow: var(--shadow);
  padding: 26px;
}

.sheet__title {
  margin: 0 0 18px 0;
  font-size: 30px;
  letter-spacing: -0.03em;
}

.paylist {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.payitem {
  height: 78px;
  border-radius: 22px;
  border: 1px solid rgba(15, 23, 42, 0.10);
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 18px;
  cursor: pointer;
}

.payitem__logo {
  font-weight: 1000;
  letter-spacing: -0.02em;
}

.payitem__logo--paywrap {
  font-size: 22px;
  color: #2b2e3a;
}

.payitem__logo--text {
  font-size: 18px;
}

.payitem__right {
  font-size: 28px;
  color: rgba(15, 23, 42, 0.55);
}

.totalblock {
  margin-top: 22px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.totalblock__label {
  color: var(--muted);
  font-weight: 900;
  letter-spacing: -0.02em;
}

.totalblock__value {
  font-size: 34px;
  font-weight: 1000;
  color: var(--accent);
}

/* center screens */
.center {
  max-width: 760px;
  margin: 0 auto;
  padding: 18px 22px 30px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  text-align: center;
}

.center__top {
  width: 100%;
  display: flex;
  justify-content: flex-end;
}

.center__title {
  margin: 0;
  font-size: 32px;
  letter-spacing: -0.03em;
}

.center__actions {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 8px;
}

.paywrapWait {
  margin-top: 6px;
  width: min(680px, 92vw);
  padding: 14px 14px;
  border-radius: 22px;
  border: 1px solid rgba(15, 23, 42, 0.10);
  background: rgba(255, 255, 255, 0.86);
  box-shadow: var(--shadow2);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.paywrapWait__spinner {
  width: 44px;
  height: 44px;
  border-radius: 999px;
  border: 4px solid rgba(255, 159, 10, 0.22);
  border-top-color: var(--accent);
  animation: paywrapSpin 900ms linear infinite;
}

.paywrapWait__text {
  font-size: 13px;
  color: rgba(15, 23, 42, 0.70);
  font-weight: 700;
}

@keyframes paywrapSpin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.btn--danger {
  background: var(--danger);
  color: white;
  border-color: transparent;
}

.btn--danger:active:not(:disabled) {
  transform: translateY(1px);
}

.paywrapLogo {
  margin-top: 20px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: center;
}

.paywrapLogo__big {
  font-size: 54px;
  font-weight: 1000;
  letter-spacing: -0.04em;
  color: #2b2e3a;
}

.paywrapLogo__sub {
  color: rgba(15, 23, 42, 0.55);
  font-weight: 800;
  font-size: 12px;
  letter-spacing: 0.18em;
}

/* scan mock */
.scanPreview {
  width: min(680px, 92vw);
  height: 240px;
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.72), rgba(255, 255, 255, 0.42));
  border: 1px solid rgba(15, 23, 42, 0.10);
  box-shadow: var(--shadow2);
  position: relative;
  overflow: hidden;
}

.scanPreview__video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: rgba(0, 0, 0, 0.06);
}

.scanPreview__shine {
  position: absolute;
  inset: -30% -30%;
  background: linear-gradient(120deg, transparent 35%, rgba(255, 159, 10, 0.18) 50%, transparent 65%);
  transform: rotate(14deg);
  animation: shine 2.2s linear infinite;
  pointer-events: none;
}

@keyframes shine {
  0% { transform: translateX(-30%) rotate(14deg); }
  100% { transform: translateX(30%) rotate(14deg); }
}

.scanPreview__barcode {
  position: absolute;
  left: 50%;
  top: 55%;
  transform: translate(-50%, -50%);
  width: 70%;
  height: 120px;
  border-radius: 16px;
  background:
    linear-gradient(90deg, rgba(0,0,0,0.05) 0 6px, transparent 6px 12px),
    linear-gradient(180deg, rgba(255, 159, 10, 0.16), rgba(255, 159, 10, 0.08));
  background-size: 12px 100%, 100% 100%;
  border: 1px solid rgba(15, 23, 42, 0.10);
  pointer-events: none;
}

.scanPreview__fallback {
  position: absolute;
  left: 50%;
  bottom: 14px;
  transform: translateX(-50%);
  width: min(640px, calc(92vw - 24px));
  padding: 10px 12px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(15, 23, 42, 0.12);
  color: rgba(15, 23, 42, 0.72);
  font-size: 13px;
  line-height: 1.35;
  text-align: center;
  display: none;
}

.scanPreview__fallback--show {
  display: block;
}

/* keypad screen */
.keypad {
  min-height: 100%;
  display: flex;
  flex-direction: column;
}

.keypad__top {
  position: relative;
  height: 170px;
}

.wave {
  position: absolute;
  inset: 0;
  background: var(--accent);
  border-bottom-left-radius: 52px;
  border-bottom-right-radius: 52px;
  clip-path: path("M0,0 H100% V60% C76% 90%, 60% 92%, 45% 76% C30% 60%, 18% 56%, 0% 70% Z");
}

.keypad__header {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: flex-end;
  padding: 18px 22px;
}

.keypad__body {
  margin-top: -54px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 0 22px 28px;
}

.keypad__title {
  margin: 0;
  font-size: 30px;
  letter-spacing: -0.03em;
}

.codebox {
  width: min(720px, 92vw);
  height: 84px;
  border-radius: 22px;
  border: 1px solid rgba(15, 23, 42, 0.10);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 46px;
  font-weight: 1000;
  letter-spacing: 0.12em;
}

.numpad {
  width: min(720px, 92vw);
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  justify-content: center;
  padding-top: 6px;
}

.key {
  width: calc(33.333% - 10px);
  min-width: 200px;
  height: 74px;
  border-radius: 16px;
  border: 1px solid rgba(15, 23, 42, 0.12);
  background: rgba(255, 255, 255, 0.90);
  font-size: 34px;
  font-weight: 1000;
  cursor: pointer;
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.08);
}

.key:active {
  transform: translateY(1px);
}

.key--muted {
  background: rgba(15, 23, 42, 0.06);
}

.key--danger {
  background: rgba(225, 29, 72, 0.10);
  border-color: rgba(225, 29, 72, 0.18);
}

/* done */
.check {
  width: 84px;
  height: 84px;
  border-radius: 999px;
  background: rgba(24, 169, 87, 0.14);
  border: 1px solid rgba(24, 169, 87, 0.26);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 44px;
  color: #117a3e;
  margin-top: 22px;
}

.receipt {
  width: min(720px, 92vw);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(15, 23, 42, 0.10);
  box-shadow: var(--shadow2);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  text-align: left;
}

.receipt__row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: baseline;
}

.receipt__row strong {
  font-weight: 1000;
}

/* toast */
.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  max-width: min(640px, calc(100vw - 32px));
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid rgba(15, 23, 42, 0.12);
  background: rgba(17, 24, 39, 0.92);
  color: rgba(255, 255, 255, 0.96);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.25);
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease;
}

.toast--show {
  opacity: 1;
}

/* responsive */
@media (max-width: 980px) {
  .layout {
    flex-direction: column;
  }

  .cart {
    width: 100%;
    max-width: none;
    min-height: 360px;
  }
}

@media (max-width: 760px) {
  .cart {
    display: none;
  }

  .bottombar {
    display: flex;
  }

  .card {
    width: calc(50% - 7px);
  }
}

@media (max-width: 520px) {
  .topbar {
    padding: 14px 14px;
  }

  .layout {
    padding: 8px 14px 16px;
  }

  .card {
    width: 100%;
  }

  .key {
    min-width: 140px;
  }
}


