/* TW PAY · desktop colour match + look-only UI fixes · 2026-11-11
   PREVIEW ONLY until Son approves deploy. Paint / spacing / typography only.
   No layout restructure, no new buttons, no service reorder, no routing, no catalog.js.
   Link LAST in money/index.html (after twpay-palette-20261111.css) so these rules win.
   Uses 3× #twm-app to outrank existing 2–3 id !important rules.
   Real TW PAY logo is untouched. */

/* Shared tokens copied from live mobile D / E so desktop cannot drift. */
html.fx26{
  --tp-fix-bg:#CFE8FF;
  --tp-fix-ink:#08204F;
  --tp-fix-text:#0B1633;
  --tp-fix-muted:#3A4766;
  --tp-fix-glass:rgba(255,255,255,.50);
  --tp-fix-glass-strong:rgba(255,255,255,.88);
  --tp-fix-line:rgba(255,255,255,.75);
  --tp-fix-shadow:inset 0 0 0 1px rgba(255,255,255,.75),inset 0 1px 0 rgba(255,255,255,.85),0 14px 36px rgba(11,61,145,.18);
  --tp-fix-tile-shadow:inset 0 0 0 1px rgba(255,255,255,.75),inset 0 1px 0 rgba(255,255,255,.85),0 6px 18px rgba(11,61,145,.18);
  --tp-fix-go-bg:#FFFFFF;
  --tp-fix-go-fg:#493082;
  --tp-fix-swatch:rgba(11,61,145,.45);
  --tp-fix-gallery:#FFFFFF;
  --twg-grad:linear-gradient(100deg,#087BFF 0%,#743DFF 38%,#F414A0 74%,#FF8740 100%);
}
@media (prefers-color-scheme: twpay-light-only){
html.fx26{
  --tp-fix-bg:#1C1C28;
  --tp-fix-ink:#F4F5FF;
  --tp-fix-text:#E8EAF6;
  --tp-fix-muted:#C9CCE0;
  --tp-fix-glass:rgba(255,255,255,.08);
  --tp-fix-glass-strong:rgba(28,28,40,.82);
  --tp-fix-line:rgba(255,255,255,.18);
  --tp-fix-shadow:inset 0 0 0 1px rgba(255,255,255,.18),inset 0 1px 0 rgba(255,255,255,.14),0 14px 36px rgba(0,0,0,.35);
  --tp-fix-tile-shadow:inset 0 0 0 1px rgba(255,255,255,.18),inset 0 1px 0 rgba(255,255,255,.14),0 6px 18px rgba(0,0,0,.35);
  --tp-fix-go-bg:#2F2F45;
  --tp-fix-go-fg:#F4F5FF;
  --tp-fix-swatch:rgba(232,234,246,.65);
  --tp-fix-gallery:#262637;
}
}

/* --------------------------------------------------------------------------
   A) Desktop uses the same colours as current mobile (light D / dark E)
   -------------------------------------------------------------------------- */
/* Re-assert page + glass on desktop-only tw5 / desk surfaces (same paint as mobile). */
@media (min-width: 901px){
html.fx26 body.twm-body.twm-body{background-color:var(--tp-fix-bg)!important;}
html.fx26 body #twm-app#twm-app#twm-app :is(
  .tw5-shop,.twp-partners,.shp-sec,.twm-card,.mx-card,
  .hmx section.shop,.hmx section.pt
){
  background-color:var(--tp-fix-glass)!important;
  background-image:linear-gradient(180deg,rgba(255,255,255,.30),transparent 45%)!important;
  border-color:var(--tp-fix-line)!important;
  box-shadow:var(--tp-fix-shadow)!important;
}
@media (prefers-color-scheme: twpay-light-only){
html.fx26 body #twm-app#twm-app#twm-app :is(
  .tw5-shop,.twp-partners,.shp-sec,.twm-card,.mx-card,
  .hmx section.shop,.hmx section.pt
){
  background-image:linear-gradient(180deg,rgba(255,255,255,.06),transparent 45%)!important;
}
}
html.fx26 body #twm-app#twm-app#twm-app :is(.twm-top,.twm-nav,.hmx>header.hd,.hmx>nav.tb){
  background-color:var(--tp-fix-glass-strong)!important;
  background-image:linear-gradient(180deg,rgba(255,255,255,.30),transparent 45%)!important;
  border-color:var(--tp-fix-line)!important;
}
@media (prefers-color-scheme: twpay-light-only){
html.fx26 body #twm-app#twm-app#twm-app :is(.twm-top,.twm-nav,.hmx>header.hd,.hmx>nav.tb){
  background-image:linear-gradient(180deg,rgba(255,255,255,.06),transparent 45%)!important;
}
}
html.fx26 body #twm-app#twm-app#twm-app :is(.twp6-tilt,.h2-pc,.hmx .tl>a.t,.hmx .pr>a.pc,.tw5-svc a,.shp-pc){
  background-color:var(--tp-fix-glass)!important;
  background-image:none!important;
  border-color:var(--tp-fix-line)!important;
  box-shadow:var(--tp-fix-tile-shadow)!important;
}
html.fx26 body #twm-app#twm-app#twm-app :is(h1,h2,h3,.twm-h1,.twm-brand span){color:var(--tp-fix-ink)!important;}
html.fx26 body #twm-app#twm-app#twm-app{color:var(--tp-fix-text)!important;}

