/**
 * Nexcart — Customer Account stylesheet.
 *
 * Conditionally enqueued on the account page only. Consumes the shared
 * design tokens declared in nexcart-public.css (the Polaris-inspired
 * --nexcart-* custom properties for color, spacing, radius, and shadow).
 *
 * Section map:
 *   1. Shell (page header, grid, sidebar, content)
 *   2. Navigation (grouped links, mobile drawer)
 *   3. Shared patterns (card, section header, page header, notices)
 *   4. Buttons & status badges (scoped to .nexcart-account)
 *   5. Dashboard (greeting bar, metric tiles, recent orders)
 *   6. Orders list & pagination
 *   7. View order (two-column layout, items, totals, meta)
 *   8. Addresses
 *   9. Payment methods
 *   10. Downloads
 *   11. Account details (including danger zone)
 *   12. Guest / login / tracking
 *   13. Forms (inputs, selects, checkboxes, field grid)
 *   14. Empty / loading / error states
 *   15. Responsive + a11y (focus, reduced motion, forced colors)
 */

.nexcart-account {
    --nxa-nav-width: 260px;
    --nxa-gutter: var(--nexcart-space-7);

    --nexcart-brand: var(--wp--preset--color--primary,
                     var(--wp--preset--color--contrast,
                     var(--nexcart-accent)));
    --nexcart-brand-hover:      color-mix(in srgb, var(--nexcart-brand) 88%, #000);
    --nexcart-brand-active:     color-mix(in srgb, var(--nexcart-brand) 78%, #000);
    --nexcart-brand-foreground: var(--wp--preset--color--base, #ffffff);
    --nexcart-brand-soft-bg:    color-mix(in srgb, var(--nexcart-brand) 10%, transparent);
    --nexcart-brand-soft-hover: color-mix(in srgb, var(--nexcart-brand) 16%, transparent);
    --nexcart-brand-soft-fg:    var(--nexcart-brand);

    display: grid;
    grid-template-columns: var(--nxa-nav-width) minmax(0, 1fr);
    gap: 0 var(--nxa-gutter);
    margin: var(--nexcart-space-7) 0 var(--nexcart-space-10);
    font-family: var(--nexcart-font-family);
    color: var(--nexcart-text);
}

.nexcart-account__page-header {
    grid-column: 1 / -1;
    margin-bottom: var(--nexcart-space-6);
}

.nexcart-account__page-title {
    font-size: clamp(28px, 3vw, 34px);
    font-weight: 700;
    letter-spacing: -0.01em;
    margin: 0 0 var(--nexcart-space-1);
    color: var(--nexcart-text);
}

.nexcart-account__page-subtitle {
    font-size: 14px;
    color: var(--nexcart-text-muted);
    margin: 0;
}

.nexcart-account__sidebar {
    grid-column: 1;
    align-self: start;
    position: sticky;
    top: var(--nexcart-space-6);
}

.nexcart-account__main {
    grid-column: 2;
    min-width: 0;
}

.nexcart-account__skip-link {
    position: absolute;
    left: -9999px;
    top: auto;
    width: 1px;
    height: 1px;
    overflow: hidden;
}
.nexcart-account__skip-link:focus {
    position: static;
    width: auto;
    height: auto;
    padding: var(--nexcart-space-2) var(--nexcart-space-3);
    background: var(--nexcart-brand);
    color: var(--nexcart-brand-foreground);
    border-radius: var(--nexcart-radius-sm);
    margin-bottom: var(--nexcart-space-3);
    display: inline-block;
}

.nexcart-account-nav {
    background: var(--nexcart-bg-surface);
    border: 1px solid var(--nexcart-border);
    border-radius: var(--nexcart-radius-lg);
    padding: var(--nexcart-space-4);
    box-shadow: var(--nexcart-shadow-xs);
}

.nexcart-account-nav__identity {
    display: flex;
    align-items: center;
    gap: var(--nexcart-space-3);
    padding: var(--nexcart-space-2);
    margin-bottom: var(--nexcart-space-3);
}

.nexcart-account-nav__avatar img,
.nexcart-account-nav__avatar {
    width: 40px;
    height: 40px;
    border-radius: var(--nexcart-radius-pill);
    object-fit: cover;
    flex-shrink: 0;
}

.nexcart-account-nav__name {
    display: block;
    font-weight: 600;
    font-size: 14px;
    color: var(--nexcart-text);
    line-height: 1.3;
    word-break: break-word;
}

.nexcart-account-nav__email {
    display: block;
    font-size: 12px;
    color: var(--nexcart-text-muted);
    line-height: 1.3;
    word-break: break-word;
}

.nexcart-account-nav__group {
    margin: 0 0 var(--nexcart-space-3);
    padding: 0;
    list-style: none;
}

.nexcart-account-nav__group + .nexcart-account-nav__group {
    padding-top: var(--nexcart-space-3);
    border-top: 1px solid var(--nexcart-border-subtle);
}

.nexcart-account-nav__group-label {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--nexcart-text-subtle);
    padding: 0 var(--nexcart-space-3);
    margin: 0 0 var(--nexcart-space-2);
}

.nexcart-account-nav__item {
    margin-bottom: 2px;
}

.nexcart-account-nav__link {
    display: flex;
    align-items: center;
    gap: var(--nexcart-space-3);
    padding: var(--nexcart-space-3);
    border-radius: var(--nexcart-radius-md);
    text-decoration: none;
    color: var(--nexcart-text-muted);
    font-size: 14px;
    font-weight: 500;
    line-height: 1.3;
    transition: background-color 0.15s ease, color 0.15s ease;
    min-height: 40px;
}

.nexcart-account-nav__link:hover,
.nexcart-account-nav__link:focus-visible {
    background: var(--nexcart-bg-surface-alt);
    color: var(--nexcart-text);
}

.nexcart-account-nav__link[aria-current="page"] {
    background: var(--nexcart-brand-soft-bg);
    color: var(--nexcart-brand-soft-fg);
    font-weight: 600;
    box-shadow: inset 2px 0 0 var(--nexcart-brand);
}

.nexcart-account-nav__link[aria-current="page"]:hover,
.nexcart-account-nav__link[aria-current="page"]:focus-visible {
    background: var(--nexcart-brand-soft-hover);
    color: var(--nexcart-brand-soft-fg);
}

.nexcart-account-nav__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.nexcart-account-nav__icon svg {
    width: 20px;
    height: 20px;
}

.nexcart-account-nav__badge {
    margin-left: auto;
    background: var(--nexcart-bg-surface-alt);
    color: var(--nexcart-text-muted);
    font-size: 11px;
    font-weight: 600;
    padding: 1px 8px;
    border-radius: var(--nexcart-radius-pill);
    line-height: 1.4;
}

.nexcart-account-nav__link[aria-current="page"] .nexcart-account-nav__badge {
    background: color-mix(in srgb, var(--nexcart-brand) 20%, transparent);
    color: var(--nexcart-brand-soft-fg);
}

.nexcart-account-nav__link--logout {
    color: var(--nexcart-text-muted);
}

.nexcart-account-nav__link--logout:hover,
.nexcart-account-nav__link--logout:focus-visible {
    color: var(--nexcart-error-accent);
    background: var(--nexcart-error-bg);
}

.nexcart-account-nav__toggle {
    display: none;
}

.nexcart-account-card {
    background: var(--nexcart-bg-surface);
    border: 1px solid var(--nexcart-border);
    border-radius: var(--nexcart-radius-lg);
    padding: var(--nexcart-space-6);
    box-shadow: var(--nexcart-shadow-xs);
}

.nexcart-account-card + .nexcart-account-card {
    margin-top: var(--nexcart-space-5);
}

.nexcart-account-card--flush {
    padding: 0;
    overflow: hidden;
}

.nexcart-account-card__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--nexcart-space-4);
    flex-wrap: wrap;
    margin-bottom: var(--nexcart-space-5);
}

