/* =========================================================
   MV Personal Warehouse
   ========================================================= */

.mv-warehouse-wrap { max-width: 100%; }

/* Header */
.mv-warehouse-header { margin-bottom: 16px; }
.mv-warehouse-title  { font-size: 24px; margin: 0 0 6px; color: #1d2327; }
.mv-warehouse-subtitle { margin: 0; color: #50575e; font-size: 14px; }

/* Info box */
.mv-warehouse-info-box {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    background: #f0f6fc;
    border: 1px solid #c3d9ef;
    border-radius: 8px;
    padding: 14px 16px;
    margin-bottom: 22px;
}
.mv-warehouse-info-box .mv-info-icon { font-size: 18px; color: #2271b1; flex-shrink: 0; margin-top: 1px; }
.mv-warehouse-info-box strong { display: block; margin-bottom: 4px; color: #1d2327; font-size: 13px; }
.mv-warehouse-info-box p { margin: 0; color: #50575e; font-size: 13px; line-height: 1.5; }

/* Layout — single column, no sidebar */
.mv-warehouse-wrap { max-width: 860px; }

/* Order cards */
.mv-order-card {
    background: #fff;
    border: 1px solid #dcdcde;
    border-radius: 8px;
    margin-bottom: 14px;
    overflow: hidden;
    box-shadow: 0 1px 2px rgba(0,0,0,.04);
}

/* Card header */
.mv-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    border-bottom: 1px solid #f0f0f1;
    flex-wrap: wrap;
    gap: 8px;
}
.mv-card-header-left  { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.mv-card-header-right { display: flex; align-items: center; gap: 12px; }
.mv-order-num  { font-size: 15px; font-weight: 600; color: #1d2327; }
.mv-order-date { color: #646970; font-size: 13px; }

/* Badges */
.mv-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    line-height: 1.5;
}
.mv-badge--partial  { background: #fcf0ce; color: #8b6400; border: 1px solid #f0d06c; }
.mv-badge--backorder { background: #f0f6fc; color: #2271b1; border: 1px solid #c3d9ef; }
.mv-badge--instock  { background: #edfaef; color: #00a32a; border: 1px solid #b8e6bf; }

/* Paid label */
.mv-paid-label { display: flex; align-items: center; gap: 4px; color: #00a32a; font-size: 13px; font-weight: 500; }
.mv-tick { font-size: 13px; }

/* Details toggle */
.mv-details-btn {
    background: none;
    border: none;
    padding: 0;
    font-size: 13px;
    color: #2271b1;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-family: inherit;
}
.mv-details-btn:hover { color: #135e96; }
.mv-details-btn .mv-chevron { font-size: 10px; display: inline-block; transition: transform 0.2s; }
.mv-details-btn.is-open .mv-chevron { transform: rotate(180deg); }

/* Item row states */
.mv-item--waiting   { opacity: 0.75; }
.mv-item--requested { opacity: 0.65; }

/* Requested label (replaces checkbox) */
.mv-requested-label {
    display: inline-block;
    font-size: 11px;
    color: #2271b1;
    background: #f0f6fc;
    border: 1px solid #c3d9ef;
    border-radius: 3px;
    padding: 3px 8px;
    white-space: nowrap;
    font-weight: 500;
}

/* Card body */
.mv-card-body { padding-bottom: 14px; }

/* Items table */
.mv-items-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.mv-items-table thead tr { background: #f6f7f7; }
.mv-items-table th {
    padding: 9px 12px;
    text-align: left;
    font-weight: 600;
    color: #1d2327;
    font-size: 12px;
    white-space: nowrap;
    border-bottom: 1px solid #dcdcde;
}
.mv-items-table td {
    padding: 12px;
    vertical-align: middle;
    border-bottom: 1px solid #f0f0f1;
    color: #1d2327;
}
.mv-items-table tbody tr:last-child td { border-bottom: none; }
.mv-item-row.mv-item--unavailable { opacity: 0.65; }

/* Article column */
.mv-col-article { min-width: 180px; }
.mv-article-wrap { display: flex; align-items: center; gap: 10px; }
.mv-item-thumb {
    width: 46px;
    height: 46px;
    flex-shrink: 0;
    border: 1px solid #dcdcde;
    border-radius: 4px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f6f7f7;
}
.mv-item-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.mv-thumb-placeholder {
    width: 100%;
    height: 100%;
    position: relative;
    background: #dcdcde;
}
.mv-thumb-placeholder::before,
.mv-thumb-placeholder::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 55%;
    height: 1px;
    background: #a7aaad;
}
.mv-thumb-placeholder::before { transform: translate(-50%, -50%) rotate(45deg); }
.mv-thumb-placeholder::after  { transform: translate(-50%, -50%) rotate(-45deg); }

.mv-item-info { display: flex; flex-direction: column; gap: 3px; }
.mv-item-name { font-weight: 500; color: #1d2327; line-height: 1.4; }
.mv-item-sku  { color: #646970; font-size: 12px; }

/* Status column */
.mv-col-status { min-width: 160px; }
.mv-status-wrap { display: flex; align-items: flex-start; gap: 8px; }
.mv-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    flex-shrink: 0;
    margin-top: 4px;
}
.mv-dot--green { background: #00a32a; }
.mv-dot--amber { background: #dba617; }
.mv-dot--red   { background: #d63638; }
.mv-status-text { display: flex; flex-direction: column; gap: 2px; }
.mv-status-main { color: #1d2327; font-weight: 500; }
.mv-status-sub  { color: #50575e; font-size: 12px; }

/* Select column */
.mv-col-select { text-align: center; width: 50px; }
.mv-item-checkbox { width: 16px; height: 16px; cursor: pointer; accent-color: #2271b1; }
input[type="checkbox"]:disabled { cursor: not-allowed; opacity: 0.4; }
.mv-not-ready-label { color: #a7aaad; font-size: 16px; }

/* Request bar (appears below items table when items checked) */
.mv-request-bar {
    margin-top: 16px;
    display: flex;
    justify-content: flex-end;
}

/* Success state */
.mv-request-success {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #edfaef;
    border: 1px solid #b8e6bf;
    border-radius: 6px;
    padding: 12px 14px;
    font-size: 13px;
    color: #00a32a;
    font-weight: 500;
}
.mv-success-icon { font-size: 16px; }

/* Load more */
.mv-load-more-wrap { display: flex; justify-content: center; margin-top: 6px; margin-bottom: 4px; }
.mv-load-more-btn {
    background: #fff;
    border: 1px solid #dcdcde;
    border-radius: 4px;
    padding: 9px 24px;
    font-size: 13px;
    color: #1d2327;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: background 0.15s;
    font-family: inherit;
}
.mv-load-more-btn:hover:not(:disabled) { background: #f6f7f7; }
.mv-load-more-btn:disabled { opacity: 0.6; cursor: not-allowed; }

.mv-empty-state { color: #50575e; padding: 16px 0; }

/* ---- Ready section ---- */
.mv-ready-section {
    background: #fff;
    border: 1px solid #b8e6bf;
    border-radius: 8px;
    padding: 20px 22px;
    margin-bottom: 28px;
    box-shadow: 0 1px 3px rgba(0,0,0,.05);
}
.mv-ready-title {
    font-size: 16px;
    font-weight: 600;
    color: #1d2327;
    margin: 0 0 14px;
}
.mv-ready-empty {
    display: flex;
    align-items: center;
    gap: 12px;
    color: #50575e;
    font-size: 14px;
}
.mv-ready-empty-icon { font-size: 22px; }
.mv-ready-empty p { margin: 0; }

.mv-ready-table { margin: 0; }

/* Order reference column inside ready table */
.mv-col-order { min-width: 110px; }
.mv-order-ref { font-weight: 600; color: #1d2327; font-size: 13px; }
.mv-order-date-small { color: #646970; font-size: 12px; }

/* Orders section heading */
.mv-orders-section-title {
    font-size: 15px;
    font-weight: 600;
    color: #1d2327;
    margin: 0 0 12px;
}

/* ---- Modal ---- */
.mv-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.55);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}
.mv-modal {
    background: #fff;
    border-radius: 10px;
    width: 100%;
    max-width: 520px;
    box-shadow: 0 8px 32px rgba(0,0,0,.18);
    display: flex;
    flex-direction: column;
    max-height: 90vh;
    overflow: hidden;
}
.mv-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px 16px;
    border-bottom: 1px solid #f0f0f1;
}
.mv-modal-title { font-size: 17px; font-weight: 600; color: #1d2327; margin: 0; }
.mv-modal-close {
    background: none;
    border: none;
    font-size: 22px;
    line-height: 1;
    color: #646970;
    cursor: pointer;
    padding: 0 4px;
}
.mv-modal-close:hover { color: #1d2327; }
.mv-modal-body {
    padding: 20px 24px;
    overflow-y: auto;
    flex: 1;
}
.mv-modal-intro { font-size: 13px; color: #50575e; margin: 0 0 10px; }
.mv-modal-item-list {
    margin: 0 0 20px 18px;
    padding: 0;
    font-size: 13px;
    color: #1d2327;
    line-height: 1.9;
}
.mv-modal-order-ref { color: #646970; font-size: 12px; }
.mv-modal-shipping-notice { font-size: 13px; color: #50575e; background: #f6f7f7; border-left: 3px solid #2271b1; padding: 8px 12px; margin: 0 0 16px; line-height: 1.6; }
.mv-modal-note-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #1d2327;
    margin-bottom: 6px;
}
.mv-required { color: #d63638; margin-left: 2px; }
.mv-modal-note {
    width: 100%;
    border: 1px solid #dcdcde;
    border-radius: 4px;
    padding: 10px 12px;
    font-size: 13px;
    font-family: inherit;
    resize: vertical;
    box-sizing: border-box;
    color: #1d2327;
    line-height: 1.5;
}
.mv-modal-note:focus { outline: 2px solid #2271b1; border-color: transparent; }
.mv-modal-note-hint { font-size: 12px; color: #646970; margin: 6px 0 0; }
.mv-modal-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    padding: 16px 24px;
    border-top: 1px solid #f0f0f1;
}
.mv-modal-cancel-btn {
    background: none;
    border: 1px solid #dcdcde;
    border-radius: 4px;
    padding: 9px 18px;
    font-size: 13px;
    color: #50575e;
    cursor: pointer;
    font-family: inherit;
}
.mv-modal-cancel-btn:hover { background: #f6f7f7; }
.mv-modal-submit-btn { min-width: 140px; }

.mv-proceed-btn {
    width: 100%;
    background: #1d2327;
    color: #fff;
    border: none;
    border-radius: 4px;
    padding: 12px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s;
    font-family: inherit;
}
.mv-proceed-btn:hover:not(:disabled) { background: #2c3338; }
.mv-proceed-btn:disabled { background: #a7aaad; cursor: not-allowed; }

/* ---- Request history ---- */
.mv-history-card {
    background: #fff;
    border: 1px solid #dcdcde;
    border-radius: 8px;
    padding: 16px 20px;
    margin-bottom: 12px;
    box-shadow: 0 1px 2px rgba(0,0,0,.04);
}
.mv-history-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}
.mv-history-date { font-size: 13px; color: #646970; }
.mv-history-badge {
    display: inline-block;
    padding: 2px 9px;
    border-radius: 3px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .3px;
}
.mv-history-badge--pending  { background: #fcf0ce; color: #8b6400; }
.mv-history-badge--resolved { background: #edfaef; color: #00a32a; }
.mv-history-order-ref { font-weight: 600; font-size: 13px; color: #1d2327; margin-bottom: 4px; }
.mv-history-item-list {
    margin: 0 0 8px 16px;
    padding: 0;
    font-size: 13px;
    color: #50575e;
    line-height: 1.8;
}
.mv-history-note {
    margin-top: 8px;
    font-size: 13px;
    color: #50575e;
    background: #f6f7f7;
    border-radius: 4px;
    padding: 8px 12px;
    line-height: 1.5;
}
.mv-history-note-label { font-weight: 600; color: #1d2327; margin-right: 6px; }

/* ---- Responsive ---- */

/* Wrap all tables so they scroll horizontally instead of overflowing */
.mv-table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }

@media (max-width: 768px) {
    .mv-warehouse-wrap { padding: 0 4px; }

    /* Card header: stack left/right blocks on narrow screens */
    .mv-card-header { flex-direction: column; align-items: flex-start; gap: 10px; }
    .mv-card-header-right { width: 100%; justify-content: space-between; }

    /* Ready section */
    .mv-ready-section { padding: 14px 12px; }
    .mv-ready-title { font-size: 14px; }

    /* Tables */
    .mv-items-table { font-size: 12px; min-width: 540px; }
    .mv-items-table th,
    .mv-items-table td { padding: 8px 10px; white-space: nowrap; }
    .mv-col-article { min-width: 160px; white-space: normal; }
    .mv-col-status  { min-width: 110px; white-space: normal; }

    /* Item thumb slightly smaller */
    .mv-item-thumb { width: 36px; height: 36px; }

    /* Proceed button full width */
    .mv-proceed-btn { font-size: 13px; padding: 11px 10px; }

    /* Request bar full width */
    .mv-request-bar { justify-content: stretch; }
    .mv-request-bar .mv-proceed-btn { width: 100%; }

    /* History cards */
    .mv-history-card { padding: 12px 14px; }
    .mv-history-header { flex-wrap: wrap; gap: 6px; }

    /* Modal */
    .mv-modal-overlay { align-items: flex-start; padding: 0; margin-top:35%; }
    .mv-modal {
        margin: 0;
        border-radius: 16px 16px 0 0;
        max-height: 85dvh;
        max-height: 85vh;
        width: 100%;
        max-width: 100%;
    }
    .mv-modal-header { padding: 16px 16px 12px; }
    .mv-modal-body   { padding: 14px 16px; overflow-y: auto; }
    .mv-modal-footer { padding: 12px 16px; flex-direction: column-reverse; gap: 8px; }
    .mv-modal-cancel-btn,
    .mv-modal-submit-btn { width: 100%; text-align: center; }
}

@media (max-width: 480px) {
    .mv-items-table { min-width: 480px; }
    .mv-card-header { padding: 12px; }
    .mv-order-num   { font-size: 14px; }
    .mv-info-box p  { font-size: 12px; }
}