/* Desktop rate CTA: match mobile .rate .go (white / dark chip), not the long gradient pill. */
html.fx26 body #twm-app#twm-app#twm-app .tw5-rate a.tw5-send,
html.fx26 body #twm-app#twm-app#twm-app .hx-rate a.tw5-send{
  background-color:var(--tp-fix-go-bg)!important;
  background-image:none!important;
  color:var(--tp-fix-go-fg)!important;
  border-color:rgba(255,255,255,.40)!important;
  box-shadow:0 4px 12px rgba(11,61,145,.16)!important;
  text-shadow:none!important;
  border-radius:14px!important;
}
html.fx26 body #twm-app#twm-app#twm-app .tw5-rate a.tw5-send :is(span,svg),
html.fx26 body #twm-app#twm-app#twm-app .hx-rate a.tw5-send :is(span,svg){
  color:var(--tp-fix-go-fg)!important;
  stroke:currentColor;
}

/* Desktop rate figure: show NT$ (mobile already reads "1 NT$ = …"). */
html.fx26 body #twm-app#twm-app#twm-app .tw5-rate .hx-big,
html.fx26 body #twm-app#twm-app#twm-app .hx-rate .hx-big{
  white-space:nowrap!important;
}
html.fx26 body #twm-app#twm-app#twm-app .tw5-rate .hx-big::before,
html.fx26 body #twm-app#twm-app#twm-app .hx-rate .hx-big::before{
  content:"NT$ ";
  font-weight:800;
  letter-spacing:0;
}
}

/* --------------------------------------------------------------------------
   B) Shop prices hidden by the bottom tab (mobile)
   Live padding was scoped to data-scr="catalog"; the live route is data-scr="shop".
   -------------------------------------------------------------------------- */
@media (max-width: 900px){
/* Pad the last section, not the fixed-height scroller (padding on #twm-main shrinks the first view). */
html.fx26 body #twm-app#twm-app#twm-app:is([data-scr="shop"],[data-scr="catalog"]) .shp-sec.shp-products,
html.fx26 body #twm-app#twm-app#twm-app:is([data-scr="shop"],[data-scr="catalog"]) > .twm-main > :last-child,
html.fx26 body #twm-app#twm-app#twm-app:is([data-scr="help"],[data-scr="account"],[data-scr="promo"],[data-scr="s00"]) > .twm-main > :last-child{
  padding-bottom:calc(var(--twm-nav-h, 64px) + 28px + env(safe-area-inset-bottom, 0px))!important;
}
}

/* --------------------------------------------------------------------------
   C) PDP image letterbox + visible white swatch border
   -------------------------------------------------------------------------- */
html.fx26 body #twm-app#twm-app#twm-app[data-scr="product"] :is(
  .s11b-gallery, .s11b-gallery .pdp-stage, .s11b-gallery .pdp-gallery-scroll, .pdp-photo-slot
){
  background-color:var(--tp-fix-gallery)!important;
}
html.fx26 body #twm-app#twm-app#twm-app[data-scr="product"] :is(
  .s11b-gallery img.pdp-gallery-img, .s11b-gallery .pdp-gallery-img, .pdp-stage img, .pdp-photo-slot img
){
  object-fit:cover!important;
  object-position:center center!important;
  width:100%!important;
  height:100%!important;
  max-height:100%!important;
}
/* White / very light swatches need a stronger ring so they don't vanish on a white card. */
html.fx26 body #twm-app#twm-app#twm-app[data-scr="product"] :is(.pdp-swatch i, .pdp-swatch-plain i){
  box-shadow:0 0 0 2px var(--tp-fix-swatch), inset 0 0 0 1px rgba(255,255,255,.9)!important;
  border:1.5px solid var(--tp-fix-swatch)!important;
  border-radius:50%!important;
}
html.fx26 body #twm-app#twm-app#twm-app[data-scr="product"] .pdp-swatch.pdp-swatch-plain{
  border:1px solid rgba(11,61,145,.28)!important;
  box-shadow:0 0 0 1px rgba(11,61,145,.12)!important;
}
@media (prefers-color-scheme: twpay-light-only){
html.fx26 body #twm-app#twm-app#twm-app[data-scr="product"] .pdp-swatch.pdp-swatch-plain{
  border:1px solid rgba(232,234,246,.45)!important;
  box-shadow:0 0 0 1px rgba(232,234,246,.18)!important;
}
}