.nexcart-account-card--flush .nexcart-account-card__header {
    padding: var(--nexcart-space-5) var(--nexcart-space-6);
    margin-bottom: 0;
    border-bottom: 1px solid var(--nexcart-border-subtle);
}

.nexcart-account-card__title {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    line-height: 1.3;
    color: var(--nexcart-text);
}

.nexcart-account-card__subtitle {
    margin: var(--nexcart-space-1) 0 0;
    font-size: 13px;
    color: var(--nexcart-text-muted);
    line-height: 1.5;
}

.nexcart-account-card__actions {
    display: flex;
    align-items: center;
    gap: var(--nexcart-space-2);
    flex-wrap: wrap;
}

.nexcart-account-card__body {
}

.nexcart-account-card--flush .nexcart-account-card__body {
    padding: var(--nexcart-space-5) var(--nexcart-space-6);
}

.nexcart-account-card--flush .nexcart-account-card__body--table {
    padding: 0;
}

.nexcart-account-subpage-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: var(--nexcart-space-4);
    flex-wrap: wrap;
    margin-bottom: var(--nexcart-space-5);
}

.nexcart-account-subpage-header__text {
    min-width: 0;
}

.nexcart-account-subpage-header__title {
    margin: 0 0 var(--nexcart-space-1);
    font-size: 22px;
    font-weight: 700;
    letter-spacing: -0.005em;
    color: var(--nexcart-text);
    line-height: 1.25;
}

.nexcart-account-subpage-header__subtitle {
    margin: 0;
    font-size: 14px;
    color: var(--nexcart-text-muted);
    line-height: 1.5;
}

.nexcart-account-subpage-header__actions {
    display: flex;
    gap: var(--nexcart-space-2);
    flex-wrap: wrap;
}

.nexcart-account-backlink {
    display: inline-flex;
    align-items: center;
    gap: var(--nexcart-space-1);
    font-size: 13px;
    font-weight: 500;
    color: var(--nexcart-text-muted);
    text-decoration: none;
    margin-bottom: var(--nexcart-space-3);
    transition: color 0.15s ease;
}

.nexcart-account-backlink:hover,
.nexcart-account-backlink:focus-visible {
    color: var(--nexcart-text);
}

.nexcart-account-backlink svg {
    width: 14px;
    height: 14px;
}

.nexcart-account-notice {
    display: flex;
    align-items: flex-start;
    gap: var(--nexcart-space-3);
    padding: var(--nexcart-space-3) var(--nexcart-space-4);
    border-radius: var(--nexcart-radius-md);
    border: 1px solid transparent;
    font-size: 14px;
    line-height: 1.5;
    margin-bottom: var(--nexcart-space-5);
}

.nexcart-account-notice__icon {
    flex-shrink: 0;
    display: inline-flex;
    width: 18px;
    height: 18px;
    margin-top: 2px;
}

.nexcart-account-notice__icon svg {
    width: 18px;
    height: 18px;
}

.nexcart-account-notice--success {
    background: var(--nexcart-success-bg);
    color: var(--nexcart-success-fg);
    border-color: var(--nexcart-success-border);
}

.nexcart-account-notice--error {
    background: var(--nexcart-error-bg);
    color: var(--nexcart-error-fg);
    border-color: var(--nexcart-error-border);
}

.nexcart-account-notice--info {
    background: var(--nexcart-info-bg);
    color: var(--nexcart-info-fg);
}

