: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}
