/* ═══════════════════════════════════════════
   FLOATING CART BAR
═══════════════════════════════════════════ */
.fbar{
  position:fixed;
  right:calc(24px + env(safe-area-inset-right, 0px));
  bottom:calc(24px + env(safe-area-inset-bottom, 0px));
  transform:translate3d(0,calc(100% + 32px),0) scale(.96);
  opacity:0;visibility:hidden;pointer-events:none;
  background:linear-gradient(135deg,var(--p),var(--a));
  color:#fff;border-radius:50px;border:none;
  padding:13px 22px;
  display:flex;align-items:center;gap:12px;
  max-width:calc(100vw - 48px - env(safe-area-inset-right, 0px));
  min-height:52px;
  box-shadow:0 12px 40px rgba(31,122,99,.45);
  z-index:800;cursor:pointer;white-space:nowrap;
  transition:box-shadow .3s;
}
.fbar[hidden]{
  display:none !important;
}
.fbar.up{
  opacity:1;visibility:visible;pointer-events:auto;
  transform:translate3d(0,0,0) scale(1);
  transition:box-shadow .3s;
}
.fbar.up:hover{box-shadow:0 18px 50px rgba(31,122,99,.55);transform:translateY(-3px);}
.fbar.up:active{transform:scale(.97);}
.fb-l{font-size:13px;font-weight:500;overflow:hidden;text-overflow:ellipsis;}
.fb-d{width:1px;height:18px;background:rgba(255,255,255,.3);}
.fb-r{display:flex;align-items:center;gap:7px;font-family:'DM Mono',monospace;font-size:14px;font-weight:500;}
.fb-r svg{width:15px;height:15px;stroke:#fff;fill:none;stroke-width:2;}
.cart-pulse{animation:cartPulse .58s var(--spring);}
@keyframes cartPulse{
  0%{transform:translateY(0) scale(1);}
  45%{transform:translateY(-3px) scale(1.08);box-shadow:0 18px 52px rgba(31,122,99,.55);}
  100%{transform:translateY(0) scale(1);}
}
.fbar.cart-pulse:not(.up){animation:none;}
.fbar.up.cart-pulse{animation:fbarPulse .62s var(--spring);}
@keyframes fbarPulse{
  0%{transform:translateY(0) scale(1);}
  42%{transform:translateY(-5px) scale(1.07);box-shadow:0 18px 54px rgba(31,122,99,.6);}
  100%{transform:translateY(0) scale(1);}
}
@media(max-width:480px){
  .fbar{
    left:auto;right:calc(12px + env(safe-area-inset-right, 0px));
    bottom:calc(16px + env(safe-area-inset-bottom, 0px));
    justify-content:space-between;
    padding:12px 16px;gap:10px;
    max-width:calc(100vw - 24px - env(safe-area-inset-right, 0px));
  }
  .fb-l{font-size:12px;}
  .fb-r{font-size:13px;}
}

@supports (height:100dvh){
  :root{--fixed-viewport-offset:calc(100vh - 100dvh);}
}

/* Live order floating status */
.live-order-widget{
  position:fixed;right:24px;
  bottom:calc(86px + var(--fixed-viewport-offset, 0px) + env(safe-area-inset-bottom, 0px));
  z-index:790;
  width:min(330px,calc(100vw - 32px));
  border:1px solid rgba(31,122,99,.18);border-radius:18px;
  background:rgba(255,255,255,.96);color:var(--ink);
  box-shadow:0 16px 46px rgba(10,18,14,.18);
  padding:12px;display:none;align-items:center;gap:10px;text-align:left;
  backdrop-filter:blur(18px);-webkit-backdrop-filter:blur(18px);
}
.live-order-widget.show{display:flex;}
.live-order-widget:hover{transform:translateY(-2px);box-shadow:0 20px 54px rgba(10,18,14,.24);}
.live-order-dot{
  width:10px;height:10px;border-radius:50%;background:var(--a);
  box-shadow:0 0 0 6px rgba(43,191,155,.14);flex-shrink:0;
}
.live-order-widget.review .live-order-dot{background:#f59e0b;box-shadow:0 0 0 6px rgba(245,158,11,.14);}
.live-order-copy{min-width:0;flex:1;}
.live-order-copy strong{display:block;font-size:13px;color:var(--ink);margin-bottom:3px;}
.live-order-copy small{display:block;font-size:11px;color:var(--muted);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
.live-order-go{
  border-radius:999px;background:var(--p);color:#fff;
  padding:7px 10px;font-size:11px;font-weight:800;flex-shrink:0;
}
.live-order-widget.review .live-order-go{background:#f59e0b;color:#1a1916;}
@media(max-width:480px){
  .live-order-widget{
    right:16px;
    bottom:calc(76px + var(--fixed-viewport-offset, 0px) + env(safe-area-inset-bottom, 0px));
    width:calc(100vw - 32px);
  }
}
@supports (height:100svh){
  .live-order-widget{
    bottom:auto;
    top:calc(100svh - 224px - env(safe-area-inset-bottom, 0px));
  }
  @media(max-width:480px){
    .live-order-widget{top:calc(100svh - 212px - env(safe-area-inset-bottom, 0px));}
  }
}

/* TOAST */
.toast{
  position:fixed;
  bottom:calc(88px + var(--fixed-viewport-offset, 0px) + env(safe-area-inset-bottom, 0px));
  left:50%;transform:translateX(-50%) translateY(16px);background:var(--ink);color:#fff;padding:10px 20px;border-radius:50px;font-size:13px;font-weight:500;z-index:999;opacity:0;pointer-events:none;transition:all .35s var(--spring);white-space:nowrap;box-shadow:0 8px 24px rgba(0,0,0,.3);
}
.toast.show{opacity:1;transform:translateX(-50%) translateY(0);}
.action-burst{
  position:fixed;z-index:2000;pointer-events:none;
  min-width:34px;height:34px;padding:0 9px;border-radius:999px;
  display:flex;align-items:center;justify-content:center;
  background:#fff;color:var(--p);font-family:'DM Mono',monospace;font-size:14px;font-weight:800;
  border:1px solid rgba(var(--accent-rgb),.22);
  box-shadow:0 12px 30px rgba(10,18,14,.2);
  transform:translate(-50%,-50%) scale(.75);
  animation:actionBurst .72s cubic-bezier(.2,.8,.2,1) forwards;
}
@keyframes actionBurst{
  0%{opacity:0;transform:translate(-50%,-36%) scale(.72);}
  18%{opacity:1;transform:translate(-50%,-70%) scale(1.04);}
  100%{opacity:0;transform:translate(-50%,-156%) scale(.88);}
}
.action-confirm{animation:actionConfirm .48s var(--spring);}
@keyframes actionConfirm{
  0%{transform:scale(1);}
  45%{transform:scale(1.05);filter:brightness(1.08);}
  100%{transform:scale(1);filter:none;}
}
.action-denied{animation:actionDenied .34s ease;}
@keyframes actionDenied{
  0%,100%{transform:translateX(0);}
  25%{transform:translateX(-5px);}
  55%{transform:translateX(5px);}
  78%{transform:translateX(-3px);}
}
.choice-pop{animation:choicePop .42s var(--spring);}
.results-pop{animation:resultsPop .46s var(--spring);}
@keyframes choicePop{
  0%{transform:scale(1);}
  50%{transform:scale(1.045);}
  100%{transform:scale(1);}
}
@keyframes resultsPop{
  0%{opacity:.35;transform:translateY(8px) scale(.98);}
  100%{opacity:1;transform:translateY(0) scale(1);}
}
.btn-spinner{
  width:16px;height:16px;border-radius:50%;border:2px solid rgba(255,255,255,.5);
  border-top-color:#fff;display:inline-block;animation:spin .75s linear infinite;
}
@keyframes spin{to{transform:rotate(360deg);}}
@media(max-width:480px){
  .toast{
    max-width:calc(100vw - 32px);
    white-space:normal;
    text-align:center;
  }
}
@supports (height:100svh){
  .toast{
    bottom:auto;
    top:calc(100svh - 202px - env(safe-area-inset-bottom, 0px));
  }
}

/* ═══════════════════════════════════════════
   ORDER STATUS TOGGLE (Kitchen)
═══════════════════════════════════════════ */
.k-toggle-wrap{
  display:flex;align-items:center;gap:12px;
  background:rgba(0,0,0,.25);border-radius:50px;
  padding:8px 16px;border:1px solid rgba(255,255,255,.08);
}
.k-toggle-label{font-size:12px;font-weight:700;color:rgba(255,255,255,.55);text-transform:uppercase;letter-spacing:.8px;}
.k-toggle-status{font-size:12px;font-weight:800;letter-spacing:.5px;transition:color .3s;}
.k-toggle-status.open{color:#4ade80;}
.k-toggle-status.closed{color:#f87171;}

/* The pill switch */
.k-switch{position:relative;width:52px;height:28px;cursor:pointer;flex-shrink:0;}
.k-switch input{opacity:0;width:0;height:0;position:absolute;}
.k-switch-track{
  position:absolute;inset:0;border-radius:28px;
  background:#374151;transition:background .3s ease;
  border:1.5px solid rgba(255,255,255,.1);
}
.k-switch input:checked ~ .k-switch-track{background:#16a34a;}
.k-switch-thumb{
  position:absolute;top:3px;left:3px;
  width:22px;height:22px;border-radius:50%;
  background:#fff;box-shadow:0 1px 4px rgba(0,0,0,.3);
  transition:transform .3s cubic-bezier(.34,1.56,.64,1);
}
.k-switch input:checked ~ .k-switch-thumb{transform:translateX(24px);}

/* ═══════════════════════════════════════════
   RESTAURANT CLOSED STATES (Customer)
═══════════════════════════════════════════ */
.closed-banner{
  display:none;
  background:linear-gradient(135deg,#7f1d1d,#991b1b);
  color:#fecaca;
  padding:14px 18px;
  border-radius:12px;
  text-align:center;
  margin-bottom:12px;
  border:1px solid rgba(239,68,68,.3);
  animation:fadeIn .3s ease;
}
.closed-banner.show{display:block;}
.closed-banner-icon{font-size:24px;margin-bottom:6px;}
.closed-banner-title{font-family:'Cormorant Garamond',serif;font-size:18px;font-weight:700;color:#fff;margin-bottom:4px;}
.closed-banner-sub{font-size:12px;opacity:.75;line-height:1.5;}

.btn-closed{
  width:100%;padding:14px;border-radius:12px;border:none;
  background:#374151;color:#9ca3af;
  font-family:'DM Sans',sans-serif;font-size:15px;font-weight:700;
  cursor:not-allowed;display:flex;align-items:center;justify-content:center;gap:8px;
}
.btn-closed svg{width:16px;height:16px;stroke:currentColor;fill:none;stroke-width:2;}

/* Closed badge on floating bar */
.fbar-closed-badge{
  background:#ef4444;color:#fff;font-size:10px;font-weight:700;
  padding:2px 8px;border-radius:50px;letter-spacing:.5px;
  text-transform:uppercase;
}

.cart-history-btn{
  min-height:32px;border:1px solid rgba(255,255,255,.34);border-radius:999px;
  padding:7px 12px;background:rgba(255,255,255,.14);color:#fff;
  font-family:'DM Sans',sans-serif;font-size:12px;font-weight:800;line-height:1;
  cursor:pointer;display:inline-flex;align-items:center;gap:7px;
  box-shadow:0 1px 0 rgba(255,255,255,.22) inset,0 8px 22px rgba(0,0,0,.12);
  transition:transform .18s var(--ease),background .18s var(--ease),border-color .18s var(--ease),box-shadow .18s var(--ease);
  appearance:none;-webkit-appearance:none;
}
.cart-history-btn svg{
  width:15px;height:15px;fill:none;stroke:currentColor;stroke-width:2;
}
.cart-history-btn:hover{
  transform:translateY(-1px);background:rgba(255,255,255,.22);
  border-color:rgba(255,255,255,.56);box-shadow:0 1px 0 rgba(255,255,255,.28) inset,0 10px 26px rgba(0,0,0,.16);
}
.cart-history-btn:active{transform:translateY(0) scale(.98);}
.cart-history-btn:focus-visible{
  outline:3px solid rgba(255,255,255,.42);outline-offset:2px;
}
@media(max-width:420px){
  .cart-history-btn{padding:7px 10px;font-size:11px;}
  .cart-history-btn span{max-width:72px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
}

@media(prefers-reduced-motion:reduce){
  .cart-pulse,.fbar.up.cart-pulse,.action-burst,.action-confirm,.action-denied,.choice-pop,.results-pop,.btn-spinner{
    animation:none!important;
  }
}

   The scrollbar disappearing causes a layout shift; we compensate
   by padding the body & fixed nav by the scrollbar width.
═══════════════════════════════════════════ */
body.scroll-locked{overflow:hidden;}
body.cart-modal-lock{
  position:fixed;
  left:0;right:0;width:100%;
  overscroll-behavior:none;
}

.cart-history-btn{
  min-height:32px;border:1px solid rgba(255,255,255,.34);border-radius:999px;
  padding:7px 12px;background:rgba(255,255,255,.14);color:#fff;
  font-family:'DM Sans',sans-serif;font-size:12px;font-weight:800;line-height:1;
  cursor:pointer;display:inline-flex;align-items:center;gap:7px;
  box-shadow:0 1px 0 rgba(255,255,255,.22) inset,0 8px 22px rgba(0,0,0,.12);
  transition:transform .18s var(--ease),background .18s var(--ease),border-color .18s var(--ease),box-shadow .18s var(--ease);
}
.cart-history-btn svg{
  width:15px;height:15px;fill:none;stroke:currentColor;stroke-width:2;
}
.cart-history-btn:hover{
  transform:translateY(-1px);background:rgba(255,255,255,.22);
  border-color:rgba(255,255,255,.56);box-shadow:0 1px 0 rgba(255,255,255,.28) inset,0 10px 26px rgba(0,0,0,.16);
}
.cart-history-btn:active{transform:translateY(0) scale(.98);}
.cart-history-btn:focus-visible{
  outline:3px solid rgba(255,255,255,.42);outline-offset:2px;
}
@media(max-width:420px){
  .cart-history-btn{padding:7px 10px;font-size:11px;}
  .cart-history-btn span{max-width:72px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
}

/* Order history */
.order-history-modal{
  position:fixed;inset:0;z-index:1300;
  background:rgba(10,18,14,.58);
  display:flex;align-items:flex-end;justify-content:center;
  padding:18px;
}
.order-history-card{
  width:100%;max-width:520px;max-height:min(620px,88vh);
  background:var(--card);border-radius:22px;
  box-shadow:0 24px 80px rgba(0,0,0,.35);
  overflow:hidden;display:flex;flex-direction:column;
}
.order-history-head{
  display:flex;align-items:center;justify-content:space-between;gap:12px;
  padding:20px 22px;border-bottom:1px solid var(--border);
}
.order-history-kicker{
  font-size:10px;font-weight:800;text-transform:uppercase;letter-spacing:1.4px;
  color:var(--a);margin-bottom:4px;
}
.order-history-title{
  font-family:'Cormorant Garamond',serif;font-size:26px;font-weight:700;color:var(--ink);
}
.order-history-close{
  width:34px;height:34px;border:1px solid var(--border);border-radius:50%;
  background:var(--cream);color:var(--muted);font-size:22px;line-height:1;
}
.order-history-body{overflow:auto;padding:10px;}
.order-history-empty{
  padding:34px 18px;text-align:center;color:var(--muted);font-size:14px;line-height:1.5;
}
.order-history-row{
  display:flex;align-items:center;justify-content:space-between;gap:12px;
  padding:13px 12px;border:1px solid var(--border);border-radius:14px;
  background:var(--cream);margin-bottom:9px;
}
.order-history-row strong{display:block;color:var(--ink);font-size:14px;margin-bottom:3px;}
.order-history-row span{display:block;color:var(--muted);font-size:12px;line-height:1.4;}
.order-history-actions{display:flex;align-items:center;gap:8px;flex-shrink:0;flex-wrap:wrap;justify-content:flex-end;}
.order-history-total{font-family:'DM Mono',monospace;color:var(--p)!important;font-weight:700;}
.order-history-track,
.order-history-again{
  display:inline-flex;align-items:center;justify-content:center;
  border:0;border-radius:10px;background:var(--p);color:#fff;text-decoration:none;
  padding:9px 12px;font-size:12px;font-weight:800;
  cursor:pointer;line-height:1;
}
.order-history-again{
  background:var(--a);color:#1b1206;
}
.order-history-again.is-loading{opacity:.72;cursor:wait;}
.order-history-track.disabled,
.order-history-again.disabled,
.order-history-again:disabled{
  background:#d8d1c8;color:#7a7570;pointer-events:none;
  cursor:not-allowed;
}
@media(max-width:520px){
  .order-history-modal{padding:10px;}
  .order-history-row{align-items:flex-start;flex-direction:column;}
  .order-history-actions{width:100%;justify-content:flex-start;}
}