.nexcart-account-notice--warning {
    background: var(--nexcart-warning-bg);
    color: var(--nexcart-warning-fg);
}

.nexcart-account-divider {
    height: 1px;
    background: var(--nexcart-border-subtle);
    border: 0;
    margin: var(--nexcart-space-5) 0;
}

.nexcart-account .nexcart-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--nexcart-space-2);
    padding: 9px var(--nexcart-space-4);
    border: 1px solid transparent;
    border-radius: var(--nexcart-radius-md);
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.3;
    text-decoration: none;
    cursor: pointer;
    transition: background-color 0.15s ease, border-color 0.15s ease,
                color 0.15s ease, box-shadow 0.15s ease, transform 0.1s ease;
    min-height: 36px;
    white-space: nowrap;
}

.nexcart-account .nexcart-btn:focus-visible {
    outline: none;
    box-shadow: var(--nexcart-shadow-focus);
}

.nexcart-account .nexcart-btn[disabled],
.nexcart-account .nexcart-btn.is-disabled {
    opacity: 0.55;
    cursor: not-allowed;
    pointer-events: none;
}

.nexcart-account .nexcart-btn svg {
    width: 14px;
    height: 14px;
}

.nexcart-account .nexcart-btn--primary {
    background: var(--nexcart-brand);
    color: var(--nexcart-brand-foreground);
    border-color: var(--nexcart-brand);
}

.nexcart-account .nexcart-btn--primary:hover {
    background: var(--nexcart-brand-hover);
    border-color: var(--nexcart-brand-hover);
}

.nexcart-account .nexcart-btn--primary:active {
    background: var(--nexcart-brand-active);
    border-color: var(--nexcart-brand-active);
}

.nexcart-account .nexcart-btn--secondary {
    background: var(--nexcart-bg-surface);
    color: var(--nexcart-text);
    border-color: var(--nexcart-border-strong);
}

.nexcart-account .nexcart-btn--secondary:hover {
    background: var(--nexcart-bg-surface-alt);
    border-color: var(--nexcart-text-muted);
}

.nexcart-account .nexcart-btn--ghost {
    background: transparent;
    color: var(--nexcart-text-muted);
    border-color: transparent;
}

.nexcart-account .nexcart-btn--ghost:hover {
    background: var(--nexcart-bg-surface-alt);
    color: var(--nexcart-text);
}

.nexcart-account .nexcart-btn--danger {
    background: var(--nexcart-bg-surface);
    color: var(--nexcart-error-accent);
    border-color: var(--nexcart-error-border);
}

.nexcart-account .nexcart-btn--danger:hover {
    background: var(--nexcart-error-bg);
}

.nexcart-account .nexcart-btn--danger-solid {
    background: var(--nexcart-error-accent);
    color: #fff;
    border-color: var(--nexcart-error-accent);
}

.nexcart-account .nexcart-btn--danger-solid:hover {
    background: var(--nexcart-error-fg);
    border-color: var(--nexcart-error-fg);
}

.nexcart-account .nexcart-btn--small {
    padding: 4px var(--nexcart-space-3);
    font-size: 13px;
    min-height: 28px;
    border-radius: var(--nexcart-radius-sm);
}

.nexcart-account .nexcart-btn--full {
    width: 100%;
}

.nexcart-account .nexcart-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 2px 10px;
    border-radius: var(--nexcart-radius-pill);
    font-size: 12px;
    font-weight: 600;
    line-height: 1.6;
    white-space: nowrap;
    background: var(--nexcart-bg-surface-alt);
    color: var(--nexcart-text-muted);
}

.nexcart-account .nexcart-status-badge::before {
    content: "";
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
    opacity: 0.7;
}

.nexcart-account .nexcart-status-badge--pending,
.nexcart-account .nexcart-status-badge--on-hold {
    background: var(--nexcart-warning-bg);
    color: var(--nexcart-warning-fg);
}

.nexcart-account .nexcart-status-badge--processing {
    background: var(--nexcart-info-bg);
    color: var(--nexcart-info-fg);
}

.nexcart-account .nexcart-status-badge--completed {
    background: var(--nexcart-success-bg);
    color: var(--nexcart-success-fg);
}

.nexcart-account .nexcart-status-badge--failed,
.nexcart-account .nexcart-status-badge--cancelled {
    background: var(--nexcart-error-bg);
    color: var(--nexcart-error-fg);
}

.nexcart-account .nexcart-status-badge--refunded {
    background: var(--nexcart-bg-surface-alt);
    color: var(--nexcart-text-muted);
}

.nexcart-account-dashboard {
    display: flex;
    flex-direction: column;
    gap: var(--nexcart-space-5);
}

.nexcart-account-greeting {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--nexcart-space-4);
    padding: var(--nexcart-space-5) var(--nexcart-space-6);
    background: var(--nexcart-bg-surface);
    border: 1px solid var(--nexcart-border);
    border-radius: var(--nexcart-radius-lg);
    box-shadow: var(--nexcart-shadow-xs);
    color: var(--nexcart-text);
    overflow: hidden;
    flex-wrap: wrap;
}

.nexcart-account-greeting::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 4px;
    background: var(--nexcart-brand);
}

.nexcart-account-greeting__text {
    min-width: 0;
    flex: 1 1 320px;
}

.nexcart-account-greeting__title {
    margin: 0 0 4px;
    font-size: 20px;
    font-weight: 700;
    line-height: 1.25;
    color: var(--nexcart-text);
}

.nexcart-account-greeting__body {
    margin: 0;
    font-size: 14px;
    line-height: 1.5;
    color: var(--nexcart-text-muted);
}

