/* ==========================================================================
   BALACCA TEOCHEW PORRIDGE — polish layer
   --------------------------------------------------------------------------
   Purely additive: depth, motion and warmth on top of the working layout.
   Loaded last so it can refine without anything here being load-bearing.

   Every animation is short (under 500ms), moves a small distance, and is
   switched off entirely by prefers-reduced-motion at the end of this file.
   A counter screen during a lunch rush must never feel like it is waiting
   on an animation.
   ========================================================================== */

/* ============================================== the keyframe library ==== */

@keyframes rise {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: none; }
}
@keyframes rise-sm {
  from { opacity: 0; transform: translateY(7px); }
  to   { opacity: 1; transform: none; }
}
@keyframes fade {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes pop {
  0%   { opacity: 0; transform: scale(.9); }
  60%  { transform: scale(1.02); }
  100% { opacity: 1; transform: scale(1); }
}
@keyframes shimmer {
  from { background-position: -420px 0; }
  to   { background-position: 420px 0; }
}
@keyframes soft-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(217, 43, 98, .34); }
  70%      { box-shadow: 0 0 0 9px rgba(217, 43, 98, 0); }
}
@keyframes ken-burns {
  from { transform: scale(1) translate(0, 0); }
  to   { transform: scale(1.07) translate(-1%, -1%); }
}
@keyframes sweep-out {
  from { opacity: 1; transform: none; max-height: 700px; }
  to   { opacity: 0; transform: translateX(28px) scale(.97); max-height: 0; }
}
@keyframes count-flash {
  0%   { color: var(--pink); transform: scale(1.14); }
  100% { color: inherit; transform: scale(1); }
}

/* ==================================================== brand furniture === */

/* A whisper of the bamboo-blind texture from the logo, behind everything. */
body.customer {
  background-image:
    repeating-linear-gradient(101deg,
      rgba(236, 216, 174, .16) 0 46px,
      rgba(253, 248, 238, 0) 46px 96px);
  background-attachment: fixed;
}

/* Frosted header, so the menu scrolling underneath stays legible. */
.c-header {
  backdrop-filter: saturate(1.25) blur(9px);
  background: linear-gradient(180deg,
    rgba(247, 237, 217, .96) 0%,
    rgba(243, 229, 201, .93) 100%);
}

.c-logo, .s-logo, .lock-logo { transition: transform .35s cubic-bezier(.2, .9, .3, 1.3); }
.c-logo:hover, .s-logo:hover, .lock-logo:hover { transform: rotate(-6deg) scale(1.07); }

/* ============================================= buttons and controls ===== */

.btn, .add-btn, .c-slide-add, .chip, .c-cat, .me-toggle,
.table-opt, .keypad button, .quick-cash button, .online-grid button {
  transition:
    transform .11s cubic-bezier(.3, .8, .3, 1),
    box-shadow .18s ease,
    background-color .16s ease,
    border-color .16s ease,
    color .16s ease;
}

.btn:hover:not(:disabled),
.add-btn:hover:not(:disabled),
.c-slide-add:hover:not(:disabled) { transform: translateY(-1px); }

.btn:active:not(:disabled),
.add-btn:active:not(:disabled),
.chip:active, .c-cat:active,
.quick-cash button:active, .online-grid button:active { transform: scale(.965); }

.btn-primary  { box-shadow: 0 2px 9px rgba(217, 43, 98, .26); }
.btn-primary:hover:not(:disabled) { box-shadow: 0 5px 18px rgba(217, 43, 98, .38); }
.btn-success  { box-shadow: 0 2px 9px rgba(26, 127, 75, .24); }
.btn-success:hover:not(:disabled) { box-shadow: 0 5px 18px rgba(26, 127, 75, .34); }

