/* ============================================================
   ext-sap-my-account-dashboard.css
   Custom My Account Dashboard — 6.3.0
   Brand: #F58220 orange | #1A1617 dark
   ============================================================ */

:root {
    --dash-orange:     #F58220;
    --dash-dark:       #1A1617;
    --dash-text:       #3a3638;
    --dash-muted:      #6b7280;
    --dash-border:     #e2e3e6;
    --dash-bg:         #f7f8fa;
    --dash-white:      #ffffff;
    --dash-success:    #1a7a1a;
    --dash-radius:     8px;
    --dash-shadow:     0 1px 4px rgba(0,0,0,.07);
    --dash-transition: 0.16s ease;
}

/* ── Outer wrapper ───────────────────────────────────────── */
.ext-dash-wrap {
    width: 100%;
    max-width: none;
}

/* ── Welcome banner ──────────────────────────────────────── */
.ext-dash-welcome {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    background: var(--dash-dark);
    border-radius: var(--dash-radius);
    padding: 22px 24px;
    margin-bottom: 22px;
    color: var(--dash-white);
}

.ext-dash-welcome__heading {
    margin: 0 0 4px;
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--dash-white);
    line-height: 1.25;
}

.ext-dash-welcome__sub {
    margin: 0;
    font-size: 0.875rem;
    color: rgba(255,255,255,.72);
    line-height: 1.5;
}

.ext-dash-welcome__right {
    display: flex;
    flex-direction: row;
    align-items: center;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 10px;
    flex-shrink: 0;
}

.ext-dash-welcome__badge {
    display: inline-block;
    padding: 5px 14px;
    border-radius: 20px;
    background: var(--dash-orange);
    color: var(--dash-white);
    font-size: 0.78rem;
    font-weight: 700;
    white-space: nowrap;
}

.ext-dash-welcome__logout {
    display: inline-block;
    padding: 5px 12px;
    font-size: 0.75rem;
    font-weight: 600;
    color: rgba(255,255,255,.75);
    border: 1px solid rgba(255,255,255,.35);
    border-radius: 4px;
    text-decoration: none;
    white-space: nowrap;
    transition: color 0.15s, border-color 0.15s;
}

.ext-dash-welcome__logout:hover,
.ext-dash-welcome__logout:focus {
    color: #fff;
    border-color: rgba(255,255,255,.8);
    outline: none;
}

/* ── Layout: 2-column desktop ────────────────────────────── */
.ext-dash-layout {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 20px;
    align-items: start;
}

@media (max-width: 780px) {
    .ext-dash-layout {
        grid-template-columns: 1fr;
    }
}

.ext-dash-main,
.ext-dash-aside {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

/* ── Cards ───────────────────────────────────────────────── */
.ext-dash-card {
    background: var(--dash-white);
    border: 1px solid var(--dash-border);
    border-radius: var(--dash-radius);
    box-shadow: var(--dash-shadow);
    overflow: hidden;
}

.ext-dash-card__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 18px;
    border-bottom: 1px solid var(--dash-border);
    background: var(--dash-bg);
}

.ext-dash-card__title {
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--dash-dark);
}

.ext-dash-card__link {
    font-size: 0.8rem;
    color: var(--dash-orange);
    text-decoration: none;
    font-weight: 600;
}

.ext-dash-card__link:hover {
    text-decoration: underline;
}

.ext-dash-card__body {
    padding: 18px;
}

.ext-dash-card__body--centered {
    text-align: center;
}

/* ── Orders table ────────────────────────────────────────── */
.ext-dash-orders-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.ext-dash-orders {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.ext-dash-orders th {
    text-align: left;
    padding: 8px 10px;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--dash-muted);
    border-bottom: 1px solid var(--dash-border);
    white-space: nowrap;
}

.ext-dash-orders td {
    padding: 10px 10px;
    vertical-align: middle;
    border-bottom: 1px solid var(--dash-border);
    color: var(--dash-text);
}

.ext-dash-orders tbody tr:last-child td {
    border-bottom: none;
}

.ext-dash-orders tbody tr:hover td {
    background: var(--dash-bg);
}

.ext-dash-order-num {
    color: var(--dash-orange);
    font-weight: 700;
    text-decoration: none;
}

.ext-dash-order-num:hover {
    text-decoration: underline;
}