.nexcart-account-greeting__actions {
    display: flex;
    gap: var(--nexcart-space-2);
    flex-wrap: wrap;
}

.nexcart-account-metrics {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: var(--nexcart-space-3);
}

.nexcart-account-metric {
    display: flex;
    flex-direction: column;
    gap: var(--nexcart-space-1);
    padding: var(--nexcart-space-4) var(--nexcart-space-5);
    background: var(--nexcart-bg-surface);
    border: 1px solid var(--nexcart-border);
    border-radius: var(--nexcart-radius-lg);
    box-shadow: var(--nexcart-shadow-xs);
    text-decoration: none;
    color: inherit;
    transition: border-color 0.15s ease, box-shadow 0.15s ease,
                transform 0.1s ease;
}

a.nexcart-account-metric:hover,
a.nexcart-account-metric:focus-visible {
    border-color: var(--nexcart-border-strong);
    box-shadow: var(--nexcart-shadow-subtle);
    transform: translateY(-1px);
}

.nexcart-account-metric__label {
    display: flex;
    align-items: center;
    gap: var(--nexcart-space-2);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--nexcart-text-muted);
}

.nexcart-account-metric__label svg {
    width: 14px;
    height: 14px;
}

.nexcart-account-metric__value {
    font-size: 26px;
    font-weight: 700;
    line-height: 1.1;
    color: var(--nexcart-text);
    font-variant-numeric: tabular-nums;
}

.nexcart-account-metric__sub {
    font-size: 12px;
    color: var(--nexcart-text-muted);
    line-height: 1.4;
}

.nexcart-account-recent {
    display: flex;
    flex-direction: column;
}

.nexcart-account-recent__row {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) auto auto;
    align-items: center;
    gap: var(--nexcart-space-3);
    padding: var(--nexcart-space-3) var(--nexcart-space-5);
    border-top: 1px solid var(--nexcart-border-subtle);
    text-decoration: none;
    color: inherit;
    transition: background-color 0.1s ease;
}

.nexcart-account-recent__row:first-child {
    border-top: 0;
}

.nexcart-account-recent__row:hover,
.nexcart-account-recent__row:focus-visible {
    background: var(--nexcart-bg-surface-alt);
}

.nexcart-account-recent__number {
    font-weight: 600;
    font-size: 14px;
    color: var(--nexcart-text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.nexcart-account-recent__date {
    font-size: 13px;
    color: var(--nexcart-text-muted);
    white-space: nowrap;
}

.nexcart-account-recent__total {
    font-size: 14px;
    font-weight: 600;
    color: var(--nexcart-text);
    font-variant-numeric: tabular-nums;
    justify-self: end;
}

.nexcart-account-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.nexcart-account-table thead th {
    text-align: left;
    padding: var(--nexcart-space-3) var(--nexcart-space-5);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--nexcart-text-muted);
    background: var(--nexcart-bg-surface-alt);
    border-bottom: 1px solid var(--nexcart-border);
}

.nexcart-account-table tbody td {
    padding: var(--nexcart-space-4) var(--nexcart-space-5);
    color: var(--nexcart-text);
    border-bottom: 1px solid var(--nexcart-border-subtle);
    vertical-align: middle;
}

.nexcart-account-table tbody tr:last-child td {
    border-bottom: 0;
}

.nexcart-account-table tbody tr:hover {
    background: var(--nexcart-bg-surface-alt);
}

.nexcart-account-table__link {
    font-weight: 600;
    color: var(--nexcart-text);
    text-decoration: none;
}

.nexcart-account-table__link:hover,
.nexcart-account-table__link:focus-visible {
    color: var(--nexcart-brand);
    text-decoration: underline;
}

.nexcart-account-table__muted {
    color: var(--nexcart-text-muted);
    font-size: 13px;
}

.nexcart-account-table__total {
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.nexcart-account-table__actions {
    display: flex;
    justify-content: flex-end;
    gap: var(--nexcart-space-2);
    flex-wrap: wrap;
}

.nexcart-account-table__align-end {
    text-align: right;
}

@media (max-width: 640px) {
    .nexcart-account-table thead {
        position: absolute;
        left: -9999px;
        top: -9999px;
    }

    .nexcart-account-table,
    .nexcart-account-table tbody,
    .nexcart-account-table tr,
    .nexcart-account-table td {
        display: block;
        width: 100%;
    }

    .nexcart-account-table tbody tr {
        padding: var(--nexcart-space-3) var(--nexcart-space-4);
        border-bottom: 1px solid var(--nexcart-border-subtle);
    }

    .nexcart-account-table tbody tr:last-child {
        border-bottom: 0;
    }

    .nexcart-account-table tbody td {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: var(--nexcart-space-3);
        padding: 6px 0;
        border-bottom: 0;
        text-align: right;
    }

    .nexcart-account-table tbody td::before {
        content: attr(data-label);
        font-size: 12px;
        font-weight: 600;
        color: var(--nexcart-text-muted);
        text-transform: uppercase;
        letter-spacing: 0.04em;
        margin-right: var(--nexcart-space-3);
    }

    .nexcart-account-table__actions {
        justify-content: flex-end;
    }
}

.nexcart-account-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--nexcart-space-1);
    margin-top: var(--nexcart-space-5);
    flex-wrap: wrap;
}

.nexcart-account-pagination__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 var(--nexcart-space-3);
    border: 1px solid var(--nexcart-border);
    border-radius: var(--nexcart-radius-sm);
    font-size: 14px;
    font-weight: 500;
    color: var(--nexcart-text);
    background: var(--nexcart-bg-surface);
    text-decoration: none;
    transition: background-color 0.15s ease, border-color 0.15s ease;
}

