/* ─── Account — account.css ─────────────────────────────────────────────────
   Loaded only on the WooCommerce account page (is_account_page()).
   Login fields and button inherit .bc-field / .button from main.css.
   ────────────────────────────────────────────────────────────────────────── */

/* ─── Login ─────────────────────────────────────────────────────────────── */

.bc-login {
    max-width: 480px;
    margin: 0 auto;
    padding: 48px 20px;
}

.bc-login__title {
    font-weight: 700;
    font-size: 24px;
    line-height: 24px;
    letter-spacing: -0.03em;
    text-align: center;
    margin: 0 0 24px;
}

.bc-login__form {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.bc-login__forgot {
    font-weight: 500;
    font-size: 13px;
    line-height: 17px;
    letter-spacing: 0.01em;
    text-align: right;
    text-decoration: underline;
    color: var(--color-grey);
    display: block;
    margin-top: 6px;
}

.bc-login__submit {
    margin-top: 24px;
}

.dash {
    background-color: #e9e9e9;
}

/* Whole account page grey, including the gutters either side of the centered
   content. account.css only loads on the account page, so this is scoped. */
body {
    background: #e9e9e9 !important;
}

/* Edit-account (Min profil) and orders pages are white. */
body.woocommerce-edit-account,
body.woocommerce-orders {
    background: #fff !important;
}

/* ─── Account layout ────────────────────────────────────────────────────── */

/* Storefront renders a page-title <header class="entry-header"> above the
   content; hide the whole wrapper (not just .entry-title) on the account page. */
.woocommerce-account .entry-header {
    display: none;
}

.account-page {
    max-width: var(--max-width-desktop);
    margin: 0 auto;
}

/* ─── Account tabs ──────────────────────────────────────────────────────── */

/* Tab nav shows on mobile only. */
.account-nav {
    display: block;
}

@media (min-width: 768px) {
    .account-nav {
        display: none;
    }
}

.account-nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    width: 100%;
    border-bottom: 1px solid hsla(0, 0%, 92%, 1);
}

.account-nav__item {
    margin: 0;
    flex: 1;
}

.account-nav__item + .account-nav__item {
    border-left: 1px solid hsla(0, 0%, 88%, 1);
}

.account-nav__item a {
    display: block;
    padding: 14px 0;
    background: white;
    text-align: center;
    font-size: 14px;
    font-weight: 500;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--color-grey);
    text-decoration: none !important;
    border-bottom: 2px solid transparent;
    box-sizing: border-box;
}

.account-nav__item.is-active a {
    color: black;
    font-weight: 700;
    border-bottom-color: black;
}

.account-page__content {
    padding: 23px 27px;
}

.account-page--dashboard .account-page__content {
    padding: 0;
}

/* ─── Dashboard: hero ───────────────────────────────────────────────────── */

.dash-hero {
    display: flex;
    flex-direction: column;
    gap: 22px;
    background: hsla(31, 100%, 50%, 1);
    padding: 11px 17px 17px 24px;
}

.dash-hero__intro {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.dash-hero__date {
    font-weight: 500;
    font-size: 13px;
    line-height: 17px;
    letter-spacing: 1.95px;
    text-transform: uppercase;
    color: black;
}

.dash-hero__greeting {
    font-weight: 500;
    font-size: 32px;
    line-height: 19px;
    letter-spacing: -0.01em;
    color: white;
    margin: 0;
}

.dash-hero__cta {
    width: 100%;
    align-self: center;
}

/* ─── Dashboard: stats ──────────────────────────────────────────────────── */

.dash-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1px;
    background: hsla(0, 0%, 92%, 1);
    margin-bottom: 9px;
}

.dash-stat {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 12px 21px 3px;
    background: white;
}

.dash-stat__num {
    font-weight: 400;
    font-size: 36px;
    line-height: 36px;
    letter-spacing: -0.02em;
    color: hsla(0, 0%, 49%, 1);
}

.dash-stat__label {
    font-weight: 500;
    font-size: 10px;
    line-height: 17px;
    letter-spacing: 0.10em;
    text-transform: uppercase;
    color: var(--color-grey);
}

/* ─── Dashboard: section head (shared) ──────────────────────────────────── */

.dash-section__head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 11px 24px;
    background: white;
}

