/* Final layout layer: keep every destination and purchase control reachable. */
:root{--towa-header-fallback:64px}
/* One scrolling document. A body's hidden X overflow computes its visible Y
   overflow to auto, creating a non-scrolling ancestor that breaks sticky headers. */
html.th332-active:not(.overlay-locked-root):not(.th332-currency-open) body.towa-store-refinement:not(.overlay-locked):not(.th332-currency-locked):not(.cart-open):not(.mini-cart-open){overflow:visible!important}
/* The two official collection layers already cover the viewport in Shop.
   Avoid decoding/painting the same home background underneath them. */
body.towa-store-focus.towa-worlds-active{background-image:none!important;background-attachment:scroll!important}
body.towa-store-focus.towa-worlds-active .bg-fx{display:none!important}
body.towa-store-focus.towa-worlds-active .bg-fx,
body.towa-store-focus.towa-worlds-active .bg-fx::before,
body.towa-store-focus.towa-worlds-active .bg-fx::after,
body.towa-store-focus.towa-worlds-active .bg-fx *{animation-play-state:paused!important}
/* One document offset. Anchor margins add only breathing room, not another
   complete header height on top of scroll-padding. */
html.th332-active{scroll-padding-top:calc(var(--towa-header-height,var(--towa-header-fallback)) + 12px)}

/* A grid/flex child may shrink below its text's intrinsic width. Names, emails
   and prices wrap inside their own panel rather than widening the document. */
body.towa-store-refinement :is(.focus-home-copy,.focus-buy-options,.focus-option,.focus-shop-copy,.focus-shop-guide,.shop-main-column,.shop-discovery-bar,.shop-section,.shop-sec-heading,.item-info,.bundle-card-info,.extra-guide>div,.towa-acc-card,.towa-acc-main,.towa-acc-sidebar,.topup-config-card,.topup-summary-card,.checkout-form-column,.checkout-summary-column,.checkout-panel,.footer-inner>div){min-width:0}
body.towa-store-refinement :is(.item-name,.bundle-card-name,.direct-service-card h2,.extra-guide h2,.towa-acc-id-top strong,.account-list-item,.footer-inner a,.footer-inner p,.footer-inner span){overflow-wrap:anywhere}
body.towa-store-refinement #shopContent :is(.item-name,.bundle-card-name){white-space:normal!important;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;overflow:hidden}
body.towa-store-refinement #shopContent .item-name{min-height:2.36em}
body.towa-store-refinement :is(.extra-guide,.extra-help-topics>a,.extra-support-box,.refinement-direct-section){scroll-margin-top:16px}
body.towa-store-refinement #page-guides .extra-guide{scroll-margin-top:16px}
body.towa-store-refinement .service-group-head{flex-wrap:wrap;row-gap:10px}
body.towa-store-refinement .service-group-head h2{flex-shrink:1;line-height:1.12}
body.towa-store-refinement .service-group-head p{min-width:0;line-height:1.6}
body.towa-store-refinement .nav-account-menu{top:calc(var(--towa-header-height,var(--towa-header-fallback)) + 8px)!important;max-height:calc(100dvh - var(--towa-header-height,var(--towa-header-fallback)) - 20px - env(safe-area-inset-bottom,0px))!important;max-width:calc(100vw - 16px)!important}
body.towa-store-refinement .nav-account-guest p{font-size:12px!important;line-height:1.6!important}
body.towa-store-refinement .nav-account-action{min-height:44px!important;padding:10px 11px!important;font-size:12px!important;line-height:1.4!important}
body.towa-store-refinement .nav-account-action-label b{font-size:12px!important;line-height:1.4!important}
body.towa-store-refinement .nav-account-menu-label{font-size:10px;line-height:1.4}
body.towa-store-refinement .th332-currency-menu{max-height:calc(100dvh - var(--towa-header-height,var(--towa-header-fallback)) - 20px - env(safe-area-inset-bottom,0px))}
/* The replacement header uses a high layer. Native dialogs must cover it so
   their close button and heading remain reachable on short screens. */
body.towa-store-refinement .cart-overlay{z-index:2147482120!important}
body.towa-store-refinement .cart-drawer.checkout-page{z-index:2147482130!important}
body.towa-store-refinement .modal-overlay{z-index:2147482200!important}
body.towa-store-refinement .checkout-page :is(.cart-trust-note,.checkout-community-panel p,.checkout-promo-summary small,.checkout-stripe-currency-note span){font-size:11px!important;line-height:1.55!important}
body.towa-store-refinement .checkout-page .checkout-payment-option>b{font-size:11px;line-height:1.4;white-space:normal}
body.towa-store-refinement .checkout-page small{font-size:11px!important;line-height:1.5!important}
body.towa-store-refinement .checkout-page :is(.checkout-stripe-explainer p,.checkout-stripe-explainer>div>span,.checkout-tether-explainer p,.checkout-tether-explainer>div>span,.cart-summary-line>span,.checkout-rewards-grid span){font-size:11px!important;line-height:1.5!important}

