/* FIXED STYLE: compact-cart-numeric-cluster */

/* Giỏ hàng: Tên SP giữ toàn bộ phần dư; cụm Đ.GIÁ | SL | T.TIỀN dùng
   track số cố định để số tăng không làm dịch SL hay mép phải T.TIỀN.
   T.TIỀN giữ 56px, đủ ngưỡng hiển thị 100.000 theo ruler hiện tại. */
.cart-compact-grid{
  grid-template-columns:minmax(0,1fr) 64px 124px 84px !important;
  column-gap:8px !important;
  justify-content:stretch !important;
}

/* Đ.GIÁ và T.TIỀN đều bám mép phải track cố định.
   Khoảng hình học quanh vùng SL luôn tính theo full track, không theo độ dài số hiện tại. */
.cart-price{
  justify-self:stretch;
  text-align:right !important;
}

.cart-total{
  justify-self:stretch;
  text-align:right !important;
  font-variant-numeric:tabular-nums;
  white-space:nowrap;
}

.cart-qty{
  justify-self:center;
}


/* Cart row leading index belongs to the product-name line, not to the full
   name + optional note block. This keeps STT aligned with TÊN SP whether a
   note exists or not. */
#cartItemList .cart-left{
  align-items:start !important;
}

#cartItemList .cart-stt{
  align-self:start !important;
  line-height:1.25 !important;
  padding-top:0 !important;
}

/* One quantity ruler for Sales list and Cart; same - / value / + alignment. */
#tab-ban-hang .product-card .flex.items-center.gap-1.border,
#cartItemList .cart-qty-control{
  display:grid !important;
  grid-template-columns:36px 40px 36px !important;
  gap:2px !important;
  align-items:center;
  justify-content:center;
  box-sizing:border-box;
  width:124px !important;
  min-width:124px !important;
  height:42px !important;
  padding:2px !important;
  margin:0 !important;
}
#tab-ban-hang .product-card button[onclick^="updateCart("],
#cartItemList .cart-qty-control > button{
  display:flex;
  align-items:center;
  justify-content:center;
  box-sizing:border-box;
  width:36px !important;
  min-width:36px !important;
  height:36px !important;
  padding:0 !important;
}
#tab-ban-hang .product-card button[onclick^="updateCart("]:first-child,
#cartItemList .cart-qty-control > button:first-child{
  background:#f1f5f9;
  border-radius:999px;
}
#tab-ban-hang .product-card input[data-qty-editor="product"],
#cartItemList .cart-qty-control > input{
  box-sizing:border-box;
  width:40px !important;
  min-width:40px !important;
  height:36px !important;
  padding:0 !important;
  text-align:center !important;
  font-size:14px !important;
  font-variant-numeric:tabular-nums;
}
/* Shared cart header/row numeric ruler; don't let legacy ch-width rules
   float price and line total inside the wrong part of a column. */
#cartBottomSheet .cart-compact-grid .cart-price,
#cartBottomSheet .cart-compact-grid .cart-total{
  box-sizing:border-box;
  width:100% !important;
  min-width:0;
}
#cartBottomSheet .cart-compact-grid .cart-qty{
  box-sizing:border-box;
  width:100% !important;
  min-width:0;
  justify-self:stretch;
  justify-content:center;
}
/* Order-detail header + rows: identical STT/Name/Price/Qty/Total tracks. */
.order-detail-compact-grid{
  grid-template-columns:26px minmax(0,1fr) 58px 30px 80px !important;
  column-gap:8px !important;
  justify-content:stretch !important;
}
.order-detail-compact-grid .order-price,
.order-detail-compact-grid .order-qty,
.order-detail-compact-grid .order-total{
  width:100% !important;
  min-width:0;
  text-align:right !important;
  font-variant-numeric:tabular-nums;
  white-space:nowrap;
}

/* Mobile cart readability: product+note use full width; labeled numbers
   share the second row without squeezing names at 320px. Desktop keeps
   the existing compact numeric ruler. */
#cartItemList .cart-field-caption{display:none}
@media (max-width:480px){
  /* The one-line cart should not fill 88% of the phone with empty space.
     Keep the native bottom-sheet scroll boundary for large orders. */
  #cartBottomSheet{
    height:auto !important;
    max-height:88vh !important;
    max-height:88dvh !important;
  }
  #cartItemList{
    flex:0 1 auto !important;
    min-height:0 !important;
    overflow-y:auto !important;
  }
  #cartBottomSheet > .cart-compact-grid{display:none !important}
  #cartItemList .cart-compact-grid{
    grid-template-columns:minmax(0,1fr) 132px minmax(0,1fr) !important;
    grid-template-areas:"line line line" "unit quantity subtotal";
    column-gap:8px !important;
    row-gap:6px;
    align-items:start;
    padding-top:10px !important;
    padding-bottom:10px !important;
  }
  #cartItemList .cart-left{grid-area:line;min-width:0}
  #cartItemList .cart-price{
    grid-area:unit;
    justify-self:stretch;
    text-align:left !important;
    min-width:0;
  }
  #cartItemList .cart-qty{
    grid-area:quantity;
    justify-self:center;
    display:flex;
    width:132px !important;
    min-width:0;
    flex-direction:column;
    align-items:center;
  }
  #cartItemList .cart-total{
    grid-area:subtotal;
    justify-self:stretch;
    text-align:right !important;
    min-width:0;
  }
  /* Name and its optional note button share the FIRST visual row.
     Previously the empty note button reserved an extra 18px row. */
  #cartItemList .cart-left > .min-w-0{
    display:flex;
    align-items:center;
    min-width:0;
    gap:6px;
  }
  #cartItemList .cart-name{
    flex:1 1 auto;
    min-width:0;
    display:block !important;
    white-space:nowrap !important;
    overflow:hidden;
    text-overflow:ellipsis;
  }
  #cartItemList [data-cart-line-note-editor]{
    flex:0 1 auto;
    min-width:0;
    max-width:94px;
    margin:0 !important;
  }
  #cartItemList [data-cart-note-id]{
    width:100%;
    min-height:24px;
    max-height:24px;
    overflow:hidden;
    text-overflow:ellipsis;
    white-space:nowrap;
    text-align:right;
  }
  #cartItemList [data-cart-note-id][data-note-current=""]{
    width:28px;
    min-width:28px;
    font-size:0 !important;
  }
  #cartItemList [data-cart-note-id][data-note-current=""]::after{
    content:"✎";
    font-size:15px;
    color:#94a3b8;
  }
  #cartItemList [data-cart-note-input-id]{
    box-sizing:border-box;
    width:94px;
    max-width:34vw;
    min-width:0;
  }
  #cartItemList .cart-line-note:not([data-cart-note-id]){
    min-width:0;
    max-width:94px;
    overflow:hidden;
    text-overflow:ellipsis;
    white-space:nowrap;
  }
  #cartItemList .cart-field-caption{
    display:block;
    margin-bottom:4px;
    color:#667085;
    font-size:11px;
    font-weight:500;
    line-height:16px;
    white-space:nowrap;
  }
  #cartItemList .cart-money-value{display:block;font-variant-numeric:tabular-nums}
  /* One phone stepper: 40px - / 40px value / 40px +. */
  #tab-ban-hang .product-card .flex.items-center.gap-1.border,
  #cartItemList .cart-qty-control{
    width:132px !important;
    min-width:132px !important;
    height:46px !important;
    grid-template-columns:40px 40px 40px !important;
  }
  #tab-ban-hang .product-card button[onclick^="updateCart("],
  #cartItemList .cart-qty-control > button{
    width:40px !important;
    min-width:40px !important;
    height:40px !important;
  }
  #tab-ban-hang .product-card input[data-qty-editor="product"],
  #cartItemList .cart-qty-control > input{
    width:40px !important;
    min-width:40px !important;
    height:40px !important;
    font-size:16px !important;
  }
  .order-detail-compact-grid{
    grid-template-columns:22px minmax(0,1fr) 52px 28px 72px !important;
    column-gap:6px !important;
  }
  .order-detail-compact-grid .order-name{
    white-space:normal;
    overflow-wrap:anywhere;
    display:-webkit-box;
    -webkit-box-orient:vertical;
    -webkit-line-clamp:2;
    overflow:hidden;
  }
  #cartItemList .cart-qty-control{
    width:132px !important;
    height:46px !important;
    grid-template-columns:40px 40px 40px !important;
    column-gap:2px !important;
    padding:0 2px !important;
  }
  #cartItemList .cart-qty-control > button{
    width:40px !important;
    height:40px !important;
  }
  #cartItemList .cart-qty-control > button i{font-size:14px !important}
  #cartItemList .cart-qty-control > input{
    width:40px !important;
    min-width:40px !important;
    height:40px !important;
    font-size:16px !important;
  }
  #cartItemList .cart-qty-readonly{
    box-sizing:border-box;
    min-height:46px;
    height:46px;
    display:grid;
    place-items:center;
    width:132px !important;
    min-width:132px !important;
    border:1px solid #e2e8f0;
    border-radius:999px;
    background:#f8fafc;
    font-weight:750;
    font-size:16px;
    font-variant-numeric:tabular-nums;
    line-height:1;
  }
  /* Identical label row and value row in view AND edit.
     Restores the unit-price caption missing in the iPhone capture. */
  #cartItemList .cart-price,
  #cartItemList .cart-total,
  #cartItemList .cart-qty{
    align-self:start;
    min-height:70px;
  }
  #cartItemList .cart-compact-grid .cart-field-caption{
    display:block !important;
    box-sizing:border-box;
    min-height:20px;
    margin:0 0 4px;
    line-height:20px;
    font-size:11px;
    font-weight:600;
    color:#667085;
  }
  #cartItemList .cart-price .cart-field-caption{text-align:left}
  #cartItemList .cart-qty > .cart-field-caption{text-align:center}
  #cartItemList .cart-total .cart-field-caption{text-align:right}
  #cartItemList .cart-price .cart-money-value,
  #cartItemList .cart-total .cart-money-value{
    display:flex;
    align-items:center;
    min-height:46px;
    height:46px;
    font-variant-numeric:tabular-nums;
    white-space:nowrap;
  }
  #cartItemList .cart-price .cart-money-value{justify-content:flex-start}
  /* Editing price is an input: align its text with Qty and Total value row. */
  #cartItemList .cart-price input.cart-money-value{
    display:block !important;
    box-sizing:border-box;
    width:100% !important;
    min-width:0 !important;
    height:46px !important;
    min-height:46px !important;
    padding:0 !important;
    text-align:left !important;
    background:transparent;
    border:0;
    font-variant-numeric:tabular-nums;
  }
  #cartItemList .cart-total .cart-money-value{justify-content:flex-end}
  #cartFooterActions > button{
    min-width:0;
    min-height:44px;
    padding-left:8px;
    padding-right:8px;
    font-size:13px;
    gap:4px;
  }
}