/* A gentle sheen that crosses a primary button on hover. */
.btn-primary, .btn-success, .add-btn, .c-slide-add, .c-basket-btn {
  position: relative;
  overflow: hidden;
  isolation: isolate;
}
.btn-primary::after, .btn-success::after, .add-btn::after,
.c-slide-add::after, .c-basket-btn::after {
  content: "";
  position: absolute;
  inset: 0 auto 0 -60%;
  width: 45%;
  z-index: -1;
  background: linear-gradient(100deg,
    rgba(255, 255, 255, 0) 0%,
    rgba(255, 255, 255, .3) 50%,
    rgba(255, 255, 255, 0) 100%);
  transform: skewX(-18deg);
  transition: left .5s cubic-bezier(.3, .8, .3, 1);
}
.btn-primary:hover::after, .btn-success:hover::after, .add-btn:hover::after,
.c-slide-add:hover::after, .c-basket-btn:hover::after { left: 115%; }

/* Focus ring that reads clearly on both the cream and the dark surfaces. */
.btn:focus-visible, .chip:focus-visible, .c-cat:focus-visible,
.add-btn:focus-visible, .table-opt:focus-visible, .s-tab:focus-visible,
.me-toggle:focus-visible, .keypad button:focus-visible {
  outline: 3px solid var(--pink);
  outline-offset: 2px;
  border-radius: var(--r-sm);
}

/* ================================================ customer: the hero === */

/* Slow drift across the featured photo, so the banner feels alive. */
.c-slide .photo-wrap img { animation: ken-burns 13s ease-in-out infinite alternate; }
.c-slider { box-shadow: var(--shadow-md), inset 0 0 0 1px rgba(255, 255, 255, .5); }
.c-slides { transition: transform .5s cubic-bezier(.25, .85, .25, 1); }

