
.sf-mobile-only{display:none!important}
@media(max-width:768px){
  :root{--m-red:#ee4d2d;--m-pink:#df4777;--m-teal:#20aaa2;--m-bg:#f5f5f5;--m-line:#ededed;--m-text:#222}
  html{scroll-behavior:smooth}
  body.page-home,body.page-product{margin:0;background:var(--m-bg);font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Arial,sans-serif;color:var(--m-text);overflow-x:hidden}
  body.page-home .header,body.page-product .header,body.page-home .footer,body.page-product .footer{display:none!important}
  .sf-mobile-only{display:block!important}
  .sf-desktop-home,.sf-desktop-product{display:none!important}
  body.page-home .flashes,body.page-product .flashes{position:fixed;left:10px;right:10px;top:10px;z-index:250}

  /* Mobile shop home */
  .sf-mobile-home{padding-bottom:80px;min-height:100vh}
  .m-home-header{background:#fff;padding:calc(12px + env(safe-area-inset-top)) 14px 12px;position:relative;z-index:30}
  .m-home-brandline{display:grid;grid-template-columns:46px minmax(0,1fr) auto auto;align-items:center;gap:10px}
  .m-home-brandline>img{width:46px;height:46px;border-radius:50%;object-fit:cover;border:1px solid #f1d9e2}
  .m-home-brandline h1{font-size:19px;margin:0 0 3px;font-weight:750;letter-spacing:-.2px}
  .m-home-brandline p{font-size:11px;color:#777;margin:0;display:flex;align-items:center;gap:4px}
  .m-online-dot{width:7px;height:7px;border-radius:50%;background:#20c07a;display:inline-block}
  .m-home-chat{height:34px;border:1px solid var(--m-pink);color:var(--m-pink);background:#fff;border-radius:6px;padding:0 12px;font-weight:650}
  .m-home-cart{position:relative;width:38px;height:38px;border-radius:50%;display:grid;place-items:center;background:#fff3f7;text-decoration:none;font-size:17px}
  .m-home-cart span{position:absolute;right:-2px;top:-4px;min-width:17px;height:17px;padding:0 3px;border-radius:9px;background:var(--m-pink);color:#fff;font-size:9px;display:grid;place-items:center;border:2px solid #fff}
  .m-home-search{height:42px;margin-top:11px;border-radius:8px;background:#f4f4f4;display:grid;grid-template-columns:30px minmax(0,1fr) 46px;align-items:center;padding:0 4px 0 9px}
  .m-home-search span{font-size:22px;color:#777;transform:rotate(-15deg)}
  .m-home-search input{min-width:0;border:0;outline:0;background:transparent;font-size:13px}
  .m-home-search button{height:34px;border:0;border-radius:6px;background:var(--m-pink);color:#fff;font-size:11px;font-weight:700}
  .m-home-tabs{position:sticky;top:0;z-index:25;background:#fff;height:48px;display:grid;grid-template-columns:repeat(3,1fr);border-top:1px solid #f4f4f4;border-bottom:1px solid var(--m-line)}
  .m-home-tabs a{display:grid;place-items:center;text-decoration:none;color:#333;font-size:14px;position:relative}
  .m-home-tabs a.active{color:var(--m-pink);font-weight:700}
  .m-home-tabs a.active:after{content:"";position:absolute;bottom:0;width:65%;height:3px;border-radius:3px;background:var(--m-pink)}
  .m-category-strip{display:flex;gap:10px;overflow-x:auto;padding:12px 12px 11px;background:#fff;border-bottom:8px solid var(--m-bg);scrollbar-width:none}
  .m-category-strip::-webkit-scrollbar{display:none}
  .m-category-strip a{min-width:92px;display:grid;grid-template-columns:42px 1fr;align-items:center;gap:7px;text-decoration:none;color:#333;background:#fafafa;border-radius:8px;padding:7px}
  .m-category-strip span{width:42px;height:42px;border-radius:7px;background:#fff1f5;display:grid;place-items:center;font-size:21px}
  .m-category-strip b{font-size:11px;line-height:1.25;font-weight:600}
  .m-home-section{background:#fff;margin-bottom:8px;padding:14px 10px}
  .m-section-heading{display:flex;align-items:center;justify-content:space-between;margin-bottom:11px}
  .m-section-heading h2{font-size:18px;margin:0;font-weight:750}
  .m-section-heading a,.m-section-heading span{font-size:11px;color:#999;text-decoration:none}
  .m-horizontal-products{display:flex;gap:9px;overflow-x:auto;scroll-snap-type:x proximity;padding-bottom:3px;scrollbar-width:none}
  .m-horizontal-products::-webkit-scrollbar{display:none}
  .m-product-card{background:#fff;border-radius:8px;overflow:hidden;text-decoration:none;color:#222;border:1px solid #ececec;display:flex;flex-direction:column;min-width:0}
  .m-product-card.horizontal{flex:0 0 45%;scroll-snap-align:start}
  .m-product-image{position:relative;aspect-ratio:1/1;overflow:hidden;background:#f5f5f5}
  .m-product-image img{width:100%;height:100%;object-fit:cover;display:block}
  .m-photo-badge{position:absolute;left:6px;bottom:6px;padding:2px 5px;border-radius:3px;background:rgba(20,20,20,.55);color:#fff;font-size:7px;letter-spacing:.08em}
  .m-product-copy{padding:8px 9px 10px;min-width:0}
  .m-product-title{font-size:12px;line-height:1.35;height:32px;overflow:hidden;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;color:#222}
  .m-product-price{font-size:17px;color:var(--m-red);margin-top:5px;font-weight:650}
  .m-price-note{display:inline-block;margin-top:4px;padding:2px 4px;border-radius:2px;background:#fff0ed;color:var(--m-red);font-size:8px}
  .m-product-meta{margin-top:6px;display:flex;gap:6px;align-items:center;font-size:9px;color:#555;white-space:nowrap}
  .m-rating{border:1px solid #f0b925;color:#b07a00;padding:2px 4px;border-radius:2px;background:#fffdf2}
  .m-product-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
  .m-bestseller{background:linear-gradient(180deg,#fff2f6,#fff8fa)}
  .m-rank-list{display:grid;gap:9px}
  .m-rank-item{display:grid;grid-template-columns:118px minmax(0,1fr);gap:12px;padding:9px;background:#fff;border-radius:10px;text-decoration:none;color:#222;box-shadow:0 4px 14px rgba(74,45,58,.05)}
  .m-rank-item img{width:118px;height:118px;border-radius:8px;object-fit:cover}
  .m-rank-item>div{display:flex;flex-direction:column;min-width:0;padding:4px 0}
  .m-rank-item span{align-self:flex-start;padding:3px 8px;border-radius:9px;background:#fff0dd;color:#dc6d1e;font-size:11px;font-weight:800}
  .m-rank-item b{margin-top:7px;font-size:13px;line-height:1.35;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
  .m-rank-item small{margin-top:auto;color:#999;font-size:10px}
  .m-rank-item strong{color:var(--m-red);font-size:16px;margin-top:5px}
  .m-empty{padding:40px;text-align:center;color:#888;font-size:13px}

  /* Product detail */
  body.page-product{padding-bottom:calc(74px + env(safe-area-inset-bottom))}
  body.page-product .sf-chat-launcher{display:none!important}
  .sf-mobile-product{min-height:100vh;background:var(--m-bg)}
  .m-product-floatbar{position:fixed;top:calc(10px + env(safe-area-inset-top));left:10px;right:10px;z-index:65;display:flex;justify-content:space-between;pointer-events:none}
  .m-product-floatbar>div{display:flex;gap:8px}
  .m-circle-action{pointer-events:auto;width:38px;height:38px;border-radius:50%;border:0;background:rgba(25,25,25,.46);color:#fff;display:grid;place-items:center;text-decoration:none;font-size:23px;backdrop-filter:blur(8px);position:relative}
  a.m-circle-action{font-size:17px}
  .m-circle-action span{position:absolute;right:-4px;top:-5px;min-width:18px;height:18px;border-radius:10px;background:var(--m-red);color:#fff;font-size:9px;display:grid;place-items:center;border:2px solid #fff}
  .m-gallery{position:relative;background:#111;overflow:hidden}
  .m-gallery-track{display:flex;overflow-x:auto;scroll-snap-type:x mandatory;overscroll-behavior-x:contain;scrollbar-width:none}
  .m-gallery-track::-webkit-scrollbar{display:none}
  .m-gallery-slide{flex:0 0 100%;scroll-snap-align:center;aspect-ratio:1/1;background:#f2f2f2}
  .m-gallery-slide img{width:100%;height:100%;object-fit:cover;display:block}
  .m-gallery-counter{position:absolute;right:12px;bottom:12px;background:rgba(0,0,0,.48);color:#fff;font-size:11px;height:27px;min-width:45px;border-radius:14px;display:grid;place-items:center;padding:0 8px}
  .m-product-summary{background:#fff;padding:13px 14px 15px;border-bottom:1px solid var(--m-line)}
  .m-summary-price{display:flex;align-items:center;gap:7px;flex-wrap:wrap}
  .m-summary-price strong{font-size:24px;color:var(--m-red);font-weight:650;letter-spacing:-.4px}
  .m-summary-price>span{padding:3px 5px;background:#fff0ed;color:var(--m-red);font-size:9px;border-radius:2px}
  .m-summary-price small{margin-left:auto;font-size:11px;color:#555}
  .m-product-summary h1{font-size:16px;line-height:1.4;margin:10px 0 9px;font-weight:500}
  .m-summary-rating{display:flex;align-items:center;gap:12px;font-size:11px}
  .m-summary-rating span{color:#eaa10a}.m-summary-rating a{color:#666;text-decoration:none}.m-summary-rating button{margin-left:auto;border:0;background:#fff;color:var(--m-pink);font-size:11px}
  .m-info-list{background:#fff;margin-top:8px;border-top:1px solid var(--m-line);border-bottom:1px solid var(--m-line)}
  .m-info-list>div{min-height:68px;display:grid;grid-template-columns:28px minmax(0,1fr) 18px;align-items:center;gap:8px;padding:10px 14px;border-bottom:1px solid var(--m-line)}
  .m-info-list>div:last-child{border-bottom:0}.m-info-list>div>span{font-size:20px}.m-info-list p{margin:0}.m-info-list b{font-size:13px;font-weight:550}.m-info-list small{display:block;margin-top:4px;color:#888;font-size:10px;line-height:1.35}.m-info-list i{font-size:22px;color:#bbb;font-style:normal}
  .m-select-row{width:100%;border:0;background:#fff;margin-top:8px;min-height:58px;padding:0 14px;display:flex;align-items:center;justify-content:space-between;text-align:left}
  .m-select-row span{display:flex;align-items:center;gap:7px}.m-select-row b{font-size:14px}.m-select-row small{font-size:12px;color:#999}.m-select-row i{font-size:22px;color:#bbb;font-style:normal}
  .m-mobile-shop-card{margin-top:8px;background:#fff;padding:13px 14px;display:grid;grid-template-columns:46px minmax(0,1fr) auto auto;gap:9px;align-items:center}
  .m-mobile-shop-card img{width:46px;height:46px;border-radius:50%;object-fit:cover}.m-mobile-shop-card b{display:block;font-size:14px}.m-mobile-shop-card small{display:block;margin-top:4px;font-size:10px;color:#777}.m-mobile-shop-card small span{display:inline-block;width:6px;height:6px;border-radius:50%;background:#20c07a;margin-right:3px}.m-mobile-shop-card button,.m-mobile-shop-card a{height:32px;border-radius:5px;padding:0 10px;display:grid;place-items:center;text-decoration:none;font-size:10px}.m-mobile-shop-card button{border:1px solid var(--m-pink);background:#fff;color:var(--m-pink)}.m-mobile-shop-card a{border:1px solid #ddd;color:#555}
  .m-content-section{background:#fff;margin-top:8px;padding:14px}
  .m-section-title{display:flex;justify-content:space-between;align-items:center;margin-bottom:12px}.m-section-title h2{margin:0;font-size:16px}.m-section-title h2 span{font-weight:400;color:#666}.m-section-title a{font-size:11px;color:#777;text-decoration:none}
  .m-review{padding:11px 0;border-top:1px solid var(--m-line)}.m-review:first-child{border-top:0}.m-review-head{display:flex;gap:8px;align-items:center}.m-review-head>span{width:32px;height:32px;border-radius:50%;background:#fff0f5;display:grid;place-items:center}.m-review-head b{display:block;font-size:12px}.m-review-head small{color:#e4a10c}.m-review p{font-size:12px;line-height:1.5;margin:8px 0 4px}.m-review>small,.m-muted{font-size:10px;color:#999}
  .m-mobile-description{font-size:13px;line-height:1.55;color:#555;overflow:hidden}.m-mobile-description.collapsed{max-height:170px;position:relative}.m-mobile-description.collapsed:after{content:"";position:absolute;left:0;right:0;bottom:0;height:48px;background:linear-gradient(transparent,#fff)}.m-description-toggle{width:100%;height:38px;border:0;background:#fff;color:#333;font-size:12px}
  .m-mobile-suggestions{padding-left:8px;padding-right:8px}
  .m-product-actions{position:fixed;z-index:70;left:0;right:0;bottom:0;height:calc(66px + env(safe-area-inset-bottom));padding-bottom:env(safe-area-inset-bottom);display:grid;grid-template-columns:25% 30% 45%;background:#fff;border-top:1px solid #ddd;box-shadow:0 -5px 18px rgba(0,0,0,.08)}
  .m-product-actions button{border:0;font-size:11px;font-weight:500}.m-action-chat{background:var(--m-teal);color:#fff;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:2px}.m-action-chat span{font-size:22px}.m-action-cart{background:#28b7aa;color:#fff;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:2px}.m-action-cart span{font-size:20px}.m-action-buy{background:var(--m-red);color:#fff;font-size:14px!important}.m-action-buy strong{font-size:17px}

  /* Purchase bottom sheet */
  .m-purchase-overlay{position:fixed;inset:0;z-index:180;background:rgba(0,0,0,.42);display:none;align-items:flex-end}
  .m-purchase-overlay.open{display:flex}
  .m-purchase-sheet{width:100%;max-height:88dvh;background:#fff;border-radius:17px 17px 0 0;padding:18px 14px calc(14px + env(safe-area-inset-bottom));overflow-y:auto;animation:mSheetUp .2s ease-out;position:relative}
  @keyframes mSheetUp{from{transform:translateY(35%);opacity:.5}to{transform:none;opacity:1}}
  .m-sheet-close{position:absolute;right:12px;top:10px;width:34px;height:34px;border-radius:50%;border:0;background:#f5f5f5;font-size:22px;color:#888;z-index:2}
  .m-sheet-product{display:grid;grid-template-columns:92px minmax(0,1fr);gap:13px;align-items:end;padding-right:42px;padding-bottom:14px;border-bottom:1px solid var(--m-line)}
  .m-sheet-product img{width:92px;height:92px;object-fit:cover;border-radius:8px}.m-sheet-product strong{display:block;color:var(--m-red);font-size:21px;line-height:1.25}.m-sheet-product small{display:block;margin-top:8px;color:#888;font-size:11px}
  .m-sheet-block{padding:15px 0;border-bottom:1px solid var(--m-line)}.m-sheet-block h3{font-size:14px;margin:0 0 10px}
  .m-sheet-variants{display:flex;flex-wrap:wrap;gap:8px}.m-sheet-variants button{border:1px solid #eee;background:#f7f7f7;border-radius:6px;min-height:46px;padding:5px 9px;display:flex;align-items:center;gap:7px;color:#333;font-size:11px}.m-sheet-variants button img{width:34px;height:34px;border-radius:4px;object-fit:cover}.m-sheet-variants button.active{border-color:var(--m-red);background:#fff8f6;color:var(--m-red);box-shadow:0 0 0 1px var(--m-red)}.m-sheet-variants button:disabled{opacity:.45}
  .m-sheet-qty{min-height:70px;display:flex;align-items:center;justify-content:space-between}.m-sheet-qty b{display:block;font-size:14px}.m-sheet-qty small{display:block;margin-top:3px;color:#888;font-size:10px}.m-sheet-qty>div:last-child{display:grid;grid-template-columns:38px 48px 38px}.m-sheet-qty button,.m-sheet-qty input{height:36px;border:1px solid #ddd;background:#fff;text-align:center}.m-sheet-qty button:first-child{border-radius:6px 0 0 6px}.m-sheet-qty button:last-child{border-radius:0 6px 6px 0}.m-sheet-qty input{border-left:0;border-right:0;outline:0;width:48px}
  .m-sheet-submit{width:100%;height:48px;border:0;border-radius:6px;background:var(--m-red);color:#fff;font-size:15px;font-weight:700}.m-sheet-submit:disabled{background:#ddd;color:#999}
  body.m-sheet-open{overflow:hidden}
}


/* v1.0.13 — Tối ưu lại bố cục mobile cho giỏ hàng / thanh toán, tránh xuống dòng vô lý */
@media(max-width:768px){
  .page-tools{display:flex;gap:10px;align-items:center;flex-wrap:wrap;padding:10px 14px 0}
  .page-tools .backbtn,.page-tools .homequick{
    min-height:42px;padding:0 14px;border-radius:10px;display:inline-flex;align-items:center;justify-content:center;
    font-size:15px;font-weight:650;white-space:nowrap
  }

  .cartpage,.checkoutpage,.trackpage,.detailpage{padding-left:12px!important;padding-right:12px!important}
  .cartpage .breadcrumb,.checkoutpage .breadcrumb,.trackpage .breadcrumb{font-size:14px;margin:8px 2px 12px;color:#7b7580}

  .cartbox{border-radius:16px;overflow:hidden}
  .carthead{display:none!important}
  .cartrow{
    display:grid!important;
    grid-template-columns:minmax(0,1fr) auto!important;
    grid-template-areas:
      'product qty'
      'price price';
    gap:12px 10px;
    padding:16px 14px!important;
    align-items:start!important;
    border-bottom:1px solid #f1edf0;
    background:#fff;
  }
  .cartproduct{grid-area:product;display:grid!important;grid-template-columns:88px minmax(0,1fr);gap:12px;align-items:start;min-width:0}
  .cartproduct img{width:88px!important;height:88px!important;border-radius:12px;object-fit:cover;display:block}
  .cartproduct a{text-decoration:none;color:#222}
  .cartproduct b{
    display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;
    font-size:14px;line-height:1.4;font-weight:700;word-break:break-word
  }
  .cartproduct .variant{margin-top:6px;font-size:12px;line-height:1.35;color:#8d8890;word-break:break-word}
  .cartrow>div:nth-child(2){display:none!important}
  .cartrow>div:nth-child(3){grid-area:qty;justify-self:end;align-self:start}
  .cartrow>div:nth-child(4){grid-area:price;display:flex!important;justify-content:flex-end;align-items:center}
  .cartprice{font-size:18px!important;font-weight:800;color:#df4777;line-height:1.1;white-space:nowrap}

  .qty{display:grid!important;grid-template-columns:40px 54px 40px;align-items:center}
  .qty form,.qty input{margin:0!important}
  .qty button,.qty input{height:40px!important;border:1px solid #e7e1e6;background:#fff;font-size:18px}
  .qty button{font-weight:700}
  .qty input{font-size:18px!important;font-weight:700;color:#222;width:54px;min-width:54px}

  .cartfooter{
    display:flex!important;flex-direction:column;gap:14px;
    padding:16px 14px calc(16px + env(safe-area-inset-bottom))!important;background:#fff
  }
  .clearcart{
    min-height:44px;padding:0 18px;border-radius:10px;white-space:nowrap;
    font-size:14px!important;font-weight:650;border:1px solid #ded8de;background:#fff;color:#666
  }
  .cart-total-actions{
    display:grid!important;grid-template-columns:minmax(0,1fr) auto;grid-template-areas:
      'label total'
      'button button';
    gap:10px 14px;align-items:center;width:100%
  }
  .cart-total-actions>span{grid-area:label;font-size:13px!important;line-height:1.4;color:#444;margin:0;min-width:0}
  .cart-total-actions>strong{grid-area:total;font-size:20px!important;line-height:1;font-weight:800;color:#df4777;white-space:nowrap}
  .cart-total-actions>.pinkbtn{
    grid-area:button;width:100%;min-height:48px;border-radius:12px;
    display:flex!important;align-items:center;justify-content:center;white-space:nowrap;
    font-size:16px!important;font-weight:800;padding:0 16px;text-align:center
  }

  /* Nút hồng / nút viền nói chung trên mobile không bị bẻ dòng vô lý */
  .pinkbtn,.outlinebtn,.voucher-apply,.voucher-back,.voucher-trigger,.placeorder .pinkbtn{
    white-space:nowrap;word-break:keep-all
  }

  /* Thanh toán và tra cứu đơn cũng thu gọn hợp lý hơn */
  .checkoutbox,.trackbox,.successbox{border-radius:16px;overflow:hidden}
  .checkout-section{padding-left:14px!important;padding-right:14px!important}
  .checkout-product{display:grid!important;grid-template-columns:minmax(0,1fr) auto;gap:8px 10px;align-items:start}
  .checkout-product .cartproduct{grid-template-columns:64px minmax(0,1fr)}
  .checkout-product .cartproduct img{width:64px!important;height:64px!important;border-radius:10px}
  .checkout-product .cartproduct b{font-size:13px;-webkit-line-clamp:2}
  .checkout-product>span:nth-child(2){font-size:13px;color:#666;white-space:nowrap}
  .checkout-product>.price{font-size:15px!important;font-weight:700;white-space:nowrap}

  .checkout-summary{display:grid!important;grid-template-columns:minmax(0,1fr) auto;gap:10px 12px}
  .checkout-summary strong.text-right,.checkout-summary strong{font-size:20px!important;white-space:nowrap}
  .shippingrow{display:grid!important;grid-template-columns:minmax(0,1fr) auto;gap:10px 12px;align-items:start}
  .shippingrow>div:nth-child(2){min-width:0}
  .shippingrow .text-right,.voucher-trigger .price{white-space:nowrap}
  .payment-options{display:grid;gap:10px}
  .payoption{min-height:44px;display:flex;align-items:center;padding:0 12px;border-radius:10px;border:1px solid #ebe5ea;background:#fff}

  .trackform{display:grid!important;grid-template-columns:1fr;gap:10px;padding:14px}
  .trackform .pinkbtn{width:100%;justify-content:center;min-height:46px}
  .trackresult,.successbox{padding:18px 14px!important}

  /* Nút mua trong header/cart sticky luôn 1 dòng */
  a.pinkbtn,button.pinkbtn{line-height:1!important}
}


/* v1.0.14 — MOBILE ONLY: căn giữa nội dung trong toàn bộ nút và hộp thao tác */
@media(max-width:768px){
  /* Chuẩn chung cho các nút/link dạng nút trên mobile. */
  .pinkbtn,
  .outlinebtn,
  .backbtn,
  .homequick,
  .clearcart,
  .voucher-back,
  .voucher-apply,
  .voucher-close,
  .placeorder button,
  .trackform button,
  .buybuttons button,
  .payment-options label,
  .cart-total-actions > .pinkbtn,
  .emptycart > .pinkbtn,
  .contentbox > .pinkbtn,
  .successbox .pinkbtn,
  .successbox .outlinebtn{
    box-sizing:border-box!important;
    display:inline-flex!important;
    align-items:center!important;
    justify-content:center!important;
    text-align:center!important;
    vertical-align:middle!important;
    line-height:1.2!important;
    white-space:nowrap!important;
    word-break:keep-all!important;
  }

  /* Trang giỏ hàng trống: toàn bộ nội dung và nút nằm đúng giữa khung. */
  .emptycart{
    width:100%!important;
    min-height:310px;
    padding:38px 18px!important;
    display:flex!important;
    flex-direction:column!important;
    align-items:center!important;
    justify-content:center!important;
    text-align:center!important;
    box-sizing:border-box!important;
  }
  .emptycart > div:first-child{
    display:grid!important;
    place-items:center!important;
    margin:0 auto 8px!important;
  }
  .emptycart h2,
  .emptycart p{
    width:100%;
    margin-left:auto!important;
    margin-right:auto!important;
    text-align:center!important;
  }
  .emptycart > .pinkbtn{
    width:min(100%,240px)!important;
    min-height:48px!important;
    margin:16px auto 0!important;
    padding:0 18px!important;
  }

  /* Các hộp thông báo / không tìm thấy / đặt hàng thành công. */
  .contentbox,
  .successbox{
    text-align:center!important;
  }
  .contentbox > .pinkbtn{
    min-width:180px;
    min-height:46px;
    margin:14px auto 0!important;
  }
  .successbox > div:last-child{
    align-items:center!important;
    justify-content:center!important;
  }
  .successbox .pinkbtn,
  .successbox .outlinebtn{
    min-height:46px;
    padding:0 16px!important;
  }

  /* Hai nút điều hướng đầu trang: chữ luôn giữa ô. */
  .page-tools .backbtn,
  .page-tools .homequick{
    min-width:0;
    min-height:42px!important;
    padding:0 14px!important;
  }

  /* Giỏ hàng có sản phẩm. */
  .cartfooter > form{
    width:100%;
    display:flex;
    justify-content:flex-start;
  }
  .clearcart{
    min-width:128px;
    min-height:44px!important;
    margin:0!important;
  }
  .cart-total-actions > .pinkbtn{
    width:100%!important;
    min-height:50px!important;
    padding:0 18px!important;
    margin:0!important;
  }

  /* Nút đặt hàng / tra cứu / voucher. */
  .placeorder{
    display:flex!important;
    justify-content:center!important;
    width:100%;
  }
  .placeorder .pinkbtn{
    width:min(100%,360px)!important;
    min-height:48px!important;
    margin:0 auto!important;
  }
  .trackform .pinkbtn{
    width:100%!important;
    min-height:46px!important;
  }
  .voucher-dialog-foot{
    display:flex!important;
    align-items:center!important;
    justify-content:center!important;
    gap:10px;
  }
  .voucher-back,
  .voucher-apply{
    min-height:42px!important;
    padding:0 18px!important;
  }

  /* Các nút mua ở trang chi tiết desktop fallback khi xuất hiện trên mobile. */
  .buybuttons{
    display:grid!important;
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
    gap:10px!important;
  }
  .buybuttons button{
    width:100%!important;
    min-height:46px!important;
    padding:0 10px!important;
  }

  /* Chữ và số trong cụm tăng/giảm số lượng luôn giữa ô. */
  .qty button,
  .qty input,
  .m-sheet-qty button,
  .m-sheet-qty input{
    display:flex!important;
    align-items:center!important;
    justify-content:center!important;
    text-align:center!important;
    padding:0!important;
    line-height:1!important;
    box-sizing:border-box!important;
  }

  /* Nhãn phương thức thanh toán không lệch dọc. */
  .payment-options label{
    justify-content:flex-start!important;
    text-align:left!important;
    white-space:normal!important;
    line-height:1.35!important;
  }
}


/* v1.0.15 — Sửa UI mobile: ô danh mục gọn hơn, không tách kỳ cục; màu nút đúng tone shop */
@media(max-width:768px){
  /* Dải danh mục: mỗi mục là 1 ô thống nhất, icon + tên không bị tách cứng nhắc */
  .m-category-strip{
    gap:12px!important;
    padding:12px 12px 13px!important;
    align-items:stretch;
  }
  .m-category-strip a{
    flex:0 0 92px!important;
    min-width:92px!important;
    max-width:92px!important;
    display:flex!important;
    flex-direction:column!important;
    align-items:center!important;
    justify-content:flex-start!important;
    gap:8px!important;
    padding:10px 8px!important;
    border-radius:12px!important;
    background:#fff!important;
    border:1px solid #f1e4eb!important;
    box-shadow:0 2px 10px rgba(206,82,126,.05)!important;
    text-align:center!important;
    box-sizing:border-box!important;
  }
  .m-category-strip span{
    width:44px!important;
    height:44px!important;
    border-radius:12px!important;
    background:#fff1f5!important;
    display:grid!important;
    place-items:center!important;
    font-size:22px!important;
    flex:0 0 44px!important;
  }
  .m-category-strip b{
    width:100%!important;
    min-height:29px!important;
    margin:0!important;
    font-size:12px!important;
    line-height:1.18!important;
    font-weight:700!important;
    text-align:center!important;
    word-break:keep-all!important;
    overflow-wrap:break-word!important;
    display:-webkit-box!important;
    -webkit-line-clamp:2!important;
    -webkit-box-orient:vertical!important;
    overflow:hidden!important;
  }

  /* Thanh mua hàng dưới cùng: chat + thêm giỏ màu xanh, mua ngay màu hồng chủ đạo */
  .m-action-chat,
  .m-action-cart{
    color:#fff!important;
    background:linear-gradient(180deg,#5aa8ff,#2d7ff0)!important;
  }
  .m-action-buy{
    background:linear-gradient(180deg,#ec6b9a,#df4777)!important;
    color:#fff!important;
  }
  .m-action-buy strong,
  .m-action-buy small,
  .m-action-buy span{
    color:#fff!important;
  }

  /* Nút/chat trên đầu trang mobile cũng giữ đồng bộ màu hồng chủ đạo */
  .m-home-chat{
    color:var(--m-pink)!important;
    border-color:#e6a0ba!important;
    background:#fff!important;
  }
}


/* v1.0.16 — Làm mềm thanh nút dưới: xanh pastel sáng hơn, chia ô rõ hơn, bớt cứng */
@media(max-width:768px){
  .m-product-actions{
    grid-template-columns:1fr 1.12fr 1.58fr!important;
    gap:8px!important;
    height:auto!important;
    min-height:78px!important;
    padding:8px 10px calc(8px + env(safe-area-inset-bottom))!important;
    background:rgba(255,255,255,.97)!important;
    backdrop-filter:blur(10px)!important;
    border-top:1px solid #f2dee7!important;
    box-shadow:0 -8px 22px rgba(219,88,135,.10)!important;
  }
  .m-product-actions button{
    min-height:58px!important;
    border-radius:16px!important;
    font-size:11px!important;
    font-weight:700!important;
    line-height:1.15!important;
    box-shadow:0 6px 16px rgba(0,0,0,.07)!important;
    border:1px solid transparent!important;
    padding:6px 8px!important;
  }
  .m-action-chat,
  .m-action-cart{
    background:linear-gradient(180deg,#9fdcff,#74c9ff)!important;
    color:#155d8f!important;
    border-color:#bfe9ff!important;
  }
  .m-action-chat{
    background:linear-gradient(180deg,#a8e6ff,#7fd6ff)!important;
  }
  .m-action-chat span,
  .m-action-cart span{
    color:#155d8f!important;
    filter:drop-shadow(0 1px 0 rgba(255,255,255,.45));
  }
  .m-action-chat span{font-size:21px!important}
  .m-action-cart span{font-size:19px!important}
  .m-action-buy{
    background:linear-gradient(180deg,#f176a2,#e25186)!important;
    color:#fff!important;
    border-color:#ee94b2!important;
  }
  .m-action-buy strong{font-size:16px!important}
  .m-action-buy small,.m-action-buy span,.m-action-buy strong{color:#fff!important}
}


/* v1.0.17 — Product mobile theo luồng Shopee, giữ màu xanh pastel + hồng Soap Flower */
@media(max-width:768px){
  .m-gallery-slide{aspect-ratio:1/1!important}

  .m-variant-preview{
    background:#fff;
    padding:10px 14px 12px;
    border-bottom:1px solid #eee;
  }
  .m-variant-preview-title{font-size:11px;color:#888;margin-bottom:8px}
  .m-variant-preview-track{display:flex;gap:8px;overflow-x:auto;scrollbar-width:none}
  .m-variant-preview-track::-webkit-scrollbar{display:none}
  .m-variant-preview-track button{width:58px;height:58px;flex:0 0 58px;border:1px solid #e9e2e6;border-radius:7px;background:#fff;padding:2px;overflow:hidden}
  .m-variant-preview-track button:first-child{border-color:#e35a8b;box-shadow:0 0 0 1px #e35a8b}
  .m-variant-preview-track img{width:100%;height:100%;object-fit:cover;border-radius:5px}

  .m-product-summary{padding:13px 14px 0!important;border-bottom:0!important}
  .m-summary-mainline{display:flex;align-items:center;justify-content:space-between;gap:12px}
  .m-summary-price{min-width:0;display:flex;align-items:center;gap:7px;flex-wrap:wrap}
  .m-summary-price strong{font-size:24px!important;color:#df4777!important;font-weight:700!important;letter-spacing:-.4px}
  .m-summary-price>span{background:#fff0f5!important;color:#df4777!important;border-radius:3px!important;padding:3px 5px!important;font-size:9px!important}
  .m-summary-sold{display:flex;align-items:center;gap:9px;white-space:nowrap}
  .m-summary-sold b{font-size:11px;color:#555}
  .m-summary-sold button{width:34px;height:34px;border:0;background:#fff;color:#999;font-size:27px;line-height:1}
  .m-summary-installment{margin-top:4px;font-size:11px;color:#5d5d5d}
  .m-summary-tags{display:flex;align-items:center;gap:6px;margin-top:10px}
  .m-summary-tags span{padding:3px 6px;background:#74caf1;color:#fff;border-radius:3px;font-size:9px;font-weight:700}
  .m-summary-tags b{font-size:10px;color:#df4777;font-weight:600}
  .m-member-offer{margin:12px -14px 0;padding:11px 14px;display:grid;grid-template-columns:24px minmax(0,1fr) 18px;align-items:center;gap:8px;background:#fff3f7;border-top:1px solid #fde3ec;border-bottom:1px solid #fde3ec}
  .m-member-offer>span{font-size:18px}
  .m-member-offer p{margin:0}
  .m-member-offer b{display:block;font-size:12px;color:#d94e7c}
  .m-member-offer small{display:block;margin-top:2px;font-size:10px;color:#8b737c}
  .m-member-offer i{font-size:24px;color:#d94e7c;font-style:normal;text-align:right}
  .m-product-summary h1{font-size:16px!important;line-height:1.45!important;font-weight:500!important;margin:13px 0 10px!important}
  .m-summary-rating{padding-bottom:13px}

  .m-info-list{margin-top:8px!important}
  .m-info-list>div{min-height:64px!important;grid-template-columns:30px minmax(0,1fr) 18px!important;padding:10px 14px!important}
  .m-info-list .m-line-icon{font-size:20px;color:#58bce9}
  .m-info-list b{font-size:13px!important;font-weight:550!important}
  .m-info-list small{font-size:10px!important;line-height:1.35!important}
  .m-select-row{min-height:60px!important;border-top:1px solid #eee;border-bottom:1px solid #eee}
  .m-select-row b{font-size:14px!important}.m-select-row small{font-size:12px!important;color:#888!important}

  /* Bottom bar: cấu trúc giống Shopee, nhưng màu xanh pastel + hồng shop */
  .m-product-actions{
    display:grid!important;
    grid-template-columns:52% 48%!important;
    gap:0!important;
    height:calc(68px + env(safe-area-inset-bottom))!important;
    min-height:0!important;
    padding:0 0 env(safe-area-inset-bottom)!important;
    background:#fff!important;
    border-top:1px solid #e8e8e8!important;
    border-radius:18px 18px 0 0!important;
    overflow:hidden!important;
    box-shadow:0 -5px 18px rgba(0,0,0,.08)!important;
  }
  .m-action-left{display:grid;grid-template-columns:1fr 1fr;background:linear-gradient(180deg,#8bd9f7,#69c7ee)}
  .m-product-actions button{min-height:68px!important;border:0!important;border-radius:0!important;box-shadow:none!important;padding:5px 4px!important}
  .m-action-chat,.m-action-cart{
    background:transparent!important;
    color:#fff!important;
    display:flex!important;
    flex-direction:column!important;
    align-items:center!important;
    justify-content:center!important;
    gap:4px!important;
    position:relative;
  }
  .m-action-chat:after{content:"";position:absolute;right:0;top:15px;bottom:15px;width:1px;background:rgba(255,255,255,.42)}
  .m-action-icon{width:27px;height:27px;display:grid;place-items:center}
  .m-action-icon svg{width:27px;height:27px;fill:none;stroke:#fff;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
  .m-action-chat small,.m-action-cart small{font-size:10px;color:#fff;font-weight:600;line-height:1.15;text-align:center}
  .m-action-buy{
    background:linear-gradient(180deg,#ef729f,#df4777)!important;
    color:#fff!important;
    display:flex!important;
    flex-direction:column!important;
    align-items:center!important;
    justify-content:center!important;
    gap:3px!important;
  }
  .m-action-buy>span{font-size:14px!important;color:#fff!important}
  .m-action-buy strong{font-size:18px!important;color:#fff!important;font-weight:700!important}
}


/* v1.0.18 — Checkout mobile không bị phóng/rụng khung khi bàn phím mở */
@media(max-width:768px){
  html,body{max-width:100%;overflow-x:hidden!important}
  body:has(.checkoutpage){background:#f7f5f7!important}

  .checkoutpage{
    width:100%!important;
    max-width:100%!important;
    margin:0!important;
    padding:0 12px 30px!important;
    box-sizing:border-box!important;
    overflow:visible!important;
  }
  .checkoutpage .breadcrumb{
    width:100%!important;
    margin:10px 0 12px!important;
    padding:0 2px!important;
    box-sizing:border-box!important;
  }
  .checkoutbox{
    width:100%!important;
    max-width:100%!important;
    margin:0!important;
    border-radius:16px!important;
    overflow:hidden!important;
    box-sizing:border-box!important;
  }
  #checkoutForm,
  .checkout-section,
  .formgrid,
  .field{
    width:100%!important;
    max-width:100%!important;
    min-width:0!important;
    box-sizing:border-box!important;
  }
  .checkout-section{
    padding:18px 16px!important;
    overflow:hidden!important;
  }
  .checkout-section h3{
    margin:0 0 16px!important;
    font-size:20px!important;
    line-height:1.25!important;
  }
  .formgrid{
    display:grid!important;
    grid-template-columns:minmax(0,1fr)!important;
    gap:14px!important;
  }
  .formgrid .field,
  .formgrid .field.full{
    grid-column:1/-1!important;
  }
  .field label{
    display:block!important;
    margin:0 0 7px!important;
    font-size:14px!important;
    line-height:1.35!important;
  }
  .field input,
  .field textarea,
  .field select,
  .shippingrow select{
    display:block!important;
    width:100%!important;
    max-width:100%!important;
    min-width:0!important;
    box-sizing:border-box!important;
    font-size:16px!important; /* ngăn iPhone tự zoom làm mất khung */
    line-height:1.35!important;
    border-radius:10px!important;
  }
  .field input,
  .shippingrow select{
    min-height:48px!important;
    padding:0 12px!important;
  }
  .field textarea{
    min-height:92px!important;
    padding:12px!important;
    resize:vertical!important;
  }
  .field input:focus,
  .field textarea:focus,
  .field select:focus{
    outline:none!important;
    border-color:#df6f99!important;
    box-shadow:0 0 0 3px rgba(223,71,119,.12)!important;
  }
  .page-tools{
    width:100%!important;
    max-width:100%!important;
    box-sizing:border-box!important;
    padding:10px 12px 0!important;
    overflow:hidden!important;
  }
  .page-tools .backbtn,
  .page-tools .homequick{
    max-width:calc(50% - 5px)!important;
    overflow:hidden!important;
    text-overflow:ellipsis!important;
  }
  .shippingrow{
    grid-template-columns:minmax(0,1fr)!important;
    gap:10px!important;
  }
  .shippingrow>.text-right{
    justify-self:start!important;
  }
  .voucher-trigger{
    width:100%!important;
    max-width:100%!important;
    box-sizing:border-box!important;
  }
}

/* Voucher: thông báo ngay đúng khu vực trên cả điện thoại và máy tính */
#voucher-shop{scroll-margin-top:18px}
.voucher-inline-status{
  margin:12px 0 0;
  min-height:44px;
  padding:10px 12px;
  border-radius:10px;
  display:flex;
  align-items:center;
  gap:9px;
  box-sizing:border-box;
  font-size:13px;
  line-height:1.4;
}
.voucher-inline-status>span{
  width:24px;
  height:24px;
  flex:0 0 24px;
  border-radius:50%;
  display:grid;
  place-items:center;
  font-weight:800;
}
.voucher-inline-status p{margin:0;min-width:0}
.voucher-inline-status.success{background:#edf9f3;border:1px solid #bfe9d3;color:#17724b}
.voucher-inline-status.success>span{background:#36bd7c;color:#fff}
.voucher-inline-status.warning{background:#fff8e8;border:1px solid #f2d79a;color:#8a6500}
.voucher-inline-status.warning>span{background:#e8ad24;color:#fff}
.voucher-inline-status.error{background:#fff0f2;border:1px solid #f2bdc7;color:#a43f55}
.voucher-inline-status.error>span{background:#db5b78;color:#fff}


/* v1.0.19 — Checkout giữ nguyên tỷ lệ khi nhập, không tự zoom hay tự cuộn */
@media(max-width:768px){
  html{
    -webkit-text-size-adjust:100%!important;
    text-size-adjust:100%!important;
  }
  body:has(.checkoutpage),
  .checkoutpage,
  .checkoutbox,
  #checkoutForm,
  .checkout-section,
  .formgrid,
  .field{
    transform:none!important;
    zoom:1!important;
  }
  .checkoutpage input,
  .checkoutpage textarea,
  .checkoutpage select,
  .checkoutpage button{
    font-size:16px!important;
    transform:none!important;
    zoom:1!important;
  }
  .checkoutpage input:focus,
  .checkoutpage textarea:focus,
  .checkoutpage select:focus{
    scroll-margin:0!important;
  }
}

/* Voucher được cập nhật tại chỗ trên cả máy tính lẫn điện thoại. */
body.sf-voucher-updating .voucher-ticket:not(.disabled){
  pointer-events:none;
}
body.sf-voucher-updating .voucher-dialog{
  opacity:.82;
}
.voucher-inline-status{
  scroll-margin:0!important;
}
