/**
 * Responsive Stylesheet for WooCommerce Reorder Page.
 */

.wcr-reorder-container {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 1rem;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

.wcr-reorder-header {
    margin-bottom: 2rem;
}

.wcr-reorder-title {
    font-size: 2rem;
    font-weight: 700;
    color: #222;
    margin: 0 0 0.5rem 0;
}

.wcr-reorder-subtitle {
    font-size: 1rem;
    color: #666;
    margin: 0;
}

/* Alert Banner Styling */
.wcr-alert {
    padding: 1rem;
    border-radius: 4px;
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
    line-height: 1.4;
}

.wcr-alert-success {
    background-color: #ecfdf5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

.wcr-alert-error {
    background-color: #fef2f2;
    color: #991b1b;
    border: 1px solid #fca5a5;
}

/* Table Architecture styling */
.wcr-table-responsive {
    width: 100%;
    overflow-x: auto;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
}

.wcr-orders-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    margin: 0;
}

.wcr-orders-table th,
.wcr-orders-table td {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid #e5e7eb;
    font-size: 0.95rem;
}

.wcr-orders-table th {
    background-color: #f9fafb;
    font-weight: 600;
    color: #374151;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
}

.wcr-orders-table tbody tr:last-child td {
    border-bottom: none;
}

/* WooCommerce Badge Architecture */
.wcr-status-badge {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    border-radius: 9999px;
    font-size: 0.825rem;
    font-weight: 500;
    text-transform: capitalize;
}

.wcr-status-completed { background-color: #d1fae5; color: #065f46; }
.wcr-status-processing { background-color: #dbeafe; color: #1e40af; }
.wcr-status-on-hold { background-color: #fef3c7; color: #92400e; }
.wcr-status-pending { background-color: #f3f4f6; color: #374151; }
.wcr-status-cancelled, .wcr-status-failed { background-color: #fee2e2; color: #991b1b; }

/* Action Button Configuration styling */
.wcr-reorder-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 130px;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    font-weight: 600;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.wcr-reorder-btn[disabled] {
    cursor: not-allowed;
    opacity: 0.6;
}

/* Button CSS loading Framework Spinner */
.wcr-btn-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    margin-left: 8px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: wcr-spin 0.8s linear infinite;
}

@keyframes wcr-spin {
    to { transform: rotate(360deg); }
}

/* Pagination Interface rules */
.wcr-pagination {
    margin-top: 2rem;
    display: flex;
    justify-content: center;
}

.wcr-pagination ul {
    display: inline-flex;
    list-style: none;
    margin: 0;
    padding: 0;
    border: 1px solid #e5e7eb;
    border-radius: 4px;
    overflow: hidden;
}

.wcr-pagination li {
    margin: 0;
    border-right: 1px solid #e5e7eb;
}

.wcr-pagination li:last-child {
    border-right: none;
}

.wcr-pagination li a,
.wcr-pagination li span {
    display: block;
    padding: 0.5rem 0.875rem;
    color: #374151;
    text-decoration: none;
    font-size: 0.875rem;
    background: #fff;
}

.wcr-pagination li span.current {
    background: #2563eb;
    color: #fff;
    font-weight: 600;
}

.wcr-pagination li a:hover {
    background: #f3f4f6;
}

/* No Orders Fallback State UI formatting */
.wcr-no-orders {
    text-align: center;
    padding: 3rem 1rem;
    background: #f9fafb;
    border: 1px dashed #cbd5e1;
    border-radius: 6px;
}

.wcr-no-orders p {
    margin: 0 0 1.5rem 0;
    color: #64748b;
    font-size: 1.1rem;
}

/**
 * Dynamic Inline Notices styling
 * Adds native WooCommerce matching styling rules for success and error conditions.
 */

/* Success Message: Green Motif */
.wcr-dynamic-notice.woocommerce-message {
    border-top: 3px solid #10b981 !important; /* Vivid Emerald Green Accent */
    background-color: #f0fdf4 !important;    /* Soft Green Tint background */
    color: #065f46 !important;               /* Deep forest green typography */
    padding: 1em 1.5em !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    margin-bottom: 2rem !important;
    list-style: none outside !important;
    width: 100% !important;
    box-sizing: border-box !important;
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

/* Error Message: Red Motif */
.wcr-dynamic-notice.woocommerce-error {
    border-top: 3px solid #ef4444 !important; /* Vivid Crimson Red Accent */
    background-color: #fef2f2 !important;    /* Soft Red Tint background */
    color: #991b1b !important;               /* Deep burgundy typography */
    padding: 1em 1.5em !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    margin-bottom: 2rem !important;
    list-style: none outside !important;
    width: 100% !important;
    box-sizing: border-box !important;
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

/* Ensure clean spacing when rendered directly ahead of the target tables */
.shop_table.order_details, 
.woocommerce-orders-table {
    margin-top: 0 !important;
}

/* Responsive Structural Breakpoint execution handling mapping rules */
@media screen and (max-width: 768px) {
    .wcr-orders-table thead {
        display: none;
    }

    .wcr-orders-table tr {
        display: block;
        border: 1px solid #e5e7eb;
        border-radius: 6px;
        margin-bottom: 1rem;
        padding: 0.5rem;
        background: #fff;
    }

    .wcr-orders-table td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        border-bottom: 1px dashed #e5e7eb;
        padding: 0.75rem 0.5rem;
        text-align: right;
    }

    .wcr-orders-table td:last-child {
        border-bottom: none;
    }

    .wcr-orders-table td::before {
        content: attr(data-label);
        font-weight: 600;
        color: #4b5563;
        text-transform: uppercase;
        font-size: 0.75rem;
        letter-spacing: 0.05em;
        text-align: left;
    }
    
    .wcr-reorder-btn {
        width: 100%;
    }
}