/* TAQA STORE V275 — UI/UX Pro Max polish layer
   Scope: visual/accessibility/responsive refinement only.
   Principles applied: accessible focus, 44px touch targets, mobile-first resilience,
   stable interaction states, readable compact text, safe-area spacing, reduced motion,
   no horizontal page overflow, consistent 4/8px rhythm, lighter mobile paint cost. */

:root{
  --v275-touch:44px;
  --v275-focus:#8dffae;
  --v275-focus-shadow:0 0 0 4px rgba(57,255,115,.18);
  --v275-ease:cubic-bezier(.2,.8,.2,1);
  --v275-fast:160ms;
  --v275-normal:220ms;
  --v275-gutter-mobile:14px;
  --v275-readable:72ch;
}

/* ---------- Baseline resilience ---------- */
html{
  width:100%;
  max-width:100%;
  background:var(--taqa-bg,#010604);
  -webkit-text-size-adjust:100%;
  text-size-adjust:100%;
  scroll-padding-top:88px;
}
html,body{overflow-x:clip;}
@supports not (overflow:clip){html,body{overflow-x:hidden;}}
body{min-width:0;}
*,*::before,*::after{box-sizing:border-box;}
img,video,canvas,picture{max-width:100%;}
img{height:auto;}
main,section,article,aside,header,footer,nav,form,
.container,.taqa-v242-home,.v263-store-main,.ca-main,.admin-main,.admin-content{min-width:0;}
:where(.container,.taqa-v242-home,.v263-store-main,.ca-main,.admin-content)>*{min-width:0;}

button,input,select,textarea{font:inherit;}
button,[role="button"],a,input,select,textarea,summary{
  -webkit-tap-highlight-color:rgba(57,255,115,.14);
}
button,[role="button"],summary{touch-action:manipulation;}
button:disabled,[aria-disabled="true"]{
  opacity:.46!important;
  cursor:not-allowed!important;
  pointer-events:none!important;
}

/* Keyboard skip link: invisible until focused, then clear and reachable. */
.v275-skip-link{
  position:fixed;top:10px;inset-inline-start:10px;z-index:2147483000;
  transform:translateY(-150%);padding:10px 14px;border-radius:10px;
  background:#f4f7f5;color:#071009!important;border:2px solid #39ff73;
  font:800 13px/1.2 "IBM Plex Sans Arabic","Tajawal",sans-serif;text-decoration:none!important;
  transition:transform var(--v275-fast) var(--v275-ease);
}
.v275-skip-link:focus{transform:translateY(0);}

/* Keyboard focus must remain visible above dark surfaces. */
:where(a,button,input,select,textarea,summary,[tabindex]):focus-visible{
  outline:2px solid var(--v275-focus)!important;
  outline-offset:3px!important;
  box-shadow:var(--v275-focus-shadow)!important;
}
:where(input,select,textarea):focus-visible{
  border-color:rgba(141,255,174,.82)!important;
}

/* Stable press feedback: never resize or shift layout bounds. */
:where(button,[role="button"],.btn,.cta,.outline-btn,.v242-btn,.v263-cart-button,.checkout-submit-v39):active{
  transform:none!important;
  filter:brightness(.94);
}

/* Long content should shrink/wrap instead of widening flex/grid tracks. */
:where(h1,h2,h3,h4,p,span,small,b,strong,label,.v263-product-title,.v263-product-subtitle,.home204-product-body){
  min-width:0;
  overflow-wrap:break-word;
}
:where(.product-card,.home204-product-card,.v263-product-card,.cart-row-clean,.summary-card,.account-card,.admin-card){min-width:0;}

/* Form baseline: readable fields and semantic states. */
:where(input:not([type="checkbox"]):not([type="radio"]),select,textarea){
  min-height:44px;
  line-height:1.45;
}
:where(input,select,textarea)::placeholder{opacity:.72;}
:where(.error,[role="alert"],.field-error,.form-error){line-height:1.55;}

/* Toasts/status feedback: never tiny or hard to read. */
:where(.toast,.ca-toast,.v260-toast){font-size:max(12px,1em);line-height:1.5;}

/* ---------- Public shell / navigation ---------- */
@media (max-width:1023px){
  body:not(.taqa-admin-v260) :where(.taqa-mobile-header__icon,.v245-mobile-action,.v234-head-back,.v234-head-bell,.icon-btn,.cart-btn,.menu-btn){
    min-width:var(--v275-touch)!important;
    width:var(--v275-touch)!important;
    min-height:var(--v275-touch)!important;
    height:var(--v275-touch)!important;
  }
  body:not(.taqa-admin-v260) :where(.mobile-bottom-nav>a,.ca-bottom>a,.ca-bottom>button){
    min-height:52px!important;
  }
  body:not(.taqa-admin-v260) :where(.mobile-bottom-nav>a,.ca-bottom>a,.ca-bottom>button)>span:last-child{
    font-size:10.5px!important;
    line-height:1.15!important;
  }
  body:not(.taqa-admin-v260) .mobile-bottom-nav,
  body.customer-account-v130 .ca-bottom{
    padding-bottom:max(4px,env(safe-area-inset-bottom))!important;
  }
  /* Reduce expensive mobile blur while preserving the premium glass look. */
  body:not(.taqa-admin-v260) :where(.v245-mobile-header,.v245-bottom-nav,.ca-bottom,.v242-command,.v263-filter-sheet){
    -webkit-backdrop-filter:blur(10px)!important;
    backdrop-filter:blur(10px)!important;
  }
  body::before{opacity:.38!important;}
}

@media (hover:none){
  :where(.product-card,.home204-product-card,.v263-product-card,.v242-lane,.v242-command-link,.cat-btn):hover{
    transform:none!important;
  }
}

/* ---------- Home ---------- */
body[data-page="home"] .taqa-v242-home{max-width:1440px;}
body[data-page="home"] .v242-section-copy p,
body[data-page="home"] .v242-brand-main p,
body[data-page="home"] .v242-step p,
body[data-page="home"] .v266-faq-answer p{max-width:var(--v275-readable);}
body[data-page="home"] :where(.v242-btn,.v242-text-link,.v242-lane,.v242-command-link,.home204-category-card,.home204-cart-btn){
  touch-action:manipulation;
}

@media (max-width:760px){
  body[data-page="home"] .taqa-v242-home{padding-inline:var(--v275-gutter-mobile)!important;}
  body[data-page="home"] .v242-hero{min-height:clamp(540px,76svh,610px)!important;}
  body[data-page="home"] .v242-hero h1{font-size:clamp(31px,9.2vw,36px)!important;line-height:1.16!important;}
  body[data-page="home"] .v242-hero-copy{font-size:13px!important;line-height:1.75!important;}
  body[data-page="home"] .v242-proof{font-size:10.5px!important;line-height:1.4!important;}
  body[data-page="home"] .v242-command-link b{font-size:10.5px!important;}
  body[data-page="home"] .v242-lane small{font-size:10.5px!important;line-height:1.4!important;}
  body[data-page="home"] .v242-label{font-size:10.5px!important;}
  body[data-page="home"] .v242-text-link{min-height:44px!important;font-size:11.5px!important;padding-inline:6px!important;}

  body[data-page="home"] .v242-featured-grid{gap:10px!important;}
  body[data-page="home"] .v242-featured-grid .home204-product-card{border-radius:17px!important;}
  body[data-page="home"] .v242-featured-grid .home204-product-status{font-size:10px!important;min-height:24px!important;padding:4px 7px!important;}
  body[data-page="home"] .v242-featured-grid .home204-delivery{font-size:10.5px!important;line-height:1.3!important;}
  body[data-page="home"] .v242-featured-grid .home204-product-body h3{font-size:12.5px!important;line-height:1.5!important;min-height:38px!important;}
  body[data-page="home"] .v242-featured-grid .home204-product-subtitle{font-size:10.5px!important;line-height:1.35!important;min-height:16px!important;height:auto!important;color:#7a877f!important;}
  body[data-page="home"] .v242-featured-grid .home204-price{font-size:13px!important;}
  body[data-page="home"] .v242-featured-grid .home204-cart-btn{
    width:44px!important;height:44px!important;min-width:44px!important;min-height:44px!important;border-radius:12px!important;
  }
  body[data-page="home"] .v242-category-grid .home204-category-card small{font-size:10.5px!important;line-height:1.4!important;}
  body[data-page="home"] .v242-step p,
  body[data-page="home"] .v242-brand-main p,
  body[data-page="home"] .v242-trust-card p,
  body[data-page="home"] .v242-faq-list details p,
  body[data-page="home"] .v266-faq-answer p{font-size:11px!important;line-height:1.75!important;}
  body[data-page="home"] .v242-faq-list summary,
  body[data-page="home"] .v266-faq-item>summary{min-height:62px!important;}
  body[data-page="home"] .v266-faq-item>summary>svg{width:36px!important;height:36px!important;padding:8px!important;}
}

/* ---------- Product listing (PLP) ---------- */
@media (max-width:760px){
  body[data-page="products"].taqa-v263-storefront .v263-store-main{padding-inline:var(--v275-gutter-mobile)!important;}
  body[data-page="products"].taqa-v263-storefront .taqa-mobile-header__icon.v245-mobile-action{
    width:44px!important;height:44px!important;min-width:44px!important;min-height:44px!important;
  }
  body[data-page="products"].taqa-v263-storefront .v263-intro-copy p{font-size:12px!important;line-height:1.55!important;}
  body[data-page="products"].taqa-v263-storefront .v263-results-copy p{font-size:10.5px!important;line-height:1.35!important;}
  body[data-page="products"].taqa-v263-storefront .v263-sort,
  body[data-page="products"].taqa-v263-storefront .v263-filter-button{
    min-height:44px!important;height:44px!important;padding-inline:11px!important;
  }
  body[data-page="products"].taqa-v263-storefront .v263-sort select,
  body[data-page="products"].taqa-v263-storefront .v263-filter-button span{font-size:11px!important;}

  body[data-page="products"].taqa-v263-storefront #productsGrid.v263-products-grid{gap:10px!important;}
  body[data-page="products"].taqa-v263-storefront .v263-card-body{padding:10px!important;}
  body[data-page="products"].taqa-v263-storefront .v263-stock-badge,
  body[data-page="products"].taqa-v263-storefront .v263-highlight-badge{
    min-height:24px!important;font-size:10px!important;padding-inline:7px!important;
  }
  /* Visual heart stays compact but hit target is 44x44. */
  body[data-page="products"].taqa-v263-storefront .v263-favorite{
    width:44px!important;height:44px!important;min-width:44px!important;min-height:44px!important;border-radius:12px!important;
  }
  body[data-page="products"].taqa-v263-storefront .v263-favorite svg{width:18px!important;height:18px!important;}
  body[data-page="products"].taqa-v263-storefront .v263-delivery{
    min-height:23px!important;font-size:10px!important;line-height:1.2!important;padding-inline:6px!important;
  }
  body[data-page="products"].taqa-v263-storefront .v263-product-title{font-size:12.5px!important;line-height:1.45!important;min-height:36px!important;}
  body[data-page="products"].taqa-v263-storefront .v263-product-subtitle{font-size:10.5px!important;line-height:1.35!important;}
  body[data-page="products"].taqa-v263-storefront .v263-product-subtitle.is-empty{color:#748078!important;}
  body[data-page="products"].taqa-v263-storefront .v263-amount{font-size:16px!important;}
  body[data-page="products"].taqa-v263-storefront .v263-currency{font-size:10.5px!important;}
  body[data-page="products"].taqa-v263-storefront .v263-cart-button{
    min-width:44px!important;width:44px!important;height:44px!important;min-height:44px!important;border-radius:12px!important;
  }
  body[data-page="products"].taqa-v263-storefront .v263-cart-button svg{width:18px!important;height:18px!important;}
  body[data-page="products"].taqa-v263-storefront .v263-sheet-header button{
    width:44px!important;height:44px!important;min-width:44px!important;min-height:44px!important;
  }
  body[data-page="products"].taqa-v263-storefront .v263-sheet-group button{min-height:44px!important;font-size:11px!important;}
}

/* Preserve two cards on common phones; use one card only where two would become unusably narrow. */
@media (max-width:340px){
  body[data-page="products"].taqa-v263-storefront #productsGrid.v263-products-grid,
  body[data-page="home"] .v242-featured-grid{grid-template-columns:1fr!important;}
}

/* ---------- Search result cards ---------- */
@media (max-width:760px){
  body[data-page="search"] #v128SearchResults .product-actions .order-clean.v253-primary-action{
    min-height:44px!important;height:44px!important;font-size:11.5px!important;
  }
  body[data-page="search"] #v128SearchResults .v253-meta-chip,
  body[data-page="search"] #v128SearchResults .product-subtitle{font-size:10.5px!important;}
}

/* ---------- Product detail ---------- */
body[data-page="product"] :where(.detail-gallery img,.v255-gallery img,.product-media img){max-width:100%;}
@media (max-width:900px){
  body[data-page="product"] :where(.plan-grid button,.detail-buttons button,.detail-buttons a,.sticky-buy-bar button,.product-action,.favorite-button){min-height:44px!important;}
  body[data-page="product"] .sticky-buy-bar span{font-size:10.5px!important;line-height:1.25!important;}
  body[data-page="product"] .sticky-buy-bar button{font-size:11px!important;}
  body[data-page="product"] #stickyAdd{width:44px!important;min-width:44px!important;}
}

/* ---------- Cart / checkout ---------- */
@media (max-width:900px){
  body[data-page="cart"] .qty-control-clean{
    min-height:44px!important;height:44px!important;
    grid-template-columns:44px 34px 44px!important;
  }
  body[data-page="cart"] .qty-control-clean button{
    width:44px!important;height:44px!important;min-width:44px!important;min-height:44px!important;
  }
  body[data-page="cart"] .cart-remove-clean{
    width:44px!important;height:44px!important;min-width:44px!important;min-height:44px!important;
  }
  body[data-page="cart"] .cart-tools .outline-btn{min-height:44px!important;height:44px!important;font-size:11.5px!important;}
  body[data-page="cart"] .cart-product-text p{font-size:11px!important;line-height:1.55!important;}
  body[data-page="cart"] .checkout-cta{min-height:52px!important;}

  body[data-page="checkout"] .checkout-step-title-v39 p,
  body[data-page="checkout"] .payment-method-copy-v116 small,
  body[data-page="checkout"] .checkout-action-v119 p,
  body[data-page="checkout"] .checkout-terms-v1283,
  body[data-page="checkout"] .tiny{font-size:11px!important;line-height:1.55!important;}
  body[data-page="checkout"] .payment-method-v119{min-height:0!important;height:auto!important;width:100%!important;}
  body[data-page="checkout"] .checkout-submit-v39{min-height:52px!important;height:52px!important;}
  body[data-page="checkout"] .v244-checkout-step{min-height:44px!important;font-size:10.5px!important;}
}

/* ---------- Account / customer surfaces ---------- */
@media (max-width:760px){
  body.customer-account-v130 .v234-head-back,
  body.customer-account-v130 .v234-head-bell{width:44px!important;height:44px!important;min-width:44px!important;min-height:44px!important;}
  body.customer-account-v130 .ca-tabs button{min-height:44px!important;height:44px!important;font-size:11.5px!important;}
  body.customer-account-v130 .v232-order-action .ca-btn{min-height:44px!important;font-size:11.5px!important;}
  body.customer-account-v130 :where(.ca-btn,button,[role="button"]){touch-action:manipulation;}
  body.customer-account-v130 .ca-main{padding-inline:var(--v275-gutter-mobile)!important;}
}

/* ---------- Authentication ---------- */
body[data-page="auth"],body[data-page="forgot-password"],body[data-page="reset-password"],body[data-page="verify-email"]{
  line-height:1.55;
}
body[data-page="auth"] :where(input,button,.ca-auth-btn,.auth-tab),
body[data-page="forgot-password"] :where(input,button,.ca-auth-btn),
body[data-page="reset-password"] :where(input,button,.ca-auth-btn),
body[data-page="verify-email"] :where(input,button,.ca-auth-btn){min-height:44px;}
@media (max-width:760px){
  body[data-page="auth"] :where(.ca-auth-card,.auth-card),
  body[data-page="forgot-password"] :where(.ca-auth-card,.auth-card),
  body[data-page="reset-password"] :where(.ca-auth-card,.auth-card){width:min(100% - 24px,560px)!important;}
}

/* ---------- Static/legal/help pages ---------- */
body[data-page] :where(.policy-card,.support-card,.faq-card,.static-card) p,
body[data-page] :where(.policy-card,.support-card,.faq-card,.static-card) li{line-height:1.8;}
@media (max-width:760px){
  body[data-page] :where(.policy-card,.support-card,.faq-card,.static-card){padding-inline:16px!important;}
}

/* ---------- Admin OS ---------- */
body.taqa-admin-v260 .admin-main,
body.taqa-admin-v260 .admin-content,
body.taqa-admin-v260 .responsive-table{min-width:0;}
body.taqa-admin-v260 .responsive-table{overflow-x:auto;-webkit-overflow-scrolling:touch;}
body.taqa-admin-v260 :where(input:not([type="checkbox"]):not([type="radio"]),select,textarea){min-height:44px;}
body.taqa-admin-v260 :where(button,.btn,[role="button"]){touch-action:manipulation;}
@media (max-width:900px){
  body.taqa-admin-v260 :where(.mobile-menu-btn,.sidebar-close,.profile-btn,.settings-tabs button,.payment-tabs button,.v260-table-toolbar button){min-height:44px!important;}
  body.taqa-admin-v260 .admin-content{padding-inline:14px!important;}
  body.taqa-admin-v260 .settings-tabs,
  body.taqa-admin-v260 .payment-tabs{scroll-snap-type:x proximity;scrollbar-width:none;}
  body.taqa-admin-v260 .settings-tabs::-webkit-scrollbar,
  body.taqa-admin-v260 .payment-tabs::-webkit-scrollbar{display:none;}
  body.taqa-admin-v260 .settings-tabs button,
  body.taqa-admin-v260 .payment-tabs button{scroll-snap-align:start;}
}

/* ---------- Motion & performance ---------- */
@media (max-width:760px){
  /* Below-the-fold sections can skip off-screen paint while retaining intrinsic space. */
  body[data-page="home"] :where(.v242-section,.v242-journey,.v242-brand,.v266-purchase-help,.v266-faq-wrap){
    content-visibility:auto;
    contain-intrinsic-size:1px 620px;
  }
}

@media (prefers-reduced-motion:reduce){
  html{scroll-behavior:auto!important;}
  *,*::before,*::after{
    animation-duration:.01ms!important;
    animation-iteration-count:1!important;
    transition-duration:.01ms!important;
    scroll-behavior:auto!important;
  }
  :where(.product-card,.home204-product-card,.v263-product-card,.v242-lane,.v242-command-link,.v242-btn):hover{transform:none!important;}
}

/* ---------- Landscape / small-height safety ---------- */
@media (max-width:900px) and (orientation:landscape){
  body:not(.taqa-admin-v260){padding-bottom:calc(72px + env(safe-area-inset-bottom))!important;}
  body[data-page="home"] .v242-hero{min-height:520px!important;}
  body[data-page="products"].taqa-v263-storefront .v263-filter-sheet{max-height:88dvh!important;overflow-y:auto!important;}
  body[data-page="product"] .sticky-buy-bar{bottom:max(4px,env(safe-area-inset-bottom))!important;}
}