.nexcart-account-pagination__btn:hover,
.nexcart-account-pagination__btn:focus-visible {
    border-color: var(--nexcart-border-strong);
    background: var(--nexcart-bg-surface-alt);
}

.nexcart-account-pagination__btn[aria-current="page"] {
    background: var(--nexcart-brand);
    color: var(--nexcart-brand-foreground);
    border-color: var(--nexcart-brand);
}

.nexcart-account-pagination__btn svg {
    width: 14px;
    height: 14px;
}

.nexcart-account-pagination__ellipsis {
    padding: 0 var(--nexcart-space-2);
    color: var(--nexcart-text-muted);
    user-select: none;
}

.nexcart-account-view-order {
    display: grid;
    grid-template-columns: minmax(0, 1.6fr) minmax(260px, 1fr);
    gap: var(--nexcart-space-5);
    align-items: start;
}

.nexcart-account-view-order__main {
    display: flex;
    flex-direction: column;
    gap: var(--nexcart-space-5);
    min-width: 0;
}

.nexcart-account-view-order__side {
    display: flex;
    flex-direction: column;
    gap: var(--nexcart-space-5);
    min-width: 0;
    position: sticky;
    top: var(--nexcart-space-6);
}

@media (max-width: 900px) {
    .nexcart-account-view-order {
        grid-template-columns: 1fr;
    }
    .nexcart-account-view-order__side {
        position: static;
    }
}

.nexcart-account-order-items {
    display: flex;
    flex-direction: column;
}

.nexcart-account-order-item {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: baseline;
    gap: var(--nexcart-space-3);
    padding: var(--nexcart-space-3) 0;
    border-top: 1px solid var(--nexcart-border-subtle);
}

.nexcart-account-order-item:first-child {
    border-top: 0;
    padding-top: 0;
}

.nexcart-account-order-item__name {
    font-size: 14px;
    font-weight: 500;
    color: var(--nexcart-text);
    word-break: break-word;
}

.nexcart-account-order-item__qty {
    display: inline-block;
    margin-left: var(--nexcart-space-2);
    font-size: 13px;
    color: var(--nexcart-text-muted);
    font-weight: 500;
}

.nexcart-account-order-item__total {
    font-size: 14px;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.nexcart-account-order-totals {
    margin-top: var(--nexcart-space-4);
    padding-top: var(--nexcart-space-4);
    border-top: 1px solid var(--nexcart-border);
    display: flex;
    flex-direction: column;
    gap: var(--nexcart-space-1);
}

.nexcart-account-order-totals__row {
    display: flex;
    justify-content: space-between;
    gap: var(--nexcart-space-4);
    font-size: 14px;
    color: var(--nexcart-text-muted);
    padding: 4px 0;
}

.nexcart-account-order-totals__row > span + span {
    font-variant-numeric: tabular-nums;
    color: var(--nexcart-text);
    font-weight: 500;
}

.nexcart-account-order-totals__row--discount > span + span {
    color: var(--nexcart-success-fg);
}

.nexcart-account-order-totals__row--grand {
    margin-top: var(--nexcart-space-2);
    padding-top: var(--nexcart-space-3);
    border-top: 1px solid var(--nexcart-border-subtle);
    font-size: 16px;
    color: var(--nexcart-text);
    font-weight: 700;
}

.nexcart-account-order-totals__row--grand > span + span {
    color: var(--nexcart-text);
    font-weight: 700;
}

.nexcart-account-meta {
    display: flex;
    flex-direction: column;
    gap: var(--nexcart-space-3);
}

.nexcart-account-meta__row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: var(--nexcart-space-3);
}

.nexcart-account-meta__label {
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--nexcart-text-muted);
}

.nexcart-account-meta__value {
    font-size: 14px;
    color: var(--nexcart-text);
    text-align: right;
    word-break: break-word;
}

.nexcart-account-notes {
    display: flex;
    flex-direction: column;
    gap: var(--nexcart-space-3);
}

.nexcart-account-note {
    padding: var(--nexcart-space-3) var(--nexcart-space-4);
    background: var(--nexcart-bg-surface-alt);
    border-radius: var(--nexcart-radius-sm);
}

.nexcart-account-note__date {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--nexcart-text-muted);
    margin-bottom: 2px;
}

.nexcart-account-note__content {
    margin: 0;
    font-size: 14px;
    color: var(--nexcart-text);
    line-height: 1.5;
}

.nexcart-account-addresses-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: var(--nexcart-space-5);
}

.nexcart-account-address-card {
    display: flex;
    flex-direction: column;
    gap: var(--nexcart-space-4);
}

.nexcart-account-address-card__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--nexcart-space-3);
}

.nexcart-account-address-card__heading {
    display: flex;
    align-items: center;
    gap: var(--nexcart-space-2);
    min-width: 0;
}

.nexcart-account-address-card__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: var(--nexcart-radius-md);
    background: var(--nexcart-bg-surface-alt);
    color: var(--nexcart-text-muted);
    flex-shrink: 0;
}

.nexcart-account-address-card__icon svg {
    width: 18px;
    height: 18px;
}

.nexcart-account-address-card__title {
    margin: 0;
    font-size: 15px;
    font-weight: 600;
    color: var(--nexcart-text);
    line-height: 1.2;
}

.nexcart-account-address-card__display {
    font-style: normal;
    font-size: 14px;
    line-height: 1.7;
    color: var(--nexcart-text);
    word-break: break-word;
}

.nexcart-account-address-card__display .nexcart-account-address-phone {
    display: inline-block;
    margin-top: var(--nexcart-space-1);
    color: var(--nexcart-text-muted);
    font-size: 13px;
}

