.hvma-account-wrapper,
.hvma-account-wrapper * {
    box-sizing: border-box;
}

.woocommerce-account .hvma-account-wrapper {
    display: grid;
    grid-template-columns: var(--hvma-sidebar-width, 280px) minmax(0, 1fr);
    gap: var(--hvma-gap, 28px);
    align-items: start;
    color: var(--hvma-text, #0f172a);
    width: 100%;
}

.woocommerce-account .hvma-layout-sidebar-right {
    grid-template-columns: minmax(0, 1fr) var(--hvma-sidebar-width, 280px);
}

.woocommerce-account .hvma-layout-sidebar-right .hvma-account-sidebar {
    order: 2;
}

.woocommerce-account .hvma-layout-top-menu,
.woocommerce-account .hvma-layout-compact {
    display: block;
}

.hvma-account-sidebar {
    background: var(--hvma-sidebar-bg, #fff);
    border-radius: var(--hvma-radius, 12px);
    box-shadow: var(--hvma-shadow, 0 12px 35px rgba(15,23,42,.08));
    padding: 18px 12px;
    border: 1px solid color-mix(in srgb, var(--hvma-border, #d7dee8), transparent 30%);
}

.hvma-layout-top-menu .hvma-account-sidebar,
.hvma-layout-compact .hvma-account-sidebar {
    margin-bottom: var(--hvma-gap, 28px);
}

.hvma-account-content {
    min-width: 0;
    background: transparent;
}

.hvma-user-panel {
    text-align: center;
    padding: 2px 10px 18px;
}

.hvma-user-avatar-wrap {
    position: relative;
    width: fit-content;
    margin: 0 auto 14px;
}

.hvma-user-avatar-image {
    display: block;
    width: min(150px, 100%);
    height: min(150px, 100%);
    border-radius: 999px;
    object-fit: cover;
    background: #f1f5f9;
    border: 1px solid var(--hvma-border, #d7dee8);
    padding: 4px;
}

.hvma-avatar-details {
    position: absolute;
    right: -7px;
    bottom: 5px;
    z-index: 6;
}

.hvma-avatar-details summary {
    list-style: none;
}

.hvma-avatar-details summary::-webkit-details-marker {
    display: none;
}

.hvma-avatar-trigger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 999px;
    background: #fff;
    color: var(--hvma-text, #0f172a);
    border: 1px solid var(--hvma-border, #d7dee8);
    box-shadow: 0 7px 15px rgba(15,23,42,.12);
    cursor: pointer;
}

.hvma-avatar-popover {
    position: absolute;
    top: 38px;
    right: 0;
    width: 230px;
    padding: 12px;
    background: #fff;
    border: 1px solid var(--hvma-border, #d7dee8);
    border-radius: 12px;
    box-shadow: 0 15px 35px rgba(15,23,42,.18);
    text-align: left;
}

.hvma-avatar-file-label {
    display: block;
    margin-bottom: 8px;
    color: var(--hvma-muted, #64748b);
    font-size: 13px;
}

.hvma-avatar-file-label input {
    display: block;
    width: 100%;
    margin-top: 5px;
    font-size: 12px;
}

.hvma-small-button,
.hvma-download-button,
.hvma-account-wrapper .button.hvma-order-action-btn,
.hvma-page-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: calc(var(--hvma-radius, 12px) - 4px);
    background: var(--hvma-primary-hover, #0a1529);
    color: var(--hvma-button-text, #fff) !important;
    min-height: 38px;
    padding: 10px 16px;
    font-weight: 700;
    text-decoration: none !important;
    cursor: pointer;
    line-height: 1.2;
}

.hvma-small-button:hover,
.hvma-download-button:hover,
.hvma-account-wrapper .button.hvma-order-action-btn:hover,
.hvma-page-btn:hover {
    background: var(--hvma-primary, #0b6dcc);
    color: var(--hvma-button-text, #fff) !important;
}

.hvma-link-button {
    display: inline-block;
    margin-top: 8px;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--hvma-primary, #0b6dcc);
    text-decoration: underline;
    cursor: pointer;
    font-size: 13px;
}

.hvma-user-greeting {
    margin: 8px 0 0;
    color: var(--hvma-muted, #64748b);
    font-size: 13px;
    line-height: 1.5;
}

.hvma-user-greeting strong {
    color: var(--hvma-text, #0f172a);
}

.hvma-user-logout-inline a {
    color: var(--hvma-text, #0f172a);
    text-decoration: none;
}

.hvma-user-logout-inline a:hover {
    color: var(--hvma-primary, #0b6dcc);
}

.hvma-account-menu {
    display: flex;
    flex-direction: column;
    gap: 7px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.hvma-layout-top-menu .hvma-account-menu,
.hvma-layout-compact .hvma-account-menu {
    flex-direction: row;
    flex-wrap: wrap;
}

.hvma-account-menu-li {
    margin: 0;
    padding: 0;
}

.hvma-account-menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    min-height: 42px;
    padding: 10px 13px;
    border: 1px solid var(--hvma-border, #d7dee8);
    border-radius: calc(var(--hvma-radius, 12px) - 4px);
    color: var(--hvma-text, #0f172a);
    background: #fff;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none !important;
    transition: .18s ease;
}

.hvma-account-menu-item:hover,
.hvma-account-menu-li.is-hvma-active .hvma-account-menu-item {
    background: var(--hvma-primary, #0b6dcc);
    color: var(--hvma-button-text, #fff);
    border-color: var(--hvma-primary, #0b6dcc);
}

.hvma-menu-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    min-width: 18px;
    font-size: 15px;
}

.hvma-menu-label {
    flex: 1;
}

.hvma-menu-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 22px;
    padding: 0 7px;
    border-radius: 999px;
    background: #f1f5f9;
    color: var(--hvma-text, #0f172a);
    font-size: 12px;
    font-weight: 700;
}

.hvma-account-menu-li.is-hvma-active .hvma-menu-badge,
.hvma-account-menu-item:hover .hvma-menu-badge {
    background: rgba(255,255,255,.18);
    color: #fff;
}

.hvma-content-card,
.hvma-account-content .woocommerce-MyAccount-content > section,
.hvma-account-content .woocommerce-address-fields,
.hvma-account-content form.woocommerce-EditAccountForm,
.hvma-account-content form.woocommerce-form-login,
.hvma-account-content form.woocommerce-form-register {
    background: var(--hvma-content-bg, #fff);
    border: 1px solid var(--hvma-border, #d7dee8);
    border-radius: var(--hvma-radius, 12px);
    padding: 20px;
}

.hvma-content-title,
.hvma-account-content h2,
.hvma-account-content h3 {
    color: var(--hvma-text, #0f172a);
}

.hvma-dashboard-cards {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    margin: 0 0 24px;
}

.hvma-dashboard-card {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 96px;
    background: var(--hvma-content-bg, #fff);
    border: 1px solid var(--hvma-border, #d7dee8);
    border-radius: var(--hvma-radius, 12px);
    padding: 16px;
    color: var(--hvma-text, #0f172a);
    text-decoration: none !important;
    box-shadow: 0 8px 22px rgba(15,23,42,.04);
}

.hvma-dashboard-card:hover {
    border-color: var(--hvma-primary, #0b6dcc);
}

.hvma-dashboard-card-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: color-mix(in srgb, var(--hvma-primary, #0b6dcc), transparent 88%);
    color: var(--hvma-primary, #0b6dcc);
    font-size: 18px;
}

.hvma-dashboard-card-content {
    display: flex;
    flex-direction: column;
}

.hvma-dashboard-card-content strong {
    font-size: 24px;
    line-height: 1;
    color: var(--hvma-text, #0f172a);
}

.hvma-dashboard-card-content small {
    color: var(--hvma-muted, #64748b);
    margin-top: 7px;
}

.hvma-downloads-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.hvma-download-card {
    background: var(--hvma-content-bg, #fff);
    border: 1px solid var(--hvma-border, #d7dee8);
    border-radius: var(--hvma-radius, 12px);
    padding: 20px 18px;
    box-shadow: 0 8px 22px rgba(15,23,42,.04);
}

.hvma-download-icon {
    margin-bottom: 12px;
    color: var(--hvma-primary-hover, #0a1529);
}

.hvma-download-title {
    margin: 0 0 6px;
    font-size: 16px;
}

.hvma-download-file-name,
.hvma-download-meta {
    color: var(--hvma-muted, #64748b);
    font-size: 13px;
}

.hvma-download-meta {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    border-top: 1px solid color-mix(in srgb, var(--hvma-border, #d7dee8), transparent 40%);
    margin-top: 14px;
    padding-top: 12px;
}

.hvma-download-button {
    width: 100%;
    margin-top: 16px;
}

.hvma-orders-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--hvma-content-bg, #fff);
    border: 1px solid var(--hvma-border, #d7dee8);
    border-radius: var(--hvma-radius, 12px);
    overflow: hidden;
}

.hvma-orders-table th,
.hvma-orders-table td {
    padding: 14px 16px;
    border: 1px solid var(--hvma-border, #d7dee8);
    text-align: left;
    vertical-align: middle;
}

.hvma-orders-table th {
    background: #f8fafc;
    font-weight: 700;
}

.hvma-order-number {
    color: var(--hvma-primary, #0b6dcc);
    font-weight: 700;
    text-decoration: none !important;
}

.hvma-order-status {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    padding: 5px 10px;
    background: #eef2ff;
    color: #3730a3;
    font-size: 12px;
    font-weight: 700;
}

.hvma-order-status-completed {
    background: #dcfce7;
    color: #166534;
}

.hvma-order-status-cancelled,
.hvma-order-status-failed {
    background: #fee2e2;
    color: #991b1b;
}

.hvma-order-status-processing {
    background: #fef3c7;
    color: #92400e;
}

.hvma-orders-card-list {
    display: none;
}

.hvma-order-card {
    background: var(--hvma-content-bg, #fff);
    border: 1px solid var(--hvma-border, #d7dee8);
    border-radius: var(--hvma-radius, 12px);
    padding: 16px;
    margin-bottom: 14px;
}

.hvma-order-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.hvma-order-card-meta {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin: 0 0 14px;
}

.hvma-order-card-meta div {
    background: #f8fafc;
    border-radius: 10px;
    padding: 10px;
}

.hvma-order-card-meta dt {
    color: var(--hvma-muted, #64748b);
    font-size: 12px;
    margin-bottom: 4px;
}

.hvma-order-card-meta dd {
    margin: 0;
    font-weight: 700;
}

.hvma-order-card-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.hvma-pagination {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-top: 18px;
}

.hvma-account-content input[type="text"],
.hvma-account-content input[type="email"],
.hvma-account-content input[type="password"],
.hvma-account-content input[type="tel"],
.hvma-account-content input[type="url"],
.hvma-account-content select,
.hvma-account-content textarea {
    border: 1px solid var(--hvma-border, #d7dee8);
    border-radius: calc(var(--hvma-radius, 12px) - 6px);
    padding: 10px 12px;
    min-height: 42px;
}

.hvma-account-content .button,
.hvma-account-content button.button,
.hvma-account-content input.button {
    border-radius: calc(var(--hvma-radius, 12px) - 4px);
}

.hvma-account-content .woocommerce-message,
.hvma-account-content .woocommerce-info,
.hvma-account-content .woocommerce-error {
    border-radius: var(--hvma-radius, 12px);
}

.hvma-shortcode-menu-only {
    display: block !important;
}

.hvma-shortcode-menu-only .hvma-account-sidebar {
    max-width: var(--hvma-sidebar-width, 280px);
}

@media (max-width: 1024px) {
    .hvma-dashboard-cards {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 768px) {
    .woocommerce-account .hvma-account-wrapper,
    .woocommerce-account .hvma-layout-sidebar-right {
        display: block;
    }

    .hvma-account-sidebar {
        margin-bottom: 18px;
    }

    .hvma-account-menu {
        flex-direction: row;
        overflow-x: auto;
        padding-bottom: 6px;
        scrollbar-width: thin;
    }

    .hvma-account-menu-li {
        flex: 0 0 auto;
    }

    .hvma-account-menu-item {
        min-width: 130px;
        justify-content: center;
    }

    .hvma-user-panel {
        padding-bottom: 12px;
    }

    .hvma-downloads-grid,
    .hvma-dashboard-cards {
        grid-template-columns: 1fr;
    }

    .hvma-orders-table {
        display: none;
    }

    .hvma-orders-card-list {
        display: block;
    }

    .hvma-order-card-meta {
        grid-template-columns: 1fr;
    }

    .hvma-has-mobile-bottom-nav .hvma-account-sidebar {
        position: fixed;
        left: 10px;
        right: 10px;
        bottom: 10px;
        z-index: 999;
        margin: 0;
        padding: 8px;
    }

    .hvma-has-mobile-bottom-nav .hvma-user-panel {
        display: none;
    }

    .hvma-has-mobile-bottom-nav .hvma-account-menu {
        flex-wrap: nowrap;
        overflow-x: auto;
    }

    .hvma-has-mobile-bottom-nav .hvma-account-menu-item {
        min-width: auto;
        width: 52px;
        height: 48px;
        padding: 8px;
        justify-content: center;
    }

    .hvma-has-mobile-bottom-nav .hvma-menu-label,
    .hvma-has-mobile-bottom-nav .hvma-menu-badge {
        display: none;
    }

    .hvma-has-mobile-bottom-nav .hvma-account-content {
        padding-bottom: 85px;
    }
}

/* Hide duplicated WooCommerce/theme account sidebar outside HVMA wrapper. */
body.hvma-force-hide-default-account .woocommerce-MyAccount-navigation:not(.hvma-account-navigation),
body.hvma-force-hide-default-account .woocommerce-account-sidebar:not(.hvma-account-sidebar),
body.hvma-force-hide-default-account .account-sidebar:not(.hvma-account-sidebar),
body.hvma-force-hide-default-account .account-user,
body.hvma-force-hide-default-account .account-nav:not(.hvma-account-navigation),
body.hvma-force-hide-default-account .woocommerce-MyAccount-tabs,
body.hvma-force-hide-default-account .my-account-tabs {
    display: none !important;
}

body.hvma-account-template-active .hvma-account-content > p,
body.hvma-account-template-active .hvma-account-content > .woocommerce-info,
body.hvma-account-template-active .hvma-account-content > .woocommerce-message,
body.hvma-account-template-active .hvma-account-content > .woocommerce-error,
body.hvma-account-template-active .hvma-account-content > .woocommerce-Address,
body.hvma-account-template-active .hvma-account-content > .woocommerce-Addresses,
body.hvma-account-template-active .hvma-account-content > form,
body.hvma-account-template-active .hvma-account-content > table,
body.hvma-account-template-active .hvma-account-content > section:not(.hvma-dashboard-template):not(.hvma-address-template):not(.hvma-edit-account-template):not(.hvma-payment-template):not(.hvma-custom-endpoint) {
    background: var(--hvma-content-bg, #fff);
    border: 1px solid var(--hvma-border, #d7dee8);
    border-radius: var(--hvma-radius, 12px);
    padding: 20px;
    box-shadow: 0 8px 22px rgba(15,23,42,.035);
}

.hvma-dashboard-template .hvma-dashboard-welcome p,
.hvma-address-note {
    margin-top: 0;
    color: var(--hvma-muted, #64748b);
}

.hvma-dashboard-quick-links {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin-top: 24px;
}

.hvma-dashboard-quick-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 62px;
    border: 1px solid var(--hvma-border, #d7dee8);
    border-radius: calc(var(--hvma-radius, 12px) - 2px);
    color: var(--hvma-text, #0f172a);
    background: #fff;
    text-decoration: none !important;
    font-size: 18px;
    font-weight: 600;
}

.hvma-dashboard-quick-link:hover {
    color: var(--hvma-primary, #0b6dcc);
    border-color: var(--hvma-primary, #0b6dcc);
}

.hvma-address-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.hvma-address-card {
    padding: 20px;
    border: 1px solid var(--hvma-border, #d7dee8);
    border-radius: calc(var(--hvma-radius, 12px) - 2px);
    background: #fff;
}

.hvma-address-card-head,
.hvma-payment-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 14px;
}

.hvma-address-card h2,
.hvma-payment-head h2 {
    margin: 0;
}

.hvma-address-edit {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    text-decoration: none !important;
    color: var(--hvma-primary, #0b6dcc);
    font-weight: 700;
}

.hvma-address-card address {
    display: block;
    margin: 0;
    color: var(--hvma-text, #0f172a);
    line-height: 1.7;
    font-style: normal;
}

.hvma-form-grid {
    display: grid;
    gap: 16px;
}

.hvma-form-grid-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.hvma-form .form-row {
    float: none !important;
    width: 100% !important;
    margin: 0 0 16px !important;
}

.hvma-form label {
    display: block;
    margin-bottom: 7px;
    color: var(--hvma-text, #0f172a);
    font-weight: 600;
}

.hvma-form input.input-text,
.hvma-form select,
.hvma-form textarea {
    width: 100%;
}

.hvma-password-fieldset {
    border: 1px solid var(--hvma-border, #d7dee8);
    border-radius: calc(var(--hvma-radius, 12px) - 2px);
    padding: 18px;
    margin: 18px 0;
}

.hvma-password-fieldset legend {
    padding: 0 8px;
    font-weight: 700;
    color: var(--hvma-text, #0f172a);
}

.hvma-submit-button {
    background: var(--hvma-primary-hover, #0a1529) !important;
    color: var(--hvma-button-text, #fff) !important;
    border: 0 !important;
    min-height: 42px;
    padding: 12px 20px !important;
}

.hvma-payment-table {
    width: 100%;
    border-collapse: collapse;
    overflow: hidden;
    border-radius: calc(var(--hvma-radius, 12px) - 2px);
}

.hvma-payment-table th,
.hvma-payment-table td {
    padding: 14px 16px;
    border: 1px solid var(--hvma-border, #d7dee8);
}

.hvma-payment-table th {
    background: #f8fafc;
}

.hvma-empty-state,
.hvma-empty-custom-content {
    border-radius: calc(var(--hvma-radius, 12px) - 2px);
}

.hvma-page-btn i {
    margin-right: 8px;
}

@media (max-width: 768px) {
    .hvma-dashboard-quick-links,
    .hvma-address-grid,
    .hvma-form-grid-2 {
        grid-template-columns: 1fr;
    }

    .hvma-address-card-head,
    .hvma-payment-head {
        align-items: flex-start;
        flex-direction: column;
    }
}

/* v1.0.2: remove empty default account columns left by themes such as Flatsome. */
body.hvma-force-hide-default-account .hvma-hidden-default-account-part,
body.hvma-force-hide-default-account .hvma-hidden-default-account-column {
    display: none !important;
    visibility: hidden !important;
    width: 0 !important;
    min-width: 0 !important;
    max-width: 0 !important;
    flex: 0 0 0 !important;
    padding: 0 !important;
    margin: 0 !important;
    border: 0 !important;
    overflow: hidden !important;
}

body.hvma-force-hide-default-account .hvma-account-content-expanded {
    width: 100% !important;
    max-width: 100% !important;
    flex: 1 1 100% !important;
    margin-left: 0 !important;
    padding-left: 0 !important;
}

body.hvma-force-hide-default-account .woocommerce:has(.hvma-account-wrapper) > .woocommerce-MyAccount-navigation:not(.hvma-account-navigation),
body.hvma-force-hide-default-account .woocommerce:has(.hvma-account-wrapper) .woocommerce-MyAccount-navigation:not(.hvma-account-navigation),
body.hvma-force-hide-default-account .row:has(.hvma-account-wrapper) > .col:has(.woocommerce-MyAccount-navigation:not(.hvma-account-navigation)),
body.hvma-force-hide-default-account .row:has(.hvma-account-wrapper) > .large-3:has(.woocommerce-MyAccount-navigation:not(.hvma-account-navigation)),
body.hvma-force-hide-default-account .row:has(.hvma-account-wrapper) > .large-4:has(.woocommerce-MyAccount-navigation:not(.hvma-account-navigation)),
body.hvma-force-hide-default-account .row:has(.hvma-account-wrapper) > .medium-3:has(.woocommerce-MyAccount-navigation:not(.hvma-account-navigation)),
body.hvma-force-hide-default-account .row:has(.hvma-account-wrapper) > .medium-4:has(.woocommerce-MyAccount-navigation:not(.hvma-account-navigation)) {
    display: none !important;
}

body.hvma-force-hide-default-account .row:has(.hvma-account-wrapper) > .col:has(.hvma-account-wrapper),
body.hvma-force-hide-default-account .row:has(.hvma-account-wrapper) > .large-8:has(.hvma-account-wrapper),
body.hvma-force-hide-default-account .row:has(.hvma-account-wrapper) > .large-9:has(.hvma-account-wrapper),
body.hvma-force-hide-default-account .row:has(.hvma-account-wrapper) > .medium-8:has(.hvma-account-wrapper),
body.hvma-force-hide-default-account .row:has(.hvma-account-wrapper) > .medium-9:has(.hvma-account-wrapper) {
    width: 100% !important;
    max-width: 100% !important;
    flex-basis: 100% !important;
}

body.hvma-account-template-active .woocommerce .hvma-account-wrapper {
    clear: both;
}
