/* ==========================================================================
 * afx-account.css — My Account dashboard.
 *
 * Every accent resolves from the theme variables in afx-store.css, so store 1 renders
 * green (#137C4E) and store 2 red (#DA0000) with no per-store code. No brand colour is
 * hardcoded.
 *
 * Loaded body-end via
 * Magento_Theme::html/account_assets.phtml, so it lands after afx-base.css and the
 * compiled tailwind.css.
 *
 * Markup: Hyvä Magento_Customer account dashboard + account navigation.
 * ========================================================================== */

:root {
    --afx-acc-border: #e2e8f0;
    --afx-acc-muted: #6b7885;
    --afx-acc-text: #1b2733;
    --afx-acc-surface: #f6f7f9;
}

/* ==========================================================================
 * 1. Account dashboard — cards
 *
 * Hyvä's account templates carry a `.card` class, but `.card` is NOT present in the
 * compiled tailwind.css on this build, so the blocks rendered with no border, no
 * padding and no radius — which is why Contact Information looked unstyled next to
 * Newsletters. Styling them here restores a consistent card treatment.
 * ========================================================================== */
.account .column.main .card,
.customer-account-index .column.main .card {
    box-sizing: border-box;
    background: #fff;
    border: 1px solid var(--afx-acc-border);
    border-radius: 8px;
    padding: 1.5rem;
}

.account .column.main .block-title:not(.afx-acc-heading):not(.afx-acc-heading-group),
.account .column.main .legend {
    margin: 0 0 1rem;
    padding-bottom: .625rem;
    border-bottom: 1px solid var(--afx-acc-border);
    font-size: 1.125rem;
    font-weight: 600;
    letter-spacing: .01em;
    color: var(--afx-acc-text);
}

.account .column.main .block {
    margin-bottom: 2rem;
}

/* Action links inside the dashboard. The dashboard's own buttons (.afx-acc-btn, defined in
   tailwind-source.css) are solid brand with white text, so they are excluded — this rule is
   for plain links in sections that still use Luma markup (My Carts, Invoices, Orders…). */
.account .column.main .box-actions a:not(.afx-acc-btn),
.account .column.main .block-content a:not(.afx-acc-btn) {
    color: var(--color-primary, #137C4E);
}

.account .column.main .box-actions a:not(.afx-acc-btn):hover,
.account .column.main .block-content a:not(.afx-acc-btn):hover {
    color: var(--color-primary-darker, #0f5d3a);
}

/* ==========================================================================
 * 2. Account navigation (sidebar)
 * ========================================================================== */
.account .sidebar-main .account-nav,
.account .sidebar-main .block-collapsible-nav {
    background: var(--afx-acc-surface);
    border: 1px solid var(--afx-acc-border);
    border-radius: 8px;
    overflow: hidden;
}

.account .account-nav .item a,
.account .account-nav .item > strong {
    display: block;
    padding: .75rem 1.125rem;
    border-left: 3px solid transparent;
    color: var(--afx-acc-text);
    font-size: .9375rem;
    text-decoration: none;
}

.account .account-nav .item a:hover {
    background: #fff;
    color: var(--color-primary, #137C4E);
    text-decoration: none;
}

/* Active item: the stock rule uses an amber accent that is not part of this theme. */
.account .account-nav .item.current a,
.account .account-nav .item.current > strong {
    background: #fff;
    border-left-color: var(--color-primary, #137C4E) !important;
    color: var(--color-primary, #137C4E);
    font-weight: 600;
}

/* ==========================================================================
 * 3. Responsive
 * ========================================================================== */
@media (max-width: 767px) {
    .account .column.main .card {
        padding: 1.125rem;
    }

    .account .sidebar-main {
        margin-bottom: 1.5rem;
    }
}

/* ==========================================================================
 * 4. Account navigation — collapsible toggle
 *
 * Hyvä renders the nav heading as a <button> (it is the collapse toggle below `md`).
 * The theme's blanket `button:not(.owl-prev)…` rule in custom.css paints every button solid
 * brand with uppercase white text and a fixed 35px height, which turned that heading into a
 * solid colour bar. Present it as a plain heading instead; it keeps working as the mobile
 * toggle, and gets a theme-coloured focus ring rather than none.
 * ========================================================================== */
.account .sidebar-main .account-nav > button {
    background: transparent !important;
    background-color: transparent !important;
    color: var(--afx-acc-text) !important;
    height: auto !important;
    line-height: 1.4 !important;
    padding: .875rem 1.25rem !important;
    text-align: left;
    text-transform: none;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 0;
}

.account .sidebar-main .account-nav > button:hover {
    background: transparent !important;
    color: var(--color-primary, #137C4E) !important;
}

.account .sidebar-main .account-nav > button:focus-visible {
    outline: 2px solid var(--color-primary, #137C4E) !important;
    outline-offset: -2px !important;
}

/* Separator under the heading, matching the panel border. Hyvä's wrapper carries `my-2`,
   whose bottom margin left an empty strip under the last link inside the panel. */
.account .sidebar-main .account-nav > nav,
.account .sidebar-main .account-nav > div[id] {
    border-top-color: var(--afx-acc-border);
    margin-top: 0;
    margin-bottom: 0;
}

.account .sidebar-main .account-nav .nav.items {
    margin: 0;
    padding: 0;
    list-style: none;
}

/* Hyvä nests <div class="block account-nav"> inside the panel. `block` is a Tailwind display
   utility here, but legacy Luma CSS also defines `.block { margin-bottom: … }`, which left an
   empty strip below the last link inside the panel. */
.account .sidebar-main .account-nav .block {
    margin-bottom: 0;
}

/* ==========================================================================
 * 5. Recent Orders — row action buttons and heading font
 * ========================================================================== */

/* The reorder control is a <button>, so the theme's blanket
   `button:not(.owl-prev):not(.owl-next):not(.slick-arrow)` rule in custom.css (specificity
   0,3,1, with !important on colour/padding/font-size) painted it as a solid brand block with
   20px side padding instead of leaving it an icon. Match that weight and reset it. */
.account .column.main a.afx-acc-icon-action,
.account .column.main button.afx-acc-icon-action {
    background: transparent !important;
    background-color: transparent !important;
    color: var(--afx-acc-muted) !important;
    height: auto !important;
    line-height: 1 !important;
    padding: .25rem !important;
    border: 0 !important;
    border-radius: .25rem;
    text-transform: none;
    font-size: inherit !important;
}

.account .column.main a.afx-acc-icon-action:hover,
.account .column.main button.afx-acc-icon-action:hover {
    background: transparent !important;
    color: var(--color-primary, #137C4E) !important;
}

.account .column.main a.afx-acc-icon-action:focus-visible,
.account .column.main button.afx-acc-icon-action:focus-visible {
    outline: 2px solid var(--color-primary, #137C4E) !important;
    outline-offset: 2px !important;
}

/* Section headings must all resolve to the same family. `inherit` alone was not enough:
   "Address Book" / "Recent Orders" sit inside a wrapper that also carries Luma's `.block-title`,
   which sets its own font, so those two inherited a different face from "Account Information".
   Resetting the wrapper as well makes all three inherit from the section and match the card
   titles beside them. */
.account .column.main .afx-acc-heading,
.account .column.main .afx-acc-heading-group,
.account .column.main .block-title.afx-acc-heading-group {
    font-family: inherit;
}