.nexcart-account-address-card__empty {
    padding: var(--nexcart-space-5) 0 var(--nexcart-space-2);
    text-align: left;
    color: var(--nexcart-text-muted);
    font-size: 14px;
    line-height: 1.5;
}

.nexcart-account-address-card__empty p {
    margin: 0 0 var(--nexcart-space-3);
}

.nexcart-account-methods {
    display: flex;
    flex-direction: column;
    gap: var(--nexcart-space-3);
}

.nexcart-account-method {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--nexcart-space-4);
    padding: var(--nexcart-space-4) var(--nexcart-space-5);
    background: var(--nexcart-bg-surface);
    border: 1px solid var(--nexcart-border);
    border-radius: var(--nexcart-radius-lg);
    box-shadow: var(--nexcart-shadow-xs);
    transition: opacity 0.2s ease, transform 0.2s ease;
    flex-wrap: wrap;
}

.nexcart-account-method.is-removing {
    opacity: 0;
    transform: scale(0.96);
}

.nexcart-account-method__main {
    display: flex;
    align-items: center;
    gap: var(--nexcart-space-4);
    min-width: 0;
    flex: 1 1 auto;
}

.nexcart-account-method__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: var(--nexcart-radius-md);
    background: var(--nexcart-bg-surface-alt);
    color: var(--nexcart-text-muted);
    flex-shrink: 0;
}

.nexcart-account-method__icon svg {
    width: 22px;
    height: 22px;
}

.nexcart-account-method__icon--paypal { color: #003087; }
.nexcart-account-method__icon--venmo  { color: #008cff; }
.nexcart-account-method__icon--card   { color: var(--nexcart-text); }

.nexcart-account-method__details {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.nexcart-account-method__label {
    font-size: 14px;
    font-weight: 600;
    color: var(--nexcart-text);
    word-break: break-word;
}

.nexcart-account-method__meta {
    display: flex;
    align-items: center;
    gap: var(--nexcart-space-2);
    font-size: 13px;
    color: var(--nexcart-text-muted);
    flex-wrap: wrap;
}

.nexcart-account-method__actions {
    display: flex;
    gap: var(--nexcart-space-2);
    flex-wrap: wrap;
    justify-content: flex-end;
}

.nexcart-account-add-method {
    display: flex;
    gap: var(--nexcart-space-3);
    flex-wrap: wrap;
    align-items: center;
}

.nexcart-account-add-method > * {
    flex: 1 1 auto;
    min-width: 180px;
}

.nexcart-account-add-method .nexcart-btn {
    flex: 0 0 auto;
    min-width: 0;
}

.nexcart-account-form {
    display: flex;
    flex-direction: column;
    gap: var(--nexcart-space-4);
}

.nexcart-account-fieldset {
    border: 0;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: var(--nexcart-space-3);
}

.nexcart-account-fieldset__legend {
    padding: 0;
    margin: 0 0 var(--nexcart-space-1);
    font-size: 13px;
    font-weight: 600;
    color: var(--nexcart-text);
}

.nexcart-account-fieldset__description {
    margin: 0 0 var(--nexcart-space-2);
    font-size: 13px;
    color: var(--nexcart-text-muted);
    line-height: 1.5;
}

.nexcart-account-form__grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--nexcart-space-4);
}

@media (max-width: 560px) {
    .nexcart-account-form__grid {
        grid-template-columns: 1fr;
    }
}

.nexcart-account-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    grid-column: 1 / -1;
    min-width: 0;
}

.nexcart-account-field--half {
    grid-column: span 1;
}

.nexcart-account-field--inline {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: var(--nexcart-space-3);
    flex-wrap: wrap;
}

.nexcart-account-field__label {
    font-size: 13px;
    font-weight: 500;
    color: var(--nexcart-text);
    line-height: 1.3;
}

.nexcart-account-field__label--required::after {
    content: " *";
    color: var(--nexcart-error-accent);
}

.nexcart-account-field__hint {
    font-size: 12px;
    color: var(--nexcart-text-muted);
    line-height: 1.5;
}

.nexcart-account-field__error {
    font-size: 12px;
    color: var(--nexcart-error-fg);
    line-height: 1.5;
}

