/*
 * Babli Fashion Point — My Account > Account Details 2-column layout.
 * Additive only; load after bfp-account-forms-signup.css.
 * Scope: the Edit Account form on /my-account/ (body.woocommerce-account).
 * Goal: every field sits in a col-md-6 / col-md-6 grid (two per row), and the
 * Phone Number field carries the same India +91 shell as the checkout/signup.
 * Does not touch address forms (they have their own grid) or any other page.
 */

/* --- The form becomes a two-column grid; the old float/clear helpers retire. --- */
body.woocommerce-account .woocommerce-MyAccount-content .woocommerce-EditAccountForm {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    column-gap: 16px !important;
    row-gap: 14px !important;
    align-items: start !important;
}

/* Retire the theme's float-based pairing and its line-break helpers. */
body.woocommerce-account .woocommerce-MyAccount-content .woocommerce-EditAccountForm .clear {
    display: none !important;
}
body.woocommerce-account .woocommerce-MyAccount-content .woocommerce-EditAccountForm .form-row {
    float: none !important;
    clear: none !important;
    width: auto !important;
    max-width: none !important;
    margin: 0 !important;
    grid-column: span 1 !important;
    min-width: 0 !important;
}

/* Password fieldset: its legend spans the full width, its rows stack two-per-row. */
body.woocommerce-account .woocommerce-MyAccount-content .woocommerce-EditAccountForm fieldset {
    grid-column: 1 / -1 !important;
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    column-gap: 16px !important;
    row-gap: 14px !important;
    border: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
}
body.woocommerce-account .woocommerce-MyAccount-content .woocommerce-EditAccountForm fieldset > legend {
    grid-column: 1 / -1 !important;
    width: 100% !important;
}

/* The submit row must break to its own full-width line under the grid. */
body.woocommerce-account .woocommerce-MyAccount-content .woocommerce-EditAccountForm > p:last-of-type,
body.woocommerce-account .woocommerce-MyAccount-content .woocommerce-EditAccountForm > p:has(> button[type="submit"]) {
    grid-column: 1 / -1 !important;
}

/* Field labels sit above their inputs in every cell and wrap inside the cell. */
body.woocommerce-account .woocommerce-MyAccount-content .woocommerce-EditAccountForm .form-row label {
    display: block !important;
    margin-bottom: 6px !important;
    overflow-wrap: anywhere !important;
}

/* Keep each field's description inside its own cell (no bleed into the neighbour). */
body.woocommerce-account .woocommerce-MyAccount-content .woocommerce-EditAccountForm .form-row {
    overflow: hidden !important;
}
body.woocommerce-account .woocommerce-MyAccount-content .woocommerce-EditAccountForm .form-row > span:not(.bfp-acct-phone-shell),
body.woocommerce-account .woocommerce-MyAccount-content .woocommerce-EditAccountForm .form-row > em,
body.woocommerce-account .woocommerce-MyAccount-content .woocommerce-EditAccountForm .form-row > small {
    display: block !important;
    margin-top: 4px !important;
    font-size: 12px !important;
    line-height: 1.35 !important;
    overflow-wrap: anywhere !important;
}

/* --- Phone Number field: same India +91 shell as Contact information. --------
   Self-contained shell (built by bfp-account-lock-v1.js): the SHELL owns the
   border/radius/height, the +91 prefix is a flex child, and the input is
   borderless inside it. This is exactly how the checkout Contact card looks, and
   it avoids the double border / glow-over-prefix artefact. */