/* Even at 320px, keep exactly TWO cart rows: name then all three fields.
   The outer list has horizontal padding, leaving room for 132px Qty and
   two flexible monetary tracks; amounts remain right aligned. */
@media (max-width:360px){
  #cartItemList .cart-compact-grid{
    grid-template-columns:minmax(0,1fr) 132px minmax(0,1fr) !important;
    grid-template-areas:"line line line" "unit quantity subtotal";
    column-gap:4px !important;
  }
  #cartItemList .cart-qty{
    grid-area:quantity;
    justify-self:center !important;
  }
  #cartItemList .cart-compact-grid .cart-field-caption{font-size:10px;}
}

/* Mobile compact two-row cart: screenshot IMG_9475 (16:33).
   STT + name remain one line. Unit price, Qty, and line total remain
   within the second logical line. Reduce vertical padding, not legibility. */
@media (max-width:480px){
  #cartItemList .cart-compact-grid{
    grid-template-columns:minmax(0,1fr) 124px minmax(0,1fr) !important;
    grid-template-areas:"line line line" "unit quantity subtotal" !important;
    grid-template-rows:max-content max-content !important;
    column-gap:6px !important;
    row-gap:3px !important;
    padding-top:6px !important;
    padding-bottom:6px !important;
  }
  #cartItemList .cart-left{
    align-items:center !important;
    min-height:24px;
  }
  #cartItemList .cart-price,
  #cartItemList .cart-qty,
  #cartItemList .cart-total{
    min-height:54px !important;
    align-self:start;
  }
  #cartItemList .cart-qty{
    width:124px !important;
    min-width:124px !important;
  }
  #cartItemList .cart-compact-grid .cart-field-caption{
    min-height:13px !important;
    margin:0 0 1px !important;
    line-height:13px !important;
    font-size:10px !important;
  }
  #cartItemList .cart-price .cart-money-value,
  #cartItemList .cart-total .cart-money-value{
    min-height:40px !important;
    height:40px !important;
    font-size:13px !important;
  }
  #cartItemList .cart-price input.cart-money-value{
    min-height:40px !important;
    height:40px !important;
  }
  #cartItemList .cart-qty-control{
    width:124px !important;
    min-width:124px !important;
    height:40px !important;
    grid-template-columns:38px 38px 38px !important;
    column-gap:1px !important;
    padding:0 2px !important;
  }
  #cartItemList .cart-qty-control > button,
  #cartItemList .cart-qty-control > input{
    width:38px !important;
    min-width:38px !important;
    height:38px !important;
  }
  #cartItemList .cart-qty-readonly{
    width:124px !important;
    min-width:124px !important;
    min-height:40px !important;
    height:40px !important;
  }
}
@media (max-width:360px){
  #cartItemList .cart-compact-grid{
    grid-template-columns:minmax(0,1fr) 124px minmax(0,1fr) !important;
    column-gap:4px !important;
  }
  #cartItemList .cart-price .cart-money-value,
  #cartItemList .cart-total .cart-money-value{
    font-size:12px !important;
    letter-spacing:-.15px;
  }
}

/* FIXED STYLE: cart-preview-parity-20261008
   The shopping cart and "Đang xem đơn" use ONE mobile item ruler.
   Preview: number; cart edit: - number +. Everything else matches. */
@media (max-width:480px){
  #cartItemList .cart-compact-grid{
    grid-template-columns:minmax(0,1fr) 104px minmax(0,1fr) !important;
    grid-template-areas:"line line line" "unit quantity subtotal" !important;
    grid-template-rows:max-content max-content !important;
    column-gap:6px !important;
    row-gap:4px !important;
    padding-top:7px !important;
    padding-bottom:7px !important;
    align-items:start !important;
  }
  #cartItemList .cart-left{grid-area:line;align-items:center !important;min-height:24px;}
  #cartItemList .cart-price{grid-area:unit;}
  #cartItemList .cart-qty{grid-area:quantity;}
  #cartItemList .cart-total{grid-area:subtotal;}
  #cartItemList .cart-price,
  #cartItemList .cart-qty,
  #cartItemList .cart-total{
    display:flex !important;
    flex-direction:column !important;
    align-items:stretch !important;
    justify-content:flex-start !important;
    box-sizing:border-box;
    width:100% !important;
    min-width:0 !important;
    min-height:50px !important;
    height:auto !important;
    gap:2px !important;
    align-self:start !important;
  }
  #cartItemList .cart-qty{width:104px !important;min-width:104px !important;align-items:center !important;}
  /* Same caption row for preview and for edit. No pseudo-label changes. */
  #cartItemList .cart-compact-grid .cart-field-caption{
    display:block !important;
    box-sizing:border-box;
    width:100% !important;
    min-width:0 !important;
    min-height:14px !important;
    margin:0 !important;
    padding:0 !important;
    font-size:10px !important;
    font-weight:600 !important;
    line-height:14px !important;
    color:#64748b !important;
    white-space:nowrap;
  }
  #cartItemList .cart-price .cart-field-caption{text-align:left !important;}
  #cartItemList .cart-qty .cart-field-caption{text-align:center !important;font-size:10px !important;}
  #cartItemList .cart-qty .cart-field-caption::after{content:none !important;}
  #cartItemList .cart-total .cart-field-caption{text-align:right !important;}
  #cartItemList .cart-price .cart-money-value,
  #cartItemList .cart-total .cart-money-value{
    display:flex !important;
    align-items:center !important;
    box-sizing:border-box;
    width:100% !important;
    min-width:0 !important;
    height:34px !important;
    min-height:34px !important;
    padding:0 !important;
    font-size:13px !important;
    font-weight:750 !important;
    font-variant-numeric:tabular-nums;
    white-space:nowrap;
  }
  #cartItemList .cart-price .cart-money-value{justify-content:flex-start !important;text-align:left !important;}
  #cartItemList .cart-total .cart-money-value{justify-content:flex-end !important;text-align:right !important;}
  #cartItemList .cart-price input.cart-money-value{
    display:block !important;
    height:34px !important;
    min-height:34px !important;
    width:100% !important;
    min-width:0 !important;
    padding:0 !important;
    background:transparent;
    border:0;
    border-radius:0;
    text-align:left !important;
    font-size:13px !important;
  }
  /* The ONLY visual difference from preview is an editable quantity control.
     Both states occupy identical 104 x 34px value positions. */
  #cartItemList .cart-qty-control{
    display:grid !important;
    box-sizing:border-box;
    flex:0 0 34px !important;
    width:104px !important;
    min-width:104px !important;
    height:34px !important;
    grid-template-columns:32px 32px 32px !important;
    gap:1px !important;
    padding:0 2px !important;
    margin:0 !important;
    align-items:center !important;
    justify-content:center !important;
  }
  #cartItemList .cart-qty-control > button{
    width:32px !important;
    min-width:32px !important;
    height:32px !important;
    min-height:32px !important;
    padding:0 !important;
  }
  #cartItemList .cart-qty-control > input{
    width:32px !important;
    min-width:32px !important;
    height:32px !important;
    min-height:32px !important;
    padding:0 !important;
    font-size:14px !important;
  }
  #cartItemList .cart-qty-readonly{
    display:grid !important;
    place-items:center !important;
    box-sizing:border-box;
    flex:0 0 34px !important;
    width:104px !important;
    min-width:104px !important;
    min-height:34px !important;
    height:34px !important;
    border:0 !important;
    background:transparent !important;
    box-shadow:none !important;
    font-size:14px !important;
    font-weight:750 !important;
    font-variant-numeric:tabular-nums;
  }
}
@media (max-width:360px){
  #cartItemList .cart-compact-grid{
    grid-template-columns:minmax(0,1fr) 104px minmax(0,1fr) !important;
    column-gap:4px !important;
  }
  #cartItemList .cart-price .cart-money-value,
  #cartItemList .cart-total .cart-money-value,
  #cartItemList .cart-price input.cart-money-value{
    font-size:12px !important;
    letter-spacing:-.1px;
  }
}