/* Intermediate desktops still need two rows when wallet/rank labels are shown. */
@media(min-width:1101px) and (max-width:1240px){
  :root{--towa-header-fallback:128px}
  body.towa-store-refinement .th332-shell{display:grid!important;grid-template-columns:minmax(0,1fr) max-content;grid-template-areas:'brand tools' 'navigation navigation';gap:8px;width:calc(100% - 28px);padding:8px 0;min-height:0}
  body.towa-store-refinement .th332-brand{grid-area:brand}
  body.towa-store-refinement .th332-tools{grid-area:tools}
  body.towa-store-refinement .th332-nav{grid-area:navigation;justify-self:stretch;justify-content:center;min-width:0}
  body.towa-store-refinement .th332-nav>button{min-height:44px;height:auto}
}

@media(max-width:1100px){
  :root{--towa-header-fallback:118px}
  body.towa-store-refinement .th332-shell{column-gap:8px;grid-template-columns:minmax(32px,1fr) max-content}
  body.towa-store-refinement .th332-brand{min-width:0}
  body.towa-store-refinement .th332-tools{min-width:0}
  body.towa-store-refinement .th332-nav>button{min-height:44px;height:auto;justify-content:center}
  body.towa-store-refinement .th332-profile{display:grid!important}
  body.towa-store-refinement .shop-sec-heading{flex-wrap:wrap;gap:10px}
}

