
/* Parya Shop v7 — stability pass based on real WooCommerce screenshots */
html,body{max-width:100%;overflow-x:hidden}
body .container{width:min(1240px,calc(100% - 32px));max-width:1240px;margin-inline:auto}
body .section{width:100%}
body .content-shell{width:100%;max-width:none}

/* Font Awesome must never inherit Vazirmatn from WooCommerce universal rules */
.fa,.fas,.fa-solid{font-family:"Font Awesome 7 Free"!important;font-weight:900!important}
.far,.fa-regular{font-family:"Font Awesome 7 Free"!important;font-weight:400!important}
.fab,.fa-brands{font-family:"Font Awesome 7 Brands"!important;font-weight:400!important}
[class^="fa-"]:before,[class*=" fa-"]:before{font-family:inherit!important}
.woocommerce-MyAccount-navigation a:before{font-family:"Font Awesome 7 Free"!important;font-weight:900!important}

/* Header: fixed proportions, no squashing */
.header-main{grid-template-columns:minmax(130px,180px) minmax(280px,1fr) auto!important;width:100%}
.site-brand,.parya-header-search,.header-actions{min-width:0}
.parya-header-search{width:100%}
.header-actions{white-space:nowrap}
@media(min-width:1081px){.mobile-toggle{display:none!important}}

/* Product grids: one source of truth */
.woocommerce ul.products,
.woocommerce-page ul.products,
.single-product .related.products ul.products,
.single-product .upsells.products ul.products,
.parya-search-results{
  display:grid!important;
  grid-template-columns:repeat(4,minmax(0,1fr))!important;
  gap:18px!important;
  width:100%!important;
  max-width:none!important;
  padding:0!important;
  margin:0!important;
  clear:both!important;
}
.woocommerce ul.products:before,.woocommerce ul.products:after{display:none!important}
.woocommerce ul.products li.product,
.woocommerce-page ul.products li.product,
.single-product .related.products ul.products li.product,
.single-product .upsells.products ul.products li.product,
.parya-search-results>.product{
  float:none!important;width:100%!important;max-width:none!important;min-width:0!important;
  margin:0!important;display:flex!important;flex-direction:column!important;
}
.product-card .product-media{width:100%!important;aspect-ratio:1/1!important;min-height:0!important}
.product-card .product-image-link{display:flex!important;width:100%!important;height:100%!important;align-items:center;justify-content:center}
.product-card .product-media img{width:100%!important;height:100%!important;max-width:100%!important;object-fit:contain!important}
.product-card .product-info{padding:14px!important;min-width:0}
.product-card .product-info h3{font-size:13px!important;line-height:1.8!important;min-height:48px!important;margin:0 0 8px!important}
.product-card .product-info .price{font-size:13px!important;margin:0 0 10px!important}
.product-card .button{width:100%!important;margin-top:auto!important;white-space:normal!important}

/* Related/Upsell must escape any product-column sizing */
.single-product .related.products,.single-product .upsells.products{
  display:block!important;grid-column:1/-1!important;width:100%!important;max-width:1240px!important;
  margin:48px auto 0!important;clear:both!important;overflow:visible!important;
}
.single-product .related.products>h2,.single-product .upsells.products>h2{width:100%!important;margin:0 0 20px!important}
.single-product .related.products .product-card,.single-product .upsells.products .product-card{min-height:100%!important}

/* Single product main area */
body.single-product .wc-page>.container{max-width:1240px}
body.single-product .woocommerce div.product.type-product{
 display:grid!important;grid-template-columns:minmax(0,1fr) minmax(0,1fr)!important;gap:32px!important;align-items:start!important
}
body.single-product .woocommerce div.product.type-product>.woocommerce-product-gallery{grid-column:1!important;grid-row:1!important;width:100%!important}
body.single-product .woocommerce div.product.type-product>.summary{grid-column:2!important;grid-row:1!important;width:100%!important;min-width:0!important}
body.rtl.single-product .woocommerce div.product.type-product>.woocommerce-product-gallery{grid-column:2!important}
body.rtl.single-product .woocommerce div.product.type-product>.summary{grid-column:1!important}

/* Account desktop: explicit columns so RTL cannot auto-place the wrong item */
body.woocommerce-account main.section>.container{max-width:1240px!important;width:min(1240px,calc(100% - 32px))!important}
body.woocommerce-account .entry-content>.woocommerce{
 display:grid!important;grid-template-columns:minmax(0,1fr) 270px!important;gap:24px!important;align-items:start!important;width:100%!important
}
body.woocommerce-account .woocommerce-MyAccount-navigation{
 grid-column:2!important;grid-row:1!important;width:100%!important;float:none!important;margin:0!important;position:static!important
}
body.woocommerce-account .woocommerce-MyAccount-content{
 grid-column:1!important;grid-row:1!important;width:100%!important;float:none!important;margin:0!important;min-width:0!important
}
body.woocommerce-account .woocommerce-MyAccount-navigation ul{position:sticky!important;top:118px!important;width:100%!important}
body.woocommerce-account .parya-account-dashboard,
body.woocommerce-account .parya-account-welcome,
body.woocommerce-account .parya-account-stats,
body.woocommerce-account .parya-account-actions{width:100%!important;max-width:none!important}
body.woocommerce-account .parya-account-stats{grid-template-columns:repeat(3,minmax(0,1fr))!important}
body.woocommerce-account .parya-account-actions{grid-template-columns:repeat(3,minmax(0,1fr))!important}

