/* ============================================================
   DIGISTORE RESPONSIVE — global safety net (loaded last).
   No redesign: reflow / stack / collapse only. Fluid-first:
   clamp(), minmax(), min(), flex-wrap, grid auto-flow.
   Breakpoints: 1440 / 1280 / 1100 / 992 / 768 / 600 / 480 / 375 / 320.
   ============================================================ */

/* ---- 0. Global containment (all viewports) ---- */
html,body{overflow-x:clip}
@supports not (overflow:clip){html,body{overflow-x:hidden}}
img,video,iframe,svg{max-width:100%}
img{height:auto}
iframe{width:100%}
.wrap{max-width:var(--wrap,1220px)}
table{max-width:100%}
.entry-content{overflow-wrap:anywhere}
.entry-content table{display:block;overflow-x:auto;-webkit-overflow-scrolling:touch}
pre{max-width:100%;overflow-x:auto}

/* Woo tables: scroll, never push the viewport */
.woocommerce table.shop_table{display:block;overflow-x:auto;-webkit-overflow-scrolling:touch}
.woocommerce table.shop_table thead,.woocommerce table.shop_table tbody{display:table;width:100%;min-width:560px}
.otable{display:block;overflow-x:auto;-webkit-overflow-scrolling:touch}
.otable table,.otable thead,.otable tbody{width:100%}
.responsive-table-wrap{overflow-x:auto;-webkit-overflow-scrolling:touch}

/* Long names / prices / meta wrap */
.product__title,.phero__title,.entry-title,.tkt__hd h4,.lic__info h4,.dl__info h4,.wcard__bd h4{overflow-wrap:anywhere}
.price__now,.price__wc,.oid{overflow-wrap:anywhere}
.product__price,.product__cta,.lic,.dl{flex-wrap:wrap}

/* Touch targets */
.btn,.icon-btn,.page-numbers,.pager button,.viewtog button,.stab,.tab{min-height:44px}
.btn--xs,.pager button,.viewtog button{min-height:38px}

/* Respect WordPress Admin Bar heights across breakpoints */
.admin-bar .hdr{top:32px}
@media(max-width:782px){.admin-bar .hdr{top:46px}}
@media(max-width:600px){.admin-bar .hdr{top:0}}

/* ---- 1. Large desktop 1440px+ ---- */
@media(min-width:1440px){
  .wrap{max-width:var(--wrap,1220px)}
}

/* ---- 2. Laptop 1280px ---- */
@media(max-width:1280px){
  :root{--gut:clamp(14px,3vw,24px)}
  .list-view .product__media{width:240px}
}

/* ---- 3. Small laptop 1100px ---- */
@media(max-width:1100px){
  .sec{padding-block:clamp(44px,6vw,72px)}
  .hero h1{font-size:clamp(1.9rem,4.4vw,2.9rem)}
  .svc-grid{grid-template-columns:repeat(2,1fr)}
  .band{grid-template-columns:repeat(2,1fr);row-gap:26px}
  .hdr__in{gap:12px}
}

/* ---- 4. Tablet portrait 992px ---- */
@media(max-width:992px){
  .hero__in{grid-template-columns:1fr}
  .searchbar{flex-wrap:wrap;border-radius:var(--r-lg)}
  .searchbar select{flex:1;min-width:140px}
  .plans{grid-template-columns:1fr;max-width:480px;margin-inline:auto}
  .faq-wrap{grid-template-columns:1fr}
  .faq-aside{position:static}
  .svc__ft{flex-wrap:wrap}
  .phero__in{grid-template-columns:1fr}
  .pcontent{grid-template-columns:1fr}
  .steps{grid-template-columns:repeat(2,1fr)}
  .modal{padding:14px}
  .qv__body{padding:24px}
}

