.order-page {
    max-width: 1440px;
}

.order-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 28px;
}

.order-header-main {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 22px;
}

.order-heading h1 {
    margin: 4px 0 5px;
    color: var(--ink);
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(28px, 3vw, 36px);
    font-weight: 500;
    line-height: 1.2;
}

.order-heading p {
    color: var(--muted);
    font-size: 14px;
}

.eyebrow {
    color: #9b7918;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 1.8px;
}

.back-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: white;
    color: var(--ink);
    text-decoration: none;
    font-size: 13px;
    font-weight: 650;
    transition: background 0.2s ease, border-color 0.2s ease;
}

.back-btn:hover {
    background: #f9f6ed;
    border-color: #d8c78f;
}

.header-status {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
}

.header-status-label {
    color: var(--muted);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 1px;
}

.order-overview {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin-bottom: 24px;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: white;
    box-shadow: var(--shadow);
}

.overview-item {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
    padding: 22px;
}

.overview-item + .overview-item {
    border-left: 1px solid var(--border);
}

.overview-icon, .card-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 43px;
    height: 43px;
    border: 1px solid #eee5c9;
    border-radius: 13px;
    background: #fbf7e9;
    color: #967316;
    font-size: 17px;
}

.overview-copy {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.overview-label {
    color: var(--muted);
    font-size: 11px;
    font-weight: 700;
}

.overview-value {
    overflow-wrap: anywhere;
    color: var(--ink);
    font-size: 15px;
    font-weight: 750;
}

.overview-total {
    background: #fcfaf3;
}

.overview-total .overview-value {
    color: #8a6a10;
    font-size: 19px;
}

.details-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
    gap: 20px;
}

.order-page .details-grid > .card {
    min-width: 0;
    padding: 24px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: white;
    box-shadow: var(--shadow);
}

.order-page .card h2 {
    margin: 0;
    color: var(--ink);
    font-family: "Segoe UI", Arial, sans-serif;
    font-size: 16px;
    font-weight: 750;
}

.card-heading {
    display: flex;
    align-items: center;
    gap: 13px;
    margin-bottom: 25px;
}

.card-heading > div:last-child {
    min-width: 0;
}

.card-heading p {
    margin-top: 3px;
    color: var(--muted);
    font-size: 12px;
}

.info-group {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.info-item {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
    padding: 15px 0;
    border-bottom: 1px solid #f0ede7;
}

.info-item:first-child {
    padding-top: 0;
}

.info-item:last-child {
    padding-bottom: 0;
    border-bottom: none;
}

.info-label {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 750;
    letter-spacing: 0.25px;
}

.info-label i {
    width: 14px;
    color: #9a7b25;
    text-align: center;
}

.info-value {
    color: #26251f;
    font-size: 14px;
    font-weight: 550;
    overflow-wrap: anywhere;
    word-break: normal;
}

.status-editor {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.status-editor label {
    color: #555149;
    font-size: 12px;
    font-weight: 750;
}

.status-select {
    width: 100%;
    min-width: 0;
    padding: 13px 14px;
    border: 1px solid #ded9ce;
    border-radius: 10px;
    background: #fcfbf8;
    color: var(--ink);
    font-size: 13px;
}

.status-select:focus {
    border-color: var(--gold);
    outline: 3px solid rgba(212, 175, 55, 0.14);
}

.field-hint {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    color: var(--muted);
    font-size: 11px;
    line-height: 1.6;
}

.field-hint i {
    margin-top: 3px;
    color: #a1832d;
}

.save-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    width: 100%;
    margin-top: 5px;
    padding: 13px 16px;
    border: 1px solid var(--gold);
    border-radius: 10px;
    background: var(--ink);
    color: #fff;
    font-size: 13px;
    font-weight: 750;
    transition: background 0.2s ease, color 0.2s ease;
}

.save-btn:hover {
    background: var(--gold);
    color: var(--ink);
}

.save-btn:disabled {
    cursor: wait;
    opacity: 0.65;
}

.fulfillmentBadge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    width: fit-content;
    margin-bottom: 15px;
    padding: 8px 12px;
    border-radius: 9px;
    background: #f1f0ed;
    color: #4d4a43;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.fulfillmentBadge.shipment {
    background: #eaf1ff;
    color: #2856a3;
}

