/* ===== START: T12 Account Dashboard ===== */

/*
 * v5.5.0: icons converted from Tabler webfont (CDN) to bundled inline
 * SVGs in assets/icons/ — no external requests. SVGs keep the ti/ti-*
 * classes so all rules below apply unchanged.
 *
 * v5.4.0 styling changes:
 *  - Back button inverted to near-black pill (high contrast)
 *  - Cool Tailwind greys replaced with warm brand greys
 *  - Sub-text / labels darkened for WCAG AA contrast
 *  - :focus-visible states added (gold ring)
 *  - Hover lift on accordion items
 *  - Inline styles moved out of dashboard.php into classes
 *  - Date column hidden on very small screens
 *  - OPTIONAL dark profile hero (clearly marked below — delete
 *    the "DARK HERO" block to revert to the white card)
 */

/* ── Hide WoodMart sidebar & duplicate nav ── */
body.woocommerce-account .wd-my-account-sidebar.wd-grid-col,
body.woocommerce-account .woocommerce-MyAccount-navigation {
    display: none !important;
}

/* ── Content column: full width & centred, whatever layout WoodMart uses ──
   Covers CSS grid (grid-column), flexbox (flex-basis), floats (float/width),
   and WoodMart's column variables — so the column fills the row once the
   sidebar is hidden, and .t12-acc centres inside it. */
body.woocommerce-account .woocommerce-MyAccount-content.wd-grid-col,
body.woocommerce-account .woocommerce-MyAccount-content {
    --wd-col-lg: 12 !important;
    --wd-col-md: 12 !important;
    --wd-col-sm: 12 !important;
    width: 100% !important;
    max-width: 100% !important;
    flex: 1 1 100% !important;
    grid-column: 1 / -1 !important;
    float: none !important;
    margin-left: auto !important;
    margin-right: auto !important;
}

/* ── Wrapper ── */
.t12-acc {
    max-width: 700px;
    margin: 0 auto;
    padding: 0.5rem 0 3rem;
    font-family: inherit;
}

/* ── Inline SVG icons (bundled Tabler outlines) ──
   Sized as 1em squares so the existing font-size rules control
   dimensions, and stroke inherits currentColor so the existing
   color rules control tint. */
.t12-acc svg.ti,
.t12-acc-back svg.ti {
    width: 1em;
    height: 1em;
    display: inline-block;
    vertical-align: middle;
    flex-shrink: 0;
}

/* ── Profile card (base) ── */
.t12-acc__profile {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    background: #fff;
    border: 1px solid #ebe8e1;
    border-radius: 20px;
    padding: 1.5rem 1.75rem;
    margin-bottom: 1.75rem;
}