/* FIXED STYLE: order-cart-share-five-columns-20261008
   Single ruler for order preview + cart; quantity is the ONLY edit control.
   Header and body share the same five columns. */
#cartBottomSheet .cart-compact-grid{
  display:grid !important;
  grid-template-columns:24px minmax(0,1fr) 82px 124px 94px !important;
  grid-template-areas:none !important;
  grid-template-rows:auto !important;
  column-gap:8px !important;
  justify-content:stretch !important;
  align-items:center !important;
}
#cartBottomSheet .cart-compact-grid .cart-left{
  display:contents !important;
}
/* SPEC-ORDER-FIVE-HEADERS-UPPERCASE-20261108: the same uppercase
   captions in cart, saved-order detail, and readonly invoice. Styling only:
   do not change the 5-column ruler or the accessible full caption labels. */
#cartBottomSheet .cart-column-header{
  display:grid !important;
  text-transform:uppercase !important;
}
#orderDetailContentToShare .order-column-header{
  text-transform:uppercase !important;
}
#cartBottomSheet .cart-column-header .cart-stt,
#cartBottomSheet .cart-compact-grid .cart-stt{
  width:100% !important;
  min-width:0 !important;
  text-align:center !important;
}
#cartBottomSheet .cart-compact-grid .cart-name,
#cartBottomSheet .cart-compact-grid .cart-left > .min-w-0{
  min-width:0 !important;
}
#cartBottomSheet .cart-column-header .cart-name,
#cartBottomSheet .cart-column-header .cart-price,
#cartBottomSheet .cart-column-header .cart-qty,
#cartBottomSheet .cart-column-header .cart-total{
  font-weight:700;
  color:#64748b;
  white-space:nowrap;
}
#cartBottomSheet .cart-column-header .cart-name{text-align:left !important;}
#cartBottomSheet .cart-column-header .cart-price{text-align:right !important;}
#cartBottomSheet .cart-column-header .cart-qty{text-align:center !important;}
#cartBottomSheet .cart-column-header .cart-total{text-align:right !important;}
#cartBottomSheet .cart-compact-grid .cart-price,
#cartBottomSheet .cart-compact-grid .cart-total{
  justify-self:stretch !important;
  min-width:0 !important;
  text-align:right !important;
}
#cartBottomSheet .cart-compact-grid .cart-price input.cart-money-value{
  text-align:right !important;
}
#cartBottomSheet .cart-compact-grid .cart-qty{
  justify-self:stretch !important;
  justify-content:center !important;
}
@media (max-width:480px){
  /* IMG_9482 (readonly) / IMG_9483 (edit): one five-column layout,
     same caption/row tracks in each mode. Only the quantity track needs
     extra room for controls when editing. Leave every spare px to Tên. */
  #cartBottomSheet .cart-compact-grid,
  #orderDetailContentToShare .order-detail-compact-grid{
    display:grid !important;
    grid-template-columns:22px minmax(0,1fr) 54px 96px 69px !important;
    grid-template-areas:none !important;
    grid-template-rows:auto !important;
    column-gap:4px !important;
    justify-content:stretch !important;
    align-items:center !important;
    min-width:0 !important;
  }
  /* Preview has plain digits instead of buttons; reclaim unused width
     for longer product names without shifting header against body. */
  #cartBottomSheet[data-cart-mode="preview"] .cart-compact-grid,
  #orderDetailContentToShare .order-detail-compact-grid{
    grid-template-columns:22px minmax(0,1fr) 54px 50px 72px !important;
  }
  #cartBottomSheet > .cart-column-header{
    display:grid !important;
    min-height:32px !important;
    padding-top:5px !important;
    padding-bottom:5px !important;
  }
  #cartItemList .cart-compact-grid{
    min-height:40px !important;
    padding-top:6px !important;
    padding-bottom:6px !important;
    row-gap:0 !important;
  }
  #cartBottomSheet .cart-column-header .cart-stt,
  #cartBottomSheet .cart-column-header .cart-name,
  #cartBottomSheet .cart-column-header .cart-price,
  #cartBottomSheet .cart-column-header .cart-qty,
  #cartBottomSheet .cart-column-header .cart-total,
  #orderDetailContentToShare .order-column-header > *{
    display:block !important;
    box-sizing:border-box;
    width:100% !important;
    min-height:0 !important;
    height:auto !important;
    padding:0 !important;
    margin:0 !important;
    font-size:10px !important;
    line-height:15px !important;
    white-space:nowrap !important;
    text-transform:uppercase !important;
  }
  #cartBottomSheet .cart-column-header .cart-qty{text-align:center !important;}
  #cartBottomSheet .cart-column-header .cart-name,
  #orderDetailContentToShare .order-column-header .order-name{text-align:left !important;}
  #cartBottomSheet .cart-column-header .cart-price,
  #orderDetailContentToShare .order-column-header .order-price{text-align:right !important;}
  #cartBottomSheet .cart-column-header .cart-total,
  #orderDetailContentToShare .order-column-header .order-total{text-align:right !important;}
  #orderDetailContentToShare .order-column-header .order-stt,
  #orderDetailContentToShare .order-column-header .order-qty{text-align:center !important;}
  /* Inner field captions belong to older 2-row layout: the shared header owns them. */
  #cartItemList .cart-compact-grid .cart-field-caption{
    display:none !important;
  }
  #cartItemList .cart-compact-grid .cart-field-caption::after{
    content:none !important;
    display:none !important;
  }
  #cartItemList .cart-compact-grid .cart-price,
  #cartItemList .cart-compact-grid .cart-qty,
  #cartItemList .cart-compact-grid .cart-total{
    display:flex !important;
    flex-direction:row !important;
    align-items:center !important;
    justify-content:center !important;
    box-sizing:border-box;
    width:100% !important;
    min-width:0 !important;
    min-height:34px !important;
    height:34px !important;
    padding:0 !important;
    gap:0 !important;
  }
  #cartItemList .cart-compact-grid .cart-price,
  #cartItemList .cart-compact-grid .cart-total{justify-content:flex-end !important;}
  #cartItemList .cart-compact-grid .cart-qty{justify-content:center !important;}
  #cartItemList .cart-compact-grid .cart-price .cart-money-value,
  #cartItemList .cart-compact-grid .cart-total .cart-money-value{
    display:block !important;
    box-sizing:border-box;
    width:100% !important;
    height:auto !important;
    min-height:0 !important;
    margin:0 !important;
    padding:0 !important;
    font-size:12px !important;
    line-height:18px !important;
    text-align:right !important;
    white-space:nowrap !important;
  }
  #cartItemList .cart-compact-grid .cart-price input.cart-money-value{
    display:block !important;
    box-sizing:border-box;
    width:100% !important;
    height:34px !important;
    min-height:34px !important;
    text-align:right !important;
  }
  #cartBottomSheet #cartItemList .cart-compact-grid .cart-qty{
    width:100% !important;
    min-width:0 !important;
  }
  #cartItemList .cart-compact-grid .cart-qty-control,
  #cartItemList .cart-compact-grid .cart-qty-readonly{
    box-sizing:border-box;
    flex:0 0 96px !important;
    width:96px !important;
    min-width:96px !important;
    min-height:34px !important;
    height:34px !important;
    padding:0 2px !important;
    margin:0 !important;
  }
  #cartItemList .cart-compact-grid .cart-qty-control{
    display:grid !important;
    grid-template-columns:30px 28px 30px !important;
    gap:1px !important;
  }
  #cartItemList .cart-compact-grid .cart-qty-control > button{
    box-sizing:border-box;
    min-width:30px !important;
    width:30px !important;
    min-height:30px !important;
    height:30px !important;
    padding:0 !important;
  }
  #cartItemList .cart-compact-grid .cart-qty-control > input{
    box-sizing:border-box;
    min-width:28px !important;
    width:28px !important;
    min-height:30px !important;
    height:30px !important;
    padding:0 !important;
  }
  #cartBottomSheet[data-cart-mode="preview"] #cartItemList .cart-compact-grid .cart-qty-readonly{
    flex:0 0 var(--cart-qty-readonly-track,32px) !important;
    width:var(--cart-qty-readonly-track,32px) !important;
    min-width:0 !important;
    padding:0 !important;
  }
  #cartItemList .cart-compact-grid .cart-qty-readonly{
    display:grid !important;
    place-items:center !important;
    border:0 !important;
    background:transparent !important;
    box-shadow:none !important;
  }
  #orderDetailContentToShare .order-detail-compact-grid .order-price,
  #orderDetailContentToShare .order-detail-compact-grid .order-total{
    justify-self:stretch !important;
    text-align:right !important;
    width:100% !important;
    min-width:0 !important;
  }
  #orderDetailContentToShare .order-detail-compact-grid .order-qty{
    justify-self:stretch !important;
    text-align:center !important;
    width:100% !important;
    min-width:0 !important;
  }
  #orderDetailContentToShare .order-detail-compact-grid .order-stt{
    width:100% !important;
    text-align:center !important;
  }
  #cartItemList .cart-compact-grid .cart-name,
  #orderDetailContentToShare .order-detail-compact-grid .order-name{
    overflow:hidden !important;
    white-space:nowrap !important;
    text-overflow:ellipsis !important;
  }
  /* In readonly mode, optional secondary notes must not crowd the name. */
  #cartItemList .cart-compact-grid[data-cart-readonly="1"] .cart-line-note:not([data-cart-note-id]){
    flex:0 1 auto !important;
    min-width:0 !important;
    max-width:48px !important;
  }
}