.ext-dash-order-date {
    white-space: nowrap;
    color: var(--dash-muted);
    font-size: 0.8rem;
}

.ext-dash-order-total {
    white-space: nowrap;
    font-weight: 600;
}

/* ── Order status chip ───────────────────────────────────── */
.ext-dash-status {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.75rem;
    font-weight: 600;
    background: var(--dash-bg);
    color: var(--dash-muted);
    border: 1px solid var(--dash-border);
    white-space: nowrap;
}

.ext-dash-status--completed,
.ext-dash-status--wc-completed {
    background: #e8f5e9;
    color: var(--dash-success);
    border-color: #c8e6c9;
}

.ext-dash-status--processing,
.ext-dash-status--wc-processing {
    background: #fff3e0;
    color: #b76800;
    border-color: #ffe0b2;
}

.ext-dash-status--cancelled,
.ext-dash-status--wc-cancelled,
.ext-dash-status--failed,
.ext-dash-status--wc-failed {
    background: #fce4e4;
    color: #c00;
    border-color: #f8b4b4;
}

.ext-dash-status--on-hold,
.ext-dash-status--wc-on-hold {
    background: #fff9e6;
    color: #7a6000;
    border-color: #ffe082;
}

/* ── Tracking badge ──────────────────────────────────────── */
.ext-dash-badge {
    display: inline-block;
    padding: 2px 7px;
    border-radius: 10px;
    font-size: 0.7rem;
    font-weight: 700;
    margin-left: 4px;
    white-space: nowrap;
}

.ext-dash-badge--track {
    background: #e8f5e9;
    color: var(--dash-success);
    border: 1px solid #c8e6c9;
}

/* ── Empty state ─────────────────────────────────────────── */
.ext-dash-empty {
    color: var(--dash-muted);
    font-size: 0.875rem;
    margin: 0;
}

/* ── Tracking summary ────────────────────────────────────── */
.ext-dash-tracking-msg {
    font-size: 0.875rem;
    color: var(--dash-text);
    margin: 0 0 14px;
    line-height: 1.5;
}

.ext-dash-tracking-msg--has {
    color: var(--dash-success);
    font-weight: 600;
}

/* ── Profile completion ──────────────────────────────────── */
.ext-dash-profile-pct {
    font-size: 0.95rem;
    font-weight: 800;
    color: var(--dash-orange);
}

.ext-dash-progress {
    height: 8px;
    background: var(--dash-border);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 14px;
}

.ext-dash-progress__fill {
    height: 100%;
    background: var(--dash-orange);
    border-radius: 4px;
    min-width: 4px;
    transition: width 0.4s ease;
}

.ext-dash-profile-missing-label {
    font-size: 0.775rem;
    font-weight: 700;
    color: var(--dash-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin: 0 0 6px;
}

.ext-dash-profile-missing {
    list-style: none;
    padding: 0;
    margin: 0 0 16px;
    font-size: 0.825rem;
    color: #c00;
}

.ext-dash-profile-missing li::before {
    content: '✕ ';
    font-size: 0.7rem;
}

.ext-dash-profile-complete {
    font-size: 0.875rem;
    color: var(--dash-success);
    font-weight: 600;
    margin: 0 0 16px;
}

/* ── Quick actions grid ──────────────────────────────────── */
.ext-dash-actions-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.ext-dash-action {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 14px 8px;
    background: var(--dash-bg);
    border: 1px solid var(--dash-border);
    border-radius: 6px;
    text-decoration: none;
    color: var(--dash-dark);
    transition: background var(--dash-transition), border-color var(--dash-transition), color var(--dash-transition);
}

.ext-dash-action:hover,
.ext-dash-action:focus {
    background: #fff3e0;
    border-color: var(--dash-orange);
    color: var(--dash-orange);
    outline: none;
}

.ext-dash-action__icon {
    font-size: 1.5rem;
    line-height: 1;
}

.ext-dash-action__label {
    font-size: 0.75rem;
    font-weight: 700;
    text-align: center;
    line-height: 1.2;
}

/* ── Support card ────────────────────────────────────────── */
.ext-dash-card--support .ext-dash-card__body {
    padding: 20px 18px;
}

.ext-dash-support-msg {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--dash-dark);
    margin: 0 0 14px;
}

