/* Phase 20.5.12.19 — Mobile UX Final Polish & Real Device Layout Pass
   Scope: mobile/tablet only. No desktop layout change.
*/
@media (max-width: 900px){
  html, body{max-width:100%;overflow-x:hidden}
  .container,.home-wide-container-v1861,.vendor-shell-pro,.vendor-shell-wide-pro,.vendor-orders-shell-wide,.checkout-v16-page .container{width:100%;max-width:100%;padding-left:max(14px,env(safe-area-inset-left));padding-right:max(14px,env(safe-area-inset-right));box-sizing:border-box}
  img,video,iframe,table{max-width:100%}
  input,select,textarea,button{font-size:16px}
  .btn,.mini-btn,.icon-btn,button[type="submit"],a.btn{min-height:42px;touch-action:manipulation}
  .hero-market,.hero-slide-pro,.vendor-hero-pro,.checkout-hero-v16{border-radius:22px}
  .hero-actions,.vendor-actions-pro,.card-actions,.vpr-actions{display:flex;flex-wrap:wrap;gap:8px}
  .hero-actions .btn,.vendor-actions-pro .btn,.vpr-actions .mini-btn{flex:1 1 auto;justify-content:center;text-align:center}
  .product-grid,.products-grid,.store-products-grid,.home-product-rail-v186,.cards-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}
  .product-card,.product-card-pro,.card,.store-card,.home-store-card-v186{min-width:0}
  .product-card h3,.product-card p,.store-card h3,.store-card p{overflow-wrap:anywhere}
  .card-actions{align-items:stretch}
  .card-actions .btn.wide{flex:1 1 100%}
  .price-row{flex-wrap:wrap;gap:6px}
  .marketak-table-wrap,.table-wrap,.admin-table-wrap,.vendor-table-wrap,.orders-table-wrap,.mobile-table-scroll-v2051219{overflow-x:auto;-webkit-overflow-scrolling:touch;max-width:100%}
  table{min-width:680px}
  .modal,.modal-card,.popup-card,.side-popup,.drawer,.bottom-sheet,.checkout-modal,.vendor-popup{max-width:calc(100vw - 24px)!important;max-height:calc(100dvh - 24px)!important;overflow:auto!important}
  .toast,.toast-pro,.smart-toast,.floating-toast,.action-toast{left:12px!important;right:12px!important;bottom:max(14px,env(safe-area-inset-bottom))!important;max-width:calc(100vw - 24px)!important}
}
@media (max-width: 760px){
  .vendor-shell-pro,.vendor-shell-wide-pro,.vendor-orders-shell-wide{display:block!important}
  .vendor-sidebar-pro{position:relative!important;width:100%!important;max-width:100%!important;margin:0 0 14px!important;border-radius:22px!important;top:auto!important;max-height:none!important}
  .vendor-main-pro{width:100%!important;max-width:100%!important;min-width:0!important}
  .vendor-menu-pro{display:flex!important;overflow-x:auto!important;gap:8px;padding-bottom:6px;-webkit-overflow-scrolling:touch}
  .vendor-menu-pro a{flex:0 0 auto;white-space:nowrap;border-radius:14px}
  .vendor-store-card{min-width:0}
  .vendor-store-card b,.vendor-store-card span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
  .vendor-orders-kpis,.vendor-order-kpi-grid,.vendor-products-kpis-pro,.stats-grid,.kpi-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:10px}
  .vendor-action-workflow-v2057{grid-template-columns:1fr!important}
  .vendor-product-row-pro,.vendor-order-card,.order-card,.customer-order-card{display:grid!important;grid-template-columns:74px minmax(0,1fr)!important;gap:10px!important;align-items:start}
  .vendor-product-row-pro img{width:74px!important;height:74px!important;object-fit:cover;border-radius:16px}
  .vpr-price,.vpr-status,.vpr-actions{grid-column:1/-1}
  .vpr-status{display:flex;flex-wrap:wrap;gap:6px}
  .vpr-actions a{flex:1 1 44%;text-align:center}
  .checkout-grid-v16{display:block!important}
  .checkout-card-v16,.order-summary-v16{width:100%!important;max-width:100%!important;margin-bottom:14px}
  .checkout-fields-v16,.form-grid,.form-grid.two,.form-grid.three{grid-template-columns:1fr!important}
  .checkout-item-v16{grid-template-columns:58px minmax(0,1fr)!important;gap:10px}
  .checkout-item-v16 img{width:58px!important;height:58px!important;object-fit:cover;border-radius:14px}
  .summary-line{gap:10px}
  .summary-line span{min-width:0;overflow-wrap:anywhere}
  .checkout-submit-v16,.checkout-submit-guard-v2051218{position:sticky;bottom:max(10px,env(safe-area-inset-bottom));z-index:8;box-shadow:0 16px 34px rgba(15,23,42,.18)}
  .checkout-address-book-pro .address-book-grid-pro{grid-template-columns:1fr!important}
  .storefront-products-layout-v155{display:block!important}
  .storefront-filter-panel-v155{max-height:calc(100dvh - 90px);overflow:auto;-webkit-overflow-scrolling:touch}
  .product-detail-layout,.product-layout,.product-details-grid{display:block!important}
  .product-gallery,.product-info{width:100%!important;max-width:100%!important}
  .customer-orders-pro,.orders-list,.vendor-products-horizontal-list{min-width:0;max-width:100%}
}
@media (max-width: 480px){
  .container,.home-wide-container-v1861{padding-left:12px;padding-right:12px}
  .product-grid,.products-grid,.store-products-grid,.home-product-rail-v186,.cards-grid{grid-template-columns:1fr!important}
  .vendor-orders-kpis,.vendor-order-kpi-grid,.vendor-products-kpis-pro,.stats-grid,.kpi-grid{grid-template-columns:1fr!important}
  .hero-slide-pro,.vendor-hero-pro,.checkout-hero-v16{padding:18px!important}
  h1{font-size:clamp(24px,8vw,34px)}
  h2{font-size:clamp(20px,6vw,28px)}
  .btn,.mini-btn,button[type="submit"]{width:auto;min-width:0}
  .hero-actions .btn,.vendor-actions-pro .btn{flex:1 1 100%}
  .modal,.modal-card,.popup-card,.side-popup,.drawer,.bottom-sheet,.checkout-modal,.vendor-popup{max-width:calc(100vw - 16px)!important;max-height:calc(100dvh - 16px)!important}
}