/* FIXED STYLE: cart-five-columns-no-implicit-areas-20261008
   Regression IMG_9481 17:40: legacy mobile .cart-left/.cart-price/.cart-qty/
   .cart-total still had grid-area:line/unit/quantity/subtotal. Turning the
   template areas off alone did NOT clear those item placements: CSS Grid
   implicitly created extra tracks and pushed the name/price out of view.
   All five visual cells must be auto-placed in the same explicit grid row. */
@media (max-width:480px){
  #cartBottomSheet .cart-compact-grid{
    grid-template-areas:none !important;
    grid-template-rows:auto !important;
    grid-auto-flow:row !important;
    grid-auto-columns:auto !important;
    grid-auto-rows:auto !important;
    row-gap:0 !important;
  }
  #cartBottomSheet .cart-compact-grid .cart-left,
  #cartBottomSheet .cart-compact-grid .cart-price,
  #cartBottomSheet .cart-compact-grid .cart-qty,
  #cartBottomSheet .cart-compact-grid .cart-total{
    grid-area:auto !important;
    grid-row:auto !important;
    grid-column:auto !important;
  }
  /* .cart-left is the holder of STT and name. Flatten it into exactly
     TWO direct CSS-grid cells without removing any note/edit handlers. */
  #cartBottomSheet .cart-compact-grid .cart-left{
    display:contents !important;
  }
  #cartBottomSheet .cart-compact-grid .cart-left > .min-w-0{
    min-width:0 !important;
    overflow:hidden;
  }
  /* STT and product name share the same vertically-centered item row. */
  #cartItemList .cart-compact-grid .cart-stt{
    box-sizing:border-box;
    display:flex !important;
    align-self:center !important;
    align-items:center !important;
    justify-content:center !important;
    min-height:34px !important;
    height:34px !important;
    padding:0 !important;
    line-height:1 !important;
  }
  #cartItemList .cart-compact-grid .cart-left > .min-w-0{
    display:flex !important;
    align-self:center !important;
    align-items:center !important;
    min-height:34px !important;
    height:34px !important;
  }
  #cartItemList .cart-compact-grid .cart-name{
    min-width:0 !important;
    max-width:100% !important;
    display:block !important;
    overflow:hidden !important;
    text-overflow:ellipsis !important;
    white-space:nowrap !important;
  }
  #cartItemList .cart-compact-grid .cart-price,
  #cartItemList .cart-compact-grid .cart-qty,
  #cartItemList .cart-compact-grid .cart-total{
    align-self:center !important;
    min-height:34px !important;
    height:34px !important;
  }
}

/* FIXED STYLE: cart-visual-numeric-gaps-and-name-note-popup-20261008
   Gap is measured by rendered content edges, not header boxes:
   [right edge of unit] ==gap== [outer qty left / number] ==gap==
   [outer qty right / number] ==gap== [LEFT edge of line total].
   Price is right aligned; total must START at its left numeric anchor.
   Track widths reserve the largest formatted values among all items. */
@media (max-width:480px){
  #cartBottomSheet .cart-compact-grid{
    grid-template-columns:22px minmax(0,1fr) var(--cart-unit-track,54px) 96px var(--cart-total-track,69px) !important;
    column-gap:4px !important;
    align-items:center !important;
  }
  #cartBottomSheet[data-cart-mode="preview"] .cart-compact-grid{
    grid-template-columns:22px minmax(0,1fr) var(--cart-unit-track,54px) var(--cart-qty-readonly-track,32px) var(--cart-total-track,69px) !important;
  }
  #cartBottomSheet .cart-column-header .cart-price{
    text-align:right !important;
  }
  #cartBottomSheet .cart-column-header .cart-qty{
    text-align:center !important;
  }
  #cartBottomSheet .cart-column-header .cart-total{
    text-align:left !important;
  }
  #cartBottomSheet #cartItemList .cart-compact-grid .cart-price,
  #cartBottomSheet #cartItemList .cart-compact-grid .cart-total{
    min-width:0 !important;
    width:100% !important;
  }
  #cartBottomSheet #cartItemList .cart-compact-grid .cart-price{
    display:flex !important;
    justify-content:flex-end !important;
    text-align:right !important;
  }
  #cartBottomSheet #cartItemList .cart-compact-grid .cart-total{
    display:flex !important;
    justify-content:flex-start !important;
    text-align:left !important;
  }
  #cartBottomSheet #cartItemList .cart-compact-grid .cart-price .cart-money-value:not(input),
  #cartBottomSheet #cartItemList .cart-compact-grid .cart-total .cart-money-value{
    flex:0 0 auto !important;
    display:block !important;
    width:auto !important;
    min-width:0 !important;
    max-width:100% !important;
    font-variant-numeric:tabular-nums;
    white-space:nowrap !important;
  }
  #cartBottomSheet #cartItemList .cart-compact-grid .cart-total .cart-money-value{
    text-align:left !important;
  }
  #cartBottomSheet #cartItemList .cart-compact-grid .cart-price input.cart-money-value{
    width:100% !important;
    min-width:0 !important;
    text-align:right !important;
  }
  #cartBottomSheet #cartItemList .cart-compact-grid .cart-qty{
    display:flex !important;
    align-items:center !important;
    justify-content:center !important;
    width:100% !important;
    min-width:0 !important;
    height:34px !important;
  }
  #cartBottomSheet #cartItemList .cart-compact-grid .cart-name-note-trigger{
    display:block !important;
    flex:1 1 100% !important;
    box-sizing:border-box;
    min-width:0 !important;
    width:100% !important;
    min-height:34px !important;
    height:34px !important;
    border:0;
    padding:0 !important;
    background:transparent;
    line-height:34px !important;
    text-align:left !important;
    white-space:nowrap !important;
    overflow:hidden !important;
    text-overflow:ellipsis !important;
    cursor:pointer;
  }
  #cartBottomSheet #cartItemList .cart-compact-grid .cart-left > .min-w-0{
    min-width:0 !important;
    width:100% !important;
    height:34px !important;
    overflow:hidden;
  }
}