/* ── Buttons ─────────────────────────────────────────────── */
.ext-dash-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 9px 20px;
    font-size: 0.85rem;
    font-weight: 700;
    font-family: inherit;
    border-radius: 5px;
    cursor: pointer;
    text-decoration: none;
    transition: background var(--dash-transition), color var(--dash-transition), border-color var(--dash-transition);
    line-height: 1;
    white-space: nowrap;
    border: 1.5px solid transparent;
}

.ext-dash-btn--primary {
    background: var(--dash-orange);
    color: var(--dash-white);
    border-color: var(--dash-orange);
}

.ext-dash-btn--primary:hover,
.ext-dash-btn--primary:focus {
    background: var(--dash-white);
    color: var(--dash-orange);
    border-color: var(--dash-orange);
    outline: none;
}

.ext-dash-btn--outline {
    background: var(--dash-white);
    color: var(--dash-orange);
    border-color: var(--dash-orange);
}

.ext-dash-btn--outline:hover,
.ext-dash-btn--outline:focus {
    background: var(--dash-orange);
    color: var(--dash-white);
    outline: none;
}

.ext-dash-btn--sm {
    padding: 5px 12px;
    font-size: 0.78rem;
    background: var(--dash-orange);
    color: var(--dash-white);
    border-color: var(--dash-orange);
    border-radius: 4px;
}

.ext-dash-btn--sm:hover {
    background: var(--dash-white);
    color: var(--dash-orange);
}

.ext-dash-btn--block {
    width: 100%;
    display: flex;
}

/* ── Carrier logo in Orders table tracking column ────────── */
.ext-order-carrier-logo {
    display: block;
    max-height: 28px;
    max-width: 90px;
    width: auto;
    height: auto;
    object-fit: contain;
}

/* ── Orders table action cell — compact button row ───────── */
.woocommerce-account .woocommerce-orders-table__cell-order-actions {
    white-space: nowrap;
    vertical-align: middle;
}

/* All action buttons — uniform compact sizing */
.woocommerce-account .woocommerce-orders-table__cell-order-actions .button,
.woocommerce-account .woocommerce-orders-table__cell-order-actions a.track-parcel {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    min-height: 30px;
    padding: 5px 12px !important;
    margin: 0 4px 0 0 !important;
    border-radius: 6px !important;
    font-size: 12px !important;
    line-height: 1.2;
    font-weight: 600;
    vertical-align: middle;
    text-decoration: none;
}

/* Track Parcel — orange brand button */
.woocommerce-account .woocommerce-orders-table__cell-order-actions a.track-parcel {
    background: #F58220 !important;
    color: #fff !important;
    border: 1px solid #F58220 !important;
    transition: background .15s, color .15s;
}

.woocommerce-account .woocommerce-orders-table__cell-order-actions a.track-parcel:hover,
.woocommerce-account .woocommerce-orders-table__cell-order-actions a.track-parcel:focus {
    background: #fff !important;
    color: #F58220 !important;
    border-color: #F58220 !important;
    outline: none;
}

/* ── Mobile: allow wrapping, abbreviate "Track Parcel" → "Track" */
@media (max-width: 520px) {
    .woocommerce-account .woocommerce-orders-table__cell-order-actions {
        white-space: normal;
    }

    .woocommerce-account .woocommerce-orders-table__cell-order-actions .button,
    .woocommerce-account .woocommerce-orders-table__cell-order-actions a.track-parcel {
        margin-bottom: 4px !important;
    }

    /* CSS-only short label: hide "Track Parcel" text, inject "Track" */
    .woocommerce-account .woocommerce-orders-table a.track-parcel {
        font-size: 0 !important;
    }
    .woocommerce-account .woocommerce-orders-table a.track-parcel::before {
        content: "Track";
        font-size: 12px;
        font-weight: 600;
        line-height: 1.2;
    }
}

/* ── Full-width sections below the 2-col grid ────────────── */
.ext-dash-full {
    display: flex;
    flex-direction: column;
    gap: 18px;
    margin-top: 20px;
}

/* Quick actions in full-width: larger, more readable cards */
.ext-dash-full .ext-dash-actions-grid {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
}

/* Mobile: 2 columns for quick actions */
@media (max-width: 600px) {
    .ext-dash-full .ext-dash-actions-grid {
        grid-template-columns: 1fr 1fr;
        gap: 12px;
    }
}

/* Bigger action cards in full-width context */
.ext-dash-full .ext-dash-action {
    padding: 20px 14px;
}

