/* =========================================================
   Phulwari v6.59 — layout fixes (loaded last)
   ========================================================= */

/* ---------- ROOT CAUSE of overlapping text site-wide ----------
   Elementor Site Settings (Kit) sets global line-heights in *px*
   (body 1.9px, h1 1.5px, h3–h6 1.7px). Any text without its own
   line-height collapsed onto the line above. Restore unitless values.
   (Also fix in Elementor → Site Settings → Typography: unit em or empty.) */
body[class*="elementor-kit-"]{line-height:var(--fv-type-body-line,1.9)}
body[class*="elementor-kit-"] :is(h1,h2){line-height:var(--fv-type-page-line,1.5)}
body[class*="elementor-kit-"] :is(h3,h4,h5,h6){line-height:var(--fv-type-section-line,1.6)}
body[class*="elementor-kit-"] :is(p,li,label,small,span,dd,dt,td,th,address,legend){line-height:inherit}

/* ---------- Elementor text widget runs wpautop on the WooCommerce shortcode:
   every line break in a template became <br> / empty <p>. The old px
   line-height hid them; now they would show as gaps (avatar letter dropping
   below its circle, icon/text gaps). Keep real line breaks in addresses. */
.elementor-widget-container .woocommerce br:not(address br,.woocommerce-customer-details br,.ph-address-value br,.woocommerce-order-details br){display:none!important}
.elementor-widget-container .woocommerce p:empty,
.woocommerce .fv-card p:empty{display:none!important}

/* =========================================================
   Account
   ========================================================= */
body.woocommerce-account .ph-address-intro:empty{display:none!important}
body.woocommerce-account .ph-account-tip{
  margin:0 0 18px!important;padding:12px 14px!important;border:1px solid #E6DFD2!important;border-radius:12px!important;
  background:#FFFBF3!important;color:var(--fv-text-2,#5A4A3E)!important;font-size:var(--fv-type-muted-size,13px)!important;line-height:1.9!important;
}
body.woocommerce-account .fv-account-endpoint-head span,
body.woocommerce-account .ph-account-welcome span{display:block;margin-bottom:2px;line-height:1.6!important}
body.woocommerce-account .fv-account-endpoint-head h2,
body.woocommerce-account .ph-account-welcome h2{line-height:1.5!important}
body.woocommerce-account .woocommerce-MyAccount-content h2:empty{display:none!important}

