/*
 * Auth + Account UI layer.
 *
 * Scope:
 * - Header account state icon/dropdown (desktop + mobile).
 * - WooCommerce account flows: login, register, lost password,
 *   dashboard, addresses, account details, orders.
 */

:root {
    --bb-auth-pink: #e9477a;
    --bb-auth-pink-dark: #c93666;
    --bb-auth-rose: #d95a5a;
    --bb-auth-cream: #fbf8f6;
    --bb-auth-surface: #fffdfb;
    --bb-auth-border: #f0e4db;
    --bb-auth-text: #3f302c;
    --bb-auth-muted: #7a6860;
    --bb-auth-shadow: 0 14px 34px rgba(63, 40, 30, 0.12);
}

/* Header account widget */
.bb-account-menu {
    position: relative;
    display: inline-flex;
    align-items: center;
    margin-left: 10px;
}

.bb-account-toggle {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border: 1px solid transparent;
    background: transparent;
    color: #2f2a28;
    font-weight: 600;
    line-height: 1;
    padding: 8px 10px;
    border-radius: 999px;
    transition: color 0.2s ease, border-color 0.2s ease, background-color 0.2s ease;
}

.bb-account-toggle:hover,
.bb-account-menu.is-open .bb-account-toggle,
.bb-account-toggle:focus {
    color: var(--bb-auth-pink);
    border-color: rgba(233, 71, 122, 0.28);
    background: rgba(233, 71, 122, 0.08);
    outline: none;
}

.bb-account-toggle-icon i {
    font-size: 20px;
    line-height: 1;
}

.bb-account-toggle-text {
    font-size: 13px;
    letter-spacing: 0.01em;
}