.ext-dash-full .ext-dash-action__icon {
    font-size: 2rem;
}

.ext-dash-full .ext-dash-action__label {
    font-size: 0.85rem;
}

/* ── Welcome banner: mobile logout stacks ────────────────── */
@media (max-width: 480px) {
    .ext-dash-welcome {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .ext-dash-welcome__right {
        flex-direction: row;
        align-items: center;
        flex-wrap: wrap;
        width: 100%;
    }
}

/* ============================================================
   Global My Account portal layout (6.5.3)
   ============================================================ */

/* ── Suppress WooCommerce default dashboard content ─────── */
/*
 * Our replace_dashboard_action() removes WC's default callback,
 * but themes may re-add the greeting or helper paragraph.
 * These rules target both the WC "Hello name" paragraph and the
 * "From your account dashboard..." description paragraph.
 */
.woocommerce-account .woocommerce-MyAccount-content > p:not([class]),
.woocommerce-account .woocommerce-MyAccount-content > p.woocommerce-greeting {
    display: none !important;
}

/* ── Hide Woodmart My Account links grids ────────────────── */
.woocommerce-account .wd-my-account-links.wd-nav-my-acc,
.woocommerce-account .wd-my-account-links.wd-nav {
    display: none !important;
}

/* ── Orders page ─────────────────────────────────────────── */
.woocommerce-account .woocommerce-orders-table-wrapper {
    overflow-x: auto;
}

.woocommerce-account .woocommerce-orders-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    border: 1px solid #e2e3e6;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 4px rgba(0,0,0,.05);
}

.woocommerce-account .woocommerce-orders-table th {
    background: #f7f8fa;
    color: #3a3638;
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 10px 14px;
    border-bottom: 1px solid #e2e3e6;
}

.woocommerce-account .woocommerce-orders-table td {
    padding: 12px 14px;
    border-bottom: 1px solid #f0f0f0;
    font-size: 0.875rem;
    color: #3a3638;
    vertical-align: middle;
}

.woocommerce-account .woocommerce-orders-table tbody tr:last-child td {
    border-bottom: none;
}

.woocommerce-account .woocommerce-orders-table tbody tr:hover td {
    background: #fafafa;
}

/* Order action buttons */
.woocommerce-account .woocommerce-orders-table .woocommerce-button,
.woocommerce-account .woocommerce-orders-table .button {
    background: #F58220 !important;
    color: #fff !important;
    border: none !important;
    border-radius: 4px !important;
    padding: 5px 12px !important;
    font-size: 0.78rem !important;
    font-weight: 600 !important;
    text-decoration: none !important;
    display: inline-block !important;
    transition: background 0.15s !important;
}

.woocommerce-account .woocommerce-orders-table .woocommerce-button:hover,
.woocommerce-account .woocommerce-orders-table .button:hover {
    background: #1A1617 !important;
}

/* ── Order Tracking page ─────────────────────────────────── */
/* Already styled by ext-sap-my-account-portal.css; ensure width */
.woocommerce-account .ext-erp-tracking-section {
    width: 100%;
}

/* ── Account Info page — ensure full-width inside My Account  */
.woocommerce-account .ext-ai-wrap {
    max-width: none;
    width: 100%;
}

/* ── Wishlist page — safe cosmetic wrapper ───────────────── */
.woocommerce-account .woocommerce-wishlist-form,
.woocommerce-account .yith-wcwl-list-wrapper {
    background: #fff;
    border: 1px solid #e2e3e6;
    border-radius: 8px;
    box-shadow: 0 1px 4px rgba(0,0,0,.05);
    padding: 16px;
    overflow-x: auto;
}

/* Wishlist buttons */
.woocommerce-account .yith-wcwl-add-to-wishlist .add_to_wishlist,
.woocommerce-account .wishlist_table .add-to-cart {
    background: #F58220;
    color: #fff;
    border-radius: 4px;
    border: none;
    padding: 7px 14px;
    font-weight: 600;
    text-decoration: none;
    display: inline-block;
    font-size: 0.82rem;
}

/* ── Mobile welcome banner tweaks ────────────────────────── */
@media (max-width: 480px) {
    .ext-dash-welcome {
        flex-direction: column;
        align-items: flex-start;
    }

    .ext-dash-welcome__right {
        justify-content: flex-start;
        width: 100%;
    }
}
