/* Mobile-only layout; saved desktop column widths and row heights are untouched. */
.mobile-only,.mobile-menu-shade{display:none}
.mobile-category-panel{display:none}
.install-dialog{width:min(440px,90vw);box-sizing:border-box;border:1px solid #ddd;border-radius:12px;padding:24px;color:#222;background:white}
.install-dialog::backdrop{background:#0006}
.install-dialog h2{font-size:18px!important;margin:0 0 16px}
.install-dialog p{font-size:14px!important;line-height:1.7;white-space:normal}
.install-dialog form{text-align:right}
.install-dialog button{background:#45743e;color:white;border:0;border-radius:5px;padding:10px 24px}
@media screen and (max-width:800px){
  body .mobile-category-panel:not([hidden]){display:block;background:#f4f4f4;border-bottom:3px solid #111;margin:-14px -12px 26px;padding:22px 12px 28px}
  body .mobile-category-panel h2{margin:0 0 22px;text-align:center}
  body .mobile-category-panel h2 button{background:none;border:0;padding:0;color:#13395f;font-size:23px!important;font-weight:700!important}
  body .mobile-category-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:7px}
  body .mobile-category-grid button{min-width:0;min-height:40px;padding:9px 10px;border:0;border-radius:4px;background:white;color:#444;text-align:left;font-size:14px!important;line-height:1.4;overflow-wrap:anywhere}
  body .mobile-category-grid button[aria-pressed="true"]{background:#000;color:white;font-weight:700!important}
  html,body{width:100%;overflow-x:clip}
  body .topbar{position:sticky!important;top:0!important;height:auto!important;min-height:0!important;display:grid!important;grid-template-columns:36px minmax(0,1fr);gap:8px;padding:calc(10px + env(safe-area-inset-top)) 12px 12px!important;background:white!important;z-index:40!important}
  body .topbar #mobileMenuButton{display:block;grid-column:1;grid-row:1;background:none;border:0;font-size:25px!important;padding:0;min-height:40px;color:#111}
  body .topbar .brand{grid-column:2;grid-row:1;width:auto!important;min-width:0!important;padding:0;font-size:22px!important;text-align:left;font-weight:700!important}
  body .topbar nav{grid-column:1/-1;grid-row:2;display:flex!important;width:100%;gap:0;justify-content:space-between;flex-wrap:wrap;margin:0;border-bottom:1px solid #eee;padding-bottom:8px}
  body .topbar nav button{font-size:12px!important;font-weight:500!important;padding:8px 2px!important;background:none!important;border:0!important;min-height:36px;color:#111!important}
  body .topbar .search{grid-column:1/-1;grid-row:3;display:flex;width:100%;max-width:none;min-width:0;gap:0}
  body .topbar .refine-search{grid-column:1/-1;grid-row:4;display:flex;min-width:0;width:100%;gap:8px}
  body .topbar .search input,body .topbar .refine-search input{min-width:0;width:0;flex:1;font-size:16px!important;height:38px;padding:8px 12px;border:1px solid #ddd!important;border-radius:22px 0 0 22px;background:#fff}
  body .topbar .refine-search label{display:block;font-size:12px!important;white-space:nowrap}
  body .topbar #searchButton,body .topbar #refineSearchButton{height:38px;padding:6px 14px!important;background:#45743e!important;color:white!important;border-radius:0 22px 22px 0;font-size:14px!important;border:0}
  body .shell{display:block!important;height:auto!important;min-height:0!important}
  body .shell>aside{display:none;position:fixed!important;top:var(--header-height)!important;left:0;width:min(82vw,320px)!important;height:calc(100dvh - var(--header-height))!important;max-height:none!important;z-index:39;overflow:auto!important;background:#f7f7f7}
  body.mobile-menu-open .shell>aside{display:block}
  body .mobile-menu-shade:not([hidden]){display:block;position:fixed;inset:var(--header-height) 0 0;background:#0006;z-index:38;border:0;border-radius:0}
  body #categories{display:block}
  body .shell>main{padding:14px 12px 0!important;height:auto!important;overflow:visible!important;min-width:0}
  body #catalogView,body #products{height:auto!important;max-height:none!important;overflow:visible!important;min-width:0!important}
  body #products{display:grid!important;grid-template-columns:minmax(0,1fr);gap:0;padding:0}
  body #products .mobile-product{border:1px solid #d9d9d9;border-radius:0;background:white;overflow:hidden;box-shadow:none}
  body #products .mobile-product+.mobile-product{border-top:0}
  body #products .mobile-product-heading{border-bottom:1px solid #ddd;padding:12px 14px;background:#fff}
  body #products .mobile-product-heading h2{margin:0;font-size:19px!important;font-weight:600!important;line-height:1.4;overflow-wrap:anywhere}
  body #products .mobile-product-heading p{margin:3px 0 0;font-size:14px!important;line-height:1.5;overflow-wrap:anywhere}
  body #products .mobile-product-body{display:grid;grid-template-columns:minmax(85px,39%) minmax(0,1fr);gap:12px;padding:16px 8px;align-items:center}
  body #products .mobile-product-image{padding:0;border:0;background:white;min-width:0;cursor:pointer}
  body #products .mobile-product-image img{width:100%;height:145px;object-fit:contain}
  body #products .mobile-product-info{min-width:0;overflow-wrap:anywhere}
  body #products .mobile-product-info p{margin:0 0 7px;font-size:13px!important;line-height:1.5}
  body #products .mobile-code b{color:#0058bd;font-size:13px!important;font-weight:500!important}
  body #products .mobile-product-fields{display:grid;grid-template-columns:45px minmax(0,1fr);gap:7px 5px;margin:18px 0 10px;align-items:center}
  body #products .mobile-product-fields dt,body #products .mobile-product-fields dd{margin:0;min-width:0;font-size:13px!important;line-height:1.5;font-weight:500!important}
  body #products .mobile-name{display:block;text-align:left;padding:0;border:0;background:none;color:#111;font-size:13px!important;line-height:1.5;white-space:normal;overflow-wrap:anywhere}
  body #products .mobile-brand{font-size:17px!important;font-weight:700!important}
  body #products .mobile-option{display:block;font-size:12px!important;margin:8px 0}
  body #products .mobile-option select{width:100%;min-width:0;height:38px;font-size:16px!important;background:white;border:1px solid #ddd;border-radius:4px}
  body #products .mobile-price-label{color:#666;font-size:12px!important;margin-top:8px}
  body #products .price{display:block;font-size:16px!important;font-weight:700!important;color:#e50000!important;line-height:1.5}
  body #products .mobile-line-total{display:flex;flex-wrap:wrap;gap:3px;justify-content:center;align-items:center;border-radius:20px;background:#f3f3f3;padding:5px 8px;margin-top:8px}
  body #products .mobile-line-total span{font-size:11px!important;color:#666}
  body #products .mobile-line-total strong{font-size:17px!important;color:#e50000!important}
  body #products .mobile-product-actions{display:flex;justify-content:space-between;align-items:center;gap:12px;padding:9px 12px;border-top:1px solid #ddd}
  body #products .mobile-detail{background:#808080!important;color:white!important;border:0;border-radius:5px;padding:10px 14px;font-size:14px!important;font-weight:600!important;min-height:44px}
  body #products .quantity-control{display:flex;max-width:130px;width:100%}
  body #products .quantity-control button{background:#808080!important;color:white!important;width:30px;min-width:28px;min-height:40px;padding:0;border:0;font-size:17px!important}
  body #products .quantity-control input{width:0;min-width:0;flex:1;height:40px;padding:6px 0;font-size:16px!important;background:white;border:1px solid #ddd;text-align:center}
  body .catalog-selection{position:sticky!important;bottom:0;padding:10px 8px calc(10px + env(safe-area-inset-bottom))!important;display:flex!important;flex-wrap:wrap;gap:6px!important;justify-content:space-between;background:white!important;margin-top:12px;z-index:20}
  body #selectionTotal{width:100%;font-size:12px!important}
  body .catalog-selection button{flex:1;padding:10px 5px!important;font-size:12px!important;min-height:42px;white-space:nowrap}
  body .forms,body #accountView .forms:has(#loginForm:not([hidden])){grid-template-columns:minmax(0,1fr)!important;gap:28px!important}
  body #registerForm:before{display:none!important}
  body #registerForm,body #certificatePanel{border:0!important;border-top:1px solid #ddd!important;padding:24px 0 0!important}
  body .panel{max-width:100%!important}
}
@media screen and (min-width:600px) and (max-width:800px){
  body .topbar{grid-template-columns:32px 170px minmax(0,1fr)}
  body .topbar nav{grid-column:3;grid-row:1;border:0;padding:0}
  body .topbar .search{grid-column:1/3;grid-row:2}
  body .topbar .refine-search{grid-column:3;grid-row:2}
  body #products .mobile-product-image img{height:200px}
  body #products .mobile-product-body{padding:20px 16px;gap:24px}
  body #products .mobile-product-fields{grid-template-columns:90px minmax(0,1fr);gap:8px 12px}
  body #products .mobile-product-fields dt,body #products .mobile-product-fields dd,body #products .mobile-name{font-size:19px!important}
  body #products .price,body #products .mobile-line-total strong{font-size:22px!important}
}
