/* TOFY PAY V50 — Mobile App UI
   Mobile/tablet-only responsive shell. Desktop design is intentionally unchanged. */

@media (max-width: 900px){
  html,body{max-width:100%;overflow-x:hidden}
  body{padding-bottom:calc(78px + env(safe-area-inset-bottom));-webkit-tap-highlight-color:transparent;overscroll-behavior-y:contain}
  img,svg,video,canvas{max-width:100%;height:auto}
  button,a,input,select,textarea{touch-action:manipulation}
  input,select,textarea{font-size:16px!important}

  .topbar{
    position:sticky;top:0;z-index:1000;height:auto!important;min-height:66px;
    padding:calc(8px + env(safe-area-inset-top)) 10px 8px!important;
    display:grid!important;grid-template-columns:minmax(0,1fr) auto!important;
    gap:8px!important;background:#07090df2!important;backdrop-filter:blur(22px);
  }
  .topbar .brand{min-width:0;gap:8px!important}
  .topbar .brand-symbol{width:38px!important;height:38px!important;object-fit:contain!important}
  .topbar .brand-words{min-width:0}
  .topbar .brand-words>b{font-size:15px!important;letter-spacing:.08em;white-space:nowrap}
  .topbar .brand-words>small{font-size:8px!important;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:145px}
  .topbar>nav{display:none!important}
  .top-actions{display:flex!important;justify-content:flex-end;gap:6px!important;min-width:0;flex-wrap:nowrap}
  .top-actions>.wallet-chip,.top-actions>.account-btn,.top-actions>.logout-link,.top-actions>.cart-header-link{display:none!important}
  .top-actions .icon-btn,.top-actions .theme-toggle{width:42px!important;height:42px!important;min-width:42px!important;padding:0!important;display:grid!important;place-items:center!important;border-radius:13px!important}
  .top-actions .lang-switch,.top-actions .language-switcher{max-width:112px}
  .topbar .tofy-pwa-install{min-width:42px!important;height:42px!important;padding:0 10px!important;border-radius:13px!important}
  .topbar .tofy-pwa-install .pwa-label{display:none!important}

  .layout,.layout.layout-global-side,body:not([data-page="home"]) .layout.layout-global-side{
    display:block!important;width:100%!important;max-width:none!important;padding:8px 10px 14px!important;margin:0!important;
  }
  .layout-global-side>.side,.layout>.side{display:none!important}
  .layout-global-side>.right,.layout>.right,.home28-rail-right{display:none!important}
  .page-main{width:100%!important;max-width:100%!important;min-width:0!important;padding:0!important;margin:0!important;overflow:visible!important}

  .mobile-bottom-nav{
    position:fixed!important;z-index:9998!important;left:8px!important;right:8px!important;bottom:calc(8px + env(safe-area-inset-bottom))!important;
    height:64px!important;display:grid!important;grid-template-columns:repeat(5,minmax(0,1fr))!important;
    border:1px solid #d7a13c55!important;border-radius:20px!important;
    background:linear-gradient(180deg,#0b0d12f5,#07080cf5)!important;backdrop-filter:blur(22px)!important;
    box-shadow:0 0 28px #d69a2720,0 14px 35px #000b!important;overflow:hidden!important;
  }
  .mobile-bottom-nav a{min-width:0!important;display:flex!important;align-items:center!important;justify-content:center!important;flex-direction:column!important;gap:3px!important;color:#9da0a7!important;font-size:18px!important;padding:5px 2px!important}
  .mobile-bottom-nav a b{font-size:9px!important;line-height:1.1!important;max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
  .mobile-bottom-nav a.on{color:#ffd36d!important;background:linear-gradient(180deg,#e7ad3422,#9d671010)!important}
  .mobile-bottom-nav a.on span{filter:drop-shadow(0 0 8px #e6aa32)}

  /* Global cards and media */
  .product-card img,.featured-cards img,.p284-logo img,.catalog-card img{object-fit:cover!important;object-position:center!important}
  .product-card{min-width:0!important}
  .product-card img{aspect-ratio:1.2/1!important;height:auto!important;min-height:0!important}
  .featured-cards,.product-grid,.network-grid,.gift-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:10px!important}
  .content-hero{padding:18px!important;border-radius:16px!important}
  .content-hero h1{font-size:24px!important}
  .catalog-toolbar{flex-wrap:wrap!important}
  .catalog-toolbar input{width:100%!important;min-height:46px!important}

  /* Home */
  .hero-slider{min-height:0!important;border-radius:18px!important}
  .hero-slide{grid-template-columns:1fr!important;min-height:0!important;padding:20px 18px 28px!important}
  .hero-copy h1{font-size:25px!important}.hero-copy h2{font-size:28px!important}
  .hero-copy p{font-size:13px!important;line-height:1.7!important}
  .hero-art{min-height:190px!important;margin-top:8px}
  .phone{width:116px!important;height:196px!important;border-radius:22px!important}
  .hex{width:48px!important;height:48px!important;font-size:20px!important}
  .hero-features{gap:10px!important;flex-wrap:wrap!important}
  .hero-actions{display:grid!important;grid-template-columns:1fr 1fr!important}
  .hero-actions a,.hero-actions button{min-height:46px!important;display:grid!important;place-items:center!important}
  .assurance{grid-template-columns:1fr!important;gap:8px!important}
  .category-strip{display:flex!important;overflow-x:auto!important;scroll-snap-type:x proximity;padding:6px!important}
  .category-strip a{flex:0 0 92px!important;scroll-snap-align:start;border-left:1px solid #282012!important}
  .stats-strip{grid-template-columns:repeat(2,1fr)!important;overflow:hidden}
  .stats-strip div:nth-child(5){grid-column:1/-1}

  /* Gift cards: app-style, 2 columns */
  .giftcards-v18-page .layout{display:block!important;padding:8px 10px!important}
  .gc18-shell{display:block!important}
  .gc18-rail{position:static!important;display:grid!important;grid-template-columns:1fr!important;margin-top:14px!important}
  .gc18-hero{grid-template-columns:1fr!important;min-height:0!important;border-radius:18px!important}
  .gc18-hero-copy{padding:22px 18px!important}
  .gc18-hero h1{font-size:30px!important}
  .gc18-hero p{font-size:12px!important;line-height:1.75!important}
  .gc18-hero-art{min-height:185px!important}
  .gc18-giftbox{transform:translateX(-50%) rotate(4deg) scale(.78)!important;top:18px!important}
  .gc18-float-card{transform:translateX(-50%) rotate(-5deg) scale(.82)!important;bottom:9px!important}
  .gc18-filters{display:flex!important;overflow-x:auto!important;overflow-y:hidden!important;scroll-snap-type:x proximity;border-radius:13px!important;gap:0!important}
  .gc18-filters button{flex:0 0 auto!important;min-width:128px!important;min-height:46px!important;scroll-snap-align:start!important;padding:0 13px!important}
  .gc18-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:10px!important}
  .gc18-card-face{min-height:0!important;aspect-ratio:.76/1!important;border-radius:14px!important}
  .gc18-card-custom{object-fit:cover!important;object-position:center!important;opacity:.22!important}
  .gc18-card-brand{top:18px!important}.gc18-card-brand img{width:30px!important}.gc18-card-brand b{font-size:12px!important}.gc18-card-brand small{font-size:6px!important}
  .gc18-value{font-size:clamp(31px,10vw,46px)!important;top:45%!important}
  .gc18-digital{font-size:8px!important;top:62%!important;padding:0 5px!important}
  .gc18-card-foot{left:8px!important;right:8px!important;bottom:9px!important;font-size:7px!important}
  .gc18-ribbon{transform:scale(.72);transform-origin:top right}
  .gc18-crown{top:47px!important;font-size:26px!important}
  .gc18-vip{font-size:9px!important;padding:5px 8px!important}
  .gc18-buyrow{margin:0 3px!important;padding:8px!important;gap:5px!important;flex-direction:column!important;align-items:stretch!important}
  .gc18-buyrow>div{display:flex!important;align-items:center!important;justify-content:space-between!important}
  .gc18-buyrow small{font-size:8px!important}.gc18-buyrow strong{font-size:14px!important}
  .gc18-buy{width:100%!important;min-height:42px!important;justify-content:center!important;padding:8px 6px!important;font-size:11px!important}
  .gc18-how{padding:15px!important}.gc18-steps{grid-template-columns:1fr 1fr!important;gap:10px!important}.gc18-steps article{min-height:145px!important;padding:16px 9px!important}
  .gc18-stats{grid-template-columns:1fr 1fr!important;gap:9px!important}.gc18-stats article{padding:11px!important;grid-template-columns:34px 1fr!important}.gc18-stats b{font-size:22px!important}.gc18-stats strong{font-size:16px!important}

  /* Products */
  .p284-grid,.p284-chat-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:9px!important}
  .p284-card{min-width:0!important;min-height:0!important;padding:9px!important}
  .p284-logo{height:auto!important;aspect-ratio:1/1!important}
  .p284-logo img{width:100%!important;height:100%!important;max-width:none!important;border-radius:16px!important}
  .p284-title h1{font-size:26px!important}
  .p284-toolbar{flex-direction:column!important;align-items:stretch!important}.p284-toolbar select{width:100%!important}

  /* Tables/forms/modals */
  .table-card{overflow-x:auto!important;-webkit-overflow-scrolling:touch}.table-card table{min-width:650px}
  .gift-modal:not([hidden]),.auth-modal:not([hidden]){padding:10px!important;align-items:end!important}
  .gc18 .gift-modal-card,.auth-dialog{width:100%!important;max-width:100%!important;border-radius:22px 22px 14px 14px!important;max-height:88dvh!important;overflow:auto!important}
}

@media (max-width: 380px){
  .topbar{padding-inline:7px!important}.topbar .brand-words>small{display:none!important}
  .topbar .brand-symbol{width:34px!important;height:34px!important}.topbar .brand-words>b{font-size:13px!important}
  .top-actions{gap:4px!important}.top-actions .icon-btn,.top-actions .theme-toggle,.topbar .tofy-pwa-install{width:38px!important;height:38px!important;min-width:38px!important}
  .gc18-grid,.p284-grid,.p284-chat-grid,.featured-cards,.product-grid,.network-grid,.gift-grid{grid-template-columns:1fr!important}
  .gc18-card-face{aspect-ratio:1.12/1!important}.gc18-value{font-size:52px!important}
  .gc18-steps,.gc18-stats{grid-template-columns:1fr!important}
}

@media (display-mode: standalone){
  body{user-select:none}
  input,textarea{user-select:text}
  .topbar{box-shadow:0 10px 28px #0009}
}
