/* =========================
   PRODUCT & TABLE STYLES
========================= */

/* Products Table */
.mv-products-container {
    overflow-x: auto;
    background: #1a1a1a;
    border-radius: 12px;
}

.mv-products-table {
    width: 100%;
    border-collapse: collapse;
    background: #1a1a1a;
    color: #eee;
}

.mv-products-table th,
.mv-products-table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #333;
}

.mv-products-table th {
    background: #222;
    color: #ff6a00;
    font-weight: 600;
    font-size: 14px;
}

.mv-products-table tr:hover {
    background: #252525;
}

/* Product thumbnail */
.mv-product-thumb {
    width: 50px;
    height: 50px;
    object-fit: cover;
    border-radius: 6px;
    background: #333;
}

/* Product type badges */
.mv-product-type {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    text-transform: capitalize;
}

.mv-type-simple { background: #1e40af; color: white; }
.mv-type-variable { background: #7c3aed; color: white; }
.mv-type-digital { background: #059669; color: white; }
.mv-type-grouped { background: #d97706; color: white; }
.mv-type-external { background: #dc2626; color: white; }

/* Status badges */
.mv-status {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    text-transform: capitalize;
}

.mv-status-publish { background: #059669; color: white; }
.mv-status-draft { background: #6b7280; color: white; }
.mv-status-pending { background: #d97706; color: white; }
.mv-status-private { background: #dc2626; color: white; }

/* Action buttons */
.mv-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.mv-btn-small {
    padding: 6px 12px;
    background: #333;
    border: none;
    border-radius: 6px;
    color: #eee;
    cursor: pointer;
    font-size: 12px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.3s ease;
}

.mv-btn-small:hover {
    background: #ff6a00;
    color: white;
    transform: translateY(-1px);
}

.mv-btn-small .mv-icon {
    width: 14px;
    height: 14px;
    filter: invert(1);
    margin-bottom: 0;
}

.mv-btn-danger {
    background: #dc2626;
}

.mv-btn-danger:hover {
    background: #b91c1c;
}

/* No products message */
.mv-no-products {
    text-align: center;
    padding: 40px !important;
    color: #999;
}

.mv-no-products a {
    color: #ff6a00;
    text-decoration: none;
}

.mv-no-products a:hover {
    text-decoration: underline;
}

/* Pagination */
.mv-products-pagination {
    padding: 20px !important;
}

.mv-pagination-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.mv-page-btn {
    padding: 8px 16px;
    background: #333;
    border: none;
    border-radius: 6px;
    color: #eee;
    cursor: pointer;
    transition: all 0.3s ease;
}

.mv-page-btn:hover {
    background: #ff6a00;
    transform: translateY(-1px);
}

.mv-page-info {
    color: #ccc;
    font-size: 14px;
}

/* =========================
   SELECT2 STYLES (for product attributes)
========================= */
.select2-container--default .select2-selection--multiple {
    background: #222 !important;
    border-color: #444 !important;
}

.select2-container--default .select2-selection--multiple .select2-selection__choice {
    background: #ff6a00 !important;
    border: none !important;
    border-radius: 6px !important;
    color: white !important;
}

.select2-container--default .select2-selection--multiple .select2-selection__choice__remove {
    color: white !important;
}

.select2-container--default .select2-selection--multiple .select2-selection__choice__remove:hover {
    background: #e65c00 !important;
    color: white !important;
}

.select2-container--default .select2-results__option--highlighted[aria-selected] {
    background: #ff6a00 !important;
}

.select2-dropdown {
    background: #222 !important;
    border-color: #444 !important;
}

.select2-search__field {
    background: #333 !important;
    border-color: #444 !important;
    color: #eee !important;
}

/* =========================
   ATTRIBUTE SELECTION STYLES
========================= */
.mv-attribute-selection {
    background: #2a2a2a;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.mv-custom-attributes {
    background: #2a2a2a;
    padding: 15px;
    border-radius: 8px;
}

.mv-attribute-selection label,
.mv-custom-attributes h4 {
    color: #ff6a00;
    margin-bottom: 10px;
    display: block;
}

/* Enhanced attribute rows */
.mv-attribute-row {
    display: grid;
    grid-template-columns: 1fr 1fr auto;
    gap: 10px;
    align-items: center;
    margin-bottom: 10px;
    padding: 10px;
    background: #333;
    border-radius: 6px;
}

.mv-attribute-name,
.mv-attribute-values {
    padding: 8px 12px;
    border: 1px solid #444;
    border-radius: 4px;
    background: #222;
    color: #eee;
}

.mv-remove-attribute {
    padding: 8px 12px;
    background: #dc2626;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    transition: background 0.3s ease;
}

.mv-remove-attribute:hover {
    background: #b91c1c;
}

/* =========================
   MANUAL VARIATION STYLES
========================= */
.mv-manual-variations {
    background: #2a2a2a;
    padding: 25px;
    border-radius: 10px;
    margin-top: 25px;
    border: 1px solid #444;
}

.mv-variation-controls {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.mv-variation-row {
    background: #333;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 15px;
    transition: all 0.3s ease;
}

.mv-variation-row:hover {
    background: #3a3a3a;
    transform: translateY(-2px);
}

.mv-variation-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #444;
}

.mv-variation-header h5 {
    margin: 0;
    color: #ff6a00;
    font-size: 16px;
}

.mv-remove-variation {
    background: #dc2626;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 5px 10px;
    cursor: pointer;
    transition: background 0.3s ease;
}

.mv-remove-variation:hover {
    background: #b91c1c;
}

.mv-variation-attributes {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 15px;
}

.mv-variation-attribute label {
    display: block;
    font-size: 12px;
    color: #ccc;
    margin-bottom: 5px;
    font-weight: 500;
}

.mv-variation-attribute input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #444;
    border-radius: 6px;
    background: #1a1a1a;
    color: #eee;
    font-size: 14px;
}

.mv-variation-attribute input:focus {
    outline: none;
    border-color: #ff6a00;
}

.mv-variation-prices {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.mv-variation-media {
    display: grid;
    grid-template-columns: 84px minmax(0, 1fr);
    gap: 14px;
    align-items: center;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #444;
}

.mv-variation-image-preview {
    position: relative;
    width: 84px;
    height: 84px;
    overflow: hidden;
    border: 1px dashed #555;
    border-radius: 10px;
    background: #202020;
    color: #888;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    text-align: center;
}

.mv-variation-image-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.mv-remove-variation-image {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 24px;
    height: 24px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.78);
    color: #fff;
    cursor: pointer;
}

.mv-variation-image-controls label {
    display: block;
    margin-bottom: 7px;
    color: #eee;
    font-size: 12px;
    font-weight: 700;
}

.mv-variation-image-controls input[type="file"] {
    width: 100%;
    color: #bbb;
    font-size: 12px;
}

.mv-variation-image-status {
    display: block;
    min-height: 17px;
    margin-top: 6px;
    color: #999;
    font-size: 11px;
}

.mv-variation-image-status.is-working { color: #ffbd8a; }
.mv-variation-image-status.is-ready { color: #7edc8f; }
.mv-variation-image-status.is-error { color: #ff8a8a; }

.mv-variation-stock {
    margin-top: 14px;
    padding: 14px;
    border: 1px solid #454545;
    border-radius: 10px;
    background: #252525;
}

.mv-variation-stock label {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    color: #f3f3f3;
    font-size: 12px;
    font-weight: 700;
}

.mv-variation-stock label i {
    color: #ff6a00;
}

.mv-variation-stock-input {
    width: 100%;
    min-height: 44px;
    padding: 9px 12px;
    border: 1px solid #4b4b4b;
    border-radius: 7px;
    background: #171717;
    color: #fff;
    font-size: 16px;
}

.mv-variation-stock-input:focus {
    outline: none;
    border-color: #ff6a00;
    box-shadow: 0 0 0 2px rgba(255, 106, 0, 0.16);
}

.mv-variation-stock small {
    display: block;
    margin-top: 7px;
    color: #999;
    font-size: 11px;
    line-height: 1.35;
}

/* Variable stock belongs to each variation card. Keep only the shared
   backorder and low-stock controls in the parent inventory panel. */
#mv-add-product.is-variable-listing #stock-fields > .mv-form-row:first-child {
    display: none;
}

.mv-description-media-manager {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid #3a3a3a;
}

.mv-description-media-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 5px;
}

.mv-description-media-heading strong {
    color: #f5f5f5;
    font-size: 13px;
}

.mv-description-media-heading span {
    padding: 4px 9px;
    border-radius: 999px;
    background: rgba(255, 106, 0, 0.13);
    color: #ff8a3d;
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
}

.mv-description-media-manager > p {
    margin: 0 0 12px;
    color: #999;
    font-size: 12px;
}

.mv-description-image-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 9px;
    margin-bottom: 10px;
}

.mv-description-image-grid:empty {
    display: none;
}

.mv-description-image-card {
    position: relative;
    min-height: 88px;
    overflow: hidden;
    border: 1px solid #3b3b3b;
    border-radius: 10px;
    background: #171717;
}

.mv-description-image-card img {
    width: 100%;
    height: 100%;
    min-height: 88px;
    max-height: 130px;
    object-fit: cover;
    display: block;
}

.mv-description-image-remove {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 27px;
    height: 27px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.8);
    color: #fff;
    cursor: pointer;
}

.mv-product-description-images {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin: 22px 0 0;
}

.mv-product-description-images figure {
    margin: 0;
    overflow: hidden;
    border-radius: 14px;
    background: #17191d;
}

.mv-product-description-images img {
    width: 100%;
    height: 100%;
    min-height: 180px;
    max-height: 420px;
    object-fit: cover;
    display: block;
}

.mv-price-field label {
    display: block;
    font-size: 12px;
    color: #ccc;
    margin-bottom: 5px;
    font-weight: 500;
}

.mv-price-field input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #444;
    border-radius: 6px;
    background: #1a1a1a;
    color: #eee;
    font-size: 14px;
}

.mv-price-field input:focus {
    outline: none;
    border-color: #ff6a00;
}

.mv-no-variations {
    text-align: center;
    padding: 40px;
    color: #999;
    background: #2a2a2a;
    border-radius: 8px;
    border: 2px dashed #444;
}

.mv-error-highlight {
    border-left-color: #dc2626 !important;
    background: #3a1a1a !important;
}

/* =========================
   ANIMATIONS
========================= */
.mv-fade-in {
    animation: fadeIn 0.5s ease-in-out;
}

.mv-slide-down {
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* =========================
   GENERAL BUTTON & ICON STYLES
========================= */
.mv-btn i,
.mv-loading i,
.mv-success i,
.mv-error i,
.mv-info i {
    margin-right: 8px;
}

/* Admin alert box */
.mv-admin-alert {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    color: #856404;
    padding: 15px;
    border-radius: 6px;
    margin-bottom: 20px;
}

/* =========================
   RESPONSIVE
========================= */
@media (max-width: 768px) {
    .mv-attribute-row {
        grid-template-columns: 1fr;
        gap: 8px;
    }
    
    .mv-attribute-selection,
    .mv-custom-attributes {
        padding: 10px;
    }
    
    .mv-variation-attributes {
        grid-template-columns: 1fr;
    }
    
    .mv-variation-prices {
        grid-template-columns: 1fr;
    }

    .mv-variation-media {
        grid-template-columns: 72px minmax(0, 1fr);
    }

    .mv-variation-image-preview {
        width: 72px;
        height: 72px;
    }

    .mv-product-description-images {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .mv-product-description-images img {
        min-height: 0;
        max-height: none;
        aspect-ratio: 4 / 3;
    }
    
    .mv-variation-controls {
        flex-direction: column;
    }
    
    .mv-variation-controls button {
        width: 100%;
    }
    
    .mv-products-table th,
    .mv-products-table td {
        padding: 8px 10px;
    }
    
    .mv-actions {
        flex-direction: column;
    }
    
    .mv-btn-small {
        width: 100%;
        justify-content: center;
    }
}

/* =========================
   High DPI Screen Optimizations
========================= */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .mv-icon {
        background-size: contain;
        image-rendering: -webkit-optimize-contrast;
        image-rendering: crisp-edges;
    }
}

/* =========================
   Reduced Motion Support
========================= */
@media (prefers-reduced-motion: reduce) {
    .mv-tab,
    .mv-section.active,
    .mv-btn,
    .mv-icon {
        transition: none;
        animation: none;
    }
    
    .mv-tab:hover,
    .mv-tab.active {
        transform: none;
    }
}

/* =========================
   Loading Overlay for Mobile
========================= */
.mv-loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    backdrop-filter: blur(10px);
}

.mv-loading-spinner {
    width: 60px;
    height: 60px;
    border: 4px solid #333;
    border-top: 4px solid #ff6a00;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}


/* =========================
   Orders Section - Enhanced Table Design
========================= */
.mv-orders-table-container {
    background: #1f1f1f;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
    margin-bottom: 20px;
    overflow-x: auto; /* Prevent horizontal scroll on container */
}

.mv-orders-table {
    width: 100%;
    border-collapse: collapse;
    background: #111;
    min-width: 600px; /* Ensure table has minimum width */
}

.mv-orders-table th {
    background: #222;
    padding: 18px 16px;
    text-align: left;
    font-weight: 600;
    color: #ff6a00;
    border-bottom: 2px solid #333;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.mv-orders-table td {
    padding: 16px;
    border-bottom: 1px solid #333;
    vertical-align: top;
}

.mv-order-row {
    transition: all 0.3s ease;
    cursor: pointer;
}

.mv-order-row:hover {
    background: #1a1a1a;
}

.mv-order-row:nth-child(even) {
    background: #151515;
}

.mv-order-row:nth-child(even):hover {
    background: #1a1a1a;
}

/* Order Cells */
.mv-order-number-main,
.mv-order-date-main,
.mv-order-customer-main,
.mv-order-amount-main {
    font-weight: 500;
    color: #eee;
}

.mv-order-amount-main {
    color: #ff6a00;
    font-weight: 600;
}

.mv-order-actions-main {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.mv-view-order-details {
    background: #333;
    color: #fff;
    border: none;
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 12px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.mv-view-order-details:hover,
.mv-view-order-details.mv-active {
    background: #ff6a00;
    color: #fff;
}

/* Status Badges */
.mv-status-badge {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: capitalize;
    display: inline-block;
}

.mv-status-pending { background: #f59e0b; color: white; }
.mv-status-processing { background: #3b82f6; color: white; }
.mv-status-on-hold { background: #6b7280; color: white; }
.mv-status-completed { background: #10b981; color: white; }
.mv-status-cancelled { background: #ef4444; color: white; }
.mv-status-refunded { background: #8b5cf6; color: white; }
.mv-status-failed { background: #dc2626; color: white; }

/* Order Details Row */
.mv-order-details-row {
    background: #1a1a1a !important;
}

.mv-order-details {
    padding: 0;
}

.mv-details-section {
    margin-bottom: 25px;
    padding: 20px;
    background: #1a1a1a!important;
    border-radius: 8px;
    
}

.mv-details-section:last-child {
    margin-bottom: 0;
}

.mv-details-section h4 {
    margin: 0 0 15px 0;
    color: #ffffff;
    font-size: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.mv-details-section h4 i {
    width: 16px;
    text-align: center;
}

.mv-details-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
}

.mv-details-grid div {
    padding: 8px 0;
    color: #ccc;
    font-size: 14px;
    border-bottom: 1px solid #333;
}

.mv-details-grid div:last-child {
    border-bottom: none;
}

.mv-details-grid strong {
    color: #eee;
    display: inline-block;
    min-width: 80px;
}

.mv-customer-info p,
.mv-shipping-info p {
    margin: 8px 0;
    color: #ccc;
    font-size: 14px;
}

.mv-customer-info strong,
.mv-shipping-info strong {
    color: #eee;
    min-width: 80px;
    display: inline-block;
}

.mv-order-items-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.mv-order-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    background: #2a2a2a;
    border-radius: 6px;
    border-left: 3px solid #ff6a00;
}

.mv-item-name {
    flex: 1;
    color: #eee;
    font-weight: 500;
}

.mv-item-quantity {
    color: #999;
    margin: 0 15px;
}

.mv-item-total {
    color: #ff6a00;
    font-weight: 600;
    min-width: 80px;
    text-align: right;
}

.mv-order-total {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 2px solid #333;
    text-align: right;
    color: #ff6a00;
    font-size: 16px;
    font-weight: 600;
}

/* Status Update Section */
.mv-status-update {
    display: flex;
    gap: 10px;
    align-items: center;
}

.mv-order-status-select {
    background: #111;
    border: 1px solid #333;
    border-radius: 6px;
    padding: 10px 12px;
    color: #eee;
    font-size: 14px;
    min-width: 150px;
}

.mv-order-status-update label {
    color: #ccc;
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
}

/* =========================
   Enhanced Pagination - Mobile First
========================= */
.mv-pagination {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    padding: 20px;
    background: #222;
    border-top: 1px solid #333;
}

.mv-pagination-info {
    color: #999;
    font-size: 14px;
    text-align: center;
    order: 2;
}

.mv-pagination-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    order: 1;
    flex-wrap: wrap;
    justify-content: center;
}

.mv-pagination-btn {
    background: linear-gradient(135deg, #ff6a00, #ff8c42);
    color: #fff;
    border: none;
    padding: 12px 20px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 120px;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(255, 106, 0, 0.3);
}

.mv-pagination-btn:hover:not(.mv-disabled) {
    background: linear-gradient(135deg, #e65c00, #ff7a2e);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 106, 0, 0.4);
}

.mv-pagination-btn.mv-disabled {
    background: #666;
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.mv-pagination-numbers {
    display: flex;
    gap: 4px;
    margin: 0 10px;
}

.mv-pagination-number {
    background: #333;
    color: #fff;
    border: none;
    width: 44px;
    height: 44px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mv-pagination-number:hover:not(.mv-active) {
    background: #444;
    transform: translateY(-1px);
}

.mv-pagination-number.mv-active {
    background: linear-gradient(135deg, #ff6a00, #ff8c42);
    color: #fff;
    transform: scale(1.05);
    box-shadow: 0 2px 8px rgba(255, 106, 0, 0.4);
}

.mv-pagination-ellipsis {
    color: #999;
    padding: 0 12px;
    display: flex;
    align-items: center;
    font-weight: 600;
}

/* No Orders State */
.mv-no-orders {
    text-align: center;
    padding: 60px 20px;
    color: #999;
    background: #1f1f1f;
    border-radius: 12px;
    margin: 20px 0;
}

.mv-no-orders-icon {
    font-size: 64px;
    margin-bottom: 20px;
    color: #444;
}

.mv-no-orders h3 {
    margin: 0 0 10px 0;
    color: #ccc;
    font-size: 24px;
}

.mv-no-orders p {
    margin: 0;
    font-size: 16px;
    line-height: 1.5;
}

/* Mobile Labels (Hidden by default) */
.mv-order-mobile-label {
    display: none;
    font-size: 12px;
    color: #999;
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Shipping Actions */
.mv-shipping-actions {
    display: flex;
    gap: 8px;
}

/* Button Styles */
.mv-btn-small {
    padding: 10px 16px;
    font-size: 13px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-weight: 600;
    min-height: 40px;
    box-sizing: border-box;
}

.mv-btn-primary {
    background: linear-gradient(135deg, #ff6a00, #ff8c42);
    color: #fff;
    box-shadow: 0 2px 8px rgba(255, 106, 0, 0.3);
}

.mv-btn-primary:hover {
    background: linear-gradient(135deg, #e65c00, #ff7a2e);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 106, 0, 0.4);
}

/* Animation for details expansion */
.mv-order-details-row {
    transition: all 0.3s ease-in-out;
}

/* Loading state for orders */
.mv-orders-loading {
    text-align: center;
    padding: 40px;
    color: #999;
}

.mv-orders-loading i {
    font-size: 24px;
    margin-bottom: 10px;
    display: block;
}

/* =========================
   Mobile Responsive Orders - IMPROVED HORIZONTAL SCROLL
========================= */
@media (max-width: 768px) {
    .mv-orders-table-container {
        border-radius: 12px;
        margin: 0 -16px; /* Negative margin to go full width on mobile */
        width: calc(100% + 32px);
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scroll-behavior: smooth;
    }
    
    /* Add scroll indicator shadow */
    .mv-orders-table-container::after {
        content: '';
        position: sticky;
        right: 0;
        top: 0;
        width: 30px;
        height: 100%;
        background: linear-gradient(to right, transparent, rgba(0,0,0,0.3));
        pointer-events: none;
        display: none;
    }
    
    .mv-orders-table-container:active::after {
        display: block;
    }
    
    .mv-orders-table {
        min-width: 800px;
        width: max-content;
        border-collapse: separate;
        border-spacing: 0;
    }
    
    /* Sticky first column (Order #) for better context */
    .mv-orders-table th:first-child,
    .mv-orders-table td:first-child {
        position: sticky;
        left: 0;
        background: #1a1a1a;
        z-index: 10;
        box-shadow: 2px 0 5px rgba(0,0,0,0.1);
    }
    
    /* Add subtle border to sticky column */
    .mv-orders-table th:first-child {
        z-index: 20;
    }
    
    /* Improve touch targets */
    .mv-orders-table th,
    .mv-orders-table td {
        padding: 14px 16px;
        font-size: 13px;
        white-space: nowrap;
    }
    
    /* Better action buttons */
    .mv-order-actions-main {
        display: flex;
        gap: 8px;
        white-space: nowrap;
    }
    
    .mv-btn-small {
        padding: 8px 14px;
        font-size: 12px;
        min-height: 36px;
        white-space: nowrap;
        border-radius: 6px;
        transition: all 0.2s ease;
    }
    
    /* Details row improvements */
    .mv-order-details-row td {
        padding: 0;
        white-space: normal;
    }
    
    .mv-order-details {
        padding: 0px;
    }
    
    .mv-details-section {
        margin: 0 0 20px 0;
        padding: 0;
    }
    
    .mv-details-grid {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
        gap: 12px;
    }
    
    .mv-order-item {
        display: flex;
        justify-content: space-between;
        padding: 8px 0;
    }
    
    .mv-status-update {
        display: flex;
        gap: 12px;
        align-items: center;
        flex-wrap: wrap;
    }
    
    .mv-order-status-select {
        flex: 1;
        min-width: 150px;
        padding: 10px;
    }
    
    /* Pagination improvements */
    .mv-products-pagination td {
        padding: 20px;
    }
    
    .mv-pagination-container {
        display: flex;
        justify-content: center;
        gap: 15px;
        flex-wrap: wrap;
    }
    
    .mv-page-btn {
        padding: 10px 18px;
        font-size: 14px;
        min-width: 100px;
    }
    
    .mv-page-info {
        font-size: 14px;
    }
}

/* Extra small devices */
@media (max-width: 480px) {
    .mv-orders-table-container {
        margin: 0 -12px;
        width: calc(100% + 24px);
    }
    
    .mv-orders-table {
        min-width: 700px;
    }
    
    .mv-orders-table th,
    .mv-orders-table td {
        padding: 12px 12px;
        font-size: 12px;
    }
    
    .mv-btn-small {
        padding: 6px 10px;
        font-size: 11px;
    }
    
    .mv-action-text {
        display: inline;
    }
    
    .mv-details-section h4 {
        font-size: 14px;
    }
    
    .mv-details-grid {
        grid-template-columns: 1fr;
        gap: 8px;
    }
    
    .mv-status-update {
        flex-direction: column;
        align-items: stretch;
    }
    
    .mv-order-status-select {
        width: 100%;
    }
    
    .mv-page-btn {
        padding: 8px 14px;
        font-size: 13px;
        min-width: 80px;
    }
}

.mv-orders-table-container {
    position: relative;
}

.mv-orders-table-container:after {
    content: '← scroll →';
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 10px;
    font-weight: 500;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
    white-space: nowrap;
    z-index: 100;
}

.mv-orders-table-container:hover:after {
    animation: scrollHint 1s ease-in-out 2;
}

@media (max-width: 768px) {
    .mv-orders-table-container:after {
        opacity: 0.7;
    }
}

@media (max-width: 480px) {
    .mv-orders-table-container:after {
        font-size: 9px;
        padding: 3px 10px;
    }
}

/* Touch device optimizations */
@media (hover: none) and (pointer: coarse) {
    .mv-orders-table-container {
        -webkit-overflow-scrolling: touch;
    }
    
    .mv-btn-small:active {
        transform: scale(0.96);
        transition: transform 0.05s;
    }
    
    .mv-page-btn:active {
        transform: scale(0.96);
    }
}
/* =========================
   BOTTOM SHEET -
========================= */
.mv-bottom-sheet-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9999;
    display: none;
}

.mv-bottom-sheet-overlay.open {
    display: block;
}

.mv-bottom-sheet {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #1f1f1f;
    border-radius: 20px 20px 0 0;
    z-index: 10000;
    transform: translateY(100%);
    transition: transform 0.3s ease;
    max-height: 85vh;
    overflow-y: auto;
    display: none;
}

.mv-bottom-sheet.open {
    display: block;
    transform: translateY(0);
}

.mv-bottom-sheet-header {
    padding: 15px 20px;
    background: #2a2a2a;
    border-bottom: 1px solid #333;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
}

.mv-bottom-sheet-header h3 {
    margin: 0;
    color: #ff6a00;
    font-size: 18px;
}

.mv-bottom-sheet-close {
    background: none;
    border: none;
    color: #fff;
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
}

.mv-bottom-sheet-content {
    padding: 10px;
}

body.sheet-open {
    overflow: hidden;
}


/* =========================
   Global Message Container
========================= */
#mv-global-message {
    position: sticky;
    top: 20px;
    z-index: 2147483647; /* Maximum safe z-index for modern browsers */
    margin-bottom: 20px;
}

#mv-global-message .mv-success,
#mv-global-message .mv-error,
#mv-global-message .mv-info,
#mv-global-message .mv-loading {
    display: flex;
    align-items: center;
    padding: 16px 20px;
    border-radius: 12px;
    margin: 0;
    font-weight: 500;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
    border-left: 4px solid;
    animation: slideInDown 0.3s ease-out;
}

@keyframes slideInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

#mv-global-message .mv-success {
    color: #10b981;
    background: #1e3a2b;
    border-left-color: #10b981;
}

#mv-global-message .mv-error {
    color: #ef4444;
    background: #3c1a1a;
    border-left-color: #ef4444;
}

#mv-global-message .mv-info {
    color: #3b82f6;
    background: #1e293b;
    border-left-color: #3b82f6;
}

#mv-global-message .mv-loading {
    color: #d1d5db;
    background: #374151;
    border-left-color: #d1d5db;
}

#mv-global-message i {
    margin-right: 10px;
    font-size: 18px;
}

/* Mobile responsive for global messages - FIXED VERSION */
@media (max-width: 768px) {
    #mv-global-message {
        position: fixed; /* Changed from sticky to fixed */
        top: 0; /* Stick to very top */
        left: 0;
        right: 0;
        z-index: 2147483647; /* SAME maximum z-index for mobile */
        margin: 0;
        width: 100%;
        border-radius: 0;
        box-shadow: 0 4px 20px rgba(0,0,0,0.4);
        /* Ensure it's above everything */
        will-change: transform;
        transform: translateZ(0); /* Force hardware acceleration */
    }
    
    /* If there's a fixed header, adjust top position */
    #mv-global-message.with-fixed-header {
        top: 60px; /* Adjust this based on your header height */
    }
    
    #mv-global-message .mv-success,
    #mv-global-message .mv-error,
    #mv-global-message .mv-info,
    #mv-global-message .mv-loading {
        border-radius: 0;
        margin: 0;
        padding: 14px 16px;
        min-height: 60px;
        align-items: center;
        justify-content: center;
        text-align: center;
        /* Ensure message content is above everything */
        position: relative;
        z-index: 2147483647;
    }
    
    /* Add close button inside the message */
    #mv-global-message .mv-success::after,
    #mv-global-message .mv-error::after,
    #mv-global-message .mv-info::after,
    #mv-global-message .mv-loading::after {
        content: "×";
        position: absolute;
        right: 15px;
        top: 50%;
        transform: translateY(-50%);
        font-size: 24px;
        color: currentColor;
        opacity: 0.7;
        cursor: pointer;
        font-weight: 300;
        z-index: 2147483647;
    }
    
    #mv-global-message .mv-success:hover::after,
    #mv-global-message .mv-error:hover::after,
    #mv-global-message .mv-info:hover::after,
    #mv-global-message .mv-loading:hover::after {
        opacity: 1;
    }
    
    /* Fix for iOS notch */
    @supports (padding: max(0px)) {
        #mv-global-message {
            padding-top: max(0px, env(safe-area-inset-top));
        }
    }
}


/* Transaction type colors */
.mv-type-sale { background: rgba(40, 167, 69, 0.2); color: #28a745; border: 1px solid rgba(40, 167, 69, 0.3); }
.mv-type-withdrawal { background: rgba(220, 53, 69, 0.2); color: #dc3545; border: 1px solid rgba(220, 53, 69, 0.3); }
.mv-type-refund { background: rgba(255, 193, 7, 0.2); color: #ffc107; border: 1px solid rgba(255, 193, 7, 0.3); }
.mv-type-commission { background: rgba(0, 123, 255, 0.2); color: #007bff; border: 1px solid rgba(0, 123, 255, 0.3); }
.mv-type-adjustment { background: rgba(108, 117, 125, 0.2); color: #6c757d; border: 1px solid rgba(108, 117, 125, 0.3); }

/* Status colors */
.mv-status-completed { background: rgba(40, 167, 69, 0.2); color: #28a745; border: 1px solid rgba(40, 167, 69, 0.3); }
.mv-status-pending { background: rgba(255, 193, 7, 0.2); color: #ffc107; border: 1px solid rgba(255, 193, 7, 0.3); }
.mv-status-failed { background: rgba(220, 53, 69, 0.2); color: #dc3545; border: 1px solid rgba(220, 53, 69, 0.3); }
.mv-status-processing { background: rgba(0, 123, 255, 0.2); color: #007bff; border: 1px solid rgba(0, 123, 255, 0.3); }



/* Shipping Fee Claim Styles */
.mv-shipping-fee-claim {
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.mv-fee-status {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px;
    border-radius: 6px;
    font-weight: 600;
}

.mv-fee-status.claimed {
    background: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
}

.mv-fee-status.available {
    background: #d1ecf1;
    border: 1px solid #bee5eb;
    color: #0c5460;
}

.mv-fee-status.no-fee {
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
}

.mv-claim-date {
    font-size: 12px;
    font-weight: normal;
    opacity: 0.8;
    margin-left: auto;
}

.mv-claim-note {
    font-size: 12px;
    font-style: italic;
    opacity: 0.7;
}

.mv-claim-shipping-fee {
    margin-left: auto;
}

/* Loading state for claim button */
.mv-claim-shipping-fee.loading {
    opacity: 0.6;
    pointer-events: none;
}

.mv-claim-shipping-fee.loading::after {
    content: '...';
    animation: loading-dots 1.5s infinite;
}

@keyframes loading-dots {
    0%, 20% { content: '.'; }
    40% { content: '..'; }
    60%, 100% { content: '...'; }
}



.mv-vendor-badges {
            display: inline-flex;
            align-items: center;
            gap: 4px;
        }
        .mv-badge {
            transition: transform 0.2s;
        }
        .mv-badge:hover {
            transform: scale(1.1);
        }
        .mv-badge-verification {
            filter: drop-shadow(0 0 2px rgba(0, 123, 255, 0.3));
        }
        .mv-badge-featured {
            filter: drop-shadow(0 0 2px rgba(255, 193, 7, 0.3));
        }
        .mv-badge-premium {
            filter: drop-shadow(0 0 2px rgba(111, 66, 193, 0.3));
        }
        .mv-badge-achievement {
            filter: drop-shadow(0 0 3px rgba(40, 167, 69, 0.5));
        }
        .vendor-name .mv-vendor-badges {
            margin-left: 8px;
        }
        .badge-tooltip {
            position: relative;
            display: inline-block;
        }
        .badge-tooltip:hover::after {
            content: attr(title);
            position: absolute;
            bottom: 100%;
            left: 50%;
            transform: translateX(-50%);
            background: #333;
            color: #fff;
            padding: 4px 8px;
            border-radius: 3px;
            font-size: 12px;
            white-space: nowrap;
            z-index: 1000;
        }

/* First-tap background loading for app-style vendor dashboard tabs. */
.mv-dashboard .mv-tab-load-status {
    position: sticky;
    top: max(8px, env(safe-area-inset-top));
    z-index: 120;
    display: flex;
    align-items: center;
    gap: 12px;
    width: min(100%, 520px);
    margin: 0 auto 14px;
    padding: 12px 14px;
    color: #fff;
    background: rgba(21, 23, 27, 0.96);
    border: 1px solid rgba(255, 106, 0, 0.48);
    border-radius: 12px;
    box-shadow: 0 12px 34px rgba(0, 0, 0, 0.32);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    animation: mv-dashboard-status-in 0.18s ease-out;
}

.mv-dashboard .mv-tab-load-status-spinner {
    width: 22px;
    height: 22px;
    flex: 0 0 22px;
    border: 3px solid rgba(255, 255, 255, 0.2);
    border-top-color: #ff6a00;
    border-radius: 50%;
    animation: mv-dashboard-tab-spin 0.65s linear infinite;
}

.mv-dashboard .mv-tab-load-status-copy {
    display: grid;
    gap: 2px;
    min-width: 0;
}

.mv-dashboard .mv-tab-load-status-copy strong {
    color: #fff;
    font-size: 13px;
    line-height: 1.3;
}

.mv-dashboard .mv-tab-load-status-copy small {
    color: #aab0b9;
    font-size: 11px;
    line-height: 1.35;
}

.mv-dashboard .mv-tab-loader {
    width: 14px;
    height: 14px;
    margin-left: auto;
    flex: 0 0 14px;
    border: 2px solid rgba(255, 255, 255, 0.28);
    border-top-color: #ff6a00;
    border-radius: 50%;
    animation: mv-dashboard-tab-spin 0.65s linear infinite;
}

.mv-dashboard .mv-tab.mv-tab-is-loading {
    cursor: wait;
}

@keyframes mv-dashboard-tab-spin {
    to { transform: rotate(360deg); }
}

@keyframes mv-dashboard-status-in {
    from { opacity: 0; transform: translateY(-6px); }
    to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 768px) {
    .mv-dashboard .mv-tab-load-status {
        top: max(6px, env(safe-area-inset-top));
        width: 100%;
        margin-bottom: 10px;
        border-radius: 10px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .mv-dashboard .mv-tab-load-status,
    .mv-dashboard .mv-tab-load-status-spinner,
    .mv-dashboard .mv-tab-loader {
        animation-duration: 0.001ms;
    }
}

/* MV Core 2.9.1.5.31 — scoped IKỌBỌ description drafting controls. */
#mv-add-product-form .mv-ikobo-description-tools {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 9px 12px;
    margin-top: 9px;
}

#mv-add-product-form .mv-ikobo-description-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 38px;
    padding: 8px 13px;
    border: 1px solid rgba(255, 106, 0, 0.48);
    border-radius: 9px;
    background: rgba(255, 106, 0, 0.08);
    color: #ff7a1a;
    font: inherit;
    font-size: 12px;
    font-weight: 800;
    cursor: pointer;
    transition: border-color .18s ease, background .18s ease, color .18s ease;
}

#mv-add-product-form .mv-ikobo-description-btn:hover,
#mv-add-product-form .mv-ikobo-description-btn:focus-visible {
    border-color: #ff6a00;
    background: rgba(255, 106, 0, 0.14);
    color: #ff8a3d;
    outline: none;
}

#mv-add-product-form .mv-ikobo-description-btn:disabled {
    opacity: .72;
    cursor: wait;
}

#mv-add-product-form .mv-ikobo-description-status {
    flex: 1 1 240px;
    margin: 0;
    color: #8f97a1;
    font-size: 11px;
    line-height: 1.45;
}

#mv-add-product-form .mv-ikobo-description-status.is-working { color: #c5cbd3; }
#mv-add-product-form .mv-ikobo-description-status.is-success { color: #74c98f; }
#mv-add-product-form .mv-ikobo-description-status.is-error { color: #ff9b86; }

@media (max-width: 520px) {
    #mv-add-product-form .mv-ikobo-description-btn {
        width: 100%;
    }
}