/* Cart desktop */
body.woocommerce-cart main.section>.container{max-width:1240px!important;width:min(1240px,calc(100% - 32px))!important}
body.woocommerce-cart .entry-content>.woocommerce{
 display:grid!important;grid-template-columns:minmax(0,1fr) 360px!important;gap:24px!important;align-items:start!important;width:100%!important
}
body.woocommerce-cart .woocommerce>.parya-wc-heading,
body.woocommerce-cart .woocommerce>.parya-purchase-steps,
body.woocommerce-cart .woocommerce>.woocommerce-notices-wrapper{grid-column:1/-1!important}
body.woocommerce-cart .woocommerce-cart-form{grid-column:1!important;width:100%!important;min-width:0!important}
body.woocommerce-cart .cart-collaterals{grid-column:2!important;width:100%!important;min-width:0!important;float:none!important}
body.woocommerce-cart .cart-collaterals .cart_totals{width:100%!important;float:none!important}
body.woocommerce-cart table.cart img{width:72px!important;height:72px!important;max-width:72px!important;object-fit:contain!important}

/* Mini cart: never allow product images to take the drawer width */
.cart-drawer{width:min(400px,94vw)!important;max-width:400px!important}
.cart-drawer .drawer-body{overflow:auto!important}
.cart-drawer .woocommerce-mini-cart{display:flex!important;flex-direction:column!important;width:100%!important}
.cart-drawer .woocommerce-mini-cart-item{
 position:relative!important;display:grid!important;
 grid-template-columns:58px minmax(0,1fr) 28px!important;
 grid-template-rows:auto auto!important;gap:5px 10px!important;
 width:100%!important;min-height:78px!important;padding:12px 0!important;margin:0!important
}
.cart-drawer .woocommerce-mini-cart-item>a:not(.remove){
 grid-column:1/3!important;grid-row:1!important;display:grid!important;
 grid-template-columns:58px minmax(0,1fr)!important;gap:10px!important;align-items:center!important;
 min-width:0!important;font-size:11px!important;line-height:1.65!important
}
.cart-drawer .woocommerce-mini-cart-item>a:not(.remove) img{
 width:58px!important;height:58px!important;max-width:58px!important;min-width:58px!important;
 margin:0!important;float:none!important;object-fit:contain!important;border-radius:12px!important;background:#fff8fa!important
}
.cart-drawer .woocommerce-mini-cart-item .remove{
 grid-column:3!important;grid-row:1!important;position:static!important;align-self:start!important
}
.cart-drawer .woocommerce-mini-cart-item .quantity{
 grid-column:2/4!important;grid-row:2!important;margin:0!important;font-size:10px!important
}

/* Checkout: billing is full width; shipping/additional stack under it */
body.woocommerce-checkout main.section>.container{max-width:1240px!important;width:min(1240px,calc(100% - 32px))!important}
body.woocommerce-checkout .entry-content>.woocommerce{width:100%!important}
body.woocommerce-checkout form.checkout{
 display:grid!important;grid-template-columns:minmax(0,1.25fr) minmax(340px,.75fr)!important;
 gap:24px!important;align-items:start!important;width:100%!important
}
body.woocommerce-checkout form.checkout #customer_details{
 grid-column:1!important;display:flex!important;flex-direction:column!important;gap:16px!important;width:100%!important;min-width:0!important
}
body.woocommerce-checkout #customer_details .col-1,
body.woocommerce-checkout #customer_details .col-2{width:100%!important;max-width:none!important;float:none!important;margin:0!important}
body.woocommerce-checkout form.checkout #order_review_heading{grid-column:2!important;width:100%!important;max-width:none!important;margin:0!important}
body.woocommerce-checkout form.checkout #order_review{grid-column:2!important;width:100%!important;max-width:none!important;margin:0!important}
body.woocommerce-checkout form.checkout[data-wizard-step="1"] .parya-checkout-wizard-nav{grid-column:1!important;width:100%!important;max-width:none!important}
body.woocommerce-checkout form.checkout[data-wizard-step="2"],
body.woocommerce-checkout form.checkout[data-wizard-step="3"]{grid-template-columns:1fr!important;max-width:900px!important;margin-inline:auto!important}
body.woocommerce-checkout form.checkout[data-wizard-step="2"] #order_review_heading,
body.woocommerce-checkout form.checkout[data-wizard-step="2"] #order_review,
body.woocommerce-checkout form.checkout[data-wizard-step="3"] #order_review_heading,
body.woocommerce-checkout form.checkout[data-wizard-step="3"] #order_review{grid-column:1!important;max-width:none!important;width:100%!important}
body.woocommerce-checkout .woocommerce-billing-fields__field-wrapper{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:12px 14px!important}
body.woocommerce-checkout .woocommerce-billing-fields__field-wrapper .form-row{width:100%!important;margin:0!important}
body.woocommerce-checkout #billing_address_1_field,
body.woocommerce-checkout #billing_address_2_field{grid-column:1/-1!important}
body.woocommerce-checkout .woocommerce-additional-fields__field-wrapper textarea{min-height:120px!important;resize:vertical!important}

