/* --- Marketer Dashboard General Styles --- */
.marketer-orders-dashboard, .marketer-order-details {
    max-width: 1200px;
    margin: 0 auto;
    padding: 15px;
    background: #fdfdfd;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

.marketer-dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}
.marketer-dashboard-header h2 {
    margin: 0;
    font-size: 22px;
    color: #333;
}
.dashboard-date {
    font-weight: 600;
    font-size: 14px;
    color: #666;
}

h3 {
    border-bottom: 2px solid #0073aa;
    padding-bottom: 5px;
    margin-top: 25px;
    margin-bottom: 15px;
    font-size: 18px;
}

.order-search {
    margin-bottom: 15px;
    padding: 10px;
    width: 100%;
    max-width: 420px;
    border-radius: 6px;
    border: 1px solid #ccc;
    font-size: 14px;
    box-sizing: border-box; /* Include padding in the element's total width and height */
}

/* Table specific styles */
.responsive-table-container {
    overflow-x: auto; /* Enables horizontal scrolling if the table is too wide */
    -webkit-overflow-scrolling: touch;
}

table.shop_table {
    width: 100%;
    border-collapse: collapse;
    min-width: 600px; /* Ensures the table is readable before mobile stacking */
    margin-top: 0;
}
table.shop_table th, table.shop_table td {
    text-align: left;
    padding: 12px 10px;
    border-bottom: 1px solid #eee;
}
table.shop_table thead th {
    background-color: #f7f7f7;
    border-top: 1px solid #eee;
    font-weight: 700;
}

th.sortable { 
    color: #0073aa; 
    cursor: pointer; /* Apply cursor change here, removed from inline JS */
}
th.sortable:hover { 
    text-decoration: underline; 
}

.small-button {
    display: inline-block;
    padding: 6px 12px;
    font-size: 13px;
    border-radius: 4px;
    text-decoration: none;
    background-color: #0073aa;
    color: #fff !important;
    border: none;
}
.small-button:hover {
    background-color: #005177;
}

/* Order Details Specific Styles */
.order-current-status-wrap {
    margin-bottom: 20px;
    font-size: 16px;
    color: #555;
}
.order-current-status {
    color: #0073aa;
    font-size: 1.1em;
}
.order-status-update {
    padding: 15px;
    background: #eaf2f8;
    border: 1px solid #0073aa;
    border-radius: 6px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}
.order-status-update h3 {
    margin: 0;
    border-bottom: none;
    font-size: 16px;
}
#mark-as-completed-button {
    background-color: #28a745;
    color: #fff;
    border: none;
    padding: 10px 18px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: bold;
}
#mark-as-completed-button:hover:not(:disabled) {
    background-color: #218838;
}
#mark-as-completed-button:disabled {
    background-color: #a2d2a7;
    cursor: wait;
}

#marketer-status-message {
    padding: 10px;
    margin-bottom: 20px;
    border-radius: 4px;
    font-weight: bold;
}
.woocommerce-message {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}
.woocommerce-error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.marketer-details-cards {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
}
.detail-card {
    flex: 1;
    min-width: 300px; /* Ensures they don't get too small on desktop */
    padding: 15px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    background: #fff;
}
.detail-card address {
    white-space: pre-wrap;
    font-style: normal;
    line-height: 1.6;
}

/* Order Totals Styling for Details Page */
.order-totals-wrap {
    margin-top: 20px;
    padding: 15px;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    background: #fff;
    max-width: 400px;
    margin-left: auto;
}
.order-total-row {
    display: flex;
    justify-content: space-between;
    padding: 5px 0;
    border-bottom: 1px dotted #ccc;
    font-size: 15px;
}
.order-total-row:last-child {
    border-bottom: none;
    font-weight: bold;
    font-size: 1.1em;
    padding-top: 10px;
}

/* --- Mobile Specific Overrides (max-width: 768px) --- */
@media (max-width: 768px) {
    /* Main Dashboard Table (marketer_orders_shortcode) */
    table.shop_table {
        min-width: auto; /* Remove minimum width for full mobile stacking */
    }
    
    table.shop_table thead {
        display: none; /* Hide header on mobile */
    }
    
    table.shop_table, table.shop_table tbody, table.shop_table tr, table.shop_table td { 
        display: block; 
        width: 100%; 
        box-sizing: border-box;
    }
    
    table.shop_table tr { 
        margin-bottom: 15px; 
        border: 1px solid #e6e6e6; 
        border-radius: 8px; 
        padding: 0;
        background: #fff; 
        box-shadow: 0 1px 3px rgba(0,0,0,0.05); 
    }
    
    table.shop_table td { 
        position: relative; 
        padding: 10px 12px 10px 50%; /* Adjust padding for pseudo-element label */
        text-align: right; 
        border: none;
        display: flex;
        justify-content: flex-end;
        align-items: center;
        min-height: 40px; /* Ensure space for content */
    }
    
    /* Use data-label attribute for the mobile label */
    table.shop_table td::before {
        content: attr(data-label);
        position: absolute;
        left: 12px;
        top: 50%;
        transform: translateY(-50%);
        width: 45%;
        padding-right: 10px;
        font-weight: 600;
        text-align: left;
        color: #333;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    /* Order Details Page */
    .marketer-details-cards {
        flex-direction: column; /* Stack detail cards vertically */
    }
    .detail-card {
        min-width: 100%;
    }
    .order-totals-wrap {
        max-width: 100%; /* Use full width for totals */
    }
    
    /* Specific table styles for delivery_details table on small screens (non-responsive) */
    .delivery_details th {
        width: 50%; /* Give th more space */
        padding-left: 0;
    }
    .delivery_details td {
        text-align: left;
        padding-right: 0;
    }
    /* Reset order items table (it's simpler, so just stack if needed) */
    table.order_items td {
        padding-left: 50%;
    }
}