/* ── My Account — dark sidebar + display-mode toggle ───────────────────────── */

/* Hide default WC navigation — we render our own in my-account.php */
.woocommerce-MyAccount-navigation {
    display: none !important;
}

/* ── Layout ────────────────────────────────────────────────────────────────── */

.woa-account-layout {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 0;
    min-height: 70vh;
    width: 100vw;
    position: relative;
    left: 50%;
    transform: translateX(-50%);
}

/* ── Sidebar ───────────────────────────────────────────────────────────────── */

.woa-account-sidebar {
    display: flex;
    flex-direction: column;
    background: var(--wp--preset--color--contrast);
    color: var(--wp--preset--color--base);
    padding: 1.5rem 1rem;
    margin-left: 0;
}

.woa-account-sidebar__nav {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.woa-account-sidebar__list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.woa-account-sidebar__item a {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 0.75rem;
    border-radius: 6px;
    text-decoration: none;
    color: rgba(255, 255, 255, 0.65);
    font-size: 0.875rem;
    font-weight: 500;
    transition: background-color 0.15s, color 0.15s;
    white-space: nowrap;
}

.woa-account-sidebar__item a:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
}

.woa-account-sidebar__item.is-active a {
    color: #fff;
    background: rgba(255, 255, 255, 0.15);
}

.woa-account-sidebar__icon {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    line-height: 0;
}

.woa-account-sidebar__icon svg {
    display: block;
}

/* ── Display-mode toggle ───────────────────────────────────────────────────── */

.woa-account-sidebar__toggle {
    display: flex;
    gap: 2px;
    padding: 2px;
    margin-top: 0.75rem;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.08);
}

.woa-account-sidebar__toggle-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.3rem;
    border: none;
    border-radius: 4px;
    background: transparent;
    color: rgba(255, 255, 255, 0.4);
    cursor: pointer;
    transition: opacity 0.15s, background-color 0.15s, color 0.15s;
}

.woa-account-sidebar__toggle-btn:hover {
    color: rgba(255, 255, 255, 0.7);
}

.woa-account-sidebar__toggle-btn.is-active {
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
}

/* ── User card ─────────────────────────────────────────────────────────────── */

.woa-account-sidebar__user {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.woa-account-sidebar__user-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
    overflow: hidden;
}

.woa-account-sidebar__user-name {
    font-size: 0.8125rem;
    font-weight: 600;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.woa-account-sidebar__user-email {
    font-size: 0.6875rem;
    color: rgba(255, 255, 255, 0.5);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ── Address header — heading + edit link inline ───────────────────────────── */

.woocommerce-Address-title h2 {
    margin-bottom: 0.25rem;
}

.woocommerce-Address-title .edit {
    float: none !important;
    display: block;
    font-size: 1.0rem;
}

/* ── Content area ──────────────────────────────────────────────────────────── */

.woa-account-layout > .woocommerce-MyAccount-content {
    padding: var(--wp--preset--spacing--50);
    min-width: 0;
}

/* ── Mode: icons only ──────────────────────────────────────────────────────── */

.woa-account-sidebar[data-mode="icons"] .woa-account-sidebar__label {
    display: none;
}

.woa-account-sidebar[data-mode="icons"] .woa-account-sidebar__item a {
    justify-content: center;
    padding: 0.65rem;
}

.woa-account-sidebar[data-mode="icons"] {
    padding: 1.5rem 0.5rem;
}

/* ── Mode: text only ───────────────────────────────────────────────────────── */

.woa-account-sidebar[data-mode="text"] .woa-account-sidebar__icon {
    display: none;
}

/* ── Mobile ────────────────────────────────────────────────────────────────── */

@media (max-width: 768px) {
    .woa-account-layout {
        grid-template-columns: 1fr;
        min-height: auto;
    }

    .woa-account-sidebar {
        border-radius: 0;
        padding: 0.75rem 1rem;
    }

    .woa-account-sidebar__nav {
        gap: 0.5rem;
    }

    .woa-account-sidebar__list {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 4px;
    }

    .woa-account-sidebar__list--footer {
        border-top: 1px solid rgba(255, 255, 255, 0.12);
        padding-top: 0.5rem;
    }

    .woa-account-sidebar__item a {
        font-size: 0.8125rem;
        padding: 0.4rem 0.625rem;
    }

    .woa-account-sidebar__user {
        display: none;
    }

    .woa-account-sidebar__toggle {
        display: none;
    }
}
