/* SunDine/POS007 7.7.6 UX rebuild fixes
   Purpose: repair deep-route asset loading, customer ordering, cart visibility, and stale overlay issues. */
html.sundine-route-fixed, body.sundine-route-fixed{min-height:100%;}
body.sundine-customer-fixed .phone{overflow:hidden!important;overflow-x:clip!important;overflow-y:clip!important;width:min(100vw,1180px)!important;}
body.sundine-customer-fixed .main{overflow:visible!important;}
body.sundine-customer-fixed .menu-frame{overflow:visible!important;}
body.sundine-customer-fixed .customer-vertical-menu{display:grid!important;grid-template-columns:repeat(auto-fit,minmax(150px,1fr))!important;gap:14px!important;transform:none!important;}
body.sundine-customer-fixed .food-card{position:relative!important;cursor:pointer!important;pointer-events:auto!important;min-height:210px!important;}
body.sundine-customer-fixed .food-card.locked{opacity:.78!important;}
body.sundine-customer-fixed .food-card .food-action{position:relative!important;z-index:4!important;pointer-events:auto!important;border:0!important;border-radius:12px!important;min-height:42px!important;background:linear-gradient(135deg,#ffefae,#ff9b1c)!important;color:#1d1004!important;font-weight:900!important;cursor:pointer!important;}
body.sundine-customer-fixed .food-card .food-action:hover{filter:brightness(1.06);}
body.sundine-customer-fixed .food-card::after{pointer-events:none!important;}
body.sundine-customer-fixed .page[data-page="cart"]{min-width:0!important;}
body.sundine-customer-fixed .bottom-bar{z-index:80!important;}
.sundine-fix-modal{position:fixed!important;inset:0!important;display:none!important;align-items:center!important;justify-content:center!important;background:rgba(0,0,0,.58)!important;backdrop-filter:blur(10px)!important;-webkit-backdrop-filter:blur(10px)!important;z-index:99999!important;padding:18px!important;}
.sundine-fix-modal.open{display:flex!important;}
.sundine-fix-dialog{width:min(94vw,520px)!important;max-height:88vh!important;overflow:auto!important;border-radius:26px!important;border:1px solid rgba(255,194,89,.35)!important;background:linear-gradient(180deg,#1a1208,#090603)!important;color:#fff8e8!important;box-shadow:0 30px 90px rgba(0,0,0,.52)!important;padding:18px!important;}
.sundine-fix-dialog h2{margin:0!important;font-size:24px!important;}
.sundine-fix-dialog .fix-head{display:flex;gap:14px;align-items:center;margin-bottom:14px;}
.sundine-fix-emoji{width:86px;height:86px;border-radius:20px;display:grid;place-items:center;background:radial-gradient(circle at 30% 25%,#fff4bb,#d89022 42%,#110905 82%);font-size:42px;border:1px solid rgba(255,222,132,.35);}
.sundine-fix-close{border:1px solid rgba(255,222,132,.22);background:#120b05;color:#ffe9b0;border-radius:14px;min-width:44px;min-height:44px;font-size:22px;cursor:pointer;}
.sundine-fix-row{display:flex;align-items:center;justify-content:space-between;gap:12px;}
.sundine-fix-options{display:grid;gap:10px;margin:12px 0;}
.sundine-fix-option-group{padding:12px;border:1px solid rgba(255,222,132,.18);border-radius:18px;background:rgba(255,255,255,.04);}
.sundine-fix-option-group strong{display:block;margin-bottom:8px;color:#ffe29d;}
.sundine-fix-chips{display:flex;gap:8px;flex-wrap:wrap;}
.sundine-fix-chip{border:1px solid rgba(255,222,132,.24);background:#110904;color:#fff1c8;border-radius:999px;padding:9px 12px;cursor:pointer;}
.sundine-fix-chip.active{background:linear-gradient(135deg,#ffefae,#ff9b1c);color:#221005;border-color:transparent;font-weight:900;}
.sundine-fix-qty{display:flex;align-items:center;gap:8px;}
.sundine-fix-qty button{width:40px;height:40px;border-radius:14px;border:0;background:#2b1a09;color:#ffe9b0;font-size:22px;cursor:pointer;}
.sundine-fix-primary{width:100%;border:0;border-radius:16px;min-height:50px;background:linear-gradient(135deg,#ffefae,#ff8f16);color:#1b0d03;font-weight:900;font-size:16px;cursor:pointer;margin-top:14px;}
.sundine-fix-cart-line{display:grid!important;gap:8px!important;border:1px solid rgba(255,194,89,.24)!important;border-radius:18px!important;padding:12px!important;background:rgba(16,9,4,.88)!important;color:#fff3d4!important;}
.sundine-fix-cart-actions{display:flex;align-items:center;gap:8px;justify-content:flex-end;}
.sundine-fix-cart-actions button{border:1px solid rgba(255,222,132,.24);background:#130b05;color:#ffe8ad;border-radius:12px;min-width:36px;min-height:34px;cursor:pointer;}
.sundine-fix-toast{position:fixed;left:50%;bottom:92px;transform:translateX(-50%);z-index:100000;background:#120904;color:#fff3cc;border:1px solid rgba(255,194,89,.35);border-radius:18px;padding:12px 16px;box-shadow:0 18px 50px rgba(0,0,0,.38);max-width:min(92vw,520px);font-weight:800;}
.sundine-fix-route-card{max-width:720px;margin:15vh auto;padding:24px;border-radius:26px;background:linear-gradient(180deg,#181008,#090604);color:#fff3d3;border:1px solid rgba(255,194,89,.3);box-shadow:0 28px 80px rgba(0,0,0,.48);}
@media (min-width:980px){
  body.sundine-customer-fixed .main:has(.page[data-page="menu"].active){display:grid!important;grid-template-columns:minmax(0,1fr) minmax(320px,380px)!important;align-items:start!important;gap:22px!important;}
  body.sundine-customer-fixed .main:has(.page[data-page="menu"].active)>.page[data-page="cart"]{display:grid!important;position:sticky!important;top:18px!important;max-height:none!important;overflow:visible!important;}
  body.sundine-customer-fixed .bottom-bar{display:none!important;}
}
@media (max-width:720px){
  body.sundine-customer-fixed .phone{width:100vw!important;}
  body.sundine-customer-fixed .customer-vertical-menu{grid-template-columns:repeat(2,minmax(0,1fr))!important;}
  body.sundine-customer-fixed .food-card{min-height:180px!important;}
}
body.sundine-customer-fixed .menu-slider.customer-vertical-menu{display:block!important;overflow:visible!important;transform:none!important;}
body.sundine-customer-fixed .menu-slider.customer-vertical-menu .menu-page{display:grid!important;grid-template-columns:repeat(auto-fit,minmax(150px,1fr))!important;gap:14px!important;min-width:0!important;width:100%!important;overflow:visible!important;}
@media (max-width:720px){body.sundine-customer-fixed .menu-slider.customer-vertical-menu .menu-page{grid-template-columns:repeat(2,minmax(0,1fr))!important;}}


/* 7.9.4 strict nested-scroll guard: ordinary phone content must not become a vertical scroll owner.
   Modal/dialog internals may scroll; page/menu/cart/table wrappers may not. */
@media (max-width:1100px), (pointer:coarse){
  body:not(.surface-auth) .phone,
  body.sundine-customer-fixed .phone{overflow:hidden!important;overflow-x:clip!important;overflow-y:clip!important;}
  body:not(.surface-auth) .phone .main,
  body:not(.surface-auth) .phone .page,
  body:not(.surface-auth) .phone .card,
  body:not(.surface-auth) .phone .panel,
  body:not(.surface-auth) .phone .food-card,
  body:not(.surface-auth) .phone .role-card,
  body:not(.surface-auth) .phone .menu-frame,
  body:not(.surface-auth) .phone .menu-slider,
  body:not(.surface-auth) .phone .menu-page,
  body:not(.surface-auth) .phone .table-wrap,
  body:not(.surface-auth) .phone .table-scroll,
  body:not(.surface-auth) .phone .sundine-table-card,
  body:not(.surface-auth) .phone .pos-cart-panel{
    height:auto!important;max-height:none!important;overflow:visible!important;overflow-x:visible!important;overflow-y:visible!important;
    overscroll-behavior:initial!important;-webkit-overflow-scrolling:auto!important;scroll-snap-type:none!important;
  }
}
@media (min-width:980px){
  body.sundine-customer-fixed .main:has(.page[data-page="menu"].active)>.page[data-page="cart"]{max-height:none!important;overflow:visible!important;}
}