.dash-section__title {
    font-weight: 500;
    font-size: 12px;
    line-height: 17px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--color-grey);
    margin: 0;
}

.dash-section__link {
    font-weight: 400;
    font-size: 16px;
    line-height: 19px;
    letter-spacing: -0.01em;
    color: var(--color-grey);
    text-decoration: none !important;
}

/* ─── Dashboard: recent orders ──────────────────────────────────────────── */

.dash-empty {
    padding: 11px 24px;
}

.dash-orders {
    margin-bottom: 9px;
}

.dash-orders__list {
    list-style: none;
    margin: 0;
    padding: 0;
    background: white;
}

.dash-order {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 24px;
    border-top: 1px solid hsla(0, 0%, 92%, 1);
}

.dash-order__dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.dash-order__dot--done      { background: hsla(0, 0%, 15%, 1); }
.dash-order__dot--onway     { background: hsla(0, 0%, 15%, 1); }
.dash-order__dot--confirmed { background: var(--color-brand); }

.dash-order__info {
    display: flex;
    flex-direction: column;
    gap: 5px;
    flex: 1;
}

.dash-order__id {
    font-weight: 600;
    font-size: 16px;
    line-height: 100%;
    color: black;
    text-decoration: none !important;
}

.dash-order__meta {
    font-weight: 400;
    font-size: 16px;
    line-height: 100%;
    letter-spacing: -0.01em;
    color: var(--color-grey);
}

.dash-order__total {
    font-weight: 500;
    font-size: 16px;
    line-height: 17px;
    letter-spacing: 0;
    text-align: right;
    color: black;
    white-space: nowrap;
}

/* ─── Dashboard: quick order search ─────────────────────────────────────── */

.dash-quick {
    margin-bottom: 9px;
    background: white;
}

/* White row that holds the grey search pill. */
.dash-quick__search {
    padding: 12px 0px;
    background: white;
    border-top: 1px solid hsla(0, 0%, 92%, 1);
}

/* Grey search pill (icon + input). */
.dash-quick__search-field {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    height: 39px;
    padding: 0 14px;
    box-sizing: border-box;
    background: #F4F4F4;
    border-radius: 0px;
}

/* Mobile: white search field on a light-grey band (inverse of desktop). */
@media (max-width: 767px) {
    .dash-quick__search {
        background: white;
    }

    .dash-quick__search-field {
        background: #FFFFFF;
        padding-left: 24px;
        gap: 0;
    }

    .dash-quick__search-icon {
        color: #B8B8B8;
    }

    .dash-quick__search-input::placeholder {
        color: #B8B8B8 !important;
    }

    .dash-chart__col .dash-chart__bar {
        width: 40px;
    }
}

.dash-quick__search-icon {
    width: 18px;
    height: 18px;
    color: #545454;
    flex-shrink: 0;
}

.dash-quick__search-input {
    flex: 1;
    min-width: 0;
    border: none;
    background: transparent !important;
    font-family: var(--font-body);
    font-weight: 400;
    font-size: 18px;
    line-height: 19px;
    letter-spacing: -0.01em;
    padding: 0;
    box-shadow: none !important;
}

.dash-quick__search-input::placeholder {
    color: #545454 !important;
    opacity: 1;
}

.dash-quick__search-input:focus {
    outline: none;
}

/* ─── Dashboard: quick order items ──────────────────────────────────────── */

.dash-quick {
    background: white;
}

.dash-quick__list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.dash-quick__item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 24px;
    border-top: 1px solid hsla(0, 0%, 92%, 1);
    background: white;
}

.dash-quick__info {
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1;
}

.dash-quick__name {
    font-weight: 600;
    font-size: 16px;
    line-height: 100%;
    letter-spacing: -0.01em;
    color: black;
    text-decoration: none !important;
}

.dash-quick__meta {
    font-weight: 400;
    font-size: 16px;
    line-height: 100%;
    letter-spacing: -0.01em;
    color: var(--color-grey);
}

.dash-quick__price {
    font-weight: 500;
    font-size: 16px;
    line-height: 17px;
    letter-spacing: 0;
    text-align: right;
    color: hsla(0, 0%, 49%, 1);
    white-space: nowrap;
}

.dash-quick__add {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border: 1px solid hsla(0, 0%, 74%, 1);
    background: white;
    color: black;
    font-size: 20px;
    line-height: 1;
    text-decoration: none !important;
    flex-shrink: 0;
}

