/* Shared order details (theme visual wave 1 part 2, T3). Boards VO-A and VOMobile-A.
   Renders woocommerce/order/order-details.php, order-details-item.php and order-details-customer.php
   on the thank-you page and the account order detail. Tokens from style.css :root; the ticket itself
   is styled by order-summary.css (.fm-summary--order). */

.fm-order-sheet {
    --fm-od-mono: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
    margin: 48px 0 0;
}

/* These blocks are <section>s: cancel the page-section padding of style.css (section { padding }). */
.fm-order-sheet,
.fm-order-items,
.fm-order-addresses {
    padding: 0;
}

.fm-order-sheet__grid {
    display: flex;
    flex-wrap: wrap;
    gap: 40px;
    align-items: flex-start;
}

/* Mono eyebrow heading shared by "itens do pedido" and "endereços". */
.fm-order-section__title {
    margin: 0;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--hairline);
    font-family: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 11px;
    font-weight: 500;
    line-height: 1.4;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--muted);
}

/* ---- Items ---- */
.fm-order-items {
    flex: 1 1 380px;
    min-width: 0;
}

.fm-order-item {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
        "body total"
        "fact .";
    column-gap: 20px;
    padding: 20px 0;
    border-bottom: 1px solid var(--hairline);
}

.fm-order-item__body {
    grid-area: body;
    min-width: 0;
}

.fm-order-item__name {
    margin: 0;
    font-family: "Fraunces", Georgia, serif;
    font-size: 20px;
    font-weight: 400;
    line-height: 1.25;
    color: var(--ink);
    overflow-wrap: break-word;
}

.fm-order-item__name a {
    color: inherit;
    text-decoration: none;
}

.fm-order-item__name a:hover,
.fm-order-item__name a:focus-visible {
    color: var(--red);
}

.fm-order-item .fm-line-meta--line {
    margin-top: 6px;
    font-size: 14px;
    line-height: 1.5;
}

.fm-order-item__fact {
    grid-area: fact;
    margin: 2px 0 0;
    font-size: 14px;
    line-height: 1.5;
    color: var(--muted);
}

.fm-order-item__qty {
    font-family: var(--fm-od-mono);
    font-weight: 500;
    color: var(--muted);
}

.fm-order-item__total {
    grid-area: total;
    padding-top: 3px;
    font-family: var(--fm-od-mono);
    font-size: 15px;
    font-weight: 500;
    color: var(--ink);
    text-align: right;
    white-space: nowrap;
}

.fm-order-item__note {
    grid-column: 1 / -1;
    margin-top: 10px;
    font-size: 14px;
    line-height: 1.5;
    color: var(--muted);
}

.fm-order-item__note p {
    margin: 0;
}

/* The customer note: one muted row under the items. */
.fm-order-items__note {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 16px;
    margin: 0;
    padding: 14px 0;
    border-bottom: 1px solid var(--hairline);
    font-size: 14px;
    line-height: 1.5;
    color: var(--muted);
}

.fm-order-items__note-label {
    font-family: var(--fm-od-mono);
    font-size: 11px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    padding-top: 2px;
}

.fm-order-items__note-text {
    flex: 1 1 200px;
    min-width: 0;
    overflow-wrap: break-word;
}

/* ---- Ticket column ---- */
.fm-order-sheet__summary {
    flex: 0 1 340px;
    min-width: 280px;
}

.fm-order-sheet__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 16px 0 0;
}

.fm-order-sheet__actions .order-actions-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 0 22px;
    border: 1px solid oklch(0.20 0.013 45 / 0.35);
    border-radius: 999px;
    background: transparent;
    color: var(--ink);
    font-family: "Geist", system-ui, sans-serif;
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
    transition: border-color var(--fast) ease, color var(--fast) ease;
}

.fm-order-sheet__actions .order-actions-button.pay {
    border-color: var(--red);
    background: var(--red);
    color: #ffffff;
}

.fm-order-sheet__actions .order-actions-button:hover,
.fm-order-sheet__actions .order-actions-button:focus-visible {
    border-color: var(--ink);
}

/* ---- Address cards ---- */
.fm-order-addresses {
    margin: 48px 0 0;
}

.fm-order-addresses__cards {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin-top: 20px;
}

.fm-order-address {
    flex: 1 1 260px;
    box-sizing: border-box;
    min-width: 0;
    padding: 20px 24px;
    background: var(--paper);
    border: 1px solid var(--hairline);
    border-radius: 16px;
}

.fm-order-address__title {
    margin: 0 0 12px;
    font-family: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 11px;
    font-weight: 500;
    line-height: 1.4;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--muted);
}

/* Upright: never the browser's italic <address>. Doubled class so an older page sheet
   (thankyou.css .woocommerce-customer-details address) does not win the cascade. */
.fm-order-address__lines,
.fm-order-addresses .fm-order-address__lines {
    font-style: normal;
    font-size: 15px;
    line-height: 1.6;
    color: var(--ink);
    overflow-wrap: break-word;
}

.fm-order-address__line {
    display: block;
}

@media (max-width: 640px) {
    .fm-order-sheet {
        margin-top: 40px;
    }

    .fm-order-sheet__grid {
        gap: 24px;
    }

    .fm-order-sheet__summary {
        flex: 1 1 100%;
        min-width: 0;
    }

    /* VOMobile-A: the fact and the line total share the row under the meta. */
    .fm-order-item {
        grid-template-columns: minmax(0, 1fr) auto;
        grid-template-areas:
            "body body"
            "fact total";
        align-items: baseline;
        padding: 18px 0;
    }

    .fm-order-item__name {
        font-size: 18px;
    }

    .fm-order-item .fm-line-meta--line {
        margin-top: 4px;
        line-height: 1.45;
    }

    .fm-order-item__fact {
        margin-top: 6px;
    }

    .fm-order-item__total {
        padding-top: 0;
    }

    .fm-order-addresses {
        margin-top: 40px;
    }

    .fm-order-addresses__cards {
        flex-direction: column;
        gap: 12px;
        margin-top: 16px;
    }

    .fm-order-address {
        flex: 0 0 auto;
        padding: 18px 20px;
    }
}
