:root{
  --bg:#f5f5f7;
  --surface:#ffffff;
  --red:#ef1c22;
  --red-dark:#c90d15;
  --text:#222;
  --muted:#7c7c84;
  --border:#ececf1;
  --shadow:0 8px 24px rgba(0,0,0,.08);
  --radius:18px;
}
*{box-sizing:border-box}
html,body{margin:0;padding:0;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Arial,sans-serif;background:var(--bg);color:var(--text)}
a{text-decoration:none;color:inherit}
img{max-width:100%;display:block}
button,input,textarea,select{font:inherit}
body{padding-bottom:84px;overflow-x:hidden}
.hero{background:#fff;position:sticky;top:0;z-index:20;box-shadow:0 2px 10px rgba(0,0,0,.04)}
.hero-banner{height:170px;background:linear-gradient(135deg,#b60008 0%,#f21d23 55%,#b70008 100%);position:relative;overflow:hidden}
.hero-banner-image{background-size:cover;background-position:center}
.hero-overlay{position:absolute;inset:0;display:flex;flex-direction:column;align-items:center;justify-content:center;color:#fff;background:linear-gradient(180deg,rgba(0,0,0,.06),rgba(0,0,0,.18))}
.hero-brand{font-size:42px;font-weight:900;letter-spacing:2px;text-transform:uppercase}
.hero-subtitle{font-size:16px;opacity:.95;margin-top:6px}
.hero-meta{display:flex;justify-content:space-around;gap:8px;background:var(--red);color:#fff;padding:10px 12px;font-size:15px}
.hero-toolbar{display:flex;gap:10px;align-items:center;padding:12px;background:#fff}
.search-form{flex:1}
.search-form input{width:100%;height:42px;border:none;background:#f1f2f5;border-radius:999px;padding:0 16px;outline:none}
.lang-switch{display:flex;gap:6px}
.lang-switch a{min-width:40px;height:40px;border-radius:999px;background:#f1f2f5;display:flex;align-items:center;justify-content:center;color:#666;font-weight:700}
.lang-switch a.active{background:var(--red);color:#fff}
.main-shell{max-width:1100px;margin:0 auto;padding:10px 10px 14px 0}
.menu-layout{display:grid;grid-template-columns:110px 1fr;gap:4px;align-items:start}
.category-column{background:#f0f0f2;border-radius:0 18px 18px 0;padding:8px 4px 8px 0;position:sticky;top:190px;max-height:calc(100vh - 250px);overflow:auto;margin-left:0;left:0}
.category-item{display:block;padding:15px 10px 15px 14px;border-radius:0 14px 14px 0;font-size:15px;line-height:1.2;color:#2e2e32}
.category-item.active{background:#fff;font-weight:800;box-shadow:var(--shadow)}
.product-column-title{font-size:17px;font-weight:900;margin:0 0 12px}
.product-list{display:flex;flex-direction:column;gap:12px}
.product-card{display:grid;grid-template-columns:140px minmax(0,1fr) auto;gap:14px;align-items:center;background:#fff;border-radius:18px;padding:14px;box-shadow:0 1px 0 rgba(0,0,0,.05);min-height:176px}
.product-thumb{width:140px;height:140px;border-radius:14px;background:#fafafa;display:flex;align-items:center;justify-content:center;overflow:hidden;border:1px solid #f1f1f1}
.product-thumb img{width:100%;height:100%;object-fit:contain}
.product-name{font-size:17px;font-weight:700;line-height:1.25;margin-bottom:8px;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;min-height:44px;max-height:44px;word-break:break-word}
.product-price{font-size:18px;font-weight:900}
.product-meta{font-size:13px;color:var(--muted);margin-top:4px}
.add-btn,.circle-btn,.main-btn,.ghost-btn{border:none;cursor:pointer}
.circle-btn{width:28px;height:28px;border-radius:999px;background:var(--red);color:#fff;font-size:18px;line-height:1;display:flex;align-items:center;justify-content:center;box-shadow:0 8px 14px rgba(239,28,34,.22)}
.main-btn{height:48px;padding:0 18px;border-radius:14px;background:var(--red);color:#fff;font-weight:800;width:100%}
.ghost-btn{height:44px;padding:0 16px;border-radius:14px;background:#f2f2f4;color:#222;font-weight:700}
.panel{background:#fff;border-radius:20px;padding:18px;box-shadow:var(--shadow)}
.card-stack{display:flex;flex-direction:column;gap:12px}
.small-muted,.muted{color:var(--muted)}
.section-title{font-size:22px;font-weight:900;margin:0 0 12px}
.product-detail{display:grid;gap:18px}
.product-detail-cover{height:260px;border-radius:24px;background:#fff;overflow:hidden;display:flex;align-items:center;justify-content:center;box-shadow:var(--shadow)}
.product-detail-cover img{width:100%;height:100%;object-fit:contain;background:#fff}
.qty-row{display:flex;gap:10px;align-items:center}
.qty-box{display:flex;align-items:center;background:#f3f3f5;border-radius:14px;padding:4px}
.qty-box button{width:20px;height:20px;border:none;background:#fff;border-radius:8px;font-size:12px;font-weight:700}
.qty-box input{width:28px;text-align:center;border:none;background:transparent;outline:none;font-size:13px}
.form-grid{display:grid;gap:12px}
.field label{display:block;font-size:14px;color:#555;margin-bottom:6px;font-weight:700}
.field input,.field textarea,.field select{width:100%;padding:13px 14px;border:1px solid var(--border);border-radius:14px;background:#fff;outline:none}
.field textarea{min-height:90px;resize:vertical}
.login-box{max-width:540px;margin:0 auto}
.notice-box{background:#fff4df;border:1px solid #ffe3a8;color:#7c5400;padding:12px 14px;border-radius:14px;margin-bottom:12px}
.cart-line,.order-card,.history-card,.profile-card{background:#fff;border-radius:18px;padding:14px;box-shadow:var(--shadow)}
.cart-line{display:grid;grid-template-columns:160px 1fr auto;gap:12px;align-items:center}
.cart-line img{width:160px;height:160px;object-fit:contain;border-radius:12px;background:#fafafa;border:1px solid #f1f1f1}
.line-actions{display:flex;align-items:center;gap:10px}
.remove-link{color:var(--red);font-weight:800;font-size:13px}
.summary-card{position:sticky;bottom:94px;background:#fff;border-radius:20px;padding:16px;box-shadow:var(--shadow);margin-top:14px}
.summary-row{display:flex;justify-content:space-between;margin:8px 0;color:#4a4a4f}
.summary-row.total{font-size:20px;font-weight:900;color:#111}
.order-card,.history-card,.profile-card{display:flex;flex-direction:column;gap:8px}
.badge{display:inline-flex;align-items:center;padding:5px 10px;border-radius:999px;background:#fff0f1;color:var(--red);font-size:12px;font-weight:800;width:auto}
.bottom-nav{position:fixed;left:0;right:0;bottom:0;height:74px;background:#fff;border-top:1px solid #ececf1;display:grid;grid-template-columns:repeat(4,1fr);z-index:50;padding-bottom:env(safe-area-inset-bottom)}
.bottom-nav a{display:flex;flex-direction:column;justify-content:center;align-items:center;font-size:12px;color:#8b8b93;gap:6px;padding-top:2px}
.bottom-nav a.active{color:var(--red);font-weight:800}
.bottom-nav .ico{font-size:22px;line-height:1;display:flex;align-items:center;justify-content:center;height:22px}
.footer-note{text-align:center;color:#8b8b93;font-size:12px;padding:14px 14px 88px}
.inline-link{color:var(--red);font-weight:800}
.top-back{display:inline-flex;align-items:center;gap:6px;color:#666;font-size:14px;margin-bottom:10px}
@media (max-width: 768px){
  .main-shell{padding:10px}
  .menu-layout{grid-template-columns:120px 1fr;gap:10px}
  .category-column{top:230px;padding:6px}
  .category-item{padding:14px 10px;font-size:15px}
  .product-card{grid-template-columns:72px 1fr auto;gap:10px;padding:12px}
  .product-thumb{width:72px;height:72px}
  .hero-brand{font-size:34px}
}
@media (max-width: 560px){
  .menu-layout{grid-template-columns:104px 1fr}
  .hero-banner{height:150px}
  .hero-brand{font-size:30px}
  .hero-meta{font-size:13px}
  .hero-toolbar{padding:10px}
  .lang-switch a{min-width:34px;height:34px;font-size:12px}
}

.loading-box{padding:16px;text-align:center;color:var(--muted);font-weight:700}
.lazy-menu-layout .product-list{min-height:240px}
.product-card img[loading="lazy"]{content-visibility:auto}

.hero-notice-bar{display:flex;align-items:center;gap:10px;overflow:hidden;padding:10px 12px;background:var(--red);color:#fff;font-size:15px}
.hero-notice-label{flex:0 0 auto;font-weight:800}
.hero-notice-marquee-wrap{overflow:hidden;position:relative;flex:1;white-space:nowrap}
.hero-notice-marquee{display:inline-flex;min-width:max-content;gap:42px;animation:marqueeX 18s linear infinite}
.hero-notice-marquee span{display:inline-block;padding-right:12px}
@keyframes marqueeX{0%{transform:translateX(0)}100%{transform:translateX(-50%)}}
.circle-btn.is-added,.main-btn.is-added{background:#22a34a!important}
.product-thumb img{background:#fff}


#cartCountBadge:empty{display:none}
.auto-collapse-banner .hero-banner{transition:height .22s ease, opacity .22s ease, margin .22s ease;opacity:1}
.auto-collapse-banner.hero-collapsed .hero-banner,.hero-collapsed .hero-banner{height:0!important;opacity:0;overflow:hidden}
.auto-collapse-banner .category-column{transition:top .22s ease}
.auto-collapse-banner.hero-collapsed .category-column,.hero-collapsed .category-column{top:82px}

.qty-box-live input{width:44px;text-align:center;border:none;background:transparent;outline:none;font-weight:800}.product-action{min-width:132px;display:flex;justify-content:flex-end}.product-action .main-btn{width:auto;padding:0 18px;height:44px;border-radius:999px}.product-action .qty-box{background:#ef1c22;color:#fff}.product-action .qty-box button{background:#fff;color:#111}.product-action .qty-box input{color:#fff}.summary-card .main-btn{height:52px;border-radius:16px;font-size:18px}.cart-line .qty-box-live{display:inline-flex}.product-card{grid-template-columns:86px 1fr auto}.product-card .product-meta:empty{display:none}.category-column{top:82px;max-height:calc(100vh - 180px)}@media (max-width:768px){.category-column{top:82px;max-height:calc(100vh - 170px)}}

.top-title-only{font-size:22px;font-weight:900;margin:0 0 12px;}
.product-info-wrap{min-width:0;}
.product-barcode{font-size:12px;color:var(--muted);margin-top:4px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;display:none;}.cart-barcode{display:block !important;}
@media (max-width:768px){.main-shell{padding:8px 8px 14px 0}.menu-layout{grid-template-columns:94px 1fr;gap:2px}.product-card{grid-template-columns:126px minmax(0,1fr) auto;min-height:170px;padding:12px}.product-thumb{width:126px;height:126px}.category-column{top:122px;max-height:calc(100vh - 180px);padding-right:2px}.category-item{padding-left:10px;padding-right:8px}.product-action{min-width:86px}.circle-btn{width:24px;height:24px;font-size:15px}.product-action .qty-box button{width:18px;height:18px;font-size:11px}.product-action .qty-box input{width:24px;font-size:12px}.cart-line{grid-template-columns:120px 1fr auto}.cart-line img{width:120px;height:120px}}

.checkout-single-col{grid-template-columns:1fr;}.checkout-form-panel{max-width:720px;margin:0 auto;}.checkout-summary-only{max-width:420px;margin-left:auto;margin-right:auto;}.checkout-compact-panel{padding-bottom:10px;}


/* v9 tuning */
.category-column{padding:8px 0 8px 0 !important;margin-left:0 !important}
.category-item{padding:15px 8px 15px 12px !important}
.menu-layout{grid-template-columns:100px 1fr !important;gap:0 !important}
.main-shell{padding-left:0 !important}

.product-list{display:flex;flex-direction:column;gap:10px}
.product-card{
  display:grid !important;
  grid-template-columns:108px minmax(0,1fr) !important;
  gap:10px !important;
  align-items:stretch !important;
  min-height:124px !important;
  padding:10px !important;
}
.product-thumb{
  width:108px !important;
  height:104px !important;
  border-radius:12px !important;
  align-self:center;
  margin:0 !important;
}
.product-main{
  min-width:0;
  display:grid;
  grid-template-rows:minmax(40px,auto) auto auto;
  align-content:space-between;
  gap:8px;
}
.product-name{
  margin:0 !important;
  min-height:40px !important;
  max-height:40px !important;
  line-height:1.2 !important;
  font-size:16px !important;
  -webkit-line-clamp:2 !important;
  display:-webkit-box !important;
  -webkit-box-orient:vertical !important;
  overflow:hidden !important;
}
.product-price{font-size:18px !important;line-height:1;margin:0 !important}
.product-card .product-barcode,.product-meta{display:none !important}
.product-action{
  min-width:0 !important;
  display:flex !important;
  justify-content:flex-start !important;
  align-items:center !important;
}
.product-action .circle-btn{
  width:24px !important;
  height:24px !important;
  font-size:15px !important;
}
.product-action .qty-box{
  transform:none !important;
  min-width:82px !important;
  height:28px !important;
}
.product-action .qty-box button{
  width:24px !important;
  height:24px !important;
  font-size:14px !important;
}
.product-action .qty-box input{
  width:28px !important;
  height:24px !important;
  font-size:13px !important;
  padding:0 !important;
}

.bottom-nav a{gap:4px !important;padding-top:0 !important}
.bottom-nav .ico{font-size:21px !important;height:24px !important;line-height:1 !important}
.bottom-nav a span:last-child{line-height:1.1}
@media (max-width:768px){
  .menu-layout{grid-template-columns:92px 1fr !important;gap:0 !important}
  .category-column{
    top:82px !important;
    max-height:calc(100vh - 168px) !important;
    padding:8px 0 !important;
    border-radius:0 16px 16px 0 !important;
  }
  .category-item{font-size:14px !important;padding:14px 6px 14px 10px !important}
  .product-card{
    grid-template-columns:96px minmax(0,1fr) !important;
    min-height:116px !important;
    gap:8px !important;
    padding:8px !important;
  }
  .product-thumb{width:96px !important;height:92px !important;border-radius:10px !important}
  .product-name{font-size:15px !important;min-height:36px !important;max-height:36px !important}
  .product-price{font-size:17px !important}
}


/* v10 small tune */
.menu-layout{gap:6px !important}
@media (max-width:768px){
  .menu-layout{gap:4px !important}
}
.product-action{
  justify-content:flex-end !important;
}
.product-action .circle-btn,
.product-action .qty-box{
  margin-left:auto !important;
}


/* v11 final tune */
.hero{top:env(safe-area-inset-top) !important}
.hero-toolbar{position:relative;z-index:2}
.hero-notice-bar{position:relative;z-index:2}
.product-main{padding-top:4px !important}
.product-name{padding-top:4px !important}


/* v12 fixed home layout */
.app-shell.home-fixed-layout{
  height:100svh;
  display:grid;
  grid-template-rows:auto 1fr auto;
  overflow:hidden;
}
.home-fixed-layout .hero{
  position:relative !important;
  top:0 !important;
  box-shadow:none;
  display:grid;
  grid-template-rows:120px 58px;
  overflow:hidden;
  border-bottom:1px solid var(--border);
}
.home-fixed-layout .hero-banner{
  height:120px !important;
}
.home-fixed-layout .hero-banner-notice{
  position:absolute;
  left:0; right:0; bottom:0;
  display:flex; align-items:center; gap:10px;
  padding:8px 12px;
  background:rgba(239,28,34,.96);
  color:#fff; font-size:14px;
  z-index:2;
}
.home-fixed-layout .hero-toolbar{
  height:58px;
  padding:8px 10px !important;
  border-top:1px solid var(--border);
}
.home-fixed-layout .main-shell{
  padding:0 !important;
  margin:0 !important;
  max-width:none !important;
  min-height:0;
  overflow:hidden;
}
.home-fixed-layout .menu-layout{
  display:grid;
  grid-template-columns:96px 1fr;
  gap:6px;
  height:100%;
  align-items:stretch;
}
.home-fixed-layout .category-column{
  position:relative !important;
  top:0 !important;
  left:0 !important;
  max-height:none !important;
  height:100%;
  overflow-y:auto;
  overflow-x:hidden;
  margin:0;
  padding:8px 0 !important;
  border-radius:0;
}
.home-fixed-layout .category-item{
  border-radius:0 14px 14px 0;
}
.home-fixed-layout .menu-layout > section{
  min-height:0;
  height:100%;
  overflow-y:auto;
  padding:8px 8px 10px 0;
}
.home-fixed-layout #productLoading,
.home-fixed-layout #productEmpty{
  margin:8px 0 0 0;
}
.home-fixed-layout .bottom-nav{
  position:relative !important;
}
@media (max-width:768px){
  .app-shell.home-fixed-layout .hero{
    grid-template-rows:112px 56px;
  }
  .home-fixed-layout .hero-banner{
    height:112px !important;
  }
  .home-fixed-layout .menu-layout{
    grid-template-columns:92px 1fr;
    gap:4px;
  }
  .home-fixed-layout .menu-layout > section{
    padding:6px 6px 8px 0;
  }
}


/* v13 fixes */
html,body{touch-action:manipulation;}
a, button, input, select, textarea, .category-item, .product-card, .circle-btn, .qty-box button { touch-action: manipulation; }
.upper-input{text-transform:uppercase;}
.bottom-nav .ico{font-size:20px !important}
.bottom-nav a{gap:5px !important}


/* v14 no whole-page scroll on home */
html,body{height:100%}
body.home-page-body{
  overflow:hidden !important;
  padding-bottom:0 !important;
}
body.home-page-body .app-shell.home-fixed-layout{
  height:100dvh !important;
  min-height:100dvh !important;
}
body.home-page-body .bottom-nav{
  position:relative !important;
  bottom:auto !important;
}
body.home-page-body .main-shell{
  overflow:hidden !important;
}
body.home-page-body .menu-layout > section,
body.home-page-body .category-column{
  overscroll-behavior:contain;
  -webkit-overflow-scrolling:touch;
}


/* v15 fixes */
.checkout-single-col{
  padding-bottom: 96px !important;
}
.checkout-form-panel{
  margin-bottom: 96px !important;
}
.checkout-submit-wrap,
.checkout-submit-bar{
  padding-bottom: calc(14px + env(safe-area-inset-bottom));
}
@media (max-width:768px){
  .checkout-single-col{
    padding-bottom: 110px !important;
  }
  .checkout-form-panel{
    margin-bottom: 110px !important;
  }
}

/* v16 checkout spacing */
.checkout-single-col{padding-bottom:74px !important}
.checkout-form-panel{margin-bottom:74px !important}
@media (max-width:768px){
  .checkout-single-col{padding-bottom:82px !important}
  .checkout-form-panel{margin-bottom:82px !important}
}

.barcode-card{background:#fff;border:1px solid var(--border);border-radius:14px;padding:10px;overflow:auto}
.barcode-card svg{display:block;max-width:100%;height:auto}


/* v17 fixes */
.checkout-lr-grid{display:grid;grid-template-columns:130px 1fr;gap:12px 12px;align-items:center}
.checkout-lr-grid .field{display:contents}
.checkout-lr-grid .field label{font-weight:700;text-align:left;margin:0}
.checkout-lr-grid .field input,
.checkout-lr-grid .field select,
.checkout-lr-grid .field textarea{width:100%}
.checkout-lr-grid .field textarea{min-height:90px}
@media (max-width:768px){
  .checkout-lr-grid{grid-template-columns:110px 1fr;gap:10px}
}
.summary-card{margin-bottom:88px !important}
.card-stack{padding-bottom:88px}
.cart-line:last-child{margin-bottom:8px}
.barcode-card{background:#fff;border:1px solid var(--border);border-radius:14px;padding:10px;overflow:auto}
.barcode-card svg{display:block;max-width:100%;height:auto}

/* v18 fixed bottom bars */
.cart-page-list,.checkout-form-panel{padding-bottom:92px !important}
.bottom-fixed-spacer{height:84px}
.cart-fixed-checkout,.checkout-fixed-submit{
  position:fixed;
  left:10px;
  right:10px;
  bottom:calc(74px + env(safe-area-inset-bottom) + 8px);
  z-index:40;
}
.cart-fixed-checkout .main-btn,.checkout-fixed-submit .main-btn{
  height:52px;
  border-radius:16px;
  box-shadow:0 8px 24px rgba(0,0,0,.12);
}
.checkout-full-width{width:99%;margin:0 auto}
.checkout-full-width .checkout-form-panel{padding:14px}
.barcode-modal{
  position:fixed;inset:0;display:flex;align-items:center;justify-content:center;z-index:100;
}
.barcode-modal-backdrop{
  position:absolute;inset:0;background:rgba(0,0,0,.45);
}
.barcode-modal-content{
  position:relative;background:#fff;border-radius:18px;padding:18px;max-width:92vw;overflow:auto;
}
@media (max-width:768px){
  .cart-fixed-checkout,.checkout-fixed-submit{left:8px;right:8px;bottom:calc(74px + env(safe-area-inset-bottom) + 6px)}
  .bottom-fixed-spacer{height:78px}
  .cart-page-list,.checkout-form-panel{padding-bottom:86px !important}
}


/* v19 adjustments */
.hero-banner{height:120px !important}
.hero-banner-image{height:120px !important}
.home-fixed-layout .hero{grid-template-rows:120px 58px !important}
.home-fixed-layout .hero-banner{height:120px !important}
@media (max-width:768px){
  .hero-banner,.hero-banner-image,.home-fixed-layout .hero-banner{height:120px !important}
  .home-fixed-layout .hero{grid-template-rows:120px 56px !important}
}
.cart-barcode{display:flex !important;align-items:center;gap:6px}
.barcode-icon-btn{
  border:none;background:#f0f0f2;color:#444;border-radius:999px;
  width:22px;height:22px;line-height:22px;padding:0;cursor:pointer;
  display:inline-flex;align-items:center;justify-content:center;font-size:13px;
}
.checkout-fill-screen{
  min-height:calc(100dvh - 120px - 58px - 74px) !important;
  align-content:start !important;
}
.checkout-full-width{
  width:99% !important;
  max-width:none !important;
}
.checkout-form-panel{
  min-height:calc(100dvh - 120px - 58px - 74px - 24px) !important;
  display:flex;flex-direction:column;justify-content:space-between;
  padding:10px !important;
}
.checkout-lr-grid{
  flex:1 1 auto;
}
.checkout-fixed-submit{
  position:fixed !important;
  left:8px; right:8px;
  bottom:calc(74px + env(safe-area-inset-bottom) + 6px) !important;
  z-index:45;
}
.checkout-form-panel .bottom-fixed-spacer{height:70px}
.cart-fixed-checkout{
  position:fixed !important;
  left:8px; right:8px;
  bottom:calc(74px + env(safe-area-inset-bottom) + 6px) !important;
  z-index:45;
}
.cart-page-list{padding-bottom:76px !important}
.cart-page-list .cart-line:last-child{margin-bottom:0}
.cart-page-list + .bottom-fixed-spacer{height:70px}

.barcode-stack{display:flex;flex-direction:column;align-items:center;gap:14px}
.account-qr{width:180px;height:180px;object-fit:contain;background:#fff;border-radius:10px}
.barcode-modal .account-qr{width:220px;height:220px}

.checkout-full-width{
  width:99.6% !important;
  padding-left:2px !important;
  padding-right:2px !important;
}
.checkout-form-panel{
  width:100% !important;
  border-radius:18px;
}
.checkout-lr-grid{
  grid-template-columns:100px 1fr !important;
  gap:10px 8px !important;
}
@media (max-width:768px){
  .checkout-lr-grid{
    grid-template-columns:92px 1fr !important;
    gap:8px 6px !important;
  }
}

/* v21 page stability and widths */
.checkout-full-width{width:100% !important;max-width:none !important;margin:0 !important;padding:0 !important}
.checkout-fill-screen{width:100% !important}
.checkout-form-panel{width:100% !important;border-radius:0 !important}
.main-shell:has(.checkout-fill-screen),
.main-shell:has(.cart-page-list){padding-left:0 !important;padding-right:0 !important}
body:has(.checkout-fill-screen),
body:has(.cart-page-list){overscroll-behavior:none}
.cart-fixed-checkout,.checkout-fixed-submit{transform:translateZ(0)}
.product-thumb.open-product-modal,.product-name.open-product-modal{
  border:none;background:transparent;padding:0;margin:0;text-align:left;cursor:pointer;
}
.modal-product-card{display:flex;flex-direction:column;align-items:center;gap:12px;min-width:min(92vw,420px)}
.modal-product-img{width:180px;height:180px;object-fit:contain;border-radius:12px;background:#fff}
.modal-product-name{font-size:24px;font-weight:800;text-align:center}
.modal-product-price{font-size:28px;font-weight:900}
.modal-product-barcode-val{font-size:16px;color:#444;word-break:break-all;text-align:center}
.modal-product-barcode-svg svg{max-width:100%;height:auto}
.modal-product-card .main-btn,.modal-product-card .ghost-btn{width:100%}

.product-name.open-product-modal{color:#111 !important}
.hero-shopinfo .hero-brand{font-size:30px !important;line-height:1.2}
.hero-shopinfo .hero-subtitle{font-size:14px !important;line-height:1.35}
.hero-shopinfo .hero-address-line{font-size:13px !important;max-width:92%;text-align:center}
.modal-product-remark{font-size:14px;line-height:1.45;color:#555;background:#f7f7f8;border-radius:12px;padding:10px;width:100%}
.modal-product-extra{font-size:14px;color:#555}

/* v25 modal/nav tweaks */
.barcode-modal-content{
  max-width: min(92vw, 420px) !important;
  overflow-x: hidden !important;
}
.modal-product-card{
  width:100%;
  max-width:100%;
  overflow:hidden;
}
.modal-product-barcode-svg svg{
  max-width:100%;
  height:auto;
}
.modal-product-actions{
  width:100%;
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:10px;
}
.modal-product-actions .main-btn,
.modal-product-actions .ghost-btn{
  width:100%;
  margin:0;
}
.bottom-nav{
  display:grid !important;
  visibility:visible !important;
  opacity:1 !important;
}

/* v26 nav + modal fit */
.bottom-nav{
  position:fixed !important;
  left:0 !important;
  right:0 !important;
  bottom:0 !important;
  width:100% !important;
  height:74px !important;
  z-index:80 !important;
  background:#fff !important;
  border-top:1px solid var(--border) !important;
}
.home-page-body .bottom-nav,
.inner-page-body .bottom-nav{
  position:fixed !important;
  inset:auto 0 0 0 !important;
}
body{padding-bottom:86px !important}
.app-shell{padding-bottom:0 !important}
.main-shell{padding-bottom:10px !important}

.barcode-modal{
  padding:12px !important;
  align-items:center !important;
}
.barcode-modal-content{
  width:min(88vw, 360px) !important;
  max-width:min(88vw, 360px) !important;
  padding:14px !important;
  border-radius:20px !important;
}
.modal-product-card{
  gap:10px !important;
  min-width:auto !important;
}
.modal-product-img{
  width:140px !important;
  height:140px !important;
}
.modal-product-name{
  font-size:18px !important;
  line-height:1.2 !important;
}
.modal-product-price{
  font-size:18px !important;
}
.modal-product-extra,
.modal-product-barcode-val{
  font-size:12px !important;
}
.modal-product-barcode-svg svg{
  width:100% !important;
  max-width:280px !important;
}
.modal-product-actions{
  gap:8px !important;
}
.modal-product-actions .main-btn,
.modal-product-actions .ghost-btn{
  height:46px !important;
  font-size:14px !important;
  padding:0 10px !important;
  min-width:0 !important;
}

/* v27 lock bottom nav and remove stray scrollbars */
html,body{
  width:100% !important;
  max-width:100% !important;
  overflow-x:hidden !important;
}
body{
  margin:0 !important;
  padding-bottom:74px !important;
}
.app-shell,
.main-shell,
.menu-layout,
.product-list,
.card-stack,
.panel,
.profile-card{
  max-width:100% !important;
}
.barcode-modal,
.barcode-modal-content,
.modal-product-card,
.modal-product-barcode-svg svg{
  max-width:100% !important;
}
.bottom-nav{
  position:fixed !important;
  left:0 !important;
  right:0 !important;
  bottom:0 !important;
  transform:none !important;
  will-change:auto !important;
  z-index:9999 !important;
  overflow:hidden !important;
}
.home-page-body,
.inner-page-body{
  overflow-x:hidden !important;
}
.home-page-body .app-shell,
.inner-page-body .app-shell{
  min-height:100dvh !important;
  padding-bottom:0 !important;
}
.home-page-body .main-shell,
.inner-page-body .main-shell{
  overflow-x:hidden !important;
}

/* v28 restore vertical scroll, keep nav fixed */
body,
.home-page-body,
.inner-page-body{
  overflow-y:auto !important;
  -webkit-overflow-scrolling:touch !important;
}
.main-shell{
  overflow-y:visible !important;
}
.home-page-body .menu-layout > section,
.home-page-body .category-column{
  overflow-y:auto !important;
}

/* v29 hard-fix homepage bottom nav */
body.home-page-body{
  padding-bottom:86px !important;
}
.app-shell.home-fixed-layout{
  display:block !important;
  height:auto !important;
  min-height:100dvh !important;
  overflow:visible !important;
}
.home-fixed-layout .main-shell{
  padding-bottom:86px !important;
  margin-bottom:0 !important;
  overflow:visible !important;
}
.home-fixed-layout .menu-layout{
  min-height:calc(100dvh - 120px - 56px - 86px) !important;
}
.home-fixed-layout .bottom-nav,
body.home-page-body .bottom-nav{
  display:flex !important;
  position:fixed !important;
  left:0 !important;
  right:0 !important;
  bottom:env(safe-area-inset-bottom) !important;
  width:100% !important;
  height:74px !important;
  z-index:2147483000 !important;
  background:#fff !important;
  border-top:1px solid var(--border) !important;
  box-shadow:0 -2px 10px rgba(0,0,0,.05) !important;
}
.home-fixed-layout .bottom-nav a{
  flex:1 1 25% !important;
  min-width:0 !important;
}

/* v30 bottom nav proper spacing */
.bottom-nav{
  display:flex !important;
  align-items:stretch !important;
  justify-content:space-between !important;
}
.bottom-nav a{
  flex:1 1 25% !important;
  min-width:0 !important;
  display:flex !important;
  flex-direction:column !important;
  align-items:center !important;
  justify-content:center !important;
  gap:4px !important;
  padding:6px 2px 8px !important;
  text-align:center !important;
  line-height:1.1 !important;
}
.bottom-nav .ico{
  display:block !important;
  font-size:22px !important;
  line-height:1 !important;
  height:22px !important;
}
.bottom-nav a span:last-child{
  display:block !important;
  width:100% !important;
  font-size:12px !important;
  white-space:nowrap !important;
  overflow:hidden !important;
  text-overflow:ellipsis !important;
}
#cartCountBadge{
  display:inline !important;
}

/* v31 fix nav overflow + restore pane scrolling */
html, body {
  width: 100% !important;
  max-width: 100% !important;
  overflow-x: hidden !important;
}

body.home-page-body {
  overflow-y: auto !important;
  padding-bottom: 86px !important;
}

body.home-page-body .app-shell.home-fixed-layout {
  display: block !important;
  height: auto !important;
  min-height: 100dvh !important;
  overflow: visible !important;
}

body.home-page-body .main-shell {
  overflow: visible !important;
  padding-bottom: 86px !important;
}

body.home-page-body .menu-layout {
  display: grid !important;
  grid-template-columns: 92px 1fr !important;
  gap: 4px !important;
  min-height: calc(100dvh - 120px - 56px - 86px) !important;
  align-items: start !important;
  overflow: visible !important;
}

body.home-page-body .category-column {
  position: relative !important;
  top: 0 !important;
  max-height: calc(100dvh - 120px - 56px - 86px) !important;
  height: auto !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  -webkit-overflow-scrolling: touch !important;
}

body.home-page-body .menu-layout > section {
  min-height: 0 !important;
  max-height: calc(100dvh - 120px - 56px - 86px) !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  -webkit-overflow-scrolling: touch !important;
  padding-right: 6px !important;
}

.bottom-nav {
  overflow: hidden !important;
}

.bottom-nav a {
  overflow: hidden !important;
}

.bottom-nav a span:last-child {
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}

/* remove any accidental horizontal scrollbar from fixed layers */
.hero,
.hero-banner,
.hero-toolbar,
.main-shell,
.menu-layout,
.product-list,
.product-card,
.barcode-modal,
.barcode-modal-content {
  max-width: 100% !important;
}

/* v32 remove homepage blank area above fixed nav */
body.home-page-body{
  padding-bottom:74px !important;
}
body.home-page-body .main-shell{
  padding-bottom:0 !important;
  margin-bottom:0 !important;
}
body.home-page-body .menu-layout{
  min-height:auto !important;
  height:calc(100dvh - 120px - 56px - 74px) !important;
  max-height:calc(100dvh - 120px - 56px - 74px) !important;
  overflow:hidden !important;
}
body.home-page-body .category-column{
  max-height:calc(100dvh - 120px - 56px - 74px) !important;
}
body.home-page-body .menu-layout > section{
  max-height:calc(100dvh - 120px - 56px - 74px) !important;
  padding-bottom:0 !important;
}
body.home-page-body #productList{
  padding-bottom:0 !important;
  margin-bottom:0 !important;
}
body.home-page-body #productLoading,
body.home-page-body #productEmpty,
body.home-page-body #loadMoreAnchor{
  margin-bottom:0 !important;
}
body.home-page-body .bottom-nav{
  bottom:0 !important;
}

/* v33 homepage bottom cleanup */
.lazy-menu-layout .product-list{
  min-height:0 !important;
}
body.home-page-body #productLoading,
body.home-page-body #productEmpty{
  display:none !important;
  height:0 !important;
  min-height:0 !important;
  padding:0 !important;
  margin:0 !important;
  border:0 !important;
  box-shadow:none !important;
  overflow:hidden !important;
}
body.home-page-body #loadMoreAnchor{
  height:1px !important;
  margin:0 !important;
  padding:0 !important;
}
body.home-page-body .menu-layout > section{
  background:transparent !important;
}
body.home-page-body #productList{
  display:flex !important;
  flex-direction:column !important;
  gap:12px !important;
  padding-bottom:0 !important;
  margin-bottom:0 !important;
}
body.home-page-body .menu-layout{
  align-items:start !important;
}
body.home-page-body .menu-layout > section{
  scrollbar-width:none;
}
body.home-page-body .menu-layout > section::-webkit-scrollbar,
body.home-page-body .category-column::-webkit-scrollbar{
  width:0 !important;
  height:0 !important;
}

.bottom-nav{
  overflow:hidden !important;
}

/* v34 hide iOS scroll indicators on home panes */
body.home-page-body .category-column,
body.home-page-body .menu-layout > section{
  scrollbar-width: none !important;
  -ms-overflow-style: none !important;
}
body.home-page-body .category-column::-webkit-scrollbar,
body.home-page-body .menu-layout > section::-webkit-scrollbar{
  width: 0 !important;
  height: 0 !important;
  display: none !important;
  background: transparent !important;
}

/* ============================================
   v35 FINAL - 修复底部空白问题
   ============================================ */

/* 重置 home 页面的 body padding，避免额外空白 */
body.home-page-body {
  padding-bottom: 0 !important;
}

/* 确保底部导航固定在底部，不产生额外空间 */
body.home-page-body .bottom-nav {
  position: fixed !important;
  bottom: 0 !important;
  top: auto !important;
  left: 0 !important;
  right: 0 !important;
  margin: 0 !important;
}

/* 精确计算内容区域高度，减去导航栏高度(74px) */
body.home-page-body .menu-layout {
  height: calc(100dvh - 120px - 56px) !important;
  max-height: calc(100dvh - 120px - 56px) !important;
  min-height: calc(100dvh - 120px - 56px) !important;
  overflow: hidden !important;
}

/* 左右两个面板的高度精确计算 */
body.home-page-body .category-column,
body.home-page-body .menu-layout > section {
  max-height: calc(100dvh - 120px - 56px) !important;
  height: 100% !important;
}

/* 移除所有可能产生额外空白的 padding/margin */
body.home-page-body .main-shell {
  padding-bottom: 0 !important;
  margin-bottom: 0 !important;
}

body.home-page-body #productList {
  padding-bottom: 0 !important;
  margin-bottom: 0 !important;
}

/* 处理 safe-area 兼容 */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
  body.home-page-body .menu-layout {
    height: calc(100dvh - 120px - 56px) !important;
    max-height: calc(100dvh - 120px - 56px) !important;
  }
  
  body.home-page-body .category-column,
  body.home-page-body .menu-layout > section {
    max-height: calc(100dvh - 120px - 56px) !important;
  }
}

/* 确保滚动时不会露出底部空白 */
body.home-page-body {
  overflow-y: auto !important;
}

body.home-page-body .category-column,
body.home-page-body .menu-layout > section {
  overflow-y: auto !important;
  -webkit-overflow-scrolling: touch !important;
}

/* 移动端适配 */
@media (max-width: 768px) {
  body.home-page-body .menu-layout {
    height: calc(100dvh - 112px - 56px) !important;
    max-height: calc(100dvh - 112px - 56px) !important;
    min-height: calc(100dvh - 112px - 56px) !important;
  }
  
  body.home-page-body .category-column,
  body.home-page-body .menu-layout > section {
    max-height: calc(100dvh - 112px - 56px) !important;
  }
}

/* ============================================
   v36 - 修复最后一个产品/分类被底部导航遮挡 + 左侧分类加宽
   ============================================ */

/* 给右侧产品列表区域添加底部内边距，确保最后一个产品不会被导航栏遮挡 */
body.home-page-body .menu-layout > section {
  padding-bottom: 20px !important;
}

body.home-page-body #productList {
  padding-bottom: 20px !important;
  margin-bottom: 0 !important;
}

/* 给左侧分类列表添加更大的底部内边距，确保最后一个分类不会被导航栏遮挡 */
body.home-page-body .category-column {
  padding-bottom: 0px !important;
}

/* 左侧分类加宽 */
body.home-page-body .menu-layout {
  grid-template-columns: 120px 1fr !important;
}

/* 确保滚动到底部时最后一个产品/分类完全可见 */
body.home-page-body .product-list .product-card:last-child {
  margin-bottom: 0;
}

body.home-page-body .category-column .category-item:last-child {
  margin-bottom: 0;
}

/* 移动端调整 - 使用更大的底部内边距，同时加宽分类 */
@media (max-width: 768px) {
  body.home-page-body .menu-layout {
    grid-template-columns: 110px 1fr !important;
  }
  
  body.home-page-body .menu-layout > section {
    padding-bottom: 45px !important;
  }
  
  body.home-page-body #productList {
    padding-bottom: 45px !important;
  }
  
  body.home-page-body .category-column {
    padding-bottom: 45px !important;
  }
}

/* 对于有安全区域（如 iPhone X 及以上）的设备，增加额外内边距 */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
  body.home-page-body .menu-layout > section {
    padding-bottom: calc(45px + env(safe-area-inset-bottom)) !important;
  }
  
  body.home-page-body #productList {
    padding-bottom: calc(45px + env(safe-area-inset-bottom)) !important;
  }
  
  body.home-page-body .category-column {
    padding-bottom: calc(85px + env(safe-area-inset-bottom)) !important;
  }
  
  @media (max-width: 768px) {
    body.home-page-body .menu-layout > section {
      padding-bottom: calc(45px + env(safe-area-inset-bottom)) !important;
    }
    
    body.home-page-body #productList {
      padding-bottom: calc(45px + env(safe-area-inset-bottom)) !important;
    }
    
    body.home-page-body .category-column {
      padding-bottom: calc(85px + env(safe-area-inset-bottom)) !important;
    }
  }
}