.fulfillmentBadge.pickup {
    background: #fbf1d1;
    color: #86620b;
}

.fulfillmentBadge.error {
    background: #fee8e7;
    color: #a12620;
}

#pickupLocation,
#pickupDate {
    font-weight: 700;
}

.note-box {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    min-height: 90px;
    padding: 17px;
    border: 1px solid #eee5c9;
    border-radius: 12px;
    background: #fcfaf3;
    color: #514a39;
    font-size: 13px;
    line-height: 1.8;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.note-box:empty::before {
    content: "No special instructions were provided.";
    color: var(--muted);
}

.order-page .items-card {
    grid-column: 1 / -1;
}

.items-heading {
    margin-bottom: 20px;
}

.items-table-wrapper {
    width: 100%;
    overflow-x: auto;
    border: 1px solid var(--border);
    border-radius: 12px;
    -webkit-overflow-scrolling: touch;
}

.items-table-wrapper table {
    min-width: 700px;
    margin: 0;
    border-radius: 0;
    box-shadow: none;
}

.items-table-wrapper th {
    padding: 14px 16px;
    background: #f8f6f1;
}

.items-table-wrapper td {
    padding: 15px 16px;
}

.items-table-wrapper tbody tr:last-child td {
    border-bottom: none;
}

.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    min-height: 260px;
    color: var(--muted);
    font-size: 14px;
}

.loading i {
    color: #a1832d;
    font-size: 20px;
}

.error-box {
    padding: 18px;
    border: 1px solid #f0c9c6;
    border-radius: 12px;
    background: #fff1f0;
    color: #991b1b;
    line-height: 1.6;
}

@media (max-width: 900px) {
    .order-page {
        padding: 26px 22px;
    }

    .order-overview {
        grid-template-columns: 1fr;
    }

    .overview-item {
        padding: 17px 20px;
    }

    .overview-item + .overview-item {
        border-top: 1px solid var(--border);
        border-left: none;
    }
}

@media (max-width: 768px) {
    .details-grid {
        grid-template-columns: 1fr;
    }

    .order-page .items-card {
        grid-column: auto;
    }

    .order-header {
        align-items: flex-start;
    }

    .header-status {
        align-items: flex-start;
    }
}

@media (max-width: 600px) {
    .order-page {
        padding: 20px 14px;
    }

    .order-header {
        flex-direction: column;
        gap: 20px;
    }

    .order-header-main {
        gap: 17px;
    }

    .order-heading h1 {
        font-size: 28px;
    }

    .order-heading p {
        font-size: 12px;
    }

    .order-overview {
        margin-bottom: 17px;
    }

    .overview-item {
        gap: 12px;
        padding: 16px;
    }

    .order-page .details-grid {
        gap: 15px;
    }

    .order-page .details-grid > .card {
        padding: 19px 16px;
    }

    .card-heading {
        gap: 11px;
        margin-bottom: 21px;
    }

    .card-icon,
    .overview-icon {
        width: 39px;
        height: 39px;
        font-size: 15px;
    }

    .order-page .card h2 {
        font-size: 15px;
    }

    .status-row {
        flex-direction: column;
        align-items: stretch;
    }

    .save-btn {
        width: 100%;
    }
}

@media (max-width: 360px) {
    .order-page {
        padding: 16px 10px;
    }

    .order-heading h1 {
        font-size: 25px;
    }

    .order-page .details-grid > .card {
        padding: 16px 13px;
    }

    .overview-value {
        font-size: 13px;
    }
}