.nexcart-account-input,
.nexcart-account-select,
.nexcart-account-textarea {
    width: 100%;
    min-height: 40px;
    padding: 9px var(--nexcart-space-3);
    font-family: inherit;
    font-size: 14px;
    line-height: 1.4;
    color: var(--nexcart-text);
    background: var(--nexcart-bg-surface);
    border: 1px solid var(--nexcart-border);
    border-radius: var(--nexcart-radius-md);
    box-sizing: border-box;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.nexcart-account-input:hover,
.nexcart-account-select:hover,
.nexcart-account-textarea:hover {
    border-color: var(--nexcart-border-strong);
}

.nexcart-account-input:focus,
.nexcart-account-select:focus,
.nexcart-account-textarea:focus {
    outline: none;
    border-color: var(--nexcart-border-focus);
    box-shadow: var(--nexcart-shadow-focus);
}

.nexcart-account-input[aria-invalid="true"],
.nexcart-account-select[aria-invalid="true"],
.nexcart-account-textarea[aria-invalid="true"] {
    border-color: var(--nexcart-border-error);
}

.nexcart-account-input[disabled],
.nexcart-account-select[disabled],
.nexcart-account-textarea[disabled] {
    background: var(--nexcart-bg-surface-alt);
    color: var(--nexcart-text-disabled);
    cursor: not-allowed;
}

.nexcart-account-select {
    appearance: none;
    -webkit-appearance: none;
    padding-right: 36px;
    background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%236b7280' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
}

.nexcart-account-textarea {
    min-height: 96px;
    resize: vertical;
}

.nexcart-account-checkbox {
    display: flex;
    align-items: flex-start;
    gap: var(--nexcart-space-2);
    font-size: 14px;
    color: var(--nexcart-text);
    cursor: pointer;
    line-height: 1.5;
}

.nexcart-account-checkbox input[type="checkbox"] {
    width: 16px;
    height: 16px;
    margin: 3px 0 0;
    accent-color: var(--nexcart-brand);
    flex-shrink: 0;
}

.nexcart-account-form__actions {
    display: flex;
    align-items: center;
    gap: var(--nexcart-space-3);
    margin-top: var(--nexcart-space-3);
    flex-wrap: wrap;
}

.nexcart-account-form__actions--end {
    justify-content: flex-end;
}

.nexcart-account-form__actions--between {
    justify-content: space-between;
}

.nexcart-account-danger-zone {
    border: 1px solid var(--nexcart-error-border);
    border-radius: var(--nexcart-radius-lg);
    padding: var(--nexcart-space-5) var(--nexcart-space-6);
    background: var(--nexcart-error-bg);
}

.nexcart-account-danger-zone__title {
    margin: 0 0 var(--nexcart-space-1);
    font-size: 15px;
    font-weight: 600;
    color: var(--nexcart-error-fg);
}

.nexcart-account-danger-zone__description {
    margin: 0 0 var(--nexcart-space-4);
    font-size: 13px;
    color: var(--nexcart-error-fg);
    line-height: 1.55;
    opacity: 0.92;
}

.nexcart-account-empty {
    text-align: center;
    padding: var(--nexcart-space-9) var(--nexcart-space-5);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--nexcart-space-3);
}

.nexcart-account-empty__icon {
    width: 64px;
    height: 64px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--nexcart-bg-surface-alt);
    color: var(--nexcart-text-subtle);
}

.nexcart-account-empty__icon svg {
    width: 32px;
    height: 32px;
}

.nexcart-account-empty__title {
    margin: 0;
    font-size: 17px;
    font-weight: 600;
    color: var(--nexcart-text);
    line-height: 1.3;
}

.nexcart-account-empty__body {
    margin: 0;
    font-size: 14px;
    color: var(--nexcart-text-muted);
    line-height: 1.5;
    max-width: 420px;
}

.nexcart-account-empty__actions {
    margin-top: var(--nexcart-space-3);
    display: flex;
    gap: var(--nexcart-space-2);
    flex-wrap: wrap;
    justify-content: center;
}

.nexcart-account-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--nexcart-space-3);
    padding: var(--nexcart-space-7) var(--nexcart-space-4);
    color: var(--nexcart-text-muted);
    font-size: 14px;
}

.nexcart-account-spinner {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 2px solid var(--nexcart-border);
    border-top-color: var(--nexcart-brand);
    animation: nexcart-account-spin 0.8s linear infinite;
}

@keyframes nexcart-account-spin {
    to { transform: rotate(360deg); }
}

.nexcart-account-error {
    display: flex;
    gap: var(--nexcart-space-3);
    padding: var(--nexcart-space-5);
    border: 1px solid var(--nexcart-error-border);
    border-radius: var(--nexcart-radius-md);
    background: var(--nexcart-error-bg);
    color: var(--nexcart-error-fg);
    align-items: flex-start;
}

.nexcart-account-error__icon {
    flex-shrink: 0;
    margin-top: 2px;
}

.nexcart-account-error__title {
    margin: 0 0 4px;
    font-size: 14px;
    font-weight: 600;
    color: var(--nexcart-error-fg);
}

.nexcart-account-error__body {
    margin: 0;
    font-size: 13px;
    line-height: 1.5;
    opacity: 0.9;
}

.nexcart-account-guest {
    max-width: 980px;
    margin: var(--nexcart-space-8) auto var(--nexcart-space-10);
    font-family: var(--nexcart-font-family);
    color: var(--nexcart-text);
}

.nexcart-account-guest__header {
    text-align: center;
    margin-bottom: var(--nexcart-space-7);
}

.nexcart-account-guest__title {
    margin: 0 0 var(--nexcart-space-2);
    font-size: clamp(26px, 3vw, 32px);
    font-weight: 700;
    letter-spacing: -0.01em;
    color: var(--nexcart-text);
}

.nexcart-account-guest__subtitle {
    margin: 0;
    font-size: 15px;
    color: var(--nexcart-text-muted);
    line-height: 1.55;
}

.nexcart-account-guest__grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--nexcart-space-5);
}

.nexcart-account-guest__grid--with-register {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

@media (max-width: 720px) {
    .nexcart-account-guest__grid--with-register {
        grid-template-columns: 1fr;
    }
}

.nexcart-account-auth-card {
    padding: var(--nexcart-space-7);
}

.nexcart-account-auth-card__head {
    text-align: center;
    margin-bottom: var(--nexcart-space-5);
}

.nexcart-account-auth-card__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--nexcart-bg-surface-alt);
    color: var(--nexcart-text-muted);
    margin-bottom: var(--nexcart-space-3);
}

.nexcart-account-auth-card__icon svg {
    width: 24px;
    height: 24px;
}

.nexcart-account-auth-card__title {
    margin: 0 0 4px;
    font-size: 18px;
    font-weight: 700;
    color: var(--nexcart-text);
}

.nexcart-account-auth-card__subtitle {
    margin: 0;
    font-size: 14px;
    color: var(--nexcart-text-muted);
    line-height: 1.5;
}

.nexcart-account-auth-card__footer {
    margin-top: var(--nexcart-space-4);
    text-align: center;
    font-size: 13px;
    color: var(--nexcart-text-muted);
}