.c-slide-nav {
  opacity: 0;
  transform: translateY(-50%) scale(.9);
  transition: opacity .2s ease, transform .2s ease, background-color .2s ease;
}
.c-slider:hover .c-slide-nav { opacity: 1; transform: translateY(-50%) scale(1); }
.c-slide-nav:hover { background: #fff; transform: translateY(-50%) scale(1.08); }
/* On a touch screen there is no hover, so keep them visible. */
@media (hover: none) {
  .c-slide-nav { opacity: .85; transform: translateY(-50%) scale(1); }
}

.c-hero-label .pill { animation: soft-pulse 2.6s ease-out infinite; }

/* ============================================ customer: the dish grid == */

.c-section { animation: rise .4s ease both; }
.c-section:nth-child(2) { animation-delay: .05s; }
.c-section:nth-child(3) { animation-delay: .1s; }
.c-section:nth-child(4) { animation-delay: .15s; }
.c-section:nth-child(5) { animation-delay: .2s; }
.c-section:nth-child(n+6) { animation-delay: .25s; }

.dish {
  animation: rise-sm .32s ease both;
  transition:
    transform .18s cubic-bezier(.3, .8, .3, 1),
    box-shadow .2s ease,
    border-color .2s ease;
}
.dish:hover { transform: translateY(-3px); }

/* Stagger the cards within a section, capped so a long menu is not slow. */
.c-grid .dish:nth-child(1) { animation-delay: .02s; }
.c-grid .dish:nth-child(2) { animation-delay: .05s; }
.c-grid .dish:nth-child(3) { animation-delay: .08s; }
.c-grid .dish:nth-child(4) { animation-delay: .11s; }
.c-grid .dish:nth-child(5) { animation-delay: .14s; }
.c-grid .dish:nth-child(n+6) { animation-delay: .16s; }

.dish .photo-wrap img { transition: transform .45s cubic-bezier(.25, .85, .25, 1); }
.dish:hover .photo-wrap img { transform: scale(1.06); }

/* A dish already in the basket gets a soft pink wash. */
.dish.in-basket {
  background: linear-gradient(96deg, var(--pink-soft) 0%, var(--paper) 42%);
}

.dish.sold-out .photo-wrap img { filter: grayscale(.85); }

.stepper { animation: pop .22s cubic-bezier(.2, 1.4, .4, 1); }
.stepper .qty { transition: transform .14s cubic-bezier(.2, 1.6, .4, 1); }
.stepper button:active + .qty { transform: scale(1.22); }

/* ============================================ customer: basket bar ===== */

.c-basket-bar { animation: rise .3s cubic-bezier(.2, .9, .3, 1.1) both; }
.c-basket-btn { transition: transform .14s ease, box-shadow .2s ease, background-color .16s ease; }
.c-basket-btn:hover { box-shadow: 0 9px 30px rgba(217, 43, 98, .5); }
.c-basket-count { transition: transform .18s cubic-bezier(.2, 1.6, .4, 1); }
.c-basket-btn:active .c-basket-count { transform: scale(1.15); }

.basket-line { animation: rise-sm .26s ease both; }

/* ============================================ sheets and dialogs ======= */

.sheet-backdrop { animation: fade .2s ease; }
.sheet { animation: sheet-rise .3s cubic-bezier(.2, .85, .25, 1); }
@keyframes sheet-rise {
  from { opacity: .4; transform: translateY(30px) scale(.985); }
  to   { opacity: 1; transform: none; }
}
.sheet.pop-in { animation: pop .3s cubic-bezier(.2, 1.25, .35, 1); }

.sheet-head { backdrop-filter: blur(6px); }
.x-btn { transition: transform .16s cubic-bezier(.2, 1.5, .4, 1), background-color .16s ease; }
.x-btn:hover { transform: rotate(90deg); }

.done-tick { animation: tick-in .45s cubic-bezier(.2, 1.5, .4, 1); }
@keyframes tick-in {
  0%   { opacity: 0; transform: scale(.4) rotate(-25deg); }
  60%  { transform: scale(1.12) rotate(4deg); }
  100% { opacity: 1; transform: scale(1) rotate(0); }
}

.toast { animation: pop .24s cubic-bezier(.2, 1.3, .4, 1); }

/* ============================================ staff: header and tabs === */

.s-header {
  background:
    linear-gradient(180deg, #33271b 0%, var(--ink) 100%);
  border-bottom: 1px solid rgba(255, 255, 255, .07);
}

.s-tab { position: relative; }
.s-tab::before {
  content: "";
  position: absolute;
  left: 50%; right: 50%; bottom: 3px;
  height: 2px;
  border-radius: 2px;
  background: var(--pink);
  transition: left .22s cubic-bezier(.3, .8, .3, 1), right .22s cubic-bezier(.3, .8, .3, 1);
}
.s-tab:hover::before { left: 22%; right: 22%; }
.s-tab.on::before { left: 50%; right: 50%; }   /* the filled pill says enough */

.s-tab .badge { animation: soft-pulse 2s ease-out infinite; }

/* ============================================ staff: the order board === */

.panel.on { animation: rise-sm .26s ease both; }

.oc {
  animation: rise-sm .3s ease both;
  transition:
    transform .16s cubic-bezier(.3, .8, .3, 1),
    box-shadow .2s ease,
    opacity .2s ease,
    border-left-color .2s ease;
}
.oc:hover { transform: translateY(-2px); }

.order-board > .oc:nth-child(1) { animation-delay: .01s; }
.order-board > .oc:nth-child(2) { animation-delay: .04s; }
.order-board > .oc:nth-child(3) { animation-delay: .07s; }
.order-board > .oc:nth-child(4) { animation-delay: .1s; }
.order-board > .oc:nth-child(5) { animation-delay: .13s; }
.order-board > .oc:nth-child(6) { animation-delay: .16s; }
.order-board > .oc:nth-child(n+7) { animation-delay: .18s; }

/* A brand new order announces itself, then settles down. */
.oc.just-in { animation: order-arrive 1s cubic-bezier(.2, .9, .3, 1) both; }
@keyframes order-arrive {
  0%   { opacity: 0; transform: translateY(-12px) scale(.97);
         box-shadow: 0 0 0 5px rgba(217, 43, 98, .55); }
  35%  { opacity: 1; transform: none;
         box-shadow: 0 0 0 5px rgba(217, 43, 98, .4); }
  100% { box-shadow: var(--shadow-sm); }
}

/* An order being swept off the board slides away rather than blinking out. */
.oc.sweeping {
  animation: sweep-out .32s cubic-bezier(.4, 0, .8, .4) forwards;
  overflow: hidden;
  pointer-events: none;
}

/* The table number badge is the thing staff scan for first. */
.oc-table {
  background: linear-gradient(155deg, #3b2d20 0%, var(--ink) 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .1);
}
.oc-table.takeaway { background: linear-gradient(155deg, #22689f 0%, var(--blue) 100%); }

.oc-line { transition: background-color .14s ease; }
.oc-line:hover { background: #fdfaf4; }
.oc-line-x { transition: transform .16s cubic-bezier(.2, 1.5, .4, 1), background-color .14s ease, color .14s ease; }
.oc-line-x:hover { transform: scale(1.22) rotate(90deg); }

.oc-total .amt { transition: color .2s ease; }
.oc-total.changed .amt { animation: count-flash .5s ease; }

.pill { transition: background-color .18s ease, color .18s ease; }
.pill-new { animation: soft-pulse 2.4s ease-out infinite; }

/* ============================================ staff: payment dialog ==== */

.pay-total {
  background: linear-gradient(155deg, #3b2d20 0%, var(--ink) 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .09);
}
.pay-total .amt { animation: pop .32s cubic-bezier(.2, 1.3, .4, 1); }

.method-tabs button.on { animation: pop .2s ease; }

.cash-input { transition: border-color .18s ease, box-shadow .18s ease; }

/* The change figure is the most important number on the whole system. */
.change-box { transition: background-color .25s ease, border-color .25s ease; }
.change-box .amt { transition: color .25s ease; }
.change-box.ready { animation: change-ready .4s cubic-bezier(.2, 1.2, .4, 1); }
@keyframes change-ready {
  0%   { transform: scale(.98); }
  55%  { transform: scale(1.015); }
  100% { transform: scale(1); }
}
.change-box.ready .amt { animation: pop .34s cubic-bezier(.2, 1.35, .4, 1); }
.change-box.short { animation: nudge .34s ease; }
@keyframes nudge {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-6px); }
  75% { transform: translateX(5px); }
}
.note-chip { animation: rise-sm .24s ease both; }
.note-breakdown .note-chip:nth-child(2) { animation-delay: .05s; }
.note-breakdown .note-chip:nth-child(3) { animation-delay: .1s; }
.note-breakdown .note-chip:nth-child(n+4) { animation-delay: .14s; }

/* ============================================ staff: reports =========== */

.stat {
  animation: rise-sm .3s ease both;
  transition: transform .18s cubic-bezier(.3, .8, .3, 1), box-shadow .2s ease;
}
.stat:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.stat-grid .stat:nth-child(1) { animation-delay: .02s; }
.stat-grid .stat:nth-child(2) { animation-delay: .06s; }
.stat-grid .stat:nth-child(3) { animation-delay: .1s; }
.stat-grid .stat:nth-child(4) { animation-delay: .14s; }
.stat-grid .stat:nth-child(n+5) { animation-delay: .17s; }

.stat.hero {
  background:
    radial-gradient(340px 150px at 88% -30%, rgba(217, 43, 98, .35) 0%, transparent 70%),
    linear-gradient(150deg, #3b2d20 0%, var(--ink) 100%);
}

.takings-hero {
  background:
    radial-gradient(460px 220px at 80% -25%, rgba(217, 43, 98, .4) 0%, transparent 70%),
    linear-gradient(150deg, var(--ink) 0%, #4a3826 100%);
  animation: rise .38s cubic-bezier(.2, .9, .3, 1) both;
}
.takings-hero .big-money { animation: pop .48s cubic-bezier(.2, 1.2, .4, 1); }
.takings-hero .sentence { animation: rise-sm .4s ease .12s both; }

.s-card { animation: rise-sm .32s ease both; }
table.tbl tbody tr { transition: background-color .13s ease; }

/* Grow the share bars in from the left when a report opens. */
.bar > i {
  transform-origin: left center;
  animation: bar-grow .55s cubic-bezier(.25, .9, .3, 1) both;
}
@keyframes bar-grow {
  from { transform: scaleX(0); }
  to   { transform: scaleX(1); }
}
table.tbl tbody tr:nth-child(1) .bar > i { animation-delay: .04s; }
table.tbl tbody tr:nth-child(2) .bar > i { animation-delay: .09s; }
table.tbl tbody tr:nth-child(3) .bar > i { animation-delay: .14s; }
table.tbl tbody tr:nth-child(4) .bar > i { animation-delay: .19s; }
table.tbl tbody tr:nth-child(n+5) .bar > i { animation-delay: .22s; }

.rank { transition: transform .16s cubic-bezier(.2, 1.5, .4, 1); }
table.tbl tbody tr:hover .rank { transform: scale(1.14); }

.table-tag { animation: pop .24s ease both; }
.tables-served .table-tag:nth-child(2) { animation-delay: .03s; }
.tables-served .table-tag:nth-child(3) { animation-delay: .06s; }
.tables-served .table-tag:nth-child(4) { animation-delay: .09s; }
.tables-served .table-tag:nth-child(n+5) { animation-delay: .11s; }

/* ============================================ staff: PIN screen ======== */

.lock-card { animation: pop .4s cubic-bezier(.2, 1.15, .35, 1); }
.pin-dots span { transition: transform .18s cubic-bezier(.2, 1.6, .4, 1), background-color .18s ease, border-color .18s ease; }
.pin-dots span.filled { animation: pop .22s cubic-bezier(.2, 1.6, .4, 1); }
.keypad button:active { transform: scale(.92); }

/* ============================================ menu editor ============== */

.me-row { animation: rise-sm .26s ease both; transition: background-color .14s ease; }
.me-row:hover { background: var(--cream-soft); }
.me-row .photo-wrap img { transition: transform .35s ease; }
.me-row:hover .photo-wrap img { transform: scale(1.1); }
.me-toggle:active { transform: scale(.94); }

/* ============================================ QR cards ================= */

.qr-card {
  animation: rise-sm .3s ease both;
  transition: transform .18s cubic-bezier(.3, .8, .3, 1), box-shadow .2s ease, border-color .2s ease;
}
.qr-card:hover {
  transform: translateY(-3px);
  border-color: var(--pink-line);
  box-shadow: var(--shadow-md);
}

/* ============================================ loading shimmer ========== */

.skeleton {
  border-radius: var(--r-md);
  background: linear-gradient(100deg,
    #efe8db 0%, #f8f3e9 42%, #efe8db 84%);
  background-size: 420px 100%;
  animation: shimmer 1.25s linear infinite;
}
.skeleton-card { height: 148px; margin-bottom: 13px; }
.skeleton-row { height: 20px; margin: 9px 0; }

/* ============================================ scrollbars =============== */

@media (hover: hover) {
  * { scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent; }
  ::-webkit-scrollbar { width: 11px; height: 11px; }
  ::-webkit-scrollbar-track { background: transparent; }
  ::-webkit-scrollbar-thumb {
    border: 3px solid transparent;
    border-radius: 8px;
    background-clip: content-box;
    background-color: var(--line-strong);
  }
  ::-webkit-scrollbar-thumb:hover { background-color: var(--ink-faint); }
}

/* ==========================================================================
   Anyone who has asked their device to reduce motion gets a completely
   still interface. Nothing above is required for the system to work.
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition-duration: .01ms !important;
  }
  .c-slide-nav { opacity: 1; transform: translateY(-50%); }
  .dish:hover, .oc:hover, .stat:hover, .qr-card:hover { transform: none; }
  .btn-primary::after, .btn-success::after, .add-btn::after,
  .c-slide-add::after, .c-basket-btn::after { display: none; }
}

/* Printed reports must be flat and inkless — no shadows, no gradients. */
@media print {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .skeleton { animation: none; background: none; }
}