/* Note UI belongs to a separate fixed layer, never inside the five columns. */
.cart-note-overlay{
  position:fixed;
  inset:0;
  z-index:100000;
  display:grid;
  place-items:center;
  box-sizing:border-box;
  padding:16px;
  padding-bottom:calc(16px + env(safe-area-inset-bottom,0px));
  background:rgba(15,23,42,.4);
}
.cart-note-dialog{
  box-sizing:border-box;
  width:min(100%,380px);
  padding:18px;
  border-radius:18px;
  background:#fff;
  box-shadow:0 16px 48px rgba(15,23,42,.2);
}
.cart-note-heading{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  color:#0f172a;
  font-size:16px;
}
.cart-note-close{
  flex:0 0 32px;
  width:32px;
  height:32px;
  border:0;
  border-radius:50%;
  background:#f1f5f9;
  color:#64748b;
  font-size:22px;
  cursor:pointer;
}
.cart-note-product{
  margin:6px 0 14px;
  color:#475569;
  font-size:13px;
  overflow-wrap:anywhere;
}
.cart-note-input,.cart-note-readonly{
  box-sizing:border-box;
  display:block;
  width:100%;
  min-height:84px;
  border:1px solid #cbd5e1;
  border-radius:10px;
  padding:10px 12px;
  font:inherit;
  font-size:14px;
  line-height:1.5;
  color:#0f172a;
  background:#fff;
  overflow-wrap:anywhere;
}
.cart-note-input:focus{outline:2px solid #16a34a;outline-offset:1px;}
.cart-note-readonly{background:#f8fafc;white-space:pre-wrap;}
.cart-note-actions{
  display:flex;
  justify-content:flex-end;
  gap:8px;
  margin-top:14px;
}
.cart-note-actions button{
  min-height:40px;
  border-radius:10px;
  padding:8px 16px;
  font-weight:700;
  cursor:pointer;
}
.cart-note-secondary{
  border:1px solid #cbd5e1;
  background:#fff;
  color:#475569;
}
.cart-note-save{
  border:1px solid #16a34a;
  background:#16a34a;
  color:#fff;
}

/* FIXED STYLE: cart-five-intrinsic-columns-20261008
   Sheet sample: A=STT, B=Tên, C=Đơn giá, D=SL, E=Thành tiền.
   Each data/header track is sized to the LARGEST measured content
   (including its label, price/total or full +/- control). Name can
   truncate only after the four numeric tracks and four EQUAL gutters
   have been reserved. No phantom flexible spacer columns.
   Runtime 6 sets all five --cart-*-track variables after rendering. */
/* Applies to the cart panel at ANY viewport width, including .pc-mode split pane. */
  #cartBottomSheet .cart-compact-grid,
  #cartBottomSheet[data-cart-mode="preview"] .cart-compact-grid{
    display:grid !important;
    grid-template-columns:
      var(--cart-stt-track,24px)
      minmax(0,1fr)
      var(--cart-unit-track,54px)
      var(--cart-qty-track,96px)
      var(--cart-total-track,69px) !important;
    grid-template-areas:none !important;
    grid-template-rows:auto !important;
    grid-auto-flow:row !important;
    column-gap:6px !important;
    row-gap:0 !important;
    justify-content:stretch !important;
    align-items:center !important;
  }
  #cartBottomSheet .cart-compact-grid .cart-left{
    display:contents !important;
    grid-area:auto !important;
  }
  #cartBottomSheet .cart-compact-grid .cart-stt{
    grid-area:auto !important;
    grid-column:1 !important;
    grid-row:1 !important;
  }
  #cartBottomSheet .cart-column-header .cart-name,
  #cartBottomSheet #cartItemList .cart-compact-grid .cart-left > .min-w-0{
    grid-area:auto !important;
    grid-column:2 !important;
    grid-row:1 !important;
    min-width:0 !important;
  }
  #cartBottomSheet .cart-compact-grid .cart-price{
    grid-area:auto !important;
    grid-column:3 !important;
    grid-row:1 !important;
  }
  #cartBottomSheet .cart-compact-grid .cart-qty{
    grid-area:auto !important;
    grid-column:4 !important;
    grid-row:1 !important;
  }
  #cartBottomSheet .cart-compact-grid .cart-total{
    grid-area:auto !important;
    grid-column:5 !important;
    grid-row:1 !important;
  }
  #cartBottomSheet .cart-column-header .cart-price{text-align:right !important;}
  #cartBottomSheet .cart-column-header .cart-qty{text-align:center !important;}
  #cartBottomSheet .cart-column-header .cart-total{text-align:right !important;}
  #cartBottomSheet #cartItemList .cart-compact-grid .cart-price{
    justify-content:flex-end !important;
  }
  #cartBottomSheet #cartItemList .cart-compact-grid .cart-total{
    justify-content:flex-start !important;
  }
  #cartBottomSheet #cartItemList .cart-compact-grid .cart-qty{
    justify-content:center !important;
    width:100% !important;
    min-width:0 !important;
  }
  #cartBottomSheet[data-cart-mode="edit"] #cartItemList .cart-compact-grid .cart-qty-control{
    display:grid !important;
    box-sizing:border-box;
    flex:0 0 var(--cart-qty-track,96px) !important;
    width:var(--cart-qty-track,96px) !important;
    min-width:0 !important;
    grid-template-columns:30px var(--cart-qty-input-track,28px) 30px !important;
    gap:1px !important;
    padding:0 2px !important;
    justify-content:center !important;
  }
  #cartBottomSheet[data-cart-mode="edit"] #cartItemList .cart-compact-grid .cart-qty-control > input{
    box-sizing:border-box;
    width:var(--cart-qty-input-track,28px) !important;
    min-width:0 !important;
    padding:0 !important;
  }
  #cartBottomSheet[data-cart-mode="preview"] #cartItemList .cart-compact-grid .cart-qty-readonly{
    flex:0 0 var(--cart-qty-track,32px) !important;
    width:var(--cart-qty-track,32px) !important;
    min-width:0 !important;
    padding:0 !important;
  }
  #cartBottomSheet #cartItemList .cart-compact-grid .cart-name-note-trigger{
    min-width:0 !important;
    max-width:100% !important;
    overflow:hidden !important;
    white-space:nowrap !important;
    text-overflow:ellipsis !important;
  }
  #cartBottomSheet #cartItemList .cart-compact-grid .cart-price{
    display:flex !important;
    align-items:center !important;
    justify-content:flex-end !important;
    text-align:right !important;
    min-width:0 !important;
  }
  #cartBottomSheet #cartItemList .cart-compact-grid .cart-total{
    display:flex !important;
    align-items:center !important;
    justify-content:flex-end !important;
    text-align:right !important;
    min-width:0 !important;
  }
  #cartBottomSheet #cartItemList .cart-compact-grid .cart-total .cart-money-value{
    flex:0 0 auto !important;
    width:auto !important;
    text-align:right !important;
    white-space:nowrap !important;
  }
  #cartBottomSheet #cartItemList .cart-compact-grid .cart-stt,
  #cartBottomSheet #cartItemList .cart-compact-grid .cart-left > .min-w-0{
    align-self:center !important;
    min-height:34px !important;
    height:34px !important;
  }
  #cartBottomSheet #cartItemList .cart-compact-grid .cart-stt{
    display:flex !important;
    align-items:center !important;
    justify-content:center !important;
    padding:0 !important;
    line-height:1 !important;
  }
  #cartBottomSheet #cartItemList .cart-compact-grid .cart-left > .min-w-0{
    display:flex !important;
    align-items:center !important;
    overflow:hidden;
  }
  #cartBottomSheet #cartItemList .cart-compact-grid .cart-name-note-trigger{
    display:block !important;
    box-sizing:border-box;
    flex:1 1 100% !important;
    width:100% !important;
    font-size:12px !important;
    line-height:34px !important;
    height:34px !important;
    min-height:34px !important;
    border:0 !important;
    padding:0 !important;
    background:transparent;
    text-align:left !important;
  }
  #cartBottomSheet #cartItemList .cart-compact-grid .cart-name-note-trigger::after{
    content:none !important;
    display:none !important;
  }
  #cartBottomSheet[data-cart-mode="edit"] #cartItemList .cart-compact-grid .cart-qty-control > button{
    box-sizing:border-box;
    width:30px !important;
    min-width:30px !important;
    height:30px !important;
    min-height:30px !important;
    padding:0 !important;
  }
  #cartBottomSheet[data-cart-mode="edit"] #cartItemList .cart-compact-grid .cart-qty-control > input{
    height:30px !important;
    min-height:30px !important;
  }