.nexcart-account-auth-card__footer a {
    color: var(--nexcart-text);
    text-decoration: none;
    font-weight: 500;
}

.nexcart-account-auth-card__footer a:hover,
.nexcart-account-auth-card__footer a:focus-visible {
    text-decoration: underline;
}

.nexcart-account-forgot-link {
    font-size: 13px;
    color: var(--nexcart-text-muted);
    text-decoration: none;
}

.nexcart-account-forgot-link:hover,
.nexcart-account-forgot-link:focus-visible {
    color: var(--nexcart-text);
    text-decoration: underline;
}

.nexcart-account-track {
    margin-top: var(--nexcart-space-5);
}

.nexcart-account-track__head {
    display: flex;
    align-items: center;
    gap: var(--nexcart-space-3);
    margin-bottom: var(--nexcart-space-2);
}

.nexcart-account-track__icon {
    display: inline-flex;
    color: var(--nexcart-text-muted);
}

.nexcart-account-track__icon svg {
    width: 22px;
    height: 22px;
}

.nexcart-account-track__title {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: var(--nexcart-text);
}

.nexcart-account-track__description {
    margin: 0 0 var(--nexcart-space-4);
    font-size: 14px;
    color: var(--nexcart-text-muted);
    line-height: 1.5;
}

.nexcart-account-track__form {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
    gap: var(--nexcart-space-3);
    align-items: end;
}

@media (max-width: 640px) {
    .nexcart-account-track__form {
        grid-template-columns: 1fr;
    }
    .nexcart-account-track__form .nexcart-btn {
        justify-self: stretch;
    }
}

.nexcart-account a:focus-visible,
.nexcart-account button:focus-visible,
.nexcart-account [role="button"]:focus-visible,
.nexcart-account summary:focus-visible {
    outline: none;
    box-shadow: var(--nexcart-shadow-focus);
    border-radius: var(--nexcart-radius-sm);
}

@media (max-width: 960px) {
    .nexcart-account {
        grid-template-columns: 1fr;
        gap: var(--nexcart-space-5);
    }

    .nexcart-account__sidebar {
        grid-column: 1;
        position: static;
    }

    .nexcart-account__main {
        grid-column: 1;
    }

    .nexcart-account-nav__toggle {
        display: flex;
        align-items: center;
        justify-content: space-between;
        width: 100%;
        padding: var(--nexcart-space-3) var(--nexcart-space-4);
        font-size: 14px;
        font-weight: 600;
        color: var(--nexcart-text);
        background: var(--nexcart-bg-surface);
        border: 1px solid var(--nexcart-border);
        border-radius: var(--nexcart-radius-md);
        cursor: pointer;
        gap: var(--nexcart-space-3);
    }

    .nexcart-account-nav__toggle[aria-expanded="true"] .nexcart-account-nav__toggle-chevron {
        transform: rotate(180deg);
    }

    .nexcart-account-nav__toggle-chevron {
        transition: transform 0.15s ease;
        display: inline-flex;
    }

    .nexcart-account-nav__toggle-chevron svg {
        width: 14px;
        height: 14px;
    }

    .nexcart-account-nav[data-collapsed="true"] .nexcart-account-nav__groups {
        display: none;
    }

    .nexcart-account-nav[data-collapsed="true"] .nexcart-account-nav__identity {
        display: none;
    }

    .nexcart-account-nav__groups {
        margin-top: var(--nexcart-space-3);
    }
}

@media (max-width: 720px) {
    .nexcart-account__page-title {
        font-size: 24px;
    }

    .nexcart-account-view-order {
        gap: var(--nexcart-space-4);
    }

    .nexcart-account-card {
        padding: var(--nexcart-space-5);
    }

    .nexcart-account-auth-card {
        padding: var(--nexcart-space-5);
    }

    .nexcart-account-greeting {
        padding: var(--nexcart-space-4) var(--nexcart-space-5);
    }

    .nexcart-account-greeting__title {
        font-size: 18px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .nexcart-account *,
    .nexcart-account *::before,
    .nexcart-account *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        transition-delay: 0ms !important;
    }

    .nexcart-account-spinner {
        animation: none;
        border-top-color: var(--nexcart-border-strong);
    }
}

@media (forced-colors: active) {
    .nexcart-account .nexcart-btn,
    .nexcart-account-card,
    .nexcart-account-method,
    .nexcart-account-metric,
    .nexcart-account-nav,
    .nexcart-account-nav__link,
    .nexcart-account-pagination__btn,
    .nexcart-account-input,
    .nexcart-account-select,
    .nexcart-account-textarea {
        border: 1px solid CanvasText;
    }

    .nexcart-account-nav__link[aria-current="page"],
    .nexcart-account-pagination__btn[aria-current="page"],
    .nexcart-account .nexcart-btn--primary {
        background: Highlight;
        color: HighlightText;
        border-color: Highlight;
    }

    .nexcart-account .nexcart-status-badge {
        border: 1px solid CanvasText;
    }
}

@media print {
    .nexcart-account {
        grid-template-columns: 1fr;
        gap: 0;
        margin: 0;
    }

    .nexcart-account__sidebar,
    .nexcart-account-nav__toggle,
    .nexcart-account-pagination,
    .nexcart-account-backlink,
    .nexcart-account-form__actions,
    .nexcart-account-card__actions {
        display: none !important;
    }

    .nexcart-account-card,
    .nexcart-account-method,
    .nexcart-account-metric {
        box-shadow: none;
        border: 1px solid #ccc;
        break-inside: avoid;
        page-break-inside: avoid;
    }

    .nexcart-account-greeting {
        background: none !important;
        color: #000 !important;
        border: 1px solid #ccc;
    }
}
