/* Checkout-only density corrections. Keep labels, hints and touch targets intact. */
body.woocommerce-checkout #customer_details{padding:16px!important}
body.woocommerce-checkout #customer_details>.col-1,
body.woocommerce-checkout #customer_details>.col-2{gap:12px!important}
body.woocommerce-checkout .zc-address-section+.zc-address-section{margin-top:14px!important;padding-top:14px!important}
body.woocommerce-checkout .zc-address-card>header{min-height:46px;padding-bottom:9px}
body.woocommerce-checkout .zc-address-summary{margin-top:9px!important}
body.woocommerce-checkout .zc-address-section.is-editing>:is(.woocommerce-billing-fields__field-wrapper,.woocommerce-shipping-fields__field-wrapper){column-gap:14px!important;row-gap:8px!important;margin-top:4px!important;padding-top:4px!important;border:0!important}
body.woocommerce-checkout .zc-address-section.is-editing .form-row{margin:0!important}
body.woocommerce-checkout .zc-address-section.is-editing .form-row>label{min-height:0!important;margin:0 0 4px!important;line-height:1.45!important}
body.woocommerce-checkout .zc-address-section.is-editing .form-row :is(.description,.woocommerce-input-wrapper+span):empty{display:none!important;min-height:0!important;padding:0!important}
body.woocommerce-checkout .zc-address-section.is-editing .form-row :is(.description,.woocommerce-input-wrapper+span):not(:empty){min-height:0!important;margin-top:4px!important;padding-top:0!important;line-height:1.55!important}
body.woocommerce-checkout .zc-address-section.is-editing :is(input.input-text,select,.select2-selection--single){min-height:44px!important}
body.woocommerce-checkout .zc-address-section.is-editing textarea{min-height:76px!important}
body.woocommerce-checkout .zc-address-section.is-editing .zc-address-group-heading{grid-column:1/-1;display:flex!important;min-height:0!important;height:auto!important;align-items:center!important;align-self:end!important;gap:8px!important;margin:8px 0 0!important;padding:0!important;border:0!important;background:transparent!important;color:var(--zc-ink,#0f172a)!important;font-size:.88rem!important;font-weight:900!important;line-height:1.55!important;box-shadow:none!important}
body.woocommerce-checkout .zc-address-section.is-editing .zc-address-group-heading:first-child{margin-top:0!important}
body.woocommerce-checkout .zc-address-section.is-editing .zc-address-group-heading:before{display:block!important;position:static!important;flex:0 0 7px;width:7px;height:7px;margin:0!important;border:0!important;border-radius:3px;background:var(--zc-primary,#2563eb)!important;content:""!important;box-shadow:none!important}
body.woocommerce-checkout .zc-address-section.is-editing .zc-address-group-heading:after{display:none!important;content:none!important}
body.woocommerce-checkout .zc-address-section.is-editing .zc-address-group-heading+.form-row{margin-top:0!important}
body.woocommerce-checkout .zc-address-redundant-divider{display:none!important;margin:0!important;padding:0!important;border:0!important}
body.woocommerce-checkout .woocommerce-billing-fields>h3:first-child{display:none!important}
body.woocommerce-checkout .zc-address-save--bottom{min-height:46px;margin-top:12px}
@media(max-width:700px){body.woocommerce-checkout #customer_details{padding:13px!important}body.woocommerce-checkout .zc-address-section.is-editing>:is(.woocommerce-billing-fields__field-wrapper,.woocommerce-shipping-fields__field-wrapper){grid-template-columns:1fr!important;gap:9px!important}}

/* Keep SelectWoo portals attached to the province/city row, never to body. */
body.woocommerce-checkout .zc-select2-dropdown-parent{position:relative!important}
body.woocommerce-checkout .zc-select2-dropdown-parent>.zc-checkout-select2-portal{position:absolute!important;z-index:100010!important;top:calc(100% - 1px)!important;right:0!important;bottom:auto!important;left:0!important;width:100%!important;max-width:none!important;margin:0!important;transform:none!important}
body.woocommerce-checkout .zc-checkout-select2-portal .select2-dropdown{margin:0!important;border:1px solid #93b4e7!important;border-radius:0 0 11px 11px!important;box-shadow:0 12px 28px rgba(15,23,42,.14)!important;overflow:hidden}
body.woocommerce-checkout .zc-checkout-select2-portal .select2-results__options{overscroll-behavior:contain}

/* Shipping title first, provider description beneath it. */
body.woocommerce-checkout .zc-checkout-shipping-options #shipping_method label{display:grid!important;grid-template-columns:minmax(0,1fr) auto!important;grid-template-areas:"title cost" "description description";align-items:center!important;gap:4px 14px!important;width:100%!important}
body.woocommerce-checkout .zc-shipping-method-title{grid-area:title;display:flex;min-width:0;width:auto;align-items:center;gap:9px;font-size:.78rem;font-weight:850;line-height:1.65;text-align:start;overflow-wrap:anywhere}
body.woocommerce-checkout .zc-shipping-method-media{display:grid;flex:0 0 30px;width:30px;height:30px;place-items:center}
body.woocommerce-checkout .zc-shipping-method-media img{display:block!important;width:30px!important;height:30px!important;max-width:30px!important;max-height:30px!important;margin:0!important;object-fit:contain!important}
body.woocommerce-checkout .zc-shipping-method-cost{grid-area:cost;display:block;justify-self:end;white-space:nowrap;text-align:end;font-size:.9rem;font-weight:500;line-height:1.6;font-variant-numeric:tabular-nums}
body.woocommerce-checkout .zc-shipping-method-cost .amount{white-space:nowrap;font-size:inherit!important;font-weight:inherit!important}
body.woocommerce-checkout .zc-checkout-shipping-options .shipping_method_description,
body.woocommerce-checkout .zc-checkout-shipping-options [class*="shipping_method_description"]{display:none!important}
body.woocommerce-checkout .zc-shipping-method-description,
body.woocommerce-checkout .zc-checkout-shipping-options #shipping_method label>:is(small,.description,.shipping-method-description,.method-description){grid-area:description;display:block;margin:0;color:#64748b;font-size:.68rem;font-weight:500;line-height:1.85;text-align:start;overflow-wrap:anywhere}
body.woocommerce-checkout .zc-shipping-method-description :is(br,strong,em,span){font:inherit}
body.woocommerce-checkout .zc-shipping-method-description .alert-danger{display:inline;padding:1px 4px;border-radius:5px;background:#fff1f2;color:#9f1239;font-weight:750}

/* Selected delivery method is unmistakable without changing plugin geometry. */
body.woocommerce-checkout .zc-checkout-shipping-options #shipping_method li{position:relative;transition:border-color .16s ease,background-color .16s ease,box-shadow .16s ease}
body.woocommerce-checkout .zc-checkout-shipping-options #shipping_method li:is(.is-selected,:has(input.shipping_method:checked)){border-color:#2563eb!important;background:#f5f9ff!important;box-shadow:inset 3px 0 0 #2563eb,0 5px 16px rgba(37,99,235,.08)!important}

/* Totals stay vertically aligned; prices gain size, not excessive weight. */
body.woocommerce-checkout .zc-checkout-totals-section tr{align-items:stretch!important}
body.woocommerce-checkout .zc-checkout-totals-section :where(th,td){display:flex!important;min-height:54px;align-items:center!important;line-height:1.65!important}
body.woocommerce-checkout .zc-checkout-totals-section th{justify-content:flex-start;gap:8px}
body.woocommerce-checkout .zc-checkout-totals-section td{justify-content:flex-end!important;font-size:.92rem!important;font-weight:500!important;font-variant-numeric:tabular-nums}
body.woocommerce-checkout .zc-checkout-totals-section td :where(.amount,bdi){font-size:inherit!important;font-weight:inherit!important}
body.woocommerce-checkout .zc-checkout-totals-section .zc-checkout-selected-shipping-total th{display:grid!important;align-content:center!important;gap:1px}
body.woocommerce-checkout .zc-checkout-totals-section .zc-checkout-selected-shipping-total th small{display:block;color:#64748b;font-size:.67rem;font-weight:500;line-height:1.6}
body.woocommerce-checkout .zc-checkout-totals-section .order-total th{font-size:.9rem!important;font-weight:900!important}
body.woocommerce-checkout .zc-checkout-totals-section .order-total td,
body.woocommerce-checkout .zc-checkout-totals-section .order-total td :where(.amount,bdi){font-size:1.12rem!important;font-weight:500!important}

/* One clear two-pixel keyboard indicator, instead of stacked outline + ring. */
body.woocommerce-checkout form.checkout :is(input.input-text,select,textarea,.select2-selection):is(:focus,:focus-visible),
body.woocommerce-checkout form.checkout .select2-container--open .select2-selection{border-color:#2563eb!important;outline:2px solid rgba(37,99,235,.42)!important;outline-offset:1px!important;box-shadow:none!important}

/* Checkout rhythm: one heading scale and four clearly separated decisions. */
body.woocommerce-checkout #order_review_heading.zc-checkout-products-heading{min-height:58px!important;display:flex!important;align-items:center!important;gap:11px!important;margin:0!important;padding:13px 16px!important;border:1px solid var(--zc-line-soft,#e2e8f0)!important;border-bottom:0!important;border-radius:15px 15px 0 0!important;background:#fff!important;color:var(--zc-ink,#0f172a)!important;font-size:.9rem!important;font-weight:900!important;line-height:1.55!important;box-shadow:none!important}
body.woocommerce-checkout .zc-checkout-step-number{display:grid;flex:0 0 32px;width:32px;height:32px;place-items:center;border-radius:10px;background:var(--zc-primary,#2563eb);color:#fff;font-size:.76rem;font-weight:850}
body.woocommerce-checkout #order_review_heading.zc-checkout-products-heading+#order_review>.woocommerce-checkout-review-order-table{border-radius:0 0 15px 15px!important}
body.woocommerce-checkout .zc-checkout-card-heading h3,
body.woocommerce-checkout .zc-checkout-totals-section>header h3,
body.woocommerce-checkout .zc-checkout-payment-heading h3{font-size:.9rem!important;font-weight:900!important;line-height:1.55!important}
body.woocommerce-checkout .woocommerce-checkout-review-order-table{margin-bottom:30px!important}
body.woocommerce-checkout .zc-checkout-shipping-section,
body.woocommerce-checkout .zc-checkout-totals-section{margin-top:0!important;margin-bottom:30px!important}
body.woocommerce-checkout #payment{margin-top:0!important;margin-bottom:10px!important}
body.woocommerce-checkout #ship-to-different-address{width:100%!important;margin:28px 0!important}
body.woocommerce-checkout #ship-to-different-address label{width:100%!important;min-height:88px!important;padding:16px 18px!important}
body.woocommerce-checkout .woocommerce-additional-fields{margin-top:30px!important;padding-top:0!important}
body.woocommerce-checkout .woocommerce-additional-fields>h3{margin:0 0 12px!important;padding:0!important;border:0!important}
body.woocommerce-checkout #order_comments_field{margin-top:0!important}
body.woocommerce-checkout #payment .woocommerce-terms-and-conditions-wrapper,
body.woocommerce-checkout #payment .woocommerce-terms-and-conditions-wrapper :where(p,label,span,a,strong,b){font-size:.66rem!important;line-height:1.9!important}
body.woocommerce-checkout .zc-checkout-acceptance{gap:9px!important;padding:12px 14px!important}
body.woocommerce-checkout .zc-checkout-acceptance>p,
body.woocommerce-checkout .zc-checkout-acceptance>p :where(span,a,strong,b,button){font-size:.68rem!important;line-height:1.85!important}
body.woocommerce-checkout .zc-checkout-acceptance>p{font-weight:500!important}
body.woocommerce-checkout .zc-checkout-acceptance>p button{font-weight:750!important}
body.woocommerce-checkout .zc-checkout-acceptance__mark{flex-basis:26px!important;width:26px!important;height:26px!important;font-size:.72rem!important}
@media(max-width:700px){body.woocommerce-checkout .woocommerce-checkout-review-order-table,body.woocommerce-checkout .zc-checkout-shipping-section,body.woocommerce-checkout .zc-checkout-totals-section{margin-bottom:22px!important}body.woocommerce-checkout #ship-to-different-address{margin:22px 0!important}body.woocommerce-checkout #ship-to-different-address label{min-height:82px!important;padding:14px!important}body.woocommerce-checkout .woocommerce-additional-fields{margin-top:24px!important}}

/* Cart totals: let labels own the available row and keep amounts intrinsic. */
body.woocommerce-cart .cart_totals .shop_table tr:not(.zc-rush-row){grid-template-columns:minmax(0,1fr) max-content!important;column-gap:14px!important}
body.woocommerce-cart .cart_totals .shop_table tr:not(.zc-rush-row)>:is(th,td){width:auto!important;max-width:none!important;min-width:0!important;box-sizing:border-box!important}
body.woocommerce-cart .cart_totals .shop_table tr:not(.zc-rush-row)>th{justify-content:flex-start!important;text-align:start!important;line-height:1.7!important;word-break:normal!important;overflow-wrap:normal!important}
body.woocommerce-cart .cart_totals .shop_table tr:not(.zc-rush-row)>td{justify-content:flex-end!important;text-align:end!important;white-space:nowrap!important}
body.woocommerce-cart .cart_totals .shop_table tr.zc-cart-selected-shipping>th{align-self:stretch!important;align-items:center!important;padding-inline-end:2px!important}
@media(max-width:480px){body.woocommerce-cart .cart_totals .shop_table tr:not(.zc-rush-row){grid-template-columns:minmax(0,1fr) max-content!important;column-gap:10px!important}body.woocommerce-cart .cart_totals .shop_table tr:not(.zc-rush-row)>th{font-size:.78rem!important}}

/* Animated, page-scoped feedback for WooCommerce BlockUI updates. */
body:is(.woocommerce-cart,.woocommerce-checkout) .blockUI.blockOverlay{z-index:90!important;background:rgba(248,250,252,.76)!important;opacity:1!important;cursor:progress!important}
body:is(.woocommerce-cart,.woocommerce-checkout) .blockUI.blockOverlay:before{position:absolute!important;top:calc(50% - 25px)!important;left:calc(50% - 19px)!important;width:38px!important;height:38px!important;margin:0!important;border:4px solid #bfdbfe!important;border-top-color:#2563eb!important;border-radius:50%!important;background:none!important;content:""!important;animation:zc-checkout-spin .75s linear infinite!important;box-sizing:border-box!important}
body:is(.woocommerce-cart,.woocommerce-checkout) .blockUI.blockOverlay:after{position:absolute;top:calc(50% + 22px);left:50%;width:max-content;max-width:calc(100% - 28px);padding:5px 9px;border-radius:8px;background:#fff;color:#334155;content:"در حال به‌روزرسانی…";font-size:.7rem;font-weight:750;line-height:1.5;transform:translateX(-50%);box-shadow:0 4px 14px rgba(15,23,42,.08)}
@keyframes zc-checkout-spin{to{transform:rotate(360deg)}}
@media(prefers-reduced-motion:reduce){body:is(.woocommerce-cart,.woocommerce-checkout) .blockUI.blockOverlay:before{animation:none!important;border-color:#2563eb!important;border-inline-start-color:#bfdbfe!important}}
