/* Astra (or an Astra addon) constrains the entire My Account content
   area to max-width: 540px via .woocommerce-account .entry-content
   .woocommerce — confirmed directly in browser dev tools (disabling
   that one declaration fixed the whole page, including the unrelated
   Addresses tab). 540px is too narrow for a two-column address layout
   or a multi-column table alike. max-width:100% rather than a fixed
   pixel value, so this fills whatever the theme's own outer container
   width actually is rather than guessing a number. */
.woocommerce-account .entry-content .woocommerce {
    max-width: 100% !important;
}

/* Consignment Button */
.wccs-consignment-button-wrapper {
    margin: 10px 0;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: #f9f9f9;
}

.wccs-consignment-button-wrapper .wccs-message {
    margin-top: 10px;
    padding: 10px;
    border-radius: 4px;
}

.wccs-consignment-button-wrapper .wccs-message.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.wccs-consignment-button-wrapper .wccs-message.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.wccs-add-to-consignment {
    margin-right: 10px !important;
}

/* Consignment Cart */
.wccs-consignment-cart {
    max-width: 1200px;
    margin: 20px auto;
    padding: 20px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.wccs-consignment-cart h2 {
    margin-top: 0;
    border-bottom: 2px solid #333;
    padding-bottom: 10px;
}

.wccs-status {
    display: inline-block;
    padding: 5px 15px;
    margin: 10px 0;
    background: #f0f0f0;
    border-radius: 20px;
    font-weight: bold;
}

.wccs-cart-table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
}

.wccs-cart-table th {
    background: #f8f8f8;
    padding: 12px;
    text-align: left;
    font-weight: bold;
    border-bottom: 2px solid #ddd;
}

.wccs-cart-table td {
    padding: 12px;
    border-bottom: 1px solid #ddd;
    vertical-align: middle;
}

.wccs-cart-table tfoot td {
    border-top: 2px solid #333;
    font-weight: bold;
    padding: 15px 12px;
}

.wccs-cart-table input[type="number"] {
    width: 70px;
    padding: 5px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.wccs-total-label {
    text-align: right;
    padding-right: 20px;
}

.wccs-total-value {
    font-size: 1.2em;
    color: #007cba;
}

.wccs-actions {
    margin: 20px 0;
    padding: 20px 0;
    border-top: 1px solid #ddd;
}

.wccs-actions .button {
    margin-right: 10px;
}

.wccs-approved-consignment {
    margin: 20px 0;
}

.wccs-split-group {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 6px;
}

.wccs-split-group label {
    display: flex;
    flex-direction: column;
    font-size: 0.8em;
    color: #555;
    gap: 2px;
}

.wccs-split-input {
    width: 60px;
    padding: 4px;
    text-align: center;
}

.wccs-split-quickfill {
    display: flex;
    gap: 6px;
    margin-bottom: 4px;
}

.wccs-split-quickfill button {
    font-size: 0.75em;
    padding: 2px 8px;
    background: #f0f0f0;
    border: 1px solid #ccc;
    border-radius: 3px;
    cursor: pointer;
}

.wccs-split-quickfill button:hover {
    background: #e0e0e0;
}

.wccs-split-remaining {
    font-size: 0.8em;
    font-weight: 600;
}

.wccs-remaining-ok {
    color: #2e8b2e;
}

.wccs-remaining-error {
    color: #dc3545;
}

#wccs-reconcile-submit:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.wccs-remove-item {
    background: none;
    border: none;
    color: #dc3545;
    cursor: pointer;
    text-decoration: underline;
    font-size: 0.9em;
    padding: 0;
}

.wccs-remove-item:hover {
    color: #a71d2a;
}

.wccs-saving-indicator {
    font-size: 0.85em;
    color: #666;
    margin: 8px 0 0;
    text-align: right;
}

.wccs-spinner {
    display: inline-block;
    width: 12px;
    height: 12px;
    border: 2px solid #ddd;
    border-top-color: #007cba;
    border-radius: 50%;
    animation: wccs-spin 0.6s linear infinite;
    vertical-align: middle;
    margin-right: 6px;
}

@keyframes wccs-spin {
    to { transform: rotate(360deg); }
}

#wccs-cart-items-body tr.wccs-row-removing {
    opacity: 0.4;
    transition: opacity 0.15s ease;
}

.wccs-pending-consignment {
    margin: 20px 0;
    padding: 20px;
    background: #fff9e6;
    border: 1px solid #ffe58f;
    border-radius: 4px;
}

.wccs-pending-consignment > p:first-child {
    margin-top: 0;
    font-size: 1.05em;
}

.wccs-sell-quantity {
    width: 60px;
    padding: 5px;
    border: 1px solid #ddd;
    border-radius: 4px;
    margin-right: 5px;
}

.wccs-sell-item {
    background: #28a745 !important;
    border-color: #28a745 !important;
    color: #fff !important;
}

.wccs-sell-item:hover {
    background: #218838 !important;
    border-color: #1e7e34 !important;
}

/* History */
.wccs-history {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 2px solid #eee;
}

.wccs-history h3 {
    margin-top: 0;
}

.wccs-history-list {
    list-style: none;
    padding: 0;
    max-height: 300px;
    overflow-y: auto;
}

.wccs-history-list li {
    padding: 8px 12px;
    border-bottom: 1px solid #f0f0f0;
}