/* ─── Dashboard: recommendations ────────────────────────────────────────── */

.dash-recs {
    margin-bottom: 9px;
}

.dash-rec__reason {
    margin: 0;
    padding: 8px 24px;
    background: transparent;
    border-top: 1px solid hsla(0, 0%, 92%, 1);
    font-weight: 600;
    font-size: 11px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: black;
}

.dash-rec__reason::before {
    content: "• ";
}

.dash-rec__item {
    position: relative;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    padding: 11px 24px;
    background: white;
}

.dash-rec__item::before {
    content: "";
    position: absolute;
    left: 0px;
    top: 0px;
    width: 5px;
    height: 32px;
    background: var(--rec-color, transparent);
}

.dash-rec--highlight  { --rec-color: #E47200; }
.dash-rec--complement { --rec-color: #6BA4DE; }
.dash-rec--habit      { --rec-color: transparent; }

.dash-rec__info {
    display: flex;
    flex-direction: column;
    gap: 0px;
}

.dash-rec__name {
    font-weight: 700;
    font-size: 16px;
    line-height: 1.2;
    color: black;
    text-decoration: none !important;
}

.dash-rec__note {
    margin: 0;
    font-style: italic;
    font-size: 14px;
    line-height: 1.3;
    color: var(--color-grey);
}

.dash-rec__price {
    font-weight: 500;
    font-size: 16px;
    color: var(--color-grey);
    white-space: nowrap;
    text-align: right;
}

/* ─── Dashboard: purchases chart ────────────────────────────────────────── */

.dash-chart {
    display: flex;
    flex-direction: column;
}

.dash-chart__bars {
    display: flex;
    align-items: flex-end;
    gap: 20px;
    padding: 20px 24px 16px;
    background: white;
    border-top: 1px solid hsla(0, 0%, 92%, 1);
    /* Grow to fill the (stretched) chart column so the white plot area reaches up
       to the head — bars stay pinned to the bottom via align-items: flex-end. */
    flex: 1;
    min-height: 150px;
}

.dash-chart__col {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.dash-chart__bar {
    width: 48px;
    max-width: 100%;
    background: var(--color-brand);
}

.dash-chart__bar--current {
    background: black;
}

.dash-chart__label {
    color: #000;
    text-align: center;
    font-family: "DM Sans", var(--font-body);
    font-size: 12px;
    font-style: normal;
    font-weight: 500;
    line-height: 17px;
    letter-spacing: 1.44px;
    text-transform: uppercase;
}

/* ─── Address (edit-address) ────────────────────────────────────────────── */

.account-address__title {
    padding-bottom: 12px;
    margin: 0 0 20px;
    border-bottom: 1px solid hsla(1, 3%, 88%, 1);
    font-weight: 700;
    font-size: 24px;
    letter-spacing: -0.02em;
}

.account-address__fields {
    display: flex;
    flex-direction: column;
}

.account-address .form-row {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin: 0 0 9px;
    padding: 0;
}

/* Override Storefront's 50% float on first/last name rows */
.account-address .form-row-first,
.account-address .form-row-last {
    width: 100% !important;
    float: none !important;
    margin-right: 0 !important;
}

.account-address .form-row label {
    font-weight: 500;
    font-size: 12px;
    line-height: 17px;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--color-grey);
}

.account-address .form-row .required {
    border: none;
    text-decoration: none;
    color: var(--color-grey);
}

.account-address .woocommerce-input-wrapper {
    display: block;
    width: 100%;
}

.account-address .woocommerce-input-wrapper input,
.account-address .woocommerce-input-wrapper select,
.account-address .woocommerce-input-wrapper .select2-container .select2-selection {
    width: 100% !important;
    height: 40px;
    border: none !important;
    border-radius: 2px;
    background: #F0F0F0 !important;
    padding: 0 12px;
    box-sizing: border-box;
    font-family: var(--font-body);
    font-size: 16px;
    box-shadow: none !important;
    color: var(--color-text);
}

.account-address .select2-container .select2-selection__rendered {
    line-height: 40px;
    padding: 0;
    color: var(--color-text);
}

.account-address .select2-container .select2-selection__arrow {
    height: 38px;
}

.account-address__actions {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    margin-top: 28px;
}

/* ─── Profile ───────────────────────────────────────────────────────────── */

.account-profile__title {
    margin: 0 0 21px;
    padding-bottom: 17px;
    border-bottom: 1px solid hsla(1, 3%, 88%, 1);
    font-family: "DM Sans", var(--font-body);
    font-size: 32px;
    font-weight: 400;
    line-height: 19px;
    letter-spacing: 0.32px;
    color: #545454;
}

/* "Byta lösenord" has no underline (it's a sub-heading within the profile column). */
.account-profile__group--password .account-profile__title {
    border-bottom: none;
    margin-bottom: 15px;
    padding-bottom: 0;
    color: #545454;
    font-family: "DM Sans", var(--font-body);
    font-size: 24px;
    font-style: normal;
    font-weight: 400;
    line-height: 19px;
    letter-spacing: -0.24px;
}

/* Mobile: space above the "Byta lösenord" heading (stacked below the profile). */
@media (max-width: 767px) {
    .account-profile__group--password .account-profile__title {
        margin-top: 43px;
    }
}

.account-profile__form {
    display: flex;
    flex-direction: column;
}

.account-profile__section-title {
    margin-top: 32px;
    margin-bottom: 15px;
}

.account-profile__password {
    width: var(--field-width) !important;
    margin-top: 6px;
    margin-bottom: 27px;
    border: none;
    padding: 0;
    background: #fff;
}

.account-profile__field {
    margin-bottom: 9px;
}

.account-profile__password-label {
    padding: 0;
    margin: 0 0 6px;
    font-weight: 500;
    font-size: 12px;
    line-height: 17px;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--color-grey);
}

.account-profile__password-card {
    display: flex;
    flex-direction: column;
    background: #F9F4F4;
    border-radius: 4px;
    padding: 24px;
    box-sizing: border-box;
}

.account-profile__hint {
    font-size: 14px;
    line-height: 18px;
    color: var(--color-text);
    margin: 0 0 29px;
}

.account-profile__password-card .bc-field input {
    width: 100%;
    background: white;
}

.account-profile__submit {
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-items: flex-start;
    margin: 28px 0 0;
}

.account-profile__submit .button {
    width: 240px;
    box-sizing: border-box;
    padding-left: 0 !important;
    padding-right: 0 !important;
    color: #FFF !important;
    text-align: center;
    font-family: "DM Sans", var(--font-body);
    font-size: 20px !important;
    font-style: normal;
    font-weight: 600;
    line-height: normal;
    letter-spacing: -0.2px !important;
    white-space: nowrap;
}

/* ─── Edit-account: delivery method (display-only) ───────────────────────── */

.bc-delivery {
    list-style: none;
    margin: 6px 0 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.bc-delivery__label {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    cursor: pointer;
}

.bc-delivery__label input[type="radio"] {
    appearance: none;
    -webkit-appearance: none;
    margin: 1px 0 0;
    flex-shrink: 0;
    box-sizing: border-box;
    width: 22px;
    height: 22px;
    border: 1.5px solid #000;
    border-radius: 50%;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.bc-delivery__label input[type="radio"]::before {
    content: "";
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: #000;
    transform: scale(0);
    transition: transform 0.1s ease-in-out;
}

.bc-delivery__label input[type="radio"]:checked::before {
    transform: scale(1);
}

.bc-delivery__body {
    display: flex;
    flex-direction: column;
    gap: 3px;
    flex: 1;
}

.bc-delivery__name {
    font-family: "DM Sans", var(--font-body);
    font-weight: 600;
    font-size: 18px;
    line-height: 1;
    letter-spacing: -0.18px;
    color: #575757;
}

.bc-delivery__desc {
    font-family: "DM Sans", var(--font-body);
    font-weight: 400;
    font-size: 16px;
    line-height: 1.3;
    color: #7E7E7E;
}

.bc-delivery__badge {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    height: 25px;
    padding: 0 8px;
    box-sizing: border-box;
    border: 1px solid hsla(0, 0%, 80%, 1);
    font-family: "DM Sans", var(--font-body);
    font-size: 14px;
    font-weight: 400;
    letter-spacing: 2.1px;
    text-transform: uppercase;
    color: #7E7E7E;
}

/* Let the edit-account fields flow to the full content width on every screen,
   overriding the fixed --field-width from .bc-field. (The 768px+ grid below
   reapplies this per column.) */
.account-page--edit-account .bc-field input,
.account-page--edit-account .bc-field select,
.account-page--edit-account .account-profile__password {
    width: 100% !important;
}

/* Field backgrounds + font size (17px per Figma). */
.account-page--edit-account .bc-field input,
.account-page--edit-account .bc-field select {
    background: #F4F4F4 !important;
    font-size: 17px !important;
}

/* Field labels: 13px / 1.95px / #575757 (Figma). */
.account-page--edit-account .bc-field label {
    font-size: 13px;
    letter-spacing: 1.95px;
    color: #575757;
}

/* Password-card fields stay white. */
.account-page--edit-account .account-profile__password-card .bc-field input {
    background: #FFFFFF !important;
}

/* ─── Dashboard — desktop ─────────────────────────────────────────────────────
   Mobile layout preserved. From 768px up, the dashboard widens; hero + stats
   span full width and the content sections flow into a 2-column card grid.
   Scoped to the dashboard so profile/address views stay narrow.
   ────────────────────────────────────────────────────────────────────────── */

@media (min-width: 768px) {

    .account-page--dashboard {
        max-width: var(--max-width-desktop);
    }

    .dash {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 9px;
    }

    .dash-hero,
    .dash-stats {
        grid-column: 1 / -1;
    }

    .dash-stats {
        grid-template-columns: repeat(4, 1fr);
        margin-bottom: 0;
        /* Sit flush against the hero (cancels the .dash grid gap). */
        margin-top: -9px;
        /* One white row, no dividers, content inset 100px from the edges. */
        gap: 0;
        box-sizing: border-box;
        padding: 17px 100px 12px;
        background: white;
        align-items: center;
    }

    .dash-stat {
        padding: 0;
        gap: 3px;
    }

    .dash-stat__num {
        font-size: 48px;
        font-weight: 400;
        letter-spacing: -0.96px;
        color: #7E7E7E;
    }

    .dash-stat__label {
        font-size: 13px;
        font-weight: 500;
        letter-spacing: 1.95px;
        color: #7E7E7E;
    }

    .dash-orders,
    .dash-quick,
    .dash-recs,
    .dash-chart {
        margin-bottom: 0;
        background: #e9e9e9;
    }

    /* Align all text at 100px (with the stats above); the status dots, rec
       squares and reason bullets sit in the gutter to the left. */
    .dash-section__head,
    .dash-empty {
        padding-left: 100px;
        padding-right: 100px;
    }

    .dash-order {
        padding-left: 100px;
        padding-right: 100px;
    }

    .dash-order__dot {
        margin-left: -20px; /* dot in the gutter; info lands at 100px */
    }

    .dash-rec__reason {
        position: relative;
        padding-left: 100px;
    }

    .dash-rec__reason::before {
        position: absolute;
        left: 86px;
    }

    .dash-rec__item {
        padding-left: 100px;
        padding-right: 100px;
    }

    /* Rec marker becomes a 16px square in the gutter, level with the name. */
    .dash-rec__item::before {
        left: 80px;
        top: 12px;
        width: 16px;
        height: 16px;
    }

    /* White row inset so the pill aligns at 100px like the rest of the column. */
    .dash-quick__search {
        padding: 12px 100px;
    }

    /* Fixed-width pill on desktop (full width on mobile). */
    .dash-quick__search-field {
        width: 411px;
        max-width: 100%;
    }

    /* Right-column content inset to 100px on desktop (24px on mobile). */
    .dash-quick__item {
        padding-left: 100px;
        padding-right: 100px;
    }

    .dash-chart__bars {
        padding-left: 100px;
        padding-right: 100px;
    }

    /* Hero: date + greeting on the left, CTA vertically centered on the right. */
    .dash-hero {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        padding: 26px 100px;
    }

    .dash-hero__cta {
        width: auto;
        align-self: center;
    }

    /* Pull the date up past the top padding (26px) so it sits 14px from the top. */
    .dash-hero__date {
        margin-top: -12px;
    }
}

/* ─── Edit account (Min profil) — desktop ─────────────────────────────────────
   Widen the container and lay the form out in two columns: profile + password
   on the left, delivery address on the right. Fields fill their column.
   Mobile preserved.
   ────────────────────────────────────────────────────────────────────────── */

@media (min-width: 768px) {

    .account-page--edit-account {
        max-width: var(--max-width-desktop);
    }

    .account-page--edit-account .account-page__content {
        max-width: none;
        padding: 23px 100px;
    }

    .account-profile__form {
        display: grid;
        grid-template-columns: 1fr 1fr 1fr;
        grid-template-areas:
            "profile  address delivery"
            "password address delivery";
        column-gap: 20px;
        row-gap: 32px;
        align-items: start;
    }

    .account-profile__group--profile  { grid-area: profile; }
    .account-profile__group--address  { grid-area: address; }
    .account-profile__group--password { grid-area: password; }

    /* Delivery column stretches full height so the actions float to the bottom. */
    .account-profile__group--delivery {
        grid-area: delivery;
        align-self: stretch;
        display: flex;
        flex-direction: column;
    }

    /* Grid gaps handle separation; drop the section-title top margin. */
    .account-profile__group .account-profile__section-title {
        margin-top: 0;
    }

    /* Fields below the line are inset 85px on the right (line stays full width). */
    .account-profile__group--profile .account-profile__field,
    .account-profile__group--address .account-profile__field {
        padding-right: 85px;
    }

    /* Byta lösenord: inset the password card 85px on the right too. */
    .account-profile__group--password .account-profile__password {
        padding-right: 85px;
        box-sizing: border-box;
    }

    /* Actions pinned to the bottom of the delivery column. */
    .account-profile__submit {
        margin-top: auto;
    }

    /* Fields fill their column. */
    .account-page--edit-account .bc-field input,
    .account-page--edit-account .bc-field select,
    .account-page--edit-account .account-profile__password {
        width: 100% !important;
    }
}

/* ─── Orders (Orderhistorik) ──────────────────────────────────────────────── */

.account-orders__title {
    margin: 0 0 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid hsla(1, 3%, 88%, 1);
    font-weight: 700;
    font-size: 24px;
    letter-spacing: -0.02em;
}

.account-orders__list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.account-orders__item {
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-areas:
        "number  status"
        "date    total"
        "actions actions";
    gap: 8px 16px;
    align-items: center;
    padding: 18px 0;
    border-bottom: 1px solid hsla(0, 0%, 92%, 1);
}

.account-orders__cell--number  { grid-area: number; }
.account-orders__cell--date    { grid-area: date; font-size: 14px; color: var(--color-grey); }
.account-orders__cell--status  { grid-area: status; justify-self: end; }
.account-orders__cell--total   { grid-area: total; justify-self: end; display: flex; flex-direction: column; align-items: flex-end; }
.account-orders__cell--actions { grid-area: actions; display: flex; gap: 8px; margin-top: 6px; }

.account-orders__number {
    font-weight: 700;
    font-size: 16px;
    color: black;
    text-decoration: none;
}

.account-orders__total {
    font-weight: 600;
    font-size: 15px;
    color: black;
}

.account-orders__count {
    font-size: 12px;
    color: var(--color-grey);
}

/* Status badge */
.order-status {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 3px;
    font-weight: 600;
    font-size: 12px;
    background: hsla(0, 0%, 92%, 1);
    color: var(--color-text);
}

.order-status--completed              { background: #E4F1E4; color: #2E7D32; }
.order-status--processing             { background: #FDECD2; color: #B26A00; }
.order-status--on-hold                { background: #E7E9EF; color: #3D4C8F; }
.order-status--cancelled,
.order-status--failed,
.order-status--refunded               { background: #F6E0DE; color: #C0392B; }

/* Buttons */
.account-orders__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 16px;
    border: 1px solid hsla(0, 0%, 80%, 1);
    border-radius: 4px;
    background: white;
    color: black;
    font-size: 14px;
    text-decoration: none;
    white-space: nowrap;
}

.account-orders__btn--pay {
    background: var(--color-brand);
    border-color: var(--color-brand);
    color: white;
}

.account-orders__pagination {
    display: flex;
    justify-content: space-between;
    margin-top: 20px;
}

.account-orders__empty {
    padding: 40px 0;
    text-align: center;
}

.account-orders__empty p {
    margin: 0 0 16px;
    color: var(--color-grey);
}

/* ─── Orders — desktop ────────────────────────────────────────────────────── */

@media (min-width: 768px) {

    .account-page--orders {
        max-width: var(--max-width-desktop);
    }

    /* Align content to the 1440 frame with the standard 100px inset
       (matches the nav and edit-account pages). */
    .account-page--orders .account-page__content {
        max-width: none;
        padding: 23px 100px;
    }

    .account-orders__item {
        grid-template-columns: 110px 1fr 150px 170px auto;
        grid-template-areas: "number date status total actions";
        gap: 20px;
    }

    .account-orders__cell--status { justify-self: start; }

    .account-orders__cell--total {
        justify-self: start;
        flex-direction: row;
        align-items: baseline;
        gap: 8px;
    }

    .account-orders__cell--actions {
        justify-self: end;
        margin-top: 0;
    }
}

/* ─── Order detail (view-order) ───────────────────────────────────────────── */

.account-order-detail__header {
    display: flex;
    flex-direction: column;
}

.account-order-detail__back {
    order: -1;
    margin-bottom: 14px;
    font-size: 14px;
    color: var(--color-grey);
    text-decoration: none;
}

.account-order-detail__title {
    margin: 0 0 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid hsla(1, 3%, 88%, 1);
    font-weight: 700;
    font-size: 24px;
    letter-spacing: -0.02em;
}

/* Status stepper */
.account-order-detail__status {
    padding-bottom: 8px;
}

.order-track {
    display: flex;
    align-items: flex-start;
    max-width: 460px;
    margin-bottom: 16px;
}

.order-track__step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
    width: 96px;
    text-align: center;
}

.order-track__dot {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: hsla(0, 0%, 85%, 1);
}

.order-track__step.is-done .order-track__dot    { background: #2E7D32; }
.order-track__step.is-current .order-track__dot { background: var(--color-brand); box-shadow: 0 0 0 4px hsla(31, 100%, 50%, 0.2); }

.order-track__label {
    font-size: 11px;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--color-grey);
    line-height: 1.3;
}

.order-track__step.is-current .order-track__label { color: black; font-weight: 600; }

.order-track__line {
    flex: 1;
    height: 2px;
    margin-top: 7px;
    background: hsla(0, 0%, 85%, 1);
}

.order-track__line.is-done { background: #2E7D32; }

.account-order-detail__status-note {
    margin: 0;
    font-size: 14px;
    color: var(--color-grey);
}

/* Sections */
.account-order-detail__subtitle {
    margin: 0 0 12px;
    font-weight: 500;
    font-size: 12px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--color-grey);
}

.account-order-detail__section,
.account-order-detail__addresses {
    padding: 20px 0;
    border-top: 1px solid hsla(0, 0%, 88%, 1);
}

.account-order-detail__items {
    list-style: none;
    margin: 0 0 12px;
    padding: 0;
}

.account-order-detail__item {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 8px 0;
    font-size: 15px;
}

.account-order-detail__item-name a { color: black; text-decoration: none; }
.account-order-detail__item-qty    { color: var(--color-grey); }
.account-order-detail__item-total  { white-space: nowrap; color: black; }

.account-order-detail__totals {
    padding-top: 12px;
    border-top: 1px solid hsla(0, 0%, 92%, 1);
}

.account-order-detail__total-row {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    padding: 4px 0;
    font-size: 15px;
    color: var(--color-text);
}

.account-order-detail__total-row:last-child {
    font-weight: 700;
    font-size: 17px;
    color: black;
}

.account-order-detail__addresses {
    display: grid;
    gap: 24px;
}

.account-order-detail__address address {
    font-style: normal;
    font-size: 15px;
    line-height: 1.5;
    color: black;
}

/* ─── Order detail — desktop ──────────────────────────────────────────────── */

@media (min-width: 768px) {

    .account-page--view-order {
        max-width: var(--max-width-desktop);
    }

    .account-order-detail {
        display: grid;
        grid-template-columns: 1fr 320px;
        column-gap: 48px;
        align-items: start;
    }

    .account-order-detail__header,
    .account-order-detail__status {
        grid-column: 1 / -1;
    }

    .account-order-detail__section--items {
        grid-column: 1;
    }

    .account-order-detail__addresses {
        grid-column: 2;
        grid-template-columns: 1fr;
    }
}
