/**
 * Modeo Account - Orders Table
 * 
 * Premium styles for orders list page
 */

/* ========================================
   ORDERS HEADER
   ======================================== */

.modeo-account-orders {
    display: flex;
    flex-direction: column;
    gap: 28px;
}

.orders-header {
    padding-bottom: 20px;
    border-bottom: 1px solid #f0f0f0;
}

.orders-description {
    color: #6b7280;
    margin: 8px 0 0;
    font-size: 1rem;
}

/* ========================================
   ORDERS TABLE
   ======================================== */

.orders-table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.modeo-orders-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background: #ffffff;
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid #f0f0f0;
}

.modeo-orders-table thead {
    background: linear-gradient(135deg, rgba(204, 22, 22, 0.04) 0%, rgba(248, 113, 113, 0.02) 100%);
}

.modeo-orders-table th {
    padding: 16px 20px;
    text-align: left;
    font-weight: 700;
    color: #1f2937;
    font-size: 0.8125rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid rgba(204, 22, 22, 0.15);
}

.modeo-orders-table th:first-child {
    border-radius: 16px 0 0 0;
}

.modeo-orders-table th:last-child {
    border-radius: 0 16px 0 0;
}

.modeo-orders-table tbody tr {
    border-bottom: 1px solid #f5f5f5;
    transition: background-color 0.2s ease;
}

.modeo-orders-table tbody tr:hover {
    background: rgba(204, 22, 22, 0.02);
}

.modeo-orders-table tbody tr:last-child {
    border-bottom: none;
}

.modeo-orders-table td {
    padding: 20px;
    vertical-align: middle;
}

/* Order Number Column */
.order-number {
    color: #cc1616;
    text-decoration: none;
    font-weight: 700;
    font-size: 1.125rem;
    display: inline-block;
    transition: all 0.2s ease;
}

.order-number:hover {
    color: #b31313;
    text-decoration: underline;
}

.order-items-mobile {
    display: none;
    font-size: 0.875rem;
    color: #6b7280;
    margin-top: 4px;
}

/* Order Items Count (desktop) */
.order-items-count {
    font-size: 0.875rem;
    color: #6b7280;
    margin-top: 4px;
}

/* Date Column */
.woocommerce-orders-table__cell-order-date time {
    font-size: 0.9375rem;
    color: #374151;
}

/* Total Column */
.woocommerce-orders-table__cell-order-total strong {
    font-size: 1.125rem;
    color: #1f2937;
}

/* Actions Column */
.order-action-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 18px;
    background: #cc1616;
    color: #ffffff;
    border: none;
    border-radius: 12px;
    font-weight: 600;
    font-size: 0.875rem;
    text-decoration: none;
    transition: all 0.2s ease;
    cursor: pointer;
    white-space: nowrap;
}

.order-action-btn:hover {
    background: #b31313;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(204, 22, 22, 0.25);
    color: #ffffff;
}

.order-action-btn.pay {
    background: #10b981;
}

.order-action-btn.pay:hover {
    background: #059669;
}

.order-action-btn.cancel {
    background: #ef4444;
}

.order-action-btn.cancel:hover {
    background: #dc2626;
}

/* ========================================
   PAGINATION
   ======================================== */

.woocommerce-pagination {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-top: 32px;
}

.woocommerce-pagination .button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: #ffffff;
    color: #cc1616;
    border: 2px solid #cc1616;
    border-radius: 999px;
    font-weight: 600;
    transition: all 0.2s ease;
}

.woocommerce-pagination .button:hover {
    background: #cc1616;
    color: #ffffff;
}

.woocommerce-pagination .material-icons {
    font-size: 18px;
}

/* ========================================
   EMPTY STATE
   ======================================== */

.orders-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 24px;
    text-align: center;
    background: linear-gradient(135deg, rgba(204, 22, 22, 0.03) 0%, rgba(248, 113, 113, 0.02) 100%);
    border-radius: 20px;
    border: 2px dashed rgba(204, 22, 22, 0.15);
}

.orders-empty-state .empty-icon {
    font-size: 80px;
    color: #cc1616;
    opacity: 0.4;
    margin-bottom: 24px;
}

.orders-empty-state h3 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 12px;
}

.orders-empty-state p {
    font-size: 1rem;
    color: #6b7280;
    margin-bottom: 28px;
    max-width: 400px;
}

.orders-empty-state .button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #cc1616;
    color: #ffffff;
    padding: 14px 28px;
    border-radius: 999px;
    font-weight: 600;
    transition: all 0.2s ease;
}

.orders-empty-state .button:hover {
    background: #b31313;
    box-shadow: 0 4px 12px rgba(204, 22, 22, 0.25);
}

/* ========================================
   RESPONSIVE - MOBILE
   ======================================== */

@media (max-width: 767px) {

    /* Hide table headers */
    .modeo-orders-table thead {
        display: none;
    }

    /* Convert table to cards */
    .modeo-orders-table,
    .modeo-orders-table tbody,
    .modeo-orders-table tr,
    .modeo-orders-table td {
        display: block;
        width: 100%;
    }

    .modeo-orders-table tr {
        margin-bottom: 16px;
        border: 1px solid #f0f0f0;
        border-radius: 16px;
        overflow: hidden;
        background: #ffffff;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    }

    .modeo-orders-table td {
        padding: 12px 16px;
        border-bottom: 1px solid #f5f5f5;
        display: flex;
        justify-content: space-between;
        align-items: center;
    }

    .modeo-orders-table td:last-child {
        border-bottom: none;
    }

    /* Show mobile labels */
    .modeo-orders-table td::before {
        content: attr(data-title);
        font-weight: 700;
        color: #6b7280;
        font-size: 0.8125rem;
        text-transform: uppercase;
        letter-spacing: 0.5px;
    }

    /* Order number - full width */
    .woocommerce-orders-table__cell-order-number {
        background: linear-gradient(135deg, rgba(204, 22, 22, 0.04) 0%, rgba(248, 113, 113, 0.02) 100%);
        padding: 16px !important;
        flex-direction: column;
        align-items: flex-start;
    }

    .woocommerce-orders-table__cell-order-number::before {
        margin-bottom: 8px;
    }

    .order-items-mobile {
        display: block;
    }

    .order-items-count {
        display: none;
    }

    /* Actions - full width button */
    .woocommerce-orders-table__cell-order-actions {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
        padding: 16px !important;
    }

    .woocommerce-orders-table__cell-order-actions::before {
        display: none;
    }

    .order-action-btn {
        width: 100%;
        justify-content: center;
    }

    /* Empty state */
    .orders-empty-state {
        padding: 60px 20px;
    }

    .orders-empty-state .empty-icon {
        font-size: 60px;
    }

    .orders-empty-state h3 {
        font-size: 1.25rem;
    }
}

/* Tablet adjustments */
@media (max-width: 991px) and (min-width: 768px) {

    .modeo-orders-table th,
    .modeo-orders-table td {
        padding: 14px 16px;
        font-size: 0.875rem;
    }

    .order-number {
        font-size: 1rem;
    }
}