/* Identity card: icon instead of «0», mobile under the name */
body.woocommerce-account .ph-account-avatar{display:inline-grid!important;place-items:center!important;color:var(--fv-gold-dark,#9B7020)!important}
body.woocommerce-account .ph-account-avatar svg{display:block}
body.woocommerce-account .ph-account-person-copy{display:grid!important;gap:2px!important;min-width:0}
body.woocommerce-account .ph-account-person-copy strong{line-height:1.6!important}
body.woocommerce-account .ph-account-person-copy small{color:var(--fv-muted,#7A6A5C)!important;font-size:12px!important;line-height:1.6!important;text-align:right}

/* Dashboard empty state (no orders yet) */
body.woocommerce-account .ph-account-empty{
  margin:0 0 22px;padding:18px 20px;border:1px dashed #D9CBB3;border-radius:14px;background:#FFFBF3;
}
body.woocommerce-account .ph-account-empty strong{display:block;margin-bottom:4px;color:var(--fv-blue-deep,#365D75);font-size:var(--fv-type-item-size,16px);line-height:1.6}
body.woocommerce-account .ph-account-empty p{margin:0;color:var(--fv-text-2,#5A4A3E);font-size:var(--fv-type-muted-size,13px);line-height:1.9}

/* Forms: inputs fill their column (name fields were ~140px wide).
   WooCommerce gives .form-row-first/last width:47%; inside the theme's
   2-column grid that became 47% of one column. */
body.woocommerce-account :is(.woocommerce-address-fields__field-wrapper,.woocommerce-EditAccountForm) p.form-row{float:none!important;width:auto!important;min-width:0!important;margin:0!important}
body.woocommerce-account .woocommerce-address-fields__field-wrapper .woocommerce-input-wrapper,
body.woocommerce-account .woocommerce-EditAccountForm .woocommerce-input-wrapper{display:block!important;width:100%!important}
body.woocommerce-account .woocommerce-address-fields__field-wrapper :is(input:not([type=hidden]),select,textarea),
body.woocommerce-account .woocommerce-EditAccountForm :is(input[type=text],input[type=email],input[type=tel]){width:100%!important;max-width:none!important;box-sizing:border-box!important}
body.woocommerce-account .woocommerce-address-fields__field-wrapper #billing_country_field{display:none!important}
body.woocommerce-account .woocommerce-address-fields > p:last-child,
body.woocommerce-account .woocommerce-EditAccountForm > p:last-child{margin-top:18px!important}
body.woocommerce-account :is(.woocommerce-address-fields,.woocommerce-EditAccountForm) button[type=submit]{min-width:200px!important}
body.woocommerce-account .woocommerce-EditAccountForm :is(span,em,.description)#account_display_name_description,
body.woocommerce-account .woocommerce-EditAccountForm #account_display_name_description{
  display:block!important;margin-top:6px!important;font-style:normal!important;font-size:12px!important;line-height:1.8!important;color:var(--fv-muted,#7A6A5C)!important;
}

/* Login is SMS-only for customers: no password block */
body.ph-otp-customer.woocommerce-account .woocommerce-EditAccountForm fieldset:has(#password_current){display:none!important}

/* SMS.ir «change mobile» block: brand colours and a tidy row */
body.woocommerce-account .woocommerce-EditAccountForm .smsir.form-row{grid-column:1 / -1!important;margin:6px 0 0!important;padding:16px!important;border:1px solid #E6DFD2!important;border-radius:16px!important;background:#FFFDF9!important}
body.woocommerce-account #smsir-edit-phone-field label,
body.woocommerce-account .woocommerce-EditAccountForm .smsir.form-row > label{margin-bottom:10px!important}
body.woocommerce-account #smsir-edit-phone-field input{min-height:48px!important;height:48px!important;border-radius:12px!important;direction:ltr;text-align:left}
body.woocommerce-account #smsir-edit-phone-field .change-phone-button{
  min-height:46px!important;height:auto!important;border:1px solid var(--fv-blue-deep,#365D75)!important;border-radius:12px!important;
  background:#fff!important;color:var(--fv-blue-deep,#365D75)!important;font-weight:800!important;box-shadow:none!important;
}
body.woocommerce-account #smsir-edit-phone-field .change-phone-button:hover{background:#EEF4F7!important}

/* Orders: empty notice with its button on its own line */
body.woocommerce-account .woocommerce-MyAccount-content .woocommerce-info,
body.woocommerce-account .woocommerce-MyAccount-content .woocommerce-message{display:flex!important;flex-wrap:wrap!important;align-items:center!important;justify-content:space-between!important;gap:12px!important;line-height:1.8!important}
body.woocommerce-account .woocommerce-MyAccount-content .woocommerce-info .button{order:2;margin:0!important}

/* Single delivery-address card spans the full width */
body.woocommerce-account .ph-address-grid.is-single{grid-template-columns:1fr!important}
body.woocommerce-account .ph-address-card-head span,
body.woocommerce-account .ph-address-card-head h2{line-height:1.6!important}

/* =========================================================
   Checkout
   ========================================================= */
body.woocommerce-checkout .woocommerce-billing-fields > h3,
body.woocommerce-checkout .woocommerce-additional-fields > h3{line-height:1.6!important;margin:6px 0 14px!important}
body.woocommerce-checkout #billing_phone,
body.woocommerce-checkout #billing_email,
body.woocommerce-checkout #billing_postcode{direction:ltr;text-align:right}
body.woocommerce-checkout .fv-checkout-summary-note{line-height:1.9!important}

/* =========================================================
   Cart
   ========================================================= */
/* Empty notices box took ~90px at the top of the cart */
body.woocommerce-cart .woocommerce-notices-wrapper:empty{display:none!important}
/* wpautop wrapped the checkout button in <p> + <br>: box was 168px for a 50px button */
body.woocommerce-cart .wc-proceed-to-checkout{padding:14px 0 0!important}
body.woocommerce-cart .wc-proceed-to-checkout p{margin:0!important}
body.woocommerce-cart .cart-collaterals .checkout-button{
  display:flex!important;align-items:center!important;justify-content:center!important;
  min-height:52px!important;padding:12px 18px!important;line-height:1.5!important;font-size:15px!important;
}
body.woocommerce-cart .cart_totals > h2{margin:0 0 14px!important;line-height:1.5!important}

/* Empty cart: «بازگشت به فروشگاه» centred, text vertically centred */
body.woocommerce-cart .return-to-shop{display:flex!important;justify-content:center!important;margin:8px 0 0!important}
body.woocommerce-cart .return-to-shop .button{
  display:inline-flex!important;align-items:center!important;justify-content:center!important;
  min-height:48px!important;padding:10px 26px!important;line-height:1.5!important;
}

/* =========================================================
   v6.62 — Product page: quantity + add-to-cart row
   On mobile the button landed in the 82px column (meant for the quantity)
   and was clipped off the card. Place both explicitly.
   ========================================================= */
body.single-product form.cart:not(:has(.fv-gift-builder)){display:grid!important;grid-template-columns:82px minmax(0,1fr)!important;gap:10px!important;direction:rtl!important}
body.single-product form.cart:not(:has(.fv-gift-builder)) > .quantity{grid-column:1!important;grid-row:1!important;width:auto!important}
body.single-product form.cart:not(:has(.fv-gift-builder)) > .single_add_to_cart_button{grid-column:2!important;grid-row:1!important;width:100%!important;min-width:0!important}
