/* v4.8: measured product proportions, aligned Woo cards and iOS-safe search. */
html { overflow-x:clip; }
body { background-color:#fff!important; }
body:not(.home) main, body:not(.home) .sp-page-content,
body:not(.home) .sp-woo, body:not(.home) .woocommerce,
body:not(.home) .woocommerce-account .woocommerce,
body:not(.home) .entry-content, body:not(.home) .sp-entry,
body:not(.home) .sp-page-banner { background-color:#fff!important; }
/* Account, checkout and cart must not inherit the old cream canvas. */
body.woocommerce-account .woocommerce form.login,
body.woocommerce-account .woocommerce form.register,
body.woocommerce-account .woocommerce .u-columns,
body.woocommerce-account .woocommerce .col-1,
body.woocommerce-account .woocommerce .col-2,
body.woocommerce-cart .woocommerce-cart-form,
body.woocommerce-checkout .woocommerce-checkout { background-color:#fff!important; }
/* Frame the visible slide instead of FlexSlider's moving wrapper. */
body.single-product.woocommerce div.product .woocommerce-product-gallery .flex-viewport {
  border:1px solid #e4e8df; border-radius:13px; background:#fff;
}
body.single-product.woocommerce div.product .flex-control-thumbs {
  display:grid!important; grid-template-columns:repeat(4,minmax(0,1fr));
  gap:8px!important; margin:12px 0 0!important; padding:0!important;
  list-style:none; clear:both; width:100%;
}
body.single-product.woocommerce div.product .flex-control-thumbs li {
  width:100%!important; float:none!important; margin:0!important;
  min-width:0; border:1px solid #e2e8e2; border-radius:9px; overflow:hidden;
}
body.single-product.woocommerce div.product .flex-control-thumbs li img {
  display:block; width:100%!important; aspect-ratio:1/1; height:auto!important;
  object-fit:cover; opacity:1!important; border-radius:8px;
}
body.single-product.woocommerce div.product .flex-control-thumbs li img.flex-active {
  outline:2px solid #1c6e39; outline-offset:-2px;
}

@media(min-width:768px){
 body.single-product.woocommerce div.product div.images { width:43%; max-width:510px; }
 body.single-product.woocommerce div.product div.summary { width:53%; }
 body.single-product.woocommerce div.product div.images img { max-height:470px; object-fit:contain; }
 body.single-product.woocommerce div.product .product_title {
   font-size:clamp(24px,1.65vw,30px); line-height:1.48; letter-spacing:-.02em;
 }
 body.single-product.woocommerce div.product p.price,
 body.single-product.woocommerce div.product span.price { font-size:23px; }
}
/* Cards have consistent image areas, text space, and bottom-aligned actions. */
.woocommerce ul.products { align-items:stretch; }
.woocommerce ul.products li.product { display:flex!important; flex-direction:column; min-width:0; height:100%; }
.woocommerce ul.products li.product a.woocommerce-LoopProduct-link { display:block; min-width:0; }
.woocommerce ul.products li.product img { display:block; width:100%; aspect-ratio:1/1; object-fit:contain; background:#fff; }
.woocommerce ul.products li.product .woocommerce-loop-product__title {
  font-family:'DM Sans','Noto Nastaliq Urdu',sans-serif;
  font-size:16px; line-height:1.55; font-weight:700; overflow-wrap:anywhere;
  min-height:76px; margin:12px 0 7px;
}
.woocommerce ul.products li.product .price { font-size:17px; line-height:1.45; margin:0 0 10px; }
.woocommerce ul.products li.product .button { margin-top:auto; }

@media(max-width:760px){
 /* WooCommerce FlexSlider: thumbnails must sit below the full-size image,
    never in an inherited float/slider row or under the image frame. */
 body.single-product.woocommerce div.product .woocommerce-product-gallery { min-width:0; overflow:visible; }
 /* Keep FlexSlider's calculated slide widths, float and transforms untouched. */
 body.single-product.woocommerce div.product .flex-viewport { overflow:hidden!important; width:100%; border-radius:13px; }
 body.single-product.woocommerce div.product .flex-control-thumbs {
   display:grid!important; grid-template-columns:repeat(4,minmax(0,1fr));
   gap:8px!important; margin:12px 0 0!important; padding:0!important;
   width:100%; list-style:none; clear:both; position:relative;
 }
 body.single-product.woocommerce div.product .flex-control-thumbs li {
   display:block!important; float:none!important; width:100%!important;
   min-width:0; margin:0!important; padding:0!important; overflow:hidden;
   border:1px solid #e2e8e2; border-radius:9px; aspect-ratio:1/1;
 }
 body.single-product.woocommerce div.product .flex-control-thumbs li img {
   display:block!important; width:100%!important; height:100%!important;
   max-height:none!important; object-fit:cover!important; margin:0!important;
   opacity:1!important; position:static!important; border-radius:8px;
 }
 body.single-product.woocommerce div.product .flex-control-thumbs li img.flex-active {
   outline:2px solid #1c6e39; outline-offset:-2px;
 }
 html,body { max-width:100%; overflow-x:clip!important; }
 body .sp-container,body .sp-header-inner,body .sp-page-content { max-width:100%; }
 body:not(.home),body:not(.home) main,body:not(.home) .sp-page-content,
 body:not(.home) .sp-woo,body:not(.home) .woocommerce,
 body:not(.home) .content-area,body:not(.home) .site-content,
 body:not(.home) .sp-page-banner,body.woocommerce-account .sp-page-content,
 body.woocommerce-account .woocommerce .u-columns,
 body.woocommerce-account .woocommerce form.login,
 body.woocommerce-account .woocommerce form.register { background:#fff!important; }
 .sp-header-v2 .sp-header-search { min-width:0!important; max-width:100%!important; width:100%!important; }
 /* iOS zooms a focused form field below 16px; this prevents the off-screen view. */
 .sp-header-v2 .sp-header-search input[name="s"] {
   font-size:16px!important; width:100%!important; min-width:0!important;
   max-width:100%!important; -webkit-text-size-adjust:100%;
 }
 .sp-header-v2 .sp-header-search button[type="submit"] { flex-shrink:0; }
 .sp-header-v2 .sp-header-search .sp-live-results {
   left:0!important; right:0!important; inset-inline:0!important;
   width:100%!important; min-width:0!important; max-width:100%!important;
   box-sizing:border-box; overflow-x:hidden!important;
   max-height:min(320px,42dvh)!important; overscroll-behavior:contain;
 }
 .sp-header-v2 .sp-header-search .sp-live-item { min-width:0; max-width:100%; overflow:hidden; }
 .sp-header-v2 .sp-header-search .sp-live-item-info { min-width:0; max-width:100%; }
 .sp-header-v2 .sp-header-search .sp-live-item strong {
   font-size:14px; line-height:1.35; display:-webkit-box; -webkit-line-clamp:2;
   line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; overflow-wrap:anywhere;
 }
 .sp-header-v2 .sp-header-search .sp-live-item small { font-size:13px; max-width:100%; overflow:hidden; text-overflow:ellipsis; }
 .woocommerce ul.products li.product .woocommerce-loop-product__title { font-size:14px; min-height:70px; }
 .woocommerce ul.products li.product .price { font-size:15px; }
}
/* Informational/legal pages: readable hierarchy instead of oversized global headings. */
.sp-standard-page { max-width:1000px; }
.sp-standard-page > h1 { font:750 clamp(28px,3vw,38px)/1.3 'DM Sans','Noto Nastaliq Urdu',sans-serif; margin:0 0 27px; }
.sp-standard-page .sp-entry { max-width:900px; font:400 15px/1.85 'DM Sans','Noto Nastaliq Urdu',sans-serif; overflow-wrap:anywhere; }
.sp-standard-page .sp-entry h1 { font:750 clamp(24px,2.5vw,30px)/1.4 'DM Sans',sans-serif; }
.sp-standard-page .sp-entry h2 { font:750 clamp(21px,2.1vw,27px)/1.4 'DM Sans','Noto Nastaliq Urdu',sans-serif; margin:29px 0 12px; }
.sp-standard-page .sp-entry h3 { font:750 clamp(18px,1.8vw,22px)/1.45 'DM Sans','Noto Nastaliq Urdu',sans-serif; margin:24px 0 10px; }
.sp-standard-page .sp-entry p { margin:0 0 16px; }
.sp-standard-page .sp-entry ul { padding-inline-start:22px; }
@media(max-width:760px){
 .sp-standard-page > h1 { font-size:29px; }
 .sp-standard-page .sp-entry h2 { font-size:22px; }
 .sp-standard-page .sp-entry { font-size:14px; line-height:1.8; }
}