/* ---- 5. Tablet 768px ---- */
@media(max-width:768px){
  :root{--hdr:64px}
  body{font-size:15px}
  h1{font-size:clamp(1.5rem,6vw,2rem)}
  h2{font-size:clamp(1.3rem,5vw,1.7rem)}
  .sec{padding-block:clamp(40px,8vw,60px)}
  .sec-head{margin-bottom:clamp(26px,6vw,40px)}

  /* Header: compact controls */
  .hdr__in{min-height:64px}
  .logo{font-size:1.05rem}
  .logo__mark{width:36px;height:36px}
  .user-pill span{max-width:110px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
  .announce{font-size:.76rem}
  .announce__in{padding-right:44px}

  /* Hero */
  .hero{padding-block:clamp(36px,9vw,56px)}
  .hero h1{font-size:clamp(1.7rem,7.4vw,2.4rem)}
  .searchbar{flex-direction:column;align-items:stretch;border-radius:var(--r-lg);padding:10px}
  .searchbar input{text-align:center}
  .searchbar .btn{width:100%}
  .stats-strip{grid-template-columns:repeat(2,1fr)}
  .bento{grid-template-columns:1fr}
  .bx--wide{flex-direction:column;align-items:flex-start}

  /* Grids collapse */
  .cats,.svc-grid,.why,.steps{grid-template-columns:1fr}
  .cat-card--feat{grid-column:1/-1}
  .band{grid-template-columns:1fr 1fr}
  .grid-p{grid-template-columns:repeat(auto-fill,minmax(min(100%,240px),1fr));gap:16px}
  .toolbar{flex-direction:column;align-items:stretch}
  .sortbox{justify-content:space-between;flex-wrap:wrap}

  /* Product cards stay readable; keep Quick View & Wishlist accessible on touch */
  .product__body{padding:16px}
  .product__price{flex-wrap:wrap}
  .icon-btn.wish{width:44px;height:44px}
  .product__actions{transform:none;inset:auto 10px 10px auto;padding:0;background:none;justify-content:flex-end}
  .product__actions .btn{min-height:38px;padding:0 13px;font-size:.78rem;background:rgba(255,255,255,.94);box-shadow:var(--sh-2)}

  /* Shop */
  .prange__vals input{min-height:42px}
  .viewtog button{width:44px;height:42px}

  /* Single product rules (buybox static, tabbar scroll, spec stack)
     live in product.css — single source of truth, no duplicates here. */

  /* Cart drawer / modals fit + scroll */
  .drawer{width:min(410px,100dvw)}
  .qty button{width:38px;height:38px}
  .modal{padding:12px}
  .modal__box{max-height:92dvh}
  .qv__img{min-height:200px}

  /* Account */
  .kpi{grid-template-columns:repeat(2,1fr)}
  .qa{grid-template-columns:repeat(2,1fr)}
  .feed__row{grid-template-columns:32px minmax(0,1fr);grid-template-areas:"ico txt" "act act"}
  .feed__ico{grid-area:ico}
  .feed__txt{grid-area:txt;min-width:0}
  .feed__act{grid-area:act;justify-self:start}
  .dl{grid-template-columns:64px minmax(0,1fr)}
  .dl img,.dl__ico{width:64px;height:52px}
  .dl__act{grid-column:1/-1;flex-direction:row;flex-wrap:wrap;align-items:stretch}
  .dl__act .btn{flex:1 1 140px;min-width:0}
  .lic{grid-template-columns:1fr}
  .row2,.row3{grid-template-columns:1fr}
  .stabs{overflow-x:auto}
  .scard{padding:18px}

  /* Checkout */
  form.checkout_coupon{display:flex;flex-wrap:wrap}
  form.checkout_coupon .input{flex:1 1 200px;min-width:0}
  .woocommerce-message .button,.woocommerce-error .button,.woocommerce-info .button{float:none;display:inline-flex;margin-bottom:10px}

  /* Footer */
  .ftr__grid{grid-template-columns:1fr 1fr}
  .ftr__about{grid-column:1/-1}
  .crumbs__in{flex-direction:column;align-items:flex-start}
  /* Toasts clear the mobile sticky buy bar when visible */
  body:has(.mbar.on) .toasts{bottom:calc(92px + env(safe-area-inset-bottom))}
}

/* ---- 6. Large mobile 600px ---- */
@media(max-width:600px){
  .wrap{padding-inline:16px}
  .btn{padding:0 20px}
  .btn--block{width:100%}
  .hero h1{font-size:clamp(1.6rem,8.4vw,2.1rem)}
  .hero h1 .u{white-space:normal}
  .pill{flex-wrap:wrap;border-radius:var(--r-lg)}
  .proof{justify-content:center;text-align:center}
  .band{grid-template-columns:1fr}
  .plans{max-width:none}
  .plan__price .v{font-size:2.5rem}
  .tcard{flex-basis:min(340px,86vw)}
  .acc__q{padding:16px;font-size:.88rem}

  /* Shop */
  .shop-hero__grid{grid-template-columns:1fr}
  .toolbar__right{width:100%;margin-left:0;display:grid;grid-template-columns:1fr 1fr;gap:10px}
  .toolbar__right .filter-mobile{grid-column:1/-1}
  .toolbar__right select{min-width:0;width:100%}
  .toolbar__right .viewtog{grid-column:1/-1;justify-self:start}
  .grid-p{grid-template-columns:1fr}
  .list-view .product{flex-direction:column}
  .list-view .product__media{width:100%}
  .pager button{min-width:40px;height:40px}
  .slider input[type=range]{height:22px}

  /* Product */
  .gal__stage{aspect-ratio:4/3}
  .buybox__act .btn{width:100%}
  .qtybox{width:100%;justify-content:space-between}

  /* Cart / checkout */
  .ds-coupon{flex-direction:column}
  .ds-coupon .btn{width:100%}
  .woocommerce .cart-collaterals .cart_totals,.woocommerce-page .cart-collaterals .cart_totals{padding:18px}

  /* Account */
  .kpi,.qa{grid-template-columns:1fr}
  .main{padding:18px 14px}
  .side__menu{padding:0 8px}

  /* Notices */
  .woocommerce-message,.woocommerce-info,.woocommerce-error,.woocommerce-notice{font-size:.84rem;padding:12px 14px}

  /* Footer / CTA */
  .ftr__grid{grid-template-columns:1fr}
  .nl input{text-align:center}
  .toasts{left:12px;right:12px;bottom:12px}
  .totop{right:14px;bottom:14px;width:44px;height:44px}
}

/* ---- 7. Mobile 480px ---- */
@media(max-width:480px){
  body{font-size:14.5px}
  .btn{white-space:normal;text-align:center;line-height:1.35}
  .hdr__act{gap:6px}
  .icon-btn{width:40px;height:40px}
  /* Account pill goes icon-only: label would push .hdr__act past 427px
     (overflowing every viewport below ~450px, incl. 390/414/430). */
  .user-pill{padding:4px}
  .user-pill span{display:none}
  .user-pill i{margin:0}
  /* Burger is last in .hdr__act: without room it clips off-screen and mobile
     loses its only menu. Wishlist + notifications both live in My Account too,
     so park them below 480px to guarantee logo/search/cart/account/burger fit. */
  .dsw-hdr,
  .dsn-bell-wrap{display:none}
  .hdr__act > *{flex-shrink:0}
  .burger{flex-shrink:0}
  .hero-stats{gap:14px}
  .stat{padding:16px}
  .svc{padding:22px}
  .plan{padding:26px 20px}
  .scard__hd{flex-direction:column;align-items:flex-start}
  .notif-row{flex-direction:column;align-items:flex-start;gap:10px}
  .tkt__replyform{flex-direction:column}
  .tkt__replyform .btn{width:100%}
  .field .row2{grid-template-columns:1fr}
  select.input,.input{font-size:16px} /* prevents iOS zoom on focus */
  .lic select,.qtyrow .quantity input.qty{font-size:16px}
  .woocommerce form .form-row input.input-text,.woocommerce form .form-row select,.woocommerce form .form-row textarea{font-size:16px}
}

/* ---- 8. Small mobile 375px ---- */
@media(max-width:375px){
  .wrap{padding-inline:14px}
  .logo span:not(.logo__mark){font-size:1rem}
  .announce__in{font-size:.72rem}
  .kpi__card{padding:16px;gap:12px}
  .kpi__ico{width:44px;height:44px}
  .dl{grid-template-columns:1fr;text-align:left}
  .dl img,.dl__ico{width:100%;height:120px}
  .feed__row{padding:14px 16px}
  .otable th,.otable td{padding:12px}
  .drawer__hd,.drawer__bd,.drawer__ft{padding-left:16px;padding-right:16px}
}

/* ---- 9. Tiny 320px ---- */
@media(max-width:320px){
  .hdr__in{gap:8px}
  .logo__mark{width:32px;height:32px;font-size:.85rem}
  #btnSearch{display:none}
  .hero h1{font-size:1.55rem}
  .chips{gap:6px}
  .chip{padding:5px 10px;font-size:.74rem}
  .catrow{gap:7px}
  .catpill{padding:8px 13px;font-size:.78rem}
  .pager{gap:5px}
  .pager button{min-width:36px;height:38px;padding:0 8px}
  .ftr__bot{font-size:.76rem}
}

/* ---- Safe areas (notch devices) ---- */
@supports(padding:max(0px)){
  .hdr,.mnav,.drawer,.modal__box,.totop,.toasts{
    padding-left:max(0px,env(safe-area-inset-left));
    padding-right:max(0px,env(safe-area-inset-right));
  }
  .drawer__ft,.totop{margin-bottom:env(safe-area-inset-bottom)}
}

/* ---- Reduced motion stays respected ---- */
@media(prefers-reduced-motion:reduce){
  html{scroll-behavior:auto}
  .nav__item > .sub-menu,.nav__item .mega,.mnav__sub,.fcol__body,.nav__link::after{transition:none}
}
