/* sandwichi.com V8 — responsive hardening and mobile UX */
:root{--mobile-nav-h:68px;--header-offset:84px}
html{overflow-x:hidden}
body{min-width:0}
main,.container,.nav-shell,.footer-top,.footer-links,.service-card,.admin-main,.admin-card,.dashboard-layout,.checkout-page-grid,.checkout-grid,.cart-page-grid,.v5-menu-hero-inner,.v5-menu-section,.v5-food-grid,.product-detail-shell{min-width:0}
img,video,canvas,svg{max-width:100%}
input,textarea,select,button{max-width:100%}
textarea{resize:vertical}
.admin-table-wrap,.table-scroll,.orders-table-wrap{max-width:100%;overflow-x:auto;-webkit-overflow-scrolling:touch}

/* Header: predictable anchoring for the collapsible menu. */
.nav-shell{position:relative}
.mobile-menu-toggle{flex:0 0 44px}
.main-nav{z-index:230}

@media(max-width:960px){
  :root{--header-offset:78px}
  .site-header{padding:8px 0}
  .nav-shell{display:grid;grid-template-columns:minmax(0,1fr) auto auto;gap:8px;min-height:60px;padding:7px 9px}
  .brand{min-width:0;overflow:hidden}
  .brand-copy{min-width:0}
  .brand-copy strong{display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
  .brand-copy small{display:none}
  .nav-actions{margin:0;gap:6px;justify-self:end}
  .mobile-menu-toggle{order:initial;justify-self:end}
  .main-nav{top:calc(100% + 8px);right:0;left:0;max-height:min(68dvh,520px);overflow:auto;padding:8px;box-shadow:0 24px 70px rgba(0,0,0,.55)}
  .main-nav a{min-height:44px;display:flex;align-items:center;padding:10px 12px}
  .main-nav.open{display:flex}
  .account-button,.auth-button,.cart-button{min-width:44px;min-height:44px}
  .menu-category-bar,.v5-category-sticky{top:var(--header-offset)}
}

@media(max-width:650px){
  :root{--header-offset:74px}
  body{padding-bottom:calc(var(--mobile-nav-h) + env(safe-area-inset-bottom) + 8px)}
  .container{width:min(100% - 20px,1380px)}
  .nav-shell{grid-template-columns:minmax(0,1fr) auto auto;padding:6px 7px;border-radius:15px}
  .brand{gap:7px}
  .brand img{width:40px;height:40px;flex:none}
  .brand-copy strong{font-size:16px;line-height:1.2}
  .nav-actions{gap:5px}
  .auth-button,.cart-button,.mobile-menu-toggle{width:42px;height:42px;padding:0;display:grid;place-items:center}
  .account-button{height:42px;padding:0 7px}
  .account-avatar{width:32px;height:32px}
  .account-label{display:none}
  .main-nav{border-radius:14px}
  .mobile-bottom-nav{height:calc(var(--mobile-nav-h) + env(safe-area-inset-bottom));padding-bottom:env(safe-area-inset-bottom);z-index:300}
  .mobile-bottom-nav a,.mobile-bottom-nav button{min-width:0;min-height:58px;font-size:9px;touch-action:manipulation}
  .mobile-bottom-nav .cart-count{top:5px;left:calc(50% - 22px)}
  .floating-call,.chat-login-prompt,.chat-widget{bottom:calc(var(--mobile-nav-h) + env(safe-area-inset-bottom) + 12px)}
  .floating-call{right:12px}
  .chat-login-prompt,.chat-widget{left:12px}
  .chat-panel{left:0;bottom:58px;width:min(calc(100vw - 24px),390px);height:min(68dvh,520px);max-height:calc(100dvh - var(--header-offset) - var(--mobile-nav-h) - 34px);border-radius:18px}
  .drawer-panel{padding-bottom:env(safe-area-inset-bottom)}
  .drawer-head{padding-top:max(16px,env(safe-area-inset-top))}
  .modal{padding:12px;overflow:auto}
  .modal-card{width:100%;max-height:calc(100dvh - 24px);overflow:auto;margin:0 auto;border-radius:20px;padding:20px}
  .auth-brand{padding-left:28px}
  .form-grid.two,.form-grid.three{grid-template-columns:1fr!important}
  .primary-button,.outline-button{min-height:44px}
}

/* Home hero: prevent tiny text/controls and horizontal spill. */
@media(max-width:800px){
  .promax-hero{padding:8px 0 24px}
  .promax-hero-grid{gap:4px}
  .promax-food{height:clamp(240px,70vw,330px)}
  .promax-food img{width:min(680px,116%);max-width:none}
  .promax-copy{text-align:center;padding:0 2px 18px}
  .promax-copy h1{font-size:clamp(31px,9.4vw,42px);line-height:1.35;margin:8px 0 12px}
  .promax-copy p{font-size:13px;line-height:1.9;margin-inline:auto;max-width:52ch}
  .promax-actions{grid-template-columns:1fr 1fr;gap:8px;margin-top:18px}
  .promax-actions a{justify-content:center;padding-inline:10px}
  .promax-facts{flex-wrap:wrap;gap:8px 18px;margin-top:14px}
  .promax-cats{grid-template-columns:repeat(4,minmax(0,1fr));padding:8px;gap:6px}
  .promax-cats a{min-width:0;min-height:70px;padding:8px 4px;text-align:center}
  .promax-cats a span{display:block;overflow:hidden;text-overflow:ellipsis;font-size:10px}
  .cod-banner{gap:8px 12px;padding:13px 14px}
  .cod-banner span{font-size:11px;line-height:1.7}
}

@media(max-width:430px){
  .promax-actions{grid-template-columns:1fr}
  .promax-facts{display:grid;grid-template-columns:1fr;justify-items:center}
  .promax-cats{grid-template-columns:repeat(2,minmax(0,1fr))}
  .phone-order-promo-inner{padding:16px!important}
  .phone-order-actions a{width:100%;justify-content:center}
  .section-heading h2{font-size:24px}
}

/* Product cards: V7's 128px split card is cramped on narrow phones. */
@media(max-width:520px){
  .product-grid,.menu-product-grid,.v5-food-grid{grid-template-columns:1fr!important}
  .product-card{border-radius:18px}
  .product-media{height:220px}
  .product-footer{align-items:stretch;flex-wrap:wrap}
  .product-footer form{margin-inline-start:auto}
  .v5-food-card{display:grid;grid-template-columns:116px minmax(0,1fr);border-radius:16px}
  .v5-food-media{height:100%;min-height:190px}
  .v5-food-body{padding:12px}
  .v5-food-body h3{font-size:16px;line-height:1.45}
  .v5-food-body>p{height:auto;min-height:0;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
  .v5-food-actions{grid-template-columns:1fr;gap:7px}
  .v5-food-actions a,.v5-food-actions button{min-height:42px}
  .v5-price-row strong{font-size:16px}
}

@media(max-width:390px){
  .v5-food-card{grid-template-columns:104px minmax(0,1fr)}
  .v5-food-media{min-height:176px}
  .v5-food-badges{flex-direction:column;align-items:flex-start;left:auto}
  .v5-food-badges span{font-size:8px}
}

@media(max-width:350px){
  .v5-food-card{display:block}
  .v5-food-media{height:190px;min-height:0}
}

/* Menu/search and sticky category strip. */
.v5-menu-search label,.menu-head-search label{min-width:0}
.v5-menu-search input,.menu-head-search input{min-width:0;width:100%}
.v5-category-strip{scrollbar-width:none;-webkit-overflow-scrolling:touch}
.v5-category-strip::-webkit-scrollbar{display:none}
@media(max-width:760px){
  .v5-menu-hero{padding-top:28px}
  .v5-menu-hero h1{font-size:clamp(30px,9vw,40px);line-height:1.4}
  .v5-menu-hero-inner{gap:18px}
  .v5-category-strip{display:flex;overflow-x:auto;overscroll-behavior-inline:contain;scroll-snap-type:x proximity}
  .v5-category-strip button{flex:0 0 auto;min-height:42px;scroll-snap-align:start}
  .v5-menu-title{gap:10px;flex-wrap:wrap}
  .v5-menu-sort{width:100%;justify-content:space-between}
  .v5-menu-sort select{min-height:42px}
}

/* Cart/checkout/product details: no side-by-side squeeze on mobile. */
@media(max-width:760px){
  .cart-page,.checkout-page,.product-detail-page{padding-top:26px}
  .cart-page-item,.cart-line{grid-template-columns:84px minmax(0,1fr)!important;gap:11px}
  .cart-line-image{width:84px;height:84px}
  .cart-line-copy{min-width:0}
  .cart-line-actions{grid-column:1/-1;display:flex;flex-wrap:wrap;gap:8px;align-items:center;justify-content:space-between}
  .checkout-v5-card,.checkout-summary,.order-summary-card,.product-detail-info{padding:16px}
  .product-detail-shell{display:flex;flex-direction:column;gap:18px}
  .product-detail-media{width:100%;min-height:0;aspect-ratio:4/3;border-radius:20px}
  .payment-v5-options,.payment-options{grid-template-columns:1fr!important}
  .checkout-submit,.checkout-actions{position:relative;z-index:1}
}

/* Account/admin/courier/KDS mobile hardening. */
@media(max-width:960px){
  .dashboard-layout,.admin-shell,.orders-grid,.admin-section-grid,.admin-chat-layout,.ticket-admin-grid,.kds-board{min-width:0}
  .dashboard-sidebar{overflow:hidden}
  .dashboard-sidebar nav{display:flex!important;overflow-x:auto;gap:6px;scrollbar-width:none;padding-bottom:3px}
  .dashboard-sidebar nav::-webkit-scrollbar{display:none}
  .dashboard-sidebar nav a{flex:0 0 auto;min-height:42px;display:flex;align-items:center}
  .admin-main{min-width:0;overflow-x:hidden}
  .admin-card{min-width:0}
  .admin-table-wrap{border-radius:12px}
  .admin-table-wrap table{white-space:nowrap}
  .admin-topbar{position:sticky;top:0;z-index:70;background:rgba(10,11,14,.96);backdrop-filter:blur(14px)}
  .admin-sidebar{height:100dvh;overflow-y:auto;overscroll-behavior:contain;padding-bottom:24px}
  .order-detail-card{max-width:100%}
  .kds-shell{overflow-x:hidden}
}

@media(max-width:620px){
  .admin-topbar{height:auto;min-height:66px;padding-block:8px}
  .admin-profile{min-width:0}
  .admin-profile strong{max-width:130px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
  .admin-main{padding:10px!important}
  .admin-card{padding:14px}
  .admin-product-list article{grid-template-columns:46px minmax(0,1fr)!important}
  .admin-product-list article>a,.admin-product-list article>form,.admin-product-list .status,.admin-product-list .admin-edit{grid-column:2!important}
  .admin-product-list article>form{width:100%}
  .admin-product-list article>form button{width:100%}
  .kds-summary{grid-template-columns:1fr 1fr!important}
  .kds-card,.kds-order-card{min-width:0}
}

/* Footer: keep it readable on 320–430px screens. */
@media(max-width:430px){
  .site-footer{padding-top:30px}
  .footer-app-card,.footer-links,.footer-brand-block{padding:17px;border-radius:16px}
  .footer-links{grid-template-columns:1fr;gap:20px}
  .footer-trust{grid-template-columns:1fr!important}
  .footer-bottom{font-size:9px;line-height:1.7}
}

/* Small landscape phones. */
@media(max-height:520px) and (orientation:landscape) and (max-width:960px){
  .main-nav{max-height:70dvh}
  .chat-panel{height:72dvh}
  .modal-card{max-height:92dvh}
}

@media(prefers-reduced-motion:reduce){
  html{scroll-behavior:auto}
  *,*::before,*::after{animation-duration:.01ms!important;animation-iteration-count:1!important;transition-duration:.01ms!important}
}


/* V9 visual polish: clearer top nav, brighter menu page, stronger builder/menu visibility */
.site-header{padding:10px 0;background:linear-gradient(180deg,rgba(16,12,10,.96),rgba(16,12,10,.86));border-bottom:1px solid rgba(255,190,120,.08)}
.nav-shell{min-height:76px;background:linear-gradient(180deg,rgba(29,19,15,.95),rgba(18,12,10,.92));border:1px solid rgba(242,161,27,.12);box-shadow:0 20px 50px rgba(0,0,0,.28)}
.brand img{width:56px;height:56px}
.brand-copy strong{font-size:24px;color:#fff}.brand-copy strong span{color:#ffb347}.brand-copy small{color:#f1c79a;font-size:10.5px}
.main-nav{gap:8px}
.main-nav a{padding:11px 16px;border-radius:12px;color:#eedbc9;font-weight:700}
.main-nav a:hover{background:rgba(242,161,27,.12);color:#fff}
.main-nav a.active{background:linear-gradient(180deg,rgba(242,161,27,.18),rgba(242,161,27,.1));color:#fff;box-shadow:inset 0 0 0 1px rgba(242,161,27,.2)}
.main-nav a.active:after{display:none}
.auth-button,.account-button,.cart-button,.mobile-menu-toggle{background:rgba(255,255,255,.03);border-color:rgba(242,161,27,.16)}
.cart-button{background:linear-gradient(180deg,#2f1812,#24120e)}
.cart-count{background:#d85b2f}
@media(max-width:960px){
  .main-nav{top:88px;background:linear-gradient(180deg,#1a120f,#120d0b);border:1px solid rgba(242,161,27,.18);box-shadow:0 24px 60px rgba(0,0,0,.32)}
  .main-nav a{padding:12px 14px}
}

.v5-menu-hero{background:radial-gradient(circle at 82% 18%,rgba(242,161,27,.18),transparent 34%),linear-gradient(180deg,#17100d,#0e0908)}
.v5-category-sticky{background:rgba(14,9,8,.95);border-bottom:1px solid rgba(242,161,27,.14)}
.v5-category-strip button{background:#1a1310;color:#f1dfcf;border-color:rgba(242,161,27,.12)}
.v5-category-strip button.active{background:linear-gradient(180deg,#ffb23e,#f29b1f);color:#2a1708}
.v5-menu-section{background:linear-gradient(180deg,#100b09,#0b0908)}
.v5-food-card{background:linear-gradient(180deg,#1b1411,#120e0c);border-color:rgba(242,161,27,.1)}
.v5-food-card:hover{border-color:rgba(242,161,27,.32)}
.v5-food-body h3 a,.v5-menu-title h2{color:#fff}
.v5-food-meta,.v5-food-body>p{color:#d4c1b2}
.v5-price-row strong{color:#ffbf58}
.v5-quick-add{background:linear-gradient(180deg,#ffb33c,#f2a11b)}
.v5-customize{background:rgba(242,161,27,.08);color:#ffd494;border-color:rgba(242,161,27,.24)}
@media(max-width:640px){
  .v5-food-card{border-radius:18px;overflow:hidden}
  .v5-food-media{min-height:190px}
}