.t12-acc__avatar {
    width: 64px;
    height: 64px;
    flex-shrink: 0;
    background: rgba(245, 197, 24, 0.1);
    border: 1px solid rgba(245, 197, 24, 0.3);
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.t12-acc__avatar .ti {
    font-size: 36px;
    color: #C99700;
}

.t12-acc__info { flex: 1; min-width: 0; }

.t12-acc__greeting {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #8d877b;
    margin: 0 0 3px;
}

.t12-acc__name {
    font-size: 22px;
    font-weight: 700;
    color: #161513;
    margin: 0;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ── DARK HERO (optional brand treatment) ─────────────────────────────
   Turns the profile card into a near-black hero with gold accents.
   Delete this whole block to revert to the white card above. */
.t12-acc__profile {
    background: #161513;
    border-color: #161513;
}

.t12-acc__profile .t12-acc__avatar {
    background: rgba(245, 197, 24, 0.12);
    border-color: rgba(245, 197, 24, 0.35);
}

.t12-acc__profile .t12-acc__avatar .ti {
    color: #F5C518;
}

.t12-acc__profile .t12-acc__greeting {
    color: rgba(250, 248, 243, 0.55);
}

.t12-acc__profile .t12-acc__name {
    color: #faf8f3;
}
/* ── END DARK HERO ──────────────────────────────────────────────────── */

/* ── Section label ── */
.t12-acc__section-label {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #8d877b;
    margin: 0 0 10px 2px;
}

/* ── Accordion list ── */
.t12-acc__accordion {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 8px;
}

/* ── Accordion item ── */
.t12-acc__item {
    background: #fff;
    border: 1px solid #ebe8e1;
    border-radius: 16px;
    overflow: hidden;
    transition: border-color 0.18s, box-shadow 0.18s;
}

.t12-acc__item:hover {
    box-shadow: 0 3px 12px rgba(22, 21, 19, 0.06);
}

.t12-acc__item.is-open {
    border-color: #F5C518;
    box-shadow: 0 3px 12px rgba(245, 197, 24, 0.12);
}

/* ── Accordion trigger (the clickable row) ── */
.t12-acc__trigger {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 1rem 1.25rem;
    cursor: pointer;
    background: none;
    border: none;
    width: 100%;
    text-align: left;
    transition: background 0.15s;
    -webkit-appearance: none;
}

.t12-acc__trigger:hover {
    background: #faf8f3;
}

.t12-acc__trigger:focus-visible {
    outline: 2px solid #F5C518;
    outline-offset: -2px;
    border-radius: 14px;
}

.t12-acc__item.is-open .t12-acc__trigger {
    background: #faf8f3;
    border-bottom: 1px solid #f0ece0;
}

.t12-acc__item-icon {
    width: 40px;
    height: 40px;
    border-radius: 11px;
    background: rgba(245,197,24,0.1);
    border: 1px solid rgba(245,197,24,0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.t12-acc__item-icon .ti {
    font-size: 19px;
    color: #C99700;
}

.t12-acc__item-text {
    flex: 1;
    min-width: 0;
}

.t12-acc__item-label {
    font-size: 14px;
    font-weight: 700;
    color: #161513;
    margin: 0 0 2px;
    line-height: 1.2;
}

.t12-acc__item-sub {
    font-size: 12px;
    color: #7d786e;
    margin: 0;
}

.t12-acc__chevron {
    font-size: 18px;
    color: #b8b3a8;
    transition: transform 0.22s, color 0.15s;
    flex-shrink: 0;
}

.t12-acc__item.is-open .t12-acc__chevron {
    transform: rotate(180deg);
    color: #C99700;
}

/* ── Accordion panel ── */
.t12-acc__panel {
    display: none;
    padding: 1.25rem 1.5rem 1.5rem;
    animation: t12PanelIn 0.18s ease;
}

.t12-acc__item.is-open .t12-acc__panel {
    display: block;
}

@keyframes t12PanelIn {
    from { opacity: 0; transform: translateY(-4px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ── Panel: loading state ── */
.t12-panel__loading {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #7d786e;
    font-size: 13px;
    padding: 0.5rem 0;
}

.t12-panel__spinner {
    width: 16px;
    height: 16px;
    border: 2px solid #ebe8e1;
    border-top-color: #C99700;
    border-radius: 50%;
    animation: t12Spin 0.7s linear infinite;
    flex-shrink: 0;
}

@keyframes t12Spin { to { transform: rotate(360deg); } }

/* ── Panel: view all link ── */
.t12-panel__viewall {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin-top: 1rem;
    font-size: 13px;
    font-weight: 600;
    color: #9a7400 !important;
    text-decoration: none !important;
    transition: gap 0.15s;
    border-radius: 6px;
}

.t12-panel__viewall:hover { gap: 8px; }

.t12-panel__viewall:focus-visible {
    outline: 2px solid #F5C518;
    outline-offset: 3px;
}

/* ── Panel: orders table ── */
.t12-panel__orders {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.t12-panel__orders th {
    text-align: left;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #8d877b;
    padding: 0 0 8px;
    border-bottom: 1px solid #f0ece0;
}

.t12-panel__orders td {
    padding: 10px 0;
    border-bottom: 1px solid #f5f2ea;
    color: #45423c;
    vertical-align: middle;
}

.t12-panel__orders tr:last-child td { border-bottom: none; }

.t12-panel__orders th.is-right,
.t12-panel__orders td.is-right {
    text-align: right;
}

.t12-panel__orders td.is-right { font-weight: 600; }

.t12-panel__order-link {
    color: #9a7400 !important;
    font-weight: 600;
    text-decoration: none !important;
}

.t12-panel__order-link:hover {
    color: #161513 !important;
    text-decoration: underline !important;
}

.t12-order-status {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 99px;
    font-size: 11px;
    font-weight: 600;
}

.t12-order-status--completed  { background: #d1fae5; color: #065f46; }
.t12-order-status--processing { background: #dbeafe; color: #1e40af; }
.t12-order-status--pending    { background: #fef3c7; color: #92400e; }
.t12-order-status--cancelled  { background: #fee2e2; color: #991b1b; }

/* ── Panel: empty state ── */
.t12-panel__empty {
    text-align: center;
    padding: 1.5rem 0 0.5rem;
    color: #7d786e;
    font-size: 13px;
}

.t12-panel__empty .ti {
    font-size: 32px;
    display: block;
    margin: 0 auto 8px;
    color: #ddd8cc;
}

/* ── Panel: address / account rows ── */
.t12-panel__rows {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.t12-panel__row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    padding: 8px 0;
    border-bottom: 1px solid #f5f2ea;
}

.t12-panel__row:last-child { border-bottom: none; }

.t12-panel__row-label { color: #7d786e; font-weight: 500; }
.t12-panel__row-icon  { vertical-align: -2px; margin-right: 4px; }
.t12-panel__row-value { color: #161513; font-weight: 600; text-align: right; }

/* ── Logout ── */
.t12-acc__logout {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #fff;
    border: 1px solid #ebe8e1;
    border-radius: 16px;
    padding: 1rem 1.25rem;
    text-decoration: none !important;
    color: inherit !important;
    transition: border-color 0.15s, box-shadow 0.15s;
    width: 100%;
    margin-top: 8px;
    cursor: pointer;
}

.t12-acc__logout:hover {
    border-color: #fca5a5;
    box-shadow: 0 3px 12px rgba(239, 68, 68, 0.08);
}

.t12-acc__logout:focus-visible {
    outline: 2px solid #F5C518;
    outline-offset: 2px;
}

.t12-acc__logout .ti  { font-size: 17px; color: #f87171; }

.t12-acc__logout span {
    font-size: 14px;
    font-weight: 500;
    color: #6f6a60;
}

.t12-acc__logout:hover span { color: #ef4444; }

/* ── Back to my account (endpoint pages) ──
   Inverted: near-black pill with gold arrow so it's the most
   prominent element at the top of every endpoint page. */
.t12-acc-back {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #161513;
    border: 1px solid #161513;
    border-radius: 99px;
    padding: 9px 18px 9px 14px;
    margin-bottom: 1.75rem;
    font-size: 13px;
    font-weight: 600;
    color: #faf8f3 !important;
    text-decoration: none !important;
    box-shadow: 0 2px 10px rgba(22, 21, 19, 0.18);
    transition: background 0.15s, box-shadow 0.15s, transform 0.15s;
}

.t12-acc-back:hover {
    background: #2b2925;
    box-shadow: 0 4px 14px rgba(22, 21, 19, 0.25);
    transform: translateY(-1px);
    color: #fff !important;
}

.t12-acc-back:focus-visible {
    outline: 2px solid #F5C518;
    outline-offset: 3px;
}

.t12-acc-back .ti {
    font-size: 16px;
    color: #F5C518;
    transition: transform 0.15s;
}

.t12-acc-back:hover .ti {
    transform: translateX(-3px);
}

/* ── Mobile ── */
@media (max-width: 600px) {
    .t12-acc__profile { padding: 1.25rem; gap: 1rem; }
    .t12-acc__name    { font-size: 18px; }
}

@media (max-width: 480px) {
    /* Date column (2nd) gets cramped on small phones — hide it */
    .t12-panel__orders th:nth-child(2),
    .t12-panel__orders td:nth-child(2) {
        display: none;
    }
}

/* ===== END: T12 Account Dashboard ===== */