/* UI-94–100 / 2026-10-08: order detail 5-column responsive ruler.
   Override legacy nowrap quantity header to prevent price/qty/total collision.
   Same five tracks are applied to caption and every data row; no data fetch. */
#orderDetailContentToShare .order-detail-compact-grid{
  display:grid !important;
  grid-template-columns:22px minmax(0,1fr) 62px 48px 76px !important;
  column-gap:7px !important;
  grid-template-areas:none !important;
  justify-content:stretch !important;
  align-items:center !important;
  width:100% !important;
  min-width:0 !important;
}
#orderDetailContentToShare .order-column-header .order-price,
#orderDetailContentToShare .order-column-header .order-qty,
#orderDetailContentToShare .order-column-header .order-total{
  min-width:0 !important;
  box-sizing:border-box !important;
  line-height:1.2 !important;
}
#orderDetailContentToShare .order-column-header .order-qty{
  white-space:normal !important;
  overflow-wrap:normal !important;
  text-align:center !important;
}
#orderDetailContentToShare .order-column-header .order-price,
#orderDetailContentToShare .order-column-header .order-total{
  white-space:nowrap !important;
  text-align:right !important;
}
#orderDetailContentToShare .order-detail-compact-grid .order-name{
  min-width:0 !important;
  overflow:hidden !important;
  text-overflow:ellipsis !important;
}
#orderDetailContentToShare .order-detail-compact-grid .order-total{
  text-align:right !important;
  justify-self:stretch !important;
  font-variant-numeric:tabular-nums;
}
@media(max-width:360px){
  #orderDetailContentToShare .order-detail-compact-grid{
    grid-template-columns:18px minmax(0,1fr) 56px 43px 70px !important;
    column-gap:5px !important;
  }
}

/* UI-101 / 2026-10-08: align text and plain numbers by typographic baseline,
   never by the center of differently-sized font boxes. Editable steppers
   remain centered as full controls; each row uses one shared grid ruler. */
#orderDetailContentToShare #detailModalItems .order-detail-compact-grid{
  align-items:baseline !important;
}
#orderDetailContentToShare #detailModalItems .order-detail-compact-grid > .min-w-0{
  align-self:baseline !important;
  min-width:0 !important;
}
#orderDetailContentToShare #detailModalItems .order-detail-compact-grid :is(.order-stt,.order-price,.order-qty,.order-total){
  align-self:baseline !important;
  line-height:1.25 !important;
}
#cartBottomSheet[data-cart-mode="preview"] #cartItemList .cart-compact-grid{
  align-items:baseline !important;
}
#cartBottomSheet[data-cart-mode="preview"] #cartItemList .cart-compact-grid :is(.cart-stt,.cart-price,.cart-qty,.cart-total),
#cartBottomSheet[data-cart-mode="preview"] #cartItemList .cart-compact-grid .cart-left > .min-w-0{
  align-self:baseline !important;
}
#cartBottomSheet[data-cart-mode="preview"] #cartItemList .cart-compact-grid .cart-qty-readonly{
  align-self:baseline !important;
  line-height:1.25 !important;
}
#cartBottomSheet[data-cart-mode="edit"] #cartItemList .cart-compact-grid{
  align-items:center !important;
}
#cartBottomSheet[data-cart-mode="edit"] #cartItemList .cart-compact-grid .cart-qty-control{
  align-self:center !important;
}

/* UI-102 / 2026-10-08 — Gap theo CHẾ ĐỘ, cùng ruler header/body.
   Preview: quantity is a plain number, release control width to product name.
   Edit: protect the entire +/- stepper; never squeeze its border/buttons.
   All numeric columns stay right anchored, baseline rules remain unchanged. */
#cartBottomSheet[data-cart-mode="preview"] .cart-compact-grid{
  grid-template-columns:
    var(--cart-stt-track,24px) minmax(0,1fr)
    var(--cart-unit-track,54px)
    var(--cart-qty-track,32px)
    var(--cart-total-track,69px) !important;
  column-gap:7px !important;
  width:100% !important;
}
#cartBottomSheet[data-cart-mode="edit"] .cart-compact-grid{
  grid-template-columns:
    var(--cart-stt-track,24px) minmax(0,1fr)
    var(--cart-unit-track,54px)
    var(--cart-qty-track,96px)
    var(--cart-total-track,69px) !important;
  column-gap:6px !important;
  width:100% !important;
}
#cartBottomSheet .cart-compact-grid .cart-total{
  justify-self:stretch !important;
  justify-content:flex-end !important;
  text-align:right !important;
}
#cartBottomSheet .cart-column-header .cart-total{text-align:right !important;}

/* UI-103 — NUMBER AXIS FIRST (2026-10-08).
   Header is only a label; price digits end at C's right edge, total digits
   end at E's right edge. D's number is positioned halfway between
   price's digit end and the earliest edge of visible total digits.
   JS measures slack between width of E's label and widest total digits.
   Translate D as ONE unit (label / full +/- control / readonly number),
   never shift only the input or resize the control and break hit targets. */
#cartBottomSheet .cart-column-header .cart-qty{
  transform:translateX(var(--cart-numeric-axis-shift,0px)) !important;
}
#cartBottomSheet[data-cart-mode="edit"] #cartItemList .cart-compact-grid .cart-qty-control,
#cartBottomSheet[data-cart-mode="preview"] #cartItemList .cart-compact-grid .cart-qty-readonly{
  transform:translateX(var(--cart-numeric-axis-shift,0px)) !important;
}
#cartBottomSheet[data-cart-mode="edit"] #cartItemList .cart-compact-grid .cart-qty-control{
  justify-self:center !important;
  align-items:center !important;
}
#cartBottomSheet[data-cart-mode="edit"] #cartItemList .cart-compact-grid .cart-qty-control > input{
  justify-self:center !important;
  text-align:center !important;
  font-variant-numeric:tabular-nums;
}
#cartBottomSheet .cart-column-header .cart-price,
#cartBottomSheet #cartItemList .cart-compact-grid .cart-price{
  text-align:right !important;
}
#cartBottomSheet .cart-column-header .cart-total,
#cartBottomSheet #cartItemList .cart-compact-grid .cart-total,
#cartBottomSheet #cartItemList .cart-compact-grid .cart-total .cart-money-value{
  text-align:right !important;
}

/* UI-104 / 2026-10-08: native responsive order-detail table.
   The exported 720px image is for sharing, never a substitute for readable
   mobile text. Header and EACH row share the same measured C/D/E tracks.
   Reserve full captions to avoid "SL" touching "Thành tiền" at small widths.
   Description alone is flexible; E is right-anchored. */