/* --------------------------------------------------------------------------
   D) Clipped text: EN "Installments", ₫ wrapping, search placeholder
   -------------------------------------------------------------------------- */
/* Service tiles: let long labels wrap inside the existing tile instead of clipping. */
html.fx26 body #twm-app#twm-app#twm-app :is(.hmx .tl>a.t, .hmx .tl a.t, .tw5-svc a, .tw5-svc li){
  overflow:visible!important;
  text-overflow:unset!important;
}
html.fx26 body #twm-app#twm-app#twm-app :is(.hmx .tl>a.t, .hmx .tl a.t, .tw5-svc a, .tw5-svc .lb) :is(span,small,b,.lb){
  white-space:normal!important;
  overflow:visible!important;
  text-overflow:unset!important;
  line-height:1.15!important;
  overflow-wrap:normal!important;
  word-break:normal!important;
  hyphens:manual!important;
  font-size:10.5px!important;
  letter-spacing:-0.03em;
}
/* Rate amount + ₫ stay on one line (EN "Send money" made the value wrap). */
html.fx26 body #twm-app#twm-app#twm-app :is(.hmx .rate .rt, .hmx .rate strong, .hmx .rate .v, .hx-big, .tw5-rate .hx-big){
  white-space:nowrap!important;
}
/* Search field: slightly smaller placeholder so "Tìm iPhone, laptop, phụ kiện…" fits better. */
html.fx26 body #twm-app#twm-app#twm-app .shp-search input::placeholder,
html.fx26 body #twm-app#twm-app#twm-app input[type="search"]::placeholder{
  font-size:13px!important;
  letter-spacing:0!important;
  opacity:1;
}

/* --------------------------------------------------------------------------
   E) Sticky "Mua ngay" bar overlapping the warranty / specs block
   -------------------------------------------------------------------------- */
html.fx26 body #twm-app#twm-app#twm-app[data-scr="product"] :is(.s11b-page.s11b-specs, .s11b-details-page, .s11b-specs){
  padding-top:calc(96px + env(safe-area-inset-bottom, 0px))!important;
  padding-bottom:16px!important;
  scroll-margin-bottom:140px!important;
}
@media (min-width: 901px){
html.fx26 body #twm-app#twm-app#twm-app[data-scr="product"] :is(.s11b-page.s11b-specs, .s11b-details-page, .s11b-specs){
  padding-top:calc(128px + env(safe-area-inset-bottom, 0px))!important;
}
}
html.fx26 body #twm-app#twm-app#twm-app[data-scr="product"] > .twm-main,
html.fx26 body #twm-app#twm-app#twm-app[data-scr="product"] > .twm-main.one{
  padding-bottom:calc(220px + env(safe-area-inset-bottom, 0px))!important;
}

/* --------------------------------------------------------------------------
   F) Small tap targets: larger hit area, same visual size
   -------------------------------------------------------------------------- */
html.fx26 body #twm-app#twm-app#twm-app :is(
  .twm-nav a, .hmx nav.tb a, .shop a, .shp-sec a, .shp-hd a, .h-all,
  .tw-ch-btn, .tw-help-channels-card a, a.mx-link, .mx-card a, .s11b-detail-link
){
  position:relative!important;
}
html.fx26 body #twm-app#twm-app#twm-app :is(
  .twm-nav a, .hmx nav.tb a, .shop a, .shp-sec a, .shp-hd a, .h-all,
  .tw-ch-btn, .tw-help-channels-card a, a.mx-link, .mx-card a, .s11b-detail-link
)::after{
  content:"";
  position:absolute;
  top:50%;
  left:50%;
  width:max(100%, 44px);
  height:max(100%, 44px);
  transform:translate(-50%,-50%);
  pointer-events:auto;
}

/* Login row "Tra cứu đơn không cần đăng nhập": keep the phrase readable, no mid-word split. */
html.fx26 body #twm-app#twm-app#twm-app :is(.mx-link, .mx-card a, .mx-content a){
  overflow-wrap:break-word!important;
  word-break:normal!important;
  line-height:1.35!important;
  hyphens:manual;
}

/* --------------------------------------------------------------------------
   G) Other small look fixes (no structure change)
   -------------------------------------------------------------------------- */
/* Home partner strip: a little bottom room so logos aren't flush against the viewport edge on desktop. */
@media (min-width: 901px){
html.fx26 body #twm-app#twm-app#twm-app[data-scr="home"] > .twm-main,
html.fx26 body #twm-app#twm-app#twm-app[data-scr="home"] > .twm-main.one{
  padding-bottom:32px!important;
}
}