.bb-account-dropdown {
    position: absolute;
    right: 0;
    top: calc(100% + 10px);
    width: 260px;
    background: linear-gradient(180deg, #fffefc 0%, #fff9f3 100%);
    border: 1px solid var(--bb-auth-border);
    border-radius: 14px;
    box-shadow: var(--bb-auth-shadow);
    padding: 12px;
    z-index: 1003;
}

.bb-account-dropdown[hidden] {
    display: none;
}

.bb-account-greeting {
    margin: 0 0 10px;
    color: var(--bb-auth-muted);
    font-size: 12px;
    border-bottom: 1px solid rgba(233, 71, 122, 0.12);
    padding: 0 2px 8px;
}

.bb-account-links {
    margin: 0;
    padding: 0;
    list-style: none;
}

.bb-account-links li {
    margin: 0;
}

.bb-account-link {
    display: block;
    border-radius: 10px;
    padding: 9px 10px;
    color: var(--bb-auth-text);
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.bb-account-link:hover,
.bb-account-link:focus {
    color: var(--bb-auth-pink);
    background: rgba(233, 71, 122, 0.1);
    text-decoration: none;
    outline: none;
}

.bb-account-link-logout {
    color: #8f3a38;
}

.bb-account-menu-mobile {
    margin-left: 8px;
}

.bb-account-menu-mobile .bb-account-toggle {
    padding: 7px 8px;
}

.bb-account-menu-mobile .bb-account-toggle-text {
    display: none;
}

.bb-account-menu-mobile .bb-account-dropdown {
    right: auto;
    left: 0;
    width: min(280px, calc(100vw - 30px));
}

/* Auth and profile pages */
.woocommerce-account .woocommerce,
.woocommerce-lost-password .woocommerce,
.woocommerce-reset-password .woocommerce {
    background: linear-gradient(180deg, rgba(251, 248, 246, 0.8) 0%, rgba(255, 252, 249, 0.94) 100%);
    border: 1px solid var(--bb-auth-border);
    border-radius: 22px;
    box-shadow: var(--bb-auth-shadow);
    padding: 24px;
}

.woocommerce-account .woocommerce h2,
.woocommerce-account .woocommerce h3,
.woocommerce-lost-password .woocommerce h2,
.woocommerce-reset-password .woocommerce h2 {
    color: #6f2f29;
    letter-spacing: 0.01em;
    margin-bottom: 16px;
}

.woocommerce-account .woocommerce-form,
.woocommerce-account form.woocommerce-EditAccountForm,
.woocommerce-account form.woocommerce-address-fields,
.woocommerce-lost-password .woocommerce-ResetPassword {
    background: var(--bb-auth-surface);
    border: 1px solid var(--bb-auth-border);
    border-radius: 16px;
    padding: 18px;
}

.woocommerce-account .form-row label,
.woocommerce-lost-password .form-row label,
.woocommerce-reset-password .form-row label {
    color: var(--bb-auth-text);
    font-weight: 600;
}

.woocommerce-account input.input-text,
.woocommerce-account textarea,
.woocommerce-account select,
.woocommerce-lost-password input.input-text,
.woocommerce-reset-password input.input-text {
    border: 1px solid #e7d9cf;
    border-radius: 10px;
    background: #fff;
    min-height: 44px;
    color: var(--bb-auth-text);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.woocommerce-account input.input-text:focus,
.woocommerce-account textarea:focus,
.woocommerce-account select:focus,
.woocommerce-lost-password input.input-text:focus,
.woocommerce-reset-password input.input-text:focus {
    border-color: rgba(233, 71, 122, 0.55);
    box-shadow: 0 0 0 4px rgba(233, 71, 122, 0.12);
    outline: none;
}

.woocommerce-account .button,
.woocommerce-lost-password .button,
.woocommerce-reset-password .button,
.woocommerce-account .woocommerce-button {
    border: none;
    border-radius: 999px;
    min-height: 44px;
    padding: 10px 20px;
    background: linear-gradient(135deg, var(--bb-auth-pink) 0%, var(--bb-auth-rose) 100%);
    color: #fff;
    font-weight: 700;
    letter-spacing: 0.01em;
    box-shadow: 0 10px 22px rgba(217, 90, 90, 0.25);
}

.woocommerce-account .button:hover,
.woocommerce-lost-password .button:hover,
.woocommerce-reset-password .button:hover,
.woocommerce-account .woocommerce-button:hover {
    background: linear-gradient(135deg, var(--bb-auth-pink-dark) 0%, #bf4b4b 100%);
    color: #fff;
}

.woocommerce-account .woocommerce-MyAccount-navigation ul {
    background: var(--bb-auth-surface);
    border: 1px solid var(--bb-auth-border);
    border-radius: 16px;
    padding: 8px;
}

.woocommerce-account .woocommerce-MyAccount-navigation ul li {
    margin: 0;
}

.woocommerce-account .woocommerce-MyAccount-navigation ul li a {
    display: block;
    border-radius: 10px;
    padding: 10px 12px;
    font-weight: 600;
    color: var(--bb-auth-text);
}

.woocommerce-account .woocommerce-MyAccount-navigation ul li.is-active a,
.woocommerce-account .woocommerce-MyAccount-navigation ul li a:hover {
    background: rgba(233, 71, 122, 0.1);
    color: var(--bb-auth-pink);
}

.woocommerce-account table.shop_table {
    border: 1px solid var(--bb-auth-border);
    border-radius: 14px;
    overflow: hidden;
    background: #fff;
}

.woocommerce-account table.shop_table th {
    background: #fff4ec;
    color: #6b312a;
    border-color: var(--bb-auth-border);
}

.woocommerce-account table.shop_table td {
    border-color: var(--bb-auth-border);
}

.woocommerce-account .woocommerce-Addresses .woocommerce-Address {
    background: var(--bb-auth-surface);
    border: 1px solid var(--bb-auth-border);
    border-radius: 14px;
    padding: 14px;
}

.woocommerce form .show-password-input,
.woocommerce-page form .show-password-input {
    color: var(--bb-auth-muted);
}

@media (max-width: 991px) {
    .woocommerce-account .woocommerce,
    .woocommerce-lost-password .woocommerce,
    .woocommerce-reset-password .woocommerce {
        padding: 18px;
        border-radius: 18px;
    }

    .woocommerce-account .woocommerce-MyAccount-navigation,
    .woocommerce-account .woocommerce-MyAccount-content {
        float: none;
        width: 100%;
    }

    .woocommerce-account .woocommerce-MyAccount-navigation {
        margin-bottom: 16px;
    }
}

@media (max-width: 767px) {
    .bb-account-menu {
        margin-left: 6px;
    }

    .bb-account-dropdown {
        width: min(250px, calc(100vw - 24px));
    }

    .woocommerce-account .woocommerce-form,
    .woocommerce-account form.woocommerce-EditAccountForm,
    .woocommerce-account form.woocommerce-address-fields,
    .woocommerce-lost-password .woocommerce-ResetPassword {
        padding: 14px;
    }
}
