/* FoodOS V9.9.6 — mobile recipe viewport fix + customer menu polish + uniform media */

/* ---------- Global horizontal stability ---------- */
body.public-body{width:100%;max-width:100%;overflow-x:hidden;overscroll-behavior-x:none;background:#f6f7f9}
.public-menu-page,.public-menu-page .public-menu-shell,.public-menu-page #publicOrderForm,.public-menu-page .public-products{min-width:0;max-width:100%}
.public-menu-page .public-menu-shell{overflow:visible}
.public-menu-page .public-categories{max-width:100vw;overscroll-behavior-x:contain;touch-action:pan-x}

/* ---------- Customer menu visual refresh ---------- */
.v996-public-menu .public-store-head{min-height:76px;padding:11px clamp(14px,3vw,24px);border-bottom:1px solid rgba(15,23,42,.06);background:rgba(255,255,255,.96);box-shadow:0 7px 28px rgba(15,23,42,.045)}
.v996-public-menu .public-store-brand>span{background:linear-gradient(145deg,#111827,#30394a);box-shadow:0 8px 20px rgba(15,23,42,.16)}
.v996-public-menu .public-store-brand small{display:flex;align-items:center;gap:5px;color:#11845b}
.v996-public-menu .public-store-brand small i{width:7px;height:7px;border-radius:50%;background:#16a36f;box-shadow:0 0 0 4px rgba(22,163,111,.10)}
.v996-public-menu .public-store-head>a{border:1px solid #e9ebef;background:#fff;box-shadow:0 5px 15px rgba(15,23,42,.05)}
.v996-public-menu .public-menu-shell{width:min(1120px,100%);padding:18px clamp(12px,3vw,22px) 130px}
.v996-public-menu .public-welcome{position:relative;overflow:hidden;margin:0 0 15px;padding:24px 24px 22px;border:1px solid #eceff3;border-radius:26px;background:linear-gradient(135deg,#fff 0%,#fff9f6 58%,#fff1eb 100%);box-shadow:0 15px 38px rgba(15,23,42,.055)}
.v996-public-menu .public-welcome:after{content:"";position:absolute;left:-52px;top:-74px;width:185px;height:185px;border-radius:50%;background:radial-gradient(circle,rgba(249,115,22,.15),rgba(249,115,22,0) 68%);pointer-events:none}
.v996-public-menu .public-welcome p{color:#e6532f;font-size:11px}
.v996-public-menu .public-welcome h1{max-width:760px;margin:5px 0 5px;font-size:clamp(23px,4vw,32px);line-height:1.45;letter-spacing:-.35px}
.v996-public-menu .public-welcome>span{display:block;max-width:760px;color:#697386;font-size:11px;line-height:1.9}
.v996-public-menu .public-menu-toolbar{top:76px;margin:0 calc(-1 * clamp(12px,3vw,22px)) 14px;padding:10px clamp(12px,3vw,22px) 9px;background:rgba(246,247,249,.94);backdrop-filter:blur(18px);border-bottom:1px solid rgba(15,23,42,.035)}
.v996-public-menu .public-search input{height:52px;border:1px solid #e3e7ed;border-radius:17px;background:#fff;box-shadow:0 7px 22px rgba(15,23,42,.035);padding-inline:16px}
.v996-public-menu .public-categories{margin-top:9px}
.v996-public-menu .public-categories button{min-height:39px;border-color:#e2e6ec;background:#fff;box-shadow:0 3px 10px rgba(15,23,42,.025)}
.v996-public-menu .public-categories button.active{border-color:#111827;background:#111827;color:#d8cec5;box-shadow:0 7px 16px rgba(15,23,42,.13)}
.v996-public-menu .public-products{grid-template-columns:repeat(4,minmax(0,1fr));gap:14px;align-items:stretch}
.v996-public-menu .v996-product-card{display:flex;min-width:0;height:100%;flex-direction:column;overflow:hidden;border:1px solid #e7e9ed;border-radius:22px;background:#fff;color:#141821;text-align:right;box-shadow:0 9px 25px rgba(15,23,42,.055);cursor:default;transform:none!important;transition:border-color .16s ease,box-shadow .16s ease,transform .16s ease}
.v996-public-menu .v996-product-card.in-cart{border-color:#fed7aa;box-shadow:0 11px 28px rgba(234,88,12,.09)}
.v996-public-menu .v996-product-card .public-product-image{position:relative;width:100%;height:auto!important;aspect-ratio:4/3;flex:0 0 auto;overflow:hidden;background:linear-gradient(145deg,#eef1f4,#e5e8ed)}
.v996-public-menu .v996-product-card .public-product-image img{width:100%;height:100%;display:block;object-fit:cover;object-position:center;transform:translateZ(0)}
.v996-public-menu .v996-product-card .public-product-image>span{display:grid;width:100%;height:100%;place-items:center;font-size:42px;color:#808897}
.v996-public-menu .v996-product-card .public-product-image i{top:9px;right:9px;background:rgba(255,255,255,.94);box-shadow:0 5px 14px rgba(15,23,42,.08)}
.v996-public-menu .v996-product-card [data-public-count]{position:absolute;left:9px;top:9px;min-width:27px;height:27px;padding:0 7px;display:grid;place-items:center;border:2px solid rgba(255,255,255,.95);border-radius:999px;background:#111827;color:#d8cec5;font-size:10px;box-shadow:0 5px 14px rgba(15,23,42,.16)}
.v996-public-menu .v996-product-card [data-public-count][hidden]{display:none!important}
.v996-public-menu .v996-product-card .public-product-copy{display:flex;flex:1;min-width:0;flex-direction:column;padding:12px 12px 8px}
.v996-public-menu .v996-product-card .public-product-copy>strong{font-size:13px;line-height:1.7}
.v996-public-menu .v996-product-card .public-product-copy>p{height:auto;min-height:36px;margin:4px 0;color:#768091;font-size:9px;line-height:1.9}
.v996-public-menu .v996-product-card .v99-custom-badge{margin-top:auto!important;margin-bottom:7px!important}
.v996-public-menu .v996-product-price{margin-top:auto!important;padding-top:6px;border-top:1px dashed #eef0f3}
.v996-public-menu .v996-product-price b{font-size:11px;color:#161b26}
.v996-product-actions{display:grid;gap:7px;padding:0 10px 10px}
.v996-product-add{width:100%;min-height:44px;border:0;border-radius:13px;background:linear-gradient(135deg,#f97316,#ea580c);color:#d8cec5;font:inherit;font-size:10px;font-weight:950;box-shadow:0 8px 17px rgba(234,88,12,.17);touch-action:manipulation}
.v996-product-add:active{transform:scale(.985)}
.v996-product-add[hidden]{display:none!important}
.v996-product-qty{display:grid;grid-template-columns:44px minmax(0,1fr) 44px;align-items:center;gap:7px;min-height:44px}
.v996-product-qty[hidden]{display:none!important}
.v996-product-qty button{width:44px;height:44px;border:1px solid #e2e6ec;border-radius:13px;background:#f8fafc;color:#111827;font:inherit;font-size:22px;font-weight:850;touch-action:manipulation}
.v996-product-qty button:first-child{border-color:#fecaca;background:#fff6f6;color:#c73737}
.v996-product-qty b{height:44px;display:grid;place-items:center;border-radius:13px;background:#fff7ed;color:#c2410c;font-size:14px}
.v996-public-menu .public-cart-dock{height:66px;border:1px solid rgba(255,255,255,.08);background:linear-gradient(145deg,#172033,#0d1421);box-shadow:0 17px 42px rgba(15,23,42,.28)}

/* Immediate undo after a mistaken remove/cancel. */
.v996-undo-toast{position:fixed;z-index:520;right:50%;bottom:calc(88px + env(safe-area-inset-bottom));transform:translate(50%,18px);width:min(420px,calc(100% - 24px));min-height:54px;padding:8px 10px 8px 13px;display:flex;align-items:center;justify-content:space-between;gap:10px;border:1px solid rgba(255,255,255,.10);border-radius:17px;background:rgba(17,24,39,.96);color:#d8cec5;box-shadow:0 18px 48px rgba(15,23,42,.30);opacity:0;transition:.18s ease;pointer-events:none}
.v996-undo-toast[hidden]{display:none!important}.v996-undo-toast.show{opacity:1;transform:translate(50%,0);pointer-events:auto}
.v996-undo-toast span{font-size:11px;font-weight:800}.v996-undo-toast button{flex:0 0 auto;min-height:38px;padding:0 12px;border:0;border-radius:11px;background:#fff;color:#111827;font:inherit;font-size:10px;font-weight:950}

/* Checkout actions: keep delete/decrement obvious on phone. */
.v996-public-menu .v9-public-cart-item{align-items:flex-start!important;flex-wrap:wrap}
.v996-public-menu .v995-cart-line-actions{width:100%;justify-content:flex-end}
.v996-public-menu .v995-cart-remove{border-color:#fecaca;background:#fff7f7}

/* ---------- Recipe material picker: guaranteed visible footer + real scroll ---------- */
.v930-sheet{z-index:20050!important}
body.v930-sheet-open{overflow:hidden!important;overscroll-behavior:none!important}
body.v930-sheet-open .v9-bottom-nav,body.v930-sheet-open .mobile-bottom-nav,body.v930-sheet-open .v4-topbar{opacity:0!important;visibility:hidden!important;pointer-events:none!important;transform:translateY(110%)!important}
.v930-sheet.open{display:block!important;overflow:hidden!important;touch-action:pan-y!important}
.v930-sheet.open .v930-sheet-backdrop{z-index:0!important}
.v930-sheet.open .v930-sheet-card{z-index:1!important;overflow:hidden!important;display:flex!important;flex-direction:column!important}
.v930-sheet.open .v995-sheet-scroll{flex:1 1 auto!important;min-height:0!important;overflow-y:auto!important;overflow-x:hidden!important;-webkit-overflow-scrolling:touch!important;overscroll-behavior-y:contain!important;touch-action:pan-y!important;scrollbar-gutter:stable}
.v930-sheet.open .v995-material-footer{position:relative!important;right:auto!important;left:auto!important;bottom:auto!important;flex:0 0 auto!important;z-index:100!important;margin:0!important;padding:10px 2px calc(10px + env(safe-area-inset-bottom))!important;background:#fff!important;box-shadow:0 -12px 28px rgba(15,23,42,.10)!important}
.v930-sheet.open #v930ConfirmMaterial{position:static!important;bottom:auto!important;z-index:auto!important}
.v930-sheet.open.v996-amount-mode .v995-sheet-scroll{scroll-padding-bottom:18px!important}
.v930-sheet.open.v996-amount-mode .v995-material-footer{display:grid}

/* ---------- Inline category creation is visually part of product creation ---------- */
.v995-category-inline{padding:9px;border:1px solid #eef0f3;border-radius:15px;background:#fafbfc}
.v995-add-category{min-height:48px;border-style:dashed;box-shadow:none}
.v995-quick-category{margin-top:7px!important;box-shadow:0 8px 22px rgba(234,88,12,.07)}

@media(max-width:980px){
  .v996-public-menu .public-products{grid-template-columns:repeat(3,minmax(0,1fr))}
}

@media(max-width:720px){
  body.public-body{max-width:100vw!important;overflow-x:hidden!important}
  .v996-public-menu .public-store-head{min-height:70px;padding:9px 12px}
  .v996-public-menu .public-store-brand>span{width:43px;height:43px;border-radius:14px}
  .v996-public-menu .public-menu-shell{padding:12px 10px 118px}
  .v996-public-menu .public-welcome{padding:18px 15px 17px;border-radius:21px}
  .v996-public-menu .public-welcome h1{font-size:22px}
  .v996-public-menu .public-menu-toolbar{top:70px;margin:0 -10px 11px;padding:8px 10px;background:rgba(246,247,249,.96)}
  .v996-public-menu .public-search input{height:48px;border-radius:15px}
  .v996-public-menu .public-categories{margin-right:-10px;margin-left:-10px;padding-right:10px;padding-left:10px}
  .v996-public-menu .public-products{grid-template-columns:repeat(2,minmax(0,1fr));gap:9px}
  .v996-public-menu .v996-product-card{border-radius:18px;box-shadow:0 7px 20px rgba(15,23,42,.05)}
  .v996-public-menu .v996-product-card .public-product-image{height:auto!important;aspect-ratio:1/1}
  .v996-public-menu .v996-product-card .public-product-copy{padding:9px 9px 6px}
  .v996-public-menu .v996-product-card .public-product-copy>strong{font-size:11px}
  .v996-public-menu .v996-product-card .public-product-copy>p{min-height:31px;font-size:8px;line-height:1.8;-webkit-line-clamp:2}
  .v996-public-menu .v996-product-card .v99-custom-badge{font-size:7px!important;padding:3px 5px!important}
  .v996-public-menu .v996-product-price b{font-size:9px}
  .v996-product-actions{padding:0 7px 8px;gap:6px}
  .v996-product-add{min-height:42px;border-radius:12px;font-size:9px}
  .v996-product-qty{grid-template-columns:40px minmax(0,1fr) 40px;min-height:40px;gap:5px}
  .v996-product-qty button,.v996-product-qty b{width:auto;height:40px;border-radius:11px}
  .v996-undo-toast{bottom:calc(82px + env(safe-area-inset-bottom))}

  /* The sheet uses the *visual* viewport set by recipe-v930.js, not the layout viewport. */
  .v930-sheet.open .v930-sheet-card{
    position:fixed!important;
    top:var(--v996-sheet-top,0px)!important;
    right:0!important;left:0!important;bottom:auto!important;
    transform:none!important;
    width:100%!important;max-width:none!important;
    height:var(--v996-sheet-height,100dvh)!important;
    max-height:var(--v996-sheet-height,100dvh)!important;
    padding:8px 11px 0!important;
    border-radius:20px 20px 0 0!important;
  }
  .v930-sheet.open .v930-sheet-card>header{min-height:58px;padding:0 1px 8px!important}
  .v930-sheet.open .v995-sheet-scroll{padding:4px 1px 14px!important;scroll-padding-bottom:18px!important}
  .v930-sheet.open .v995-material-footer{grid-template-columns:minmax(0,1.35fr) minmax(112px,.65fr)!important;gap:7px!important;padding:8px 1px calc(8px + env(safe-area-inset-bottom))!important}
  .v930-sheet.open .v995-confirm-material,.v930-sheet.open .v995-confirm-close{min-height:50px!important;padding:0 8px!important;font-size:10px!important;border-radius:13px!important}
  .v930-sheet.open .v995-confirm-material{order:initial!important}
  .v930-sheet.open .v995-confirm-close{order:initial!important}
  .v930-sheet.open .v930-quick-amounts{margin-bottom:8px!important}
}

@media(max-width:390px){
  .v996-public-menu .public-products{gap:7px}
  .v996-public-menu .v996-product-card .public-product-copy{padding:8px 8px 5px}
  .v996-product-actions{padding:0 6px 7px}
  .v930-sheet.open .v995-material-footer{grid-template-columns:minmax(0,1.2fr) minmax(102px,.8fr)!important}
  .v930-sheet.open .v995-confirm-material,.v930-sheet.open .v995-confirm-close{font-size:9px!important}
}