body.woocommerce-account .woocommerce-MyAccount-content .woocommerce-EditAccountForm .bfp-acct-phone-shell {
    display: flex !important;
    align-items: stretch !important;
    width: 100% !important;
    height: 40px !important;
    min-height: 40px !important;
    margin: 0 !important;
    border: 1.5px solid #ece6e2 !important;
    border-radius: 11px !important;
    background: #faf8f7 !important;
    overflow: hidden !important;
    box-sizing: border-box !important;
    transition: border-color .16s ease, background .16s ease, box-shadow .16s ease !important;
}
body.woocommerce-account .woocommerce-MyAccount-content .woocommerce-EditAccountForm .bfp-acct-phone-shell:focus-within {
    border-color: #ff4b1f !important;
    background: #fff !important;
    box-shadow: 0 0 0 3.5px rgba(255, 75, 31, .11) !important;
}
body.woocommerce-account .woocommerce-MyAccount-content .woocommerce-EditAccountForm .bfp-acct-phone-shell .bfp-acct-phone-prefix {
    display: flex !important;
    align-items: center !important;
    gap: 6px !important;
    height: 100% !important;
    padding: 0 10px !important;
    border-right: 1.5px solid #ece6e2 !important;
    background: #f4f1ef !important;
    flex: 0 0 auto !important;
    font-family: inherit !important;
    font-size: 13.5px !important;
    font-weight: 700 !important;
    line-height: 1 !important;
    color: #3a3430 !important;
    white-space: nowrap !important;
    pointer-events: none !important;
    user-select: none !important;
}
body.woocommerce-account .woocommerce-MyAccount-content .woocommerce-EditAccountForm .bfp-acct-phone-shell .bfp-acct-phone-prefix .bfp-acct-flag {
    display: inline-flex !important;
    align-items: center !important;
}
/* Keep every field's own box; only the phone field is borderless inside the shell. */
body.woocommerce-account .woocommerce-MyAccount-content .woocommerce-EditAccountForm input:not([type="hidden"]):not([type="checkbox"]):not([type="radio"]),
body.woocommerce-account .woocommerce-MyAccount-content form.edit-account input:not([type="hidden"]):not([type="checkbox"]):not([type="radio"]) {
    box-sizing: border-box !important;
    height: 40px !important;
    min-height: 40px !important;
    padding: 0 13px !important;
}
/* Phone input: fill the shell, no own border/background; the shell draws it. */
body.woocommerce-account .woocommerce-MyAccount-content .woocommerce-EditAccountForm .bfp-acct-phone-shell input[name="_wc_other/bfp/contact-phone"],
body.woocommerce-account .woocommerce-MyAccount-content .woocommerce-EditAccountForm input:not([type="hidden"]):not([type="checkbox"]):not([type="radio"])[name="_wc_other/bfp/contact-phone"] {
    box-sizing: border-box !important;
    flex: 1 1 auto !important;
    width: auto !important;
    height: 100% !important;
    min-height: 0 !important;
    margin: 0 !important;
    padding: 0 13px !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    font-family: inherit !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    color: #25211f !important;
    outline: none !important;
}
body.woocommerce-account .woocommerce-MyAccount-content .woocommerce-EditAccountForm .bfp-acct-phone-shell input[name="_wc_other/bfp/contact-phone"]:focus {
    border: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
}
/* Locked (read-only) identity fields: Email + Phone. */
body.woocommerce-account .woocommerce-MyAccount-content .woocommerce-EditAccountForm input[readonly] {
    color: #57514c !important;
    caret-color: transparent !important;
    cursor: default !important;
}
/* Email keeps its own box, so it greys directly. */
body.woocommerce-account .woocommerce-MyAccount-content .woocommerce-EditAccountForm input#account_email[readonly],
body.woocommerce-account .woocommerce-MyAccount-content .woocommerce-EditAccountForm input[name="account_email"][readonly] {
    background: #f3f1ef !important;
}
/* Phone is inside the shell, so grey the SHELL instead. */
body.woocommerce-account .woocommerce-MyAccount-content .woocommerce-EditAccountForm .bfp-acct-phone-shell:has(input[readonly]),
body.woocommerce-account .woocommerce-MyAccount-content .woocommerce-EditAccountForm .bfp-acct-phone-shell--locked {
    background: #f3f1ef !important;
    border-color: #e6e0db !important;
}
body.woocommerce-account .woocommerce-MyAccount-content .woocommerce-EditAccountForm .bfp-acct-phone-shell--locked input {
    color: #57514c !important;
    cursor: default !important;
}

/* Hide the Display name helper paragraph ("This will be how your name ..."). */
body.woocommerce-account .woocommerce-MyAccount-content .woocommerce-EditAccountForm #account_display_name_description {
    display: none !important;
}

/* --- Mobile: one column. --- */
@media (max-width: 767px) {
    body.woocommerce-account .woocommerce-MyAccount-content .woocommerce-EditAccountForm,
    body.woocommerce-account .woocommerce-MyAccount-content .woocommerce-EditAccountForm fieldset {
        grid-template-columns: minmax(0, 1fr) !important;
    }
    body.woocommerce-account .woocommerce-MyAccount-content .woocommerce-EditAccountForm .form-row {
        grid-column: 1 !important;
    }
}