/* Homepage admin orders demo */

.demo-admin-panel[hidden],
#demo-shop-panel[hidden] {
    display: none !important;
}

.demo-admin-orders h1 {
    margin: 0 0 8px;
    font-size: 1.75rem;
    letter-spacing: -0.02em;
}

.demo-admin-orders__intro {
    margin: 0 0 4px;
    color: var(--demo-muted);
}

.demo-admin-orders__count {
    margin: 0 0 16px;
    font-size: 13px;
    color: var(--demo-muted);
}

.demo-admin-orders__table-wrap {
    padding: 0;
    overflow: hidden;
}

.demo-admin-orders__scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.demo-admin-orders__table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.demo-admin-orders__table th,
.demo-admin-orders__table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid var(--demo-border);
    vertical-align: top;
}

.demo-admin-orders__table th {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--demo-muted);
    background: #f9fafb;
    white-space: nowrap;
}

.demo-admin-orders__row {
    cursor: pointer;
    transition: background 0.15s ease;
}

.demo-admin-orders__row:nth-child(even) {
    background: #fafbfc;
}

.demo-admin-orders__row:hover,
.demo-admin-orders__row:focus {
    background: #fef2f1;
    outline: none;
}

.demo-admin-orders__row:focus-visible {
    box-shadow: inset 0 0 0 2px var(--demo-accent);
}

.demo-admin-orders__row--on-hold {
    background: #eff6ff !important;
    box-shadow: inset 4px 0 0 #2563eb;
}

.demo-admin-orders__row--on-hold:nth-child(even) {
    background: #eff6ff !important;
}

.demo-admin-orders__row--on-hold:hover,
.demo-admin-orders__row--on-hold:focus {
    background: #dbeafe !important;
    box-shadow: inset 4px 0 0 #1d4ed8, inset 0 0 0 1px #93c5fd;
}

.demo-admin-orders__row--on-hold:focus-visible {
    box-shadow: inset 4px 0 0 #1d4ed8, inset 0 0 0 2px var(--demo-accent);
}

.demo-admin-orders__status {
    white-space: nowrap;
    width: 1%;
}

.demo-order-status {
    display: inline-block;
    font-size: 12px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 999px;
    text-transform: capitalize;
}

.demo-order-status--paid {
    color: #166534;
    background: #dcfce7;
}

.demo-order-status--processing {
    color: #92400e;
    background: #fef3c7;
}

.demo-order-status--on-hold {
    color: #1e40af;
    background: #dbeafe;
}

.demo-order-status--cancelled {
    color: #991b1b;
    background: #fee2e2;
}

.demo-admin-orders__notes {
    max-width: 220px;
    color: var(--demo-muted);
    font-size: 13px;
}

.demo-admin-orders__actions {
    white-space: nowrap;
    width: 1%;
}

.demo-admin-orders__row .demo-admin-orders__actions {
    cursor: default;
}

.demo-btn--small {
    padding: 6px 12px;
    font-size: 13px;
    white-space: nowrap;
}

.demo-admin-orders__email-btn {
    background: var(--demo-surface);
    color: var(--demo-text);
    border: 1px solid var(--demo-border);
    box-shadow: none;
}

.demo-admin-orders__email-btn:hover {
    background: #f9fafb;
    border-color: #d1d5db;
}

/* Order detail modal */
.demo-order-detail-dialog {
    border: none;
    padding: 0;
    margin: auto;
    max-width: min(520px, calc(100vw - 32px));
    width: 100%;
    background: transparent;
}

.demo-order-detail-dialog::backdrop {
    background: rgba(15, 23, 42, 0.45);
}

.demo-order-detail-dialog__inner {
    background: var(--demo-surface);
    border-radius: var(--demo-radius);
    box-shadow: var(--demo-shadow), 0 16px 48px rgba(15, 23, 42, 0.12);
    overflow: hidden;
}

.demo-order-detail-dialog__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 20px 20px 0;
}

.demo-order-detail-dialog__header h2 {
    margin: 0;
    font-size: 1.25rem;
}

.demo-order-detail-dialog__close {
    border: none;
    background: transparent;
    font-size: 1.5rem;
    line-height: 1;
    color: var(--demo-muted);
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 6px;
}

.demo-order-detail-dialog__close:hover {
    color: var(--demo-text);
    background: #f3f4f6;
}

.demo-order-detail-dialog__body {
    padding: 16px 20px;
    max-height: min(60vh, 480px);
    overflow-y: auto;
}

.demo-order-detail-dialog__footer {
    padding: 0 20px 20px;
    display: flex;
    justify-content: flex-end;
}

.demo-order-detail {
    margin: 0;
    display: grid;
    gap: 12px;
}

.demo-order-detail > div {
    display: grid;
    gap: 2px;
}

.demo-order-detail dt {
    margin: 0;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--demo-muted);
}

.demo-order-detail dd {
    margin: 0;
}

.demo-order-detail__items {
    margin: 0;
    padding-left: 1.25rem;
}

.demo-order-detail__line-total {
    color: var(--demo-muted);
}

/* Confirmation email preview */
.demo-confirmation-email-dialog {
    max-width: min(600px, calc(100vw - 32px));
}

.demo-confirmation-email__demo-label {
    margin: 0 0 12px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--demo-accent);
}

.demo-confirmation-email__envelope {
    border: 1px solid var(--demo-border);
    border-radius: 8px;
    overflow: hidden;
    background: #f9fafb;
}

.demo-confirmation-email__meta {
    padding: 12px 16px;
    font-size: 13px;
    background: #fff;
    border-bottom: 1px solid var(--demo-border);
}

.demo-confirmation-email__meta p {
    margin: 0 0 6px;
}

.demo-confirmation-email__meta p:last-child {
    margin-bottom: 0;
}

.demo-confirmation-email__message {
    padding: 20px 16px;
    background: #fff;
    font-size: 14px;
}

.demo-confirmation-email__message h3 {
    margin: 0 0 12px;
    font-size: 1.1rem;
}

.demo-confirmation-email__message > p {
    margin: 0 0 12px;
}

.demo-confirmation-email__brand {
    margin: 0 0 16px !important;
    font-weight: 700;
    font-size: 1rem;
}

.demo-confirmation-email__brand span {
    color: var(--demo-accent);
}

.demo-confirmation-email__summary {
    width: 100%;
    border-collapse: collapse;
    margin: 0 0 16px;
    font-size: 14px;
}

.demo-confirmation-email__summary th,
.demo-confirmation-email__summary td {
    padding: 8px 0;
    border-bottom: 1px solid var(--demo-border);
    text-align: left;
    vertical-align: top;
}

.demo-confirmation-email__summary th {
    width: 38%;
    padding-right: 12px;
    color: var(--demo-muted);
    font-weight: 500;
}

.demo-confirmation-email__summary tr:last-child th,
.demo-confirmation-email__summary tr:last-child td {
    border-bottom: none;
}

@media (max-width: 640px) {
    .demo-admin-orders__table th,
    .demo-admin-orders__table td {
        padding: 10px 12px;
        font-size: 13px;
    }

    .demo-admin-orders__table td:nth-child(5),
    .demo-admin-orders__table td.demo-admin-orders__notes {
        min-width: 140px;
    }

    .demo-admin-orders__actions {
        min-width: 108px;
    }
}