#orderDetailContentToShare .order-detail-compact-grid{
  display:grid !important;
  grid-template-columns:
    var(--order-stt-track,24px)
    minmax(0,1fr)
    var(--order-price-track,60px)
    var(--order-qty-track,29px)
    var(--order-total-track,76px) !important;
  column-gap:7px !important;
  justify-content:stretch !important;
  min-width:0 !important;
  width:100% !important;
}
#orderDetailContentToShare .order-column-header{
  align-items:center !important;
}
#orderDetailContentToShare .order-column-header > *{
  box-sizing:border-box !important;
  min-width:0 !important;
  white-space:nowrap !important;
  overflow:visible !important;
}
#orderDetailContentToShare .order-detail-compact-grid :is(.order-price,.order-total){
  text-align:right !important;
  justify-self:stretch !important;
  font-variant-numeric:tabular-nums;
}
#orderDetailContentToShare .order-detail-compact-grid .order-qty{
  text-align:center !important;
  justify-self:stretch !important;
  font-variant-numeric:tabular-nums;
}
#orderDetailContentToShare .order-detail-compact-grid .order-stt{
  text-align:center !important;
  justify-self:stretch !important;
}
#orderDetailContentToShare #detailModalItems .order-detail-compact-grid{
  align-items:baseline !important;
}
@media(max-width:620px){
  #orderDetailContentToShare .order-detail-compact-grid{
    column-gap:6px !important;
  }
  #orderDetailContentToShare .order-column-header > *{
    font-size:11px !important;
    line-height:1.4 !important;
  }
  #orderDetailContentToShare #detailModalItems .order-detail-compact-grid{
    font-size:13px !important;
    min-height:46px !important;
    line-height:1.4 !important;
  }
  #orderDetailContentToShare #detailModalItems .order-detail-compact-grid .order-name{
    line-height:1.35 !important;
  }
}
@media(max-width:350px){
  #orderDetailContentToShare .order-detail-compact-grid{
    column-gap:4px !important;
  }
}

/* UI-104b: the actual numeric cell fills its measured grid track.
   Older global --num-*-cap width declarations must not shrink C/D/E
   inside the shared ruler, especially when a 2–3 digit SL is displayed. */
#orderDetailContentToShare .order-detail-compact-grid > :is(.order-stt,.order-price,.order-qty,.order-total){
  width:100% !important;
  min-width:0 !important;
  justify-self:stretch !important;
  box-sizing:border-box !important;
}
#orderDetailContentToShare .order-column-header .order-price,
#orderDetailContentToShare .order-column-header .order-total{
  text-align:right !important;
}
#orderDetailContentToShare .order-column-header .order-qty{
  text-align:center !important;
}
/* Narrow pane sizing follows the actual pane, not merely the browser viewport. */
#orderDetailContentToShare.order-readable-compact .order-column-header > *{
  font-size:11px !important;
  line-height:1.35 !important;
}
#orderDetailContentToShare.order-readable-compact #detailModalItems .order-detail-compact-grid{
  font-size:14px !important;
  min-height:46px !important;
  line-height:1.4 !important;
  column-gap:6px !important;
}
#orderDetailContentToShare.order-readable-compact #detailModalItems .order-name{
  line-height:1.35 !important;
}

/* UI-105 CANONICAL: BODY ROW FIRST, CAPTION SECOND.
   Never move price, quantity input, total or shared data tracks to fix labels.
   Header SL/Số lượng may shift only within the remaining clear space before
   "Thành tiền". JS measures the ACTUAL rendered caption glyph bounds and
   clamps label-only offset, reserving at least 8px of visible separation. */
#cartBottomSheet .cart-column-header .cart-qty{
  transform:translateX(var(--cart-header-axis-shift,0px)) !important;
  white-space:nowrap !important;
  text-align:center !important;
}
#cartBottomSheet .cart-column-header .cart-total{
  transform:none !important;
  text-align:right !important;
  white-space:nowrap !important;
}

/* UI-115 — Fast sale note: no inline editor or empty note row.
   The note affordance appears only when product quantity > 0.
   It shares the price row so vertical swiping stays fast. */
#tab-ban-hang .sale-note-inline:not(.hidden){
  display:inline-flex !important;
  align-items:center;
  flex:0 1 auto;
  min-width:0;
  max-width:116px;
}
#tab-ban-hang .sale-note-trigger{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:4px;
  flex:0 1 auto;
  min-width:36px;
  max-width:100%;
  height:34px;
  padding:0 6px;
  border:0;
  border-radius:8px;
  background:#f8fafc;
  color:#64748b;
  cursor:pointer;
  touch-action:manipulation;
  -webkit-tap-highlight-color:transparent;
}
#tab-ban-hang .sale-note-trigger:focus-visible{
  outline:2px solid #16a34a;
  outline-offset:2px;
}
#tab-ban-hang .sale-note-trigger.has-note{
  background:#f0fdf4;
  color:#15803d;
}
#tab-ban-hang .sale-note-trigger > i{
  font-size:14px;
  flex:none;
}
#tab-ban-hang .sale-note-trigger .sale-note-summary:not(.hidden){
  min-width:0;
  max-width:84px;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
  text-align:left;
  font-size:11px;
  font-weight:650;
  line-height:1.2;
}
@media(max-width:640px){
  /* Notes are a one-purpose bottom sheet, not a second tall central modal.
     Adjust to dynamic viewport and keyboard without changing cart scroll. */
  .cart-note-overlay{
    display:flex;
    justify-content:center;
    align-items:flex-end;
    padding:0 !important;
    overflow-y:auto;
    overscroll-behavior:contain;
  }
  .cart-note-dialog{
    width:100%;
    max-width:480px;
    max-height:calc(var(--cart-note-visible-height,100dvh) - 8px);
    overflow-y:auto;
    border-radius:20px 20px 0 0;
    padding:18px 18px calc(18px + env(safe-area-inset-bottom,0px));
  }
}

/* UI-116: two-line note by default; expand only for actual content.
   On iPhone use 16px so focusing a note never zooms the whole app. */
.cart-note-input{
  height:52px;
  min-height:52px;
  max-height:120px;
  resize:none;
  overflow-y:hidden;
}
@media(max-width:640px){
  .cart-note-input{font-size:16px;}
  .cart-note-dialog{
    scroll-padding-bottom:calc(16px + env(safe-area-inset-bottom,0px));
  }
}

/* UI-122: sale cards must never resize when SL changes 0 ↔ 1.
   The note icon is painted beside the price but OUT OF FLOW;
   no additional row, height, padding, or margin on selection. */
#tab-ban-hang .product-card .sale-product-price-row{
  position:relative;
  height:20px;
  min-height:20px;
  max-height:20px;
  flex-wrap:nowrap;
  line-height:20px;
}
#tab-ban-hang .product-card .sale-product-price-row > .sale-note-inline:not(.hidden){
  display:block !important;
  position:relative;
  flex:0 0 0px !important;
  width:0 !important;
  min-width:0 !important;
  max-width:0 !important;
  height:0 !important;
  margin:0 !important;
  padding:0 !important;
  overflow:visible;
}
#tab-ban-hang .product-card .sale-product-price-row > .sale-note-inline .sale-note-trigger{
  position:absolute !important;
  left:1px;
  top:0;
  transform:translateY(-50%);
  box-sizing:border-box;
  height:32px;
  width:max-content;
  min-width:32px;
  max-width:76px;
  padding:0 5px;
  white-space:nowrap;
}
#tab-ban-hang .product-card .sale-product-price-row .sale-note-summary:not(.hidden){
  max-width:41px;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}


/* UI-130: crisp icons and compact reprice button for the pending-order cart. */
#cartBottomSheet #cartItemList .cart-qty-control > button svg{
 display:block;width:16px;height:16px;flex:none;stroke-width:3;
}
/* UI-130 contrast refinement: minus is now legible against gray. */
#cartBottomSheet #cartItemList .cart-qty-control > button:first-child,
#tab-ban-hang .product-card button[onclick^="updateCart("]:first-child{
 color:#334155 !important;background:#e9eef5 !important;
}
#cartBottomSheet #cartItemList .cart-qty-control > button:last-child{color:#fff !important;}
#tab-ban-hang .product-card button[onclick^="updateCart("] i{
 font-size:14px !important;line-height:1 !important;
}
#cartBottomSheet #cartItemList .cart-qty-control > button{transform:none !important;}
#cartBottomSheet .cart-edit-header-group{flex-wrap:wrap;min-width:0;row-gap:5px;}
#cartBottomSheet .cart-price-refresh{
 display:inline-flex;align-items:center;justify-content:center;
 min-height:28px;padding:4px 9px;border:1px solid #c7d7ef;border-radius:8px;
 background:#eff6ff;color:#1d4ed8;font-size:11px;font-weight:700;line-height:1.2;white-space:nowrap;
}
#cartBottomSheet .cart-price-refresh.hidden{display:none !important;}
#cartBottomSheet .cart-price-refresh:disabled{opacity:.55;pointer-events:none;}
#cartBottomSheet .cart-price-refresh:focus-visible{outline:2px solid #2563eb;outline-offset:2px;}
/* UI-PRICE-ACTIONS-20261116: full-width price tools immediately below
   cart title, outside the cramped share/close/badge flex row. */
#cartBottomSheet .cart-price-actions{
  display:flex;align-items:center;gap:8px;flex-wrap:wrap;
  flex:0 0 auto;min-width:0;
  padding:8px 16px;border-bottom:1px solid #e2e8f0;background:#f8fafc;
}
#cartBottomSheet .cart-price-actions.hidden{display:none!important;}
#cartBottomSheet .cart-price-actions-label{
  flex:0 0 auto;color:#64748b;font-size:12px;font-weight:750;
}
#cartBottomSheet .cart-price-actions .cart-price-refresh{
  min-height:32px;font-size:12px;padding:6px 12px;
}
#cartBottomSheet .cart-price-special{
  border-color:#9bd8bd;background:#effcf5;color:#127747;
}

@media(max-width:400px){
 #cartBottomSheet .cart-price-refresh{min-height:26px;padding:3px 7px;font-size:10px;}
}

/* UI-130C — Crisp GREEN + edge in Cart only (image 2026-10-09).
   Preserve the existing 30px button and the same five-column ruler.
   Do not leave a blurry ring from the former shadow-sm wrapper. */
#cartBottomSheet #cartItemList .cart-compact-grid .cart-qty-control{
  box-shadow:none !important;
  filter:none !important;
  transform:none !important;
}
#cartBottomSheet #cartItemList .cart-compact-grid .cart-qty-control > button:last-child{
  -webkit-appearance:none;
  appearance:none;
  box-shadow:none !important;
  filter:none !important;
  -webkit-filter:none !important;
  border:0 !important;
  background-clip:padding-box;
  border-radius:50% !important;
  transform:none !important;
  opacity:1 !important;
  outline:0;
}
#cartBottomSheet #cartItemList .cart-compact-grid .cart-qty-control > button:last-child:focus-visible{
  outline:2px solid #065f46;
  outline-offset:2px;
}

/* UI-132/133/134 / 2026-10-09: preserve circular painted shape despite compressed button viewport.
   Screenshot proved rendered 30px wide x 34px tall due to clipping at
   the 96px quantity-column edge. Leave 2px breathing room each side:
   92px framed control = border 2 + 32px minus + 1px gap + 24px number
   + 1px gap + 32px plus. Source Sales Phosphor glyph is preserved.
   Each button is a locked 32 x 32 square with a circular painted edge.
   No scale, shadow, backend or order data changes. */
#cartBottomSheet[data-cart-mode="edit"] #cartItemList .cart-compact-grid .cart-qty-control {
  box-sizing:border-box !important;
  width:92px !important;
  min-width:92px !important;
  max-width:92px !important;
  height:34px !important;
  min-height:34px !important;
  max-height:34px !important;
  justify-self:center !important;
  display:grid !important;
  grid-template-columns:32px 24px 32px !important;
  gap:1px !important;
  padding:0 !important;
  border:1px solid #e2e8f0 !important;
  border-radius:999px !important;
  background:#fff !important;
  box-shadow:none !important;
  filter:none !important;
  transform:none !important;
}
#cartBottomSheet[data-cart-mode="edit"] #cartItemList .cart-compact-grid .cart-qty-control > button {
  box-sizing:border-box !important;
  width:32px !important;
  min-width:32px !important;
  max-width:32px !important;
  height:32px !important;
  min-height:32px !important;
  max-height:32px !important;
  aspect-ratio:1 / 1 !important;
  flex:0 0 32px !important;
  margin:0 !important;
  padding:0 !important;
  border:0 !important;
  border-radius:50% !important;
  box-shadow:none !important;
  filter:none !important;
  transform:none !important;
  transition:none !important;
  display:grid !important;
  place-items:center !important;
}
#cartBottomSheet[data-cart-mode="edit"] #cartItemList .cart-compact-grid .cart-qty-control > button:last-child {
  background:transparent !important;
  background-image:none !important;
  color:#fff !important;
  opacity:1 !important;
  overflow:visible !important;
}
/* Paint the green disk inside a square SVG with xMidYMid meet, not
   on the HTML button. Even a 30x34 button viewport yields a 30x30 circle.
   This is intentionally scoped to the Cart "+"; Sales remains unchanged. */
#cartBottomSheet[data-cart-mode="edit"] #cartItemList .cart-compact-grid .cart-qty-control > button:last-child svg.cart-plus-circle {
  display:block !important;
  flex:0 0 auto !important;
  width:30px !important;
  min-width:30px !important;
  max-width:30px !important;
  height:30px !important;
  min-height:30px !important;
  max-height:30px !important;
  aspect-ratio:1 / 1 !important;
  overflow:visible !important;
  transform:none !important;
  filter:none !important;
  box-shadow:none !important;
}
#cartBottomSheet[data-cart-mode="edit"] #cartItemList .cart-compact-grid .cart-qty-control > input {
  box-sizing:border-box !important;
  width:24px !important;
  min-width:24px !important;
  height:32px !important;
  min-height:32px !important;
  margin:0 !important;
  padding:0 !important;
  text-align:center !important;
  font-variant-numeric:tabular-nums;
}


/* SPEC-TAPHOA-MILK-X-CART-20261116: Milk product ending in a standalone X is high-priced.
   Highlight only the final X and that row's quantity, without changing its totals. */
#cartBottomSheet #cartItemList .cart-milk-x-marker,
#cartBottomSheet #cartItemList .cart-milk-x-qty {
  color:#dc2626 !important;
}

/* SPEC-TAPHOA-CART-REVIEW-20261116 — picking checks belong inside the SL
   track, preserving the canonical five-column ruler and item index. */
#cartBottomSheet .cart-review-bar{
  display:flex;justify-content:space-between;align-items:center;gap:10px;
  flex-wrap:wrap;flex:0 0 auto;min-height:34px;padding:7px 16px;
  background:#f8fafc;border-bottom:1px solid #e2e8f0;
  font-size:11px;line-height:1.25;color:#475569;
}
#cartBottomSheet .cart-review-bar[hidden]{display:none !important}
#cartBottomSheet .cart-review-heading{font-weight:800;color:#0f172a;white-space:nowrap}
#cartBottomSheet .cart-review-message{font-size:10px;color:#64748b}
#cartBottomSheet .cart-review-finished{background:#f0fdf4;border-bottom-color:#bbf7d0}
#cartBottomSheet .cart-review-finished .cart-review-message{color:#15803d;font-weight:700}
#cartBottomSheet #cartItemList .cart-row-reviewed{background:#f0fdf4}
#cartBottomSheet #cartItemList .cart-review-qty{
  box-sizing:border-box;display:flex;justify-content:center;align-items:center;
  gap:4px;width:var(--cart-qty-readonly-track,56px);
  min-width:0;max-width:100%;height:34px;
}
#cartBottomSheet #cartItemList .cart-review-checkbox{
  appearance:auto !important;-webkit-appearance:checkbox !important;
  box-sizing:border-box !important;flex:0 0 20px !important;
  width:20px !important;height:20px !important;min-width:20px !important;
  margin:0 !important;padding:0 !important;accent-color:#16a34a;
  cursor:pointer;touch-action:manipulation;
}
#cartBottomSheet[data-cart-review="1"] #cartItemList .cart-compact-grid .cart-review-qty .cart-qty-readonly{
  flex:0 0 calc(var(--cart-qty-readonly-track,56px) - 24px) !important;
  width:calc(var(--cart-qty-readonly-track,56px) - 24px) !important;
  min-width:0 !important;max-width:none !important;
  padding:0 !important;margin:0 !important;
}
#cartBottomSheet #cartItemList .cart-review-checkbox:focus-visible{
  outline:2px solid #15803d;outline-offset:3px;
}