/* Search: product result cards and footer can never become side columns */
body.search main.parya-search-page{display:block!important;width:100%!important}
body.search .parya-search-page>.container{display:block!important;max-width:1240px!important;width:min(1240px,calc(100% - 32px))!important}
body.search .parya-search-results{align-items:stretch!important}
body.search .parya-search-results>.product-card{width:100%!important;min-width:0!important}
body.search footer.parya-footer,body.search .parya-prefooter{display:block!important;width:100%!important;max-width:none!important;clear:both!important}

/* Footer stable grid */
.parya-prefooter,.parya-footer{width:100%!important;clear:both!important}
.parya-footer>.container{max-width:1240px!important;width:min(1240px,calc(100% - 32px))!important}
.parya-footer-main{display:grid!important;grid-template-columns:1.35fr .8fr .8fr 1.2fr!important;gap:34px!important;width:100%!important}
.parya-footer-main>*{min-width:0!important}
.parya-footer a{overflow-wrap:anywhere}

/* Admin bar compatibility */
body.admin-bar .topbar{top:32px}
body.admin-bar .woocommerce-MyAccount-navigation ul,
body.admin-bar .cart-collaterals .cart_totals,
body.admin-bar .woocommerce-checkout #order_review{top:150px!important}

@media(max-width:1080px){
 .woocommerce ul.products,.woocommerce-page ul.products,.single-product .related.products ul.products,.single-product .upsells.products ul.products,.parya-search-results{grid-template-columns:repeat(3,minmax(0,1fr))!important}
 body.single-product .woocommerce div.product.type-product{grid-template-columns:1fr!important}
 body.single-product .woocommerce div.product.type-product>.woocommerce-product-gallery,
 body.single-product .woocommerce div.product.type-product>.summary,
 body.rtl.single-product .woocommerce div.product.type-product>.woocommerce-product-gallery,
 body.rtl.single-product .woocommerce div.product.type-product>.summary{grid-column:1!important;grid-row:auto!important}
 body.woocommerce-account .entry-content>.woocommerce{grid-template-columns:1fr!important}
 body.woocommerce-account .woocommerce-MyAccount-navigation,
 body.woocommerce-account .woocommerce-MyAccount-content{grid-column:1!important;grid-row:auto!important}
 body.woocommerce-account .woocommerce-MyAccount-navigation ul{position:static!important;display:flex!important;overflow:auto!important;gap:6px!important}
 body.woocommerce-account .woocommerce-MyAccount-navigation li{min-width:max-content!important}
 body.woocommerce-cart .entry-content>.woocommerce{grid-template-columns:1fr!important}
 body.woocommerce-cart .woocommerce-cart-form,body.woocommerce-cart .cart-collaterals{grid-column:1!important}
 body.woocommerce-checkout form.checkout{grid-template-columns:1fr!important}
 body.woocommerce-checkout form.checkout #customer_details,
 body.woocommerce-checkout form.checkout #order_review_heading,
 body.woocommerce-checkout form.checkout #order_review,
 body.woocommerce-checkout form.checkout[data-wizard-step="1"] .parya-checkout-wizard-nav{grid-column:1!important}
 .parya-footer-main{grid-template-columns:repeat(2,minmax(0,1fr))!important}
}
@media(max-width:720px){
 body .container,body.woocommerce-account main.section>.container,body.woocommerce-cart main.section>.container,body.woocommerce-checkout main.section>.container,body.search .parya-search-page>.container,.parya-footer>.container{width:min(100% - 20px,1240px)!important}
 .header-main{grid-template-columns:44px 1fr auto!important;gap:8px!important}
 .header-main .parya-header-search{grid-column:1/-1!important}
 .woocommerce ul.products,.woocommerce-page ul.products,.single-product .related.products ul.products,.single-product .upsells.products ul.products,.parya-search-results{grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:10px!important}
 .product-card .product-info{padding:10px!important}
 .product-card .product-info h3{font-size:11px!important;min-height:42px!important}
 body.woocommerce-account .parya-account-stats,body.woocommerce-account .parya-account-actions{grid-template-columns:1fr!important}
 body.woocommerce-checkout .woocommerce-billing-fields__field-wrapper{grid-template-columns:1fr!important}
 body.woocommerce-checkout #billing_address_1_field,body.woocommerce-checkout #billing_address_2_field{grid-column:auto!important}
 .parya-footer-main{grid-template-columns:1fr!important}
 .parya-prefooter-grid{grid-template-columns:1fr 1fr!important}
}
@media(max-width:480px){
 .parya-prefooter-grid{grid-template-columns:1fr!important}
}