@media(max-width:900px){
  body.towa-store-refinement .focus-home-intro{gap:26px}
  body.towa-store-refinement .focus-shop-intro{gap:24px}
  body.towa-store-refinement .shop-main-column{max-width:100%}
  /* Categories remain a swipeable row. A second sticky block would cover the
     search field on the two-row header and consume most of a short phone. */
  body.towa-store-refinement #page-shop .shop-sidebar{position:relative!important;inset:auto!important;width:100%!important;max-width:100%!important;margin:0!important}
  body.towa-store-refinement #page-shop .shop-discovery-bar{position:relative!important;inset:auto!important;min-width:0;max-width:100%}
  body.towa-store-refinement .shop-search-wrap{min-width:0;max-width:100%}
  body.towa-store-refinement .shop-search{width:100%;min-width:0}
  body.towa-store-refinement .smart-filters{display:flex;flex-wrap:nowrap;max-width:100%;overflow-x:auto;overscroll-behavior-inline:contain}
  body.towa-store-refinement .smart-filters button{flex:0 0 auto;min-height:44px;white-space:nowrap}
  body.towa-store-refinement #shopContent .shop-grid{min-width:0}
  body.towa-store-refinement .shop-sec-title{overflow-wrap:anywhere;line-height:1.12!important}
  body.towa-store-refinement .item-name{line-height:1.18!important}
  body.towa-store-refinement .item-btns{gap:6px;flex-wrap:wrap}
  body.towa-store-refinement .item-add-btn,body.towa-store-refinement .item-view-btn{min-width:40px;min-height:40px}
  body.towa-store-refinement .bundle-card-name{line-height:1.15!important}
  body.towa-store-refinement .bundle-card-info{min-width:0}
  body.towa-store-refinement .bundle-card-price{flex-wrap:wrap;gap:6px}
  body.towa-store-refinement .official-comparison small{white-space:normal;line-height:1.35}
  /* The checkout sheet already scrolls; its item list need not trap a second
     vertical gesture in a small 250px nested window. */
  body.towa-store-refinement .checkout-page .cart-items{max-height:none!important;overflow:visible!important}
  body.towa-store-refinement .service-group-head{align-items:flex-start}
  body.towa-store-refinement .service-group-head>span{flex-basis:100%}
  body.towa-store-refinement .service-group-head p{flex-basis:100%;margin-left:0}
  body.towa-store-refinement .extra-inline-links{align-items:flex-start}
  body.towa-store-refinement .extra-inline-links>a{max-width:100%;white-space:normal}
  body.towa-store-refinement .footer-inner>div{min-width:0}
  body.towa-store-refinement .footer-inner a{max-width:100%;line-height:1.7}
  body.towa-store-refinement .verified-review-meta{flex-wrap:wrap;row-gap:7px}
  body.towa-store-refinement .verified-review-meta strong{overflow-wrap:anywhere}
  body.towa-store-refinement .community-review-stage .verified-reviews-head{flex-wrap:wrap}
  body.towa-store-refinement .community-review-stage .verified-reviews-head h2{min-width:0}
  body.towa-store-refinement{padding-bottom:calc(var(--mobile-dock-h,72px) + 20px + env(safe-area-inset-bottom,0px))!important}
  /* Contact stays at the footer while the mobile dock is present. */
  body.towa-store-refinement .whatsapp-help{position:relative!important;inset:auto!important;width:calc(100% - 28px);max-width:480px;min-height:60px;margin:20px auto 0;padding:10px 14px;justify-content:space-between;gap:12px;border:1px solid #2b4057;border-radius:12px;background:#101c2e;box-shadow:none;transform:none!important}
  body.towa-store-refinement .whatsapp-help>span{display:block;position:static;opacity:1;visibility:visible;transform:none;margin:0;padding:0;background:none;box-shadow:none;color:#dfe9fa;font-size:13px;line-height:1.5}
  body.towa-store-refinement .whatsapp-help>b{width:40px;height:40px;flex:0 0 40px}
}

@media(max-width:760px){
  body.towa-store-refinement .th332-shell{width:calc(100% - 20px);column-gap:6px;row-gap:6px;padding-block:7px}
  body.towa-store-refinement .th332-brand{width:32px;height:44px;padding:0}
  body.towa-store-refinement .th332-brand img{width:32px;height:32px}
  body.towa-store-refinement .th332-tools{gap:4px}
  body.towa-store-refinement .th332-currency-button{min-width:68px;height:44px;padding:0 7px;gap:5px;font-size:11px}
  body.towa-store-refinement .th332-currency-button>svg{width:10px}
  body.towa-store-refinement .th332-flag,body.towa-store-refinement .th332-header .th332-flag-svg{width:21px!important;height:14px!important}
  body.towa-store-refinement .th332-status,body.towa-store-refinement .th332-icon-button{width:40px;min-width:40px;height:44px;padding:0 6px}
  body.towa-store-refinement .th332-nav{padding:3px;gap:1px}
  body.towa-store-refinement .th332-nav>button{flex:1 1 0;min-width:0;padding:0 6px;font-size:10px;gap:5px}
  body.towa-store-refinement .th332-nav>button[data-route=shop]{flex-grow:1.45}
  body.towa-store-refinement .th332-nav>button>svg{width:13px;height:13px}
  body.towa-store-refinement .th332-currency-menu{top:calc(var(--towa-header-height,var(--towa-header-fallback)) + 8px);left:auto;right:8px}
  body.towa-store-refinement .focus-shop-guide{min-width:0}
  body.towa-store-refinement .focus-home-copy h1{overflow-wrap:break-word}
  body.towa-store-refinement .focus-action{max-width:100%;white-space:normal;text-align:center}
  body.towa-store-refinement .focus-option-note{width:auto;overflow-wrap:anywhere}
  body.towa-store-refinement #page-bots .bots-command-grid :is(.bot-form,.readiness-panel){min-width:0}
  body.towa-store-refinement #page-bots .readiness-head{gap:10px;flex-wrap:wrap}
  body.towa-store-refinement #page-bots .readiness-head strong{max-width:100%;white-space:normal;line-height:1.4}
  body.towa-store-refinement #page-bots .bots-route article>div{min-width:0}
  body.towa-store-refinement #page-bots .bots-route article strong{line-height:1.4;overflow-wrap:anywhere}
  body.towa-store-refinement #page-bots .epic-recipient-top{flex-wrap:wrap;row-gap:8px}
  body.towa-store-refinement #page-bots .recipient-card-actions{flex-wrap:wrap;gap:8px}
  body.towa-store-refinement .towa-acc-topbar,body.towa-store-refinement .towa-acc-id-top{flex-wrap:wrap;gap:12px}
  body.towa-store-refinement .account-phone-row{grid-template-columns:82px minmax(0,1fr)!important}
  body.towa-store-refinement .account-list-item{gap:10px}
  body.towa-store-refinement .checkout-panel :is(input,select,textarea){min-width:0;max-width:100%}
  body.towa-store-refinement .checkout-panel :is(.form-hint,.checkout-payment-option,.cart-summary-line){overflow-wrap:anywhere}
  body.towa-store-refinement .mini-cart-copy{min-width:0}
  body.towa-store-refinement .mini-cart-copy>strong{overflow-wrap:anywhere}
  body.towa-store-refinement .mini-cart-footer{padding-bottom:calc(14px + env(safe-area-inset-bottom,0px))}
  body.towa-store-refinement .modal-overlay>.modal{max-width:calc(100vw - 16px)!important;max-height:calc(100dvh - 16px - env(safe-area-inset-bottom,0px))!important}
  body.towa-store-refinement .modal-overlay>.modal>.modal-close{float:none!important;display:grid;place-items:center;position:sticky!important;inset:8px auto auto!important;margin:8px 8px -52px auto;z-index:8}
  body.towa-store-refinement .locker-info .modal-name{overflow-wrap:anywhere;line-height:1.12}
  body.towa-store-refinement .locker-facts span{flex-wrap:wrap;gap:7px 14px}
  body.towa-store-refinement .locker-facts b{max-width:100%;overflow-wrap:anywhere}
}

@media(max-width:480px){
  body.towa-store-refinement .footer-inner{grid-template-columns:minmax(0,1fr)!important;gap:28px!important}
  body.towa-store-refinement .footer-inner>div{width:100%}
  body.towa-store-refinement .footer-bottom{align-items:flex-start;flex-direction:column;gap:10px;line-height:1.7}
  body.towa-store-refinement .community-review-stage{padding-inline:14px}
  body.towa-store-refinement .community-review-stage .towa-community-copy{padding:30px 22px}
  body.towa-store-refinement .community-review-stage .verified-reviews{padding:24px 20px}
  body.towa-store-refinement .topup-summary-lines>div{flex-wrap:wrap;gap:7px}
  body.towa-store-refinement .topup-summary-lines dd{max-width:100%;overflow-wrap:anywhere}
  body.towa-store-refinement .topup-summary-total>strong{flex-wrap:wrap;line-height:1.1}
  body.towa-store-refinement .checkout-community-heading{grid-template-columns:32px minmax(0,1fr)!important}
  body.towa-store-refinement .checkout-community-heading>b{grid-column:2;justify-self:start}
  body.towa-store-refinement .mini-cart-savings{grid-template-columns:28px minmax(0,1fr)!important}
  body.towa-store-refinement .mini-cart-savings>strong,body.towa-store-refinement .mini-cart-savings>b{grid-column:2!important;grid-row:auto!important;justify-self:start!important;margin:0!important}
}

@media(max-width:360px){
  :root{--towa-header-fallback:162px}
  /* At 320px six utility buttons and a logo cannot share one line. Keep the
     actions visible in their own row instead of hiding account/cart access. */
  body.towa-store-refinement .th332-shell{grid-template-columns:minmax(0,1fr);grid-template-areas:'brand' 'tools' 'navigation'}
  body.towa-store-refinement .th332-brand{width:auto;height:32px;gap:8px;justify-self:start}
  body.towa-store-refinement .th332-brand img{width:28px;height:28px}
  body.towa-store-refinement .th332-brand span{display:grid}
  body.towa-store-refinement .th332-brand strong{font-size:14px}
  body.towa-store-refinement .th332-brand small{font-size:6px;margin-top:3px}
  body.towa-store-refinement .th332-tools{justify-self:stretch;justify-content:space-between;gap:4px}
  body.towa-store-refinement .th332-status,body.towa-store-refinement .th332-icon-button{width:38px;min-width:38px}
  body.towa-store-refinement .th332-currency-button{min-width:76px}
  body.towa-store-refinement .th332-nav>button{padding-inline:4px;font-size:10px}
  body.towa-store-refinement .focus-option-direct{grid-template-columns:minmax(0,1fr)}
  body.towa-store-refinement .focus-option-direct img{width:100%;height:135px;object-fit:contain;grid-row:1}
  body.towa-store-refinement .focus-option-direct .focus-action{width:100%}
  body.towa-store-refinement #shopContent .shop-grid{grid-template-columns:minmax(0,1fr)!important}
  body.towa-store-refinement .item-thumb{aspect-ratio:1.1!important}
  body.towa-store-refinement .item-name{min-height:0;font-size:18px!important}
  body.towa-store-refinement .item-price{font-size:18px!important}
  body.towa-store-refinement #page-bots .bots-signal-row{gap:7px;flex-wrap:wrap}
  body.towa-store-refinement #page-bots .bots-signal{max-width:100%;white-space:normal;line-height:1.5}
  body.towa-store-refinement .recharge-stats{grid-template-columns:minmax(0,1fr)!important}
}