.wccs-history-date {
    color: #666;
    font-size: 0.9em;
}

.wccs-history-status {
    display: inline-block;
    padding: 2px 8px;
    margin: 0 5px;
    background: #f0f0f0;
    border-radius: 10px;
    font-size: 0.9em;
}

.wccs-history-note {
    color: #555;
}

/* Status Badges */
.wccs-status-badge {
    display: inline-block;
    padding: 3px 12px;
    border-radius: 20px;
    font-size: 0.85em;
    font-weight: bold;
}

.status-draft {
    background: #f8f9fa;
    color: #6c757d;
}

.status-pending {
    background: #fff3cd;
    color: #856404;
}

.status-approved {
    background: #d4edda;
    color: #155724;
}

.status-partially_completed {
    background: #cce5ff;
    color: #004085;
}

.status-completed {
    background: #28a745;
    color: #fff;
}

.status-cancelled {
    background: #dc3545;
    color: #fff;
}

/* Responsive */
@media (max-width: 768px) {
    .wccs-cart-table {
        font-size: 0.9em;
    }
    
    .wccs-cart-table th,
    .wccs-cart-table td {
        padding: 8px;
    }
    
    .wccs-cart-table input[type="number"] {
        width: 50px;
    }
    
    .wccs-actions .button {
        display: block;
        width: 100%;
        margin: 5px 0;
        text-align: center;
    }
}

/* Modal — replaces native alert()/confirm() throughout this file */
.wccs-modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.wccs-modal-box {
    background: #fff;
    border-radius: 6px;
    max-width: 420px;
    width: 100%;
    padding: 24px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

.wccs-modal-message {
    font-size: 15px;
    line-height: 1.5;
    color: #333;
    margin-bottom: 20px;
}

.wccs-modal-message a {
    font-weight: 600;
}

.wccs-modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* Small, fully explicit button style — matches the look of "Add to
   Consignment"/"Add All to Cart" (solid fill, bold text, rounded
   corners), just sized down for a modal or an inline action row. Every
   property is specified explicitly, on every side, rather than relying
   on the theme's own .button defaults — that partial inheritance was the
   root cause of both the vanishing-text-on-hover bug and the missing-
   left-border bug (the same missing-left-border pattern shows up on
   WooCommerce's own Orders page, confirming it's a theme-wide default,
   not something specific to any one button). */
.wccs-btn {
    display: inline-block;
    padding: 8px 22px;
    border: 2px solid transparent;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.4;
    cursor: pointer;
    text-decoration: none;
    text-align: center;
    transition: background 0.2s ease, border-color 0.2s ease, transform 0.15s ease;
}
.wccs-btn:hover {
    transform: translateY(-1px);
    text-decoration: none;
}
.wccs-btn:disabled {
    background: #ccc !important;
    border-color: #ccc !important;
    color: #888 !important;
    cursor: not-allowed;
    transform: none;
}

.wccs-btn-confirm {
    background: #46b450;
    border-color: #3a9b42;
    color: #fff;
}
.wccs-btn-confirm:hover {
    background: #3a9b42;
    border-color: #2f7d35;
    color: #fff;
}

.wccs-btn-cancel {
    background: #dc3232;
    border-color: #b32d2e;
    color: #fff;
}
.wccs-btn-cancel:hover {
    background: #b32d2e;
    border-color: #8a2222;
    color: #fff;
}

.wccs-btn-neutral {
    background: #f0f0f0;
    border-color: #ddd;
    color: #333;
}
.wccs-btn-neutral:hover {
    background: #e0e0e0;
    border-color: #999;
    color: #333;
}

/* My Consignment draft-view actions */
#wccs-send-request, #wccs-clear-all {
    padding: 10px 26px;
    font-size: 15px;
}

/* Shown when the "Add to Consignment" button (product page or wizard) is
   disabled because the user already has a non-draft consignment. */
.wccs-consignment-blocked-notice {
    font-size: 13px;
    color: #8a6300;
    background: #fff3cd;
    padding: 8px 12px;
    border-radius: 4px;
    margin-top: 8px;
    max-width: 400px;
}
.wccs-consignment-blocked-notice a {
    font-weight: 600;
}

.wccs-reconcile-bulk-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin: 12px 0 20px;
}
.wccs-reconcile-bulk-actions .wccs-btn {
    padding: 6px 14px;
    font-size: 13px;
}

.wccs-reconcile-filter-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 0 16px;
}
#wccs-reconcile-sku-filter {
    max-width: 220px;
    padding: 7px 10px;
}
.wccs-reconcile-filter-wrap .wccs-btn {
    padding: 6px 14px;
    font-size: 13px;
}
.wccs-reconcile-filter-count {
    font-size: 13px;
    color: #666;
}

.wccs-reconcile-export-actions {
    margin: 0 0 16px;
    display: flex;
    gap: 10px;
}

@media print {
    /* .woocommerce-MyAccount-navigation is WooCommerce's own standard
       class for the My Account sidebar — reliable across themes,
       including Astra. */
    .woocommerce-MyAccount-navigation,
    .wccs-reconcile-bulk-actions,
    .wccs-reconcile-filter-wrap,
    .wccs-reconcile-export-actions,
    .wccs-actions,
    #wccs-reconcile-body .wccs-split-group button {
        display: none !important;
    }
}
