/* Touch-first overrides, isolated from the desktop design and print documents. */
#mobile-shell,#mobile-menu-button{display:none}
@media screen and (max-width:1024px){
 .catalog-layout{grid-template-columns:minmax(0,1fr)}
 .cart-box{position:static;max-width:none}
 .products{grid-template-columns:repeat(2,minmax(0,1fr))}
 .columns,.columns.equal{grid-template-columns:minmax(0,1fr)}
 .products.list .product-info{grid-template-columns:minmax(0,1fr) 150px}
 .gateway-hero{grid-template-columns:minmax(0,1.1fr) minmax(300px,.9fr)}
}
@media screen and (max-width:820px){
 html{scroll-padding-bottom:155px;-webkit-text-size-adjust:100%}
 body{padding-bottom:calc(85px + env(safe-area-inset-bottom,0px))}
 body.mobile-has-cart{padding-bottom:calc(155px + env(safe-area-inset-bottom,0px))}
 body.gateway-page{padding-bottom:env(safe-area-inset-bottom,0px)}
 header{height:auto;min-height:76px;padding:12px max(14px,env(safe-area-inset-right,0px)) 12px max(14px,env(safe-area-inset-left,0px));gap:10px;flex-wrap:wrap}
 header .modes,header .avatar,header .demo-pill{display:none}
 .head-end{margin-inline-start:auto;gap:8px}
 #mobile-menu-button{display:grid;place-items:center;width:44px;height:44px;min-width:44px;background:#274d36;border-color:#536c50;color:white;padding:8px}
 .brand{margin:0}.b2b-brand{font-size:23px}
 .language-picker :is(button,a){min-height:44px;min-width:42px;padding:9px 10px;font-size:12px}
 .shell{display:block}.shell>#sidebar{display:none}
 main{padding:20px 16px;min-width:0}
 .breadcrumb{margin-bottom:14px;overflow-wrap:anywhere}
 .pagehead{display:block}.pagehead .controls{margin-top:14px}.pagehead h1{font-size:27px;line-height:1.3;overflow-wrap:anywhere}
 .pagehead .subtitle{font-size:13px;line-height:1.7}
 button,input,select,textarea{min-height:44px}
 input,select,textarea,.qty input,.suggestion .qty input{font-size:16px}
 input[type=checkbox]{min-height:22px;width:22px;height:22px;flex-shrink:0}
 .field label,.form-note,.checkline{font-size:12px;line-height:1.7}
 .formgrid{grid-template-columns:minmax(0,1fr);gap:17px}
 .form-actions{align-items:stretch;flex-direction:column}
 .form-actions button{width:100%}
 .field,.panel,.stat,.controls,.keyline>*{min-width:0}
 .panel{padding:19px}.panel-title{gap:10px;padding:17px}
 .keyline{gap:12px;flex-wrap:wrap;overflow-wrap:anywhere}
 .keyline span,.keyline b{max-width:100%}
 .stats{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
 .stat{padding:15px}.stat strong{font-size:27px;overflow-wrap:anywhere}
 .hero{min-height:0;padding:20px}.hero p{max-width:85%;font-size:12px}.hero h2{font-size:22px}.hero-art{font-size:60px}
 .catalog-body>.controls{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:8px}
 .searchwrap{min-width:0}.searchwrap input{min-height:48px;padding-inline-start:38px;padding-inline-end:44px}
 .searchwrap .icon{inset-inline-start:12px;top:15px}.clear-search{top:2px;inset-inline-end:2px;min-width:40px;padding:0}
 .view-toggle{gap:0;padding:2px}.view-toggle button{min-width:38px;padding:7px}
 .searchpop{top:55px;max-height:55dvh;overscroll-behavior:contain}
 .suggestion{display:grid;grid-template-columns:38px minmax(0,1fr) auto;gap:8px;padding:12px}
 .suggestion .thumb{width:38px;height:38px}.suggestion .result-name{font-size:12px;overflow-wrap:anywhere}
 .suggestion small{font-size:10px}.suggestion .price{font-size:13px}
 .suggestion .qtyrow{grid-column:2/4;width:100%;justify-self:stretch}
 .suggestion .qty{max-width:none;width:100%}
 .suggestion .qty input,.suggestion .qty button{height:44px}
 .suggestion .qty button{min-width:48px;font-size:20px}
 .filter-chips{max-width:100%;padding:14px 0;scrollbar-width:thin;overscroll-behavior-x:contain}
 .filter-chips button{flex-shrink:0;font-size:12px;padding-inline:14px}
 .catalog-heading{gap:10px;flex-wrap:wrap}.sort{font-size:14px;max-width:100%}
 .products{gap:10px}.product-info{padding:11px}
 .product h3{font-size:14px;min-height:42px;line-height:1.5;overflow-wrap:anywhere}
 .product-brand{font-size:9px}.product .meta{font-size:11px;flex-wrap:wrap;gap:2px 8px}
 .art{height:160px}.art .tag{font-size:10px;max-width:calc(100% - 56px);line-height:1.5}
 .detail-icon{width:44px;height:44px;min-height:44px;top:4px;inset-inline-end:4px}
 .price-row{flex-wrap:wrap;gap:5px}.product .price{font-size:19px}.taxnote{font-size:10px}
 .qtyrow{gap:0}.qty-label{display:none}.qty{max-width:none;width:100%}
 .qty button{height:44px;min-width:44px;padding:5px;font-size:21px}.qty input{height:44px}
 .dealbutton{font-size:12px;min-height:46px;padding:8px;line-height:1.5;white-space:normal}
 .products.list .product{align-items:flex-start}.products.list .art{width:90px;height:110px;margin:8px}
 .products.list .product-info{display:grid;grid-template-columns:minmax(0,1fr);gap:9px;padding:12px;min-width:0}
 .products.list h3{min-height:0;margin-top:4px}.products.list .qty{max-width:none}
 .products.list .dealbutton{font-size:12px}.products.list .price-row{display:flex;flex-wrap:wrap}.products.list .meta{display:flex}
 .cart-box{scroll-margin-top:14px;scroll-margin-bottom:150px}
 .cartline{font-size:13px}.cartline small,.cartnote{font-size:12px}.cartline .remove{font-size:12px;padding:10px 3px}
 .sumrow{font-size:13px}.sumrow.total{font-size:19px}.cart-body>.primary{min-height:50px;font-size:15px}
 #mobile-shell{display:block;position:fixed;inset-inline:0;bottom:0;z-index:25;background:#fff;padding-bottom:env(safe-area-inset-bottom,0px);box-shadow:0 -6px 25px #203d2615;border-top:1px solid #d9e3d0}
 .gateway-page #mobile-shell{display:none}
 .mobile-bottom-nav{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));padding:5px max(6px,env(safe-area-inset-right,0px)) 5px max(6px,env(safe-area-inset-left,0px));gap:3px}
 .mobile-bottom-nav button{display:flex;flex-direction:column;justify-content:center;align-items:center;gap:5px;min-height:62px;border:0;border-radius:9px;padding:7px 3px;background:none;color:#758568;font-size:10px;line-height:1.4;overflow-wrap:anywhere}
 .mobile-bottom-nav button[aria-current=page]{background:#e9f0dc;color:#284d32}
 .mobile-bottom-nav svg{width:21px;height:21px;flex-shrink:0}
 .mobile-cart-summary{display:flex;align-items:center;justify-content:space-between;gap:8px;width:calc(100% - 24px);margin:10px 12px 3px;padding:13px;background:#234b35;color:#fff;border:0;border-radius:10px;min-height:50px;font-size:12px}
 .mobile-cart-summary span{display:flex;align-items:center;gap:6px}.mobile-cart-summary strong{font-size:17px;direction:ltr;white-space:nowrap}
 body:has(input:focus,textarea:focus,select:focus) #mobile-shell{display:none}
 dialog{width:calc(100% - 20px);max-width:calc(100% - 20px);max-height:calc(100dvh - 28px - env(safe-area-inset-top,0px) - env(safe-area-inset-bottom,0px));padding:18px;padding-top:12px;overscroll-behavior:contain;overflow-wrap:anywhere}
 dialog .close{width:44px;height:44px;min-height:44px;position:sticky;top:0;z-index:5}
 dialog h2{font-size:22px;padding-inline-end:35px;line-height:1.5}
 .modal-product{grid-template-columns:minmax(0,1fr);gap:18px}.modal-product .art{height:180px}
 .price-options button{font-size:13px;gap:12px;min-height:50px}
 .mobile-menu-panel .nav-caption,.mobile-menu-panel .nav-bottom{display:none}
 .mobile-menu-panel .nav-item{width:100%;font-size:14px;white-space:normal;min-height:48px;margin-bottom:5px}
 .mobile-menu-panel h2{margin-bottom:20px}.mobile-mode-options{display:grid;grid-template-columns:1fr 1fr;gap:10px;border-top:1px solid var(--line);padding-top:18px;margin-top:18px}
 #toast{bottom:calc(155px + env(safe-area-inset-bottom,0px));max-width:calc(100vw - 28px);font-size:13px;overflow-wrap:anywhere}
 .gateway-page #toast{bottom:22px}
 footer,footer div{flex-wrap:wrap;gap:10px}footer a,footer button{display:inline-flex;align-items:center;min-height:44px}
 .docbuttons button{font-size:12px;flex:1 1 130px;min-height:48px}
 .timeline{flex-wrap:wrap}.stage{flex:1 1 45%;font-size:12px;padding:12px}
 .tablewrap{overflow:visible;background:transparent;border:0}
 .tablewrap table.mobile-cards,.tablewrap .mobile-cards tbody{display:block;width:100%;white-space:normal}
 .mobile-cards thead,.mobile-cards tr:has(th):not(:has(td)){display:none}
 .mobile-cards tr:has(td){display:block;margin-bottom:14px;background:#fff;border:1px solid var(--line);border-radius:11px;padding:8px 15px}
 .tablewrap .mobile-cards td{display:block;position:relative;padding:11px 0 11px 42%;padding-inline:42% 0;min-height:44px;font-size:13px;overflow-wrap:anywhere;border-bottom:1px solid #edf0e7;text-align:start}
 .mobile-cards td::before{content:attr(data-label);position:absolute;inset-inline-start:0;top:13px;width:37%;font-size:11px;color:#89957d;line-height:1.7;overflow-wrap:anywhere}
 .tablewrap .mobile-cards td.mobile-actions{padding-inline-start:0;display:flex;gap:8px;flex-wrap:wrap;border-bottom:0}
 .mobile-cards .mobile-actions::before{content:none}
 .tablewrap .mobile-cards td button{font-size:12px;min-height:44px;padding:10px 13px;white-space:normal}
 .mobile-cards td:last-child{border-bottom:0}.mobile-cards td small{font-size:11px;line-height:1.6}
 .mobile-cards td[colspan]{padding-inline-start:0}.mobile-cards td[colspan]::before{content:none}
 /* Keep the login action high on the page; art stays on desktop. */
 .gateway-page main{padding:0 16px}.gateway-nav{height:auto;min-height:82px;gap:10px}
 .gateway-logo{font-size:28px;padding-right:0;flex-shrink:0}.gateway-logo i{display:none}.gateway-nav>.controls{gap:0}
 .gateway-contact{display:none}.gateway-hero{display:flex;flex-direction:column;border-radius:17px}
 .gateway-story{padding:24px}.gateway-story h1{font-size:34px;margin:15px 0 12px;line-height:1.2}
 .thai-ui .gateway-story h1{font-size:31px;line-height:1.45}
 .gateway-story>p{font-size:13px;line-height:1.7}.gateway-kicker{font-size:10px;line-height:1.7}
 .gateway-scene,.gateway-features,.gateway-market{display:none}
 .gateway-entry{padding:25px 24px}.entry-symbol{display:none}.gateway-entry h2{font-size:26px;margin-top:8px}
 .gateway-entry .entry-subtitle{font-size:13px;margin-bottom:19px}
 .gateway-entry label{font-size:12px}.gateway-entry select{font-size:16px}
 .gateway-submit,.gateway-register{min-height:50px;font-size:14px}.gateway-demo-note{font-size:11px}
 .gateway-business{min-height:44px;font-size:12px}.entry-bottom{flex-wrap:wrap;gap:12px;padding-top:17px;margin-top:16px}
 .gateway-steps{grid-template-columns:1fr}.gateway-steps article{padding:15px 19px}.gateway-steps article+article{border-inline-start:0;border-top:1px solid #dce1d2}
 .gateway-steps h3{font-size:13px}.gateway-owner{flex-wrap:wrap;gap:10px}.gateway-owner span{font-size:11px}
}
@media screen and (max-width:460px){
 .products:not(.list){grid-template-columns:minmax(0,1fr)}
 .products:not(.list) .art{height:190px}
 .products:not(.list) .product-info{padding:16px}
 .products:not(.list) h3{font-size:17px;min-height:0}
 .products:not(.list) .product-brand{font-size:10px}
 .products:not(.list) .meta{flex-direction:row;font-size:12px}
 .catalog-body>.controls{grid-template-columns:minmax(0,1fr)}
 .view-toggle{justify-self:end}.searchwrap{width:100%}
 .product .qty{max-width:none}.gateway-page main{padding-inline:12px}
 .gateway-story,.gateway-entry{padding-inline:20px}
 .gateway-story h1{font-size:30px}.thai-ui .gateway-story h1{font-size:28px}
 .gateway-logo{font-size:25px}.gateway-logo>span{font-size:8px;letter-spacing:2.8px}
 .language-picker :is(button,a){padding:8px;min-width:40px}
 .b2b-brand{font-size:20px}.b2b-brand span{font-size:7px}
 .head-end{gap:0}header{gap:8px}.language-picker{padding:2px}
 #mobile-menu-button{width:40px;min-width:40px}.pagehead h1{font-size:25px}
 .mobile-cart-summary{font-size:11px}.mobile-cart-summary strong{font-size:16px}
}
@media screen and (max-height:500px) and (orientation:landscape){
 .mobile-bottom-nav button{flex-direction:row;min-height:44px}.mobile-bottom-nav{padding-block:2px}
 .mobile-cart-summary{min-height:44px;padding-block:9px;margin-top:5px}
 body{padding-bottom:60px}body.mobile-has-cart{padding-bottom:115px}
}
