/**
 * WC Stock Display Manager - M3 Orders Styles
 */

.wcsdm-m3-orders__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    gap: 12px;
}

.wcsdm-m3-orders__header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
}

.wcsdm-m3-orders__refresh {
    font-size: 13px !important;
    padding: 6px 14px !important;
    cursor: pointer;
}

/* Loading */
.wcsdm-m3-orders__loading {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 24px;
    color: #64748b;
    font-size: 14px;
}

.wcsdm-spinner {
    display: inline-block;
    width: 18px;
    height: 18px;
    border: 2px solid #e2e8f0;
    border-top-color: #3b82f6;
    border-radius: 50%;
    animation: wcsdm-spin 0.6s linear infinite;
}

@keyframes wcsdm-spin {
    to { transform: rotate(360deg); }
}

/* Error */
.wcsdm-m3-orders__error {
    padding: 14px 18px;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 6px;
    color: #991b1b;
    font-size: 14px;
}

/* Empty */
.wcsdm-m3-orders__empty {
    padding: 32px;
    text-align: center;
    color: #94a3b8;
    font-size: 14px;
}

/* Table */
.wcsdm-m3-orders__table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

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

.wcsdm-m3-orders__table thead th {
    text-align: left;
    padding: 10px 12px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: #64748b;
    border-bottom: 2px solid #e2e8f0;
    white-space: nowrap;
}

.wcsdm-m3-orders__table tbody td {
    padding: 12px;
    border-bottom: 1px solid #f1f5f9;
    vertical-align: middle;
}

.wcsdm-col-expand {
    width: 36px;
}

/* Expand button */
.wcsdm-expand-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border: 1px solid #cbd5e1;
    border-radius: 4px;
    background: #fff;
    cursor: pointer;
    padding: 0;
    transition: all 0.2s ease;
}

.wcsdm-expand-btn:hover {
    background: #f1f5f9;
    border-color: #94a3b8;
}

.wcsdm-expand-btn.is-open {
    background: #1e293b;
    border-color: #1e293b;
}

/* CSS chevron */
.wcsdm-chevron {
    display: block;
    width: 7px;
    height: 7px;
    border-right: 2px solid #475569;
    border-bottom: 2px solid #475569;
    transform: rotate(-45deg);
    margin-left: -2px;
    transition: transform 0.2s ease, border-color 0.2s ease;
}

.wcsdm-expand-btn.is-open .wcsdm-chevron {
    transform: rotate(45deg);
    margin-left: 0;
    margin-top: -2px;
    border-color: #fff;
}

/* Order row hover */
.wcsdm-order-row:hover td {
    background: #f8fafc;
}

.wcsdm-order-row td:first-child {
    border-bottom-color: transparent;
}

/* Order number */
.wcsdm-orno {
    font-weight: 600;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 13px;
    color: #1e293b;
}

/* Status badge */
.wcsdm-status {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
}

.wcsdm-status::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
}

.wcsdm-status--pending {
    background: #fef3c7;
    color: #92400e;
}
.wcsdm-status--pending::before { background: #f59e0b; }

.wcsdm-status--active {
    background: #dbeafe;
    color: #1e40af;
}
.wcsdm-status--active::before { background: #3b82f6; }

.wcsdm-status--shipping {
    background: #e0e7ff;
    color: #4338ca;
}
.wcsdm-status--shipping::before { background: #6366f1; }

.wcsdm-status--completed {
    background: #ecfdf5;
    color: #065f46;
}
.wcsdm-status--completed::before { background: #10b981; }

/* Expanded order lines row */
.wcsdm-lines-row {
    display: none;
}

.wcsdm-lines-row.is-open {
    display: table-row;
}

.wcsdm-lines-row td {
    padding: 0 12px 16px 48px;
    background: #f8fafc;
    border-bottom: 2px solid #e2e8f0;
}

/* Order lines table */
.wcsdm-lines-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    margin-top: 8px;
}

.wcsdm-lines-table thead th {
    text-align: left;
    padding: 6px 10px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    color: #94a3b8;
    border-bottom: 1px solid #e2e8f0;
}

.wcsdm-lines-table tbody td {
    padding: 8px 10px;
    border-bottom: 1px solid #f1f5f9;
    color: #334155;
}

.wcsdm-lines-table tbody tr:last-child td {
    border-bottom: none;
}

.wcsdm-lines-loading {
    padding: 16px;
    color: #94a3b8;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.wcsdm-lines-loading .wcsdm-spinner {
    width: 14px;
    height: 14px;
}

/* Responsive */
@media (max-width: 768px) {
    .wcsdm-col-hide-mobile {
        display: none;
    }

    .wcsdm-m3-orders__table thead th,
    .wcsdm-m3-orders__table tbody td {
        padding: 8px 6px;
        font-size: 12px;
    }

    .wcsdm-lines-row td {
        padding-left: 12px;
    }

    .wcsdm-m3-orders__header {
        flex-wrap: wrap;
    }
}
