/* ================================================================
   Store MM — Workflow Frontend CSS (workflow.css)
   Used by: my-products-dev, my-products-live (designer view)
   Palette: #0a0a0a (black) · #c0392b (red) · #ffffff (white)
   ================================================================ */

/* ---- Wrapper ---------------------------------------------------------- */
.store-mm-workflow-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px 56px;
    font-family: inherit;
    color: #1a1a1a;
    box-sizing: border-box;
}
.store-mm-workflow-container *, .store-mm-workflow-container *::before, .store-mm-workflow-container *::after {
    box-sizing: inherit;
}

/* ---- Header ------------------------------------------------------------ */
.store-mm-workflow-header {
    margin-bottom: 20px;
    padding-bottom: 14px;
    border-bottom: 2px solid #0a0a0a;
}

.store-mm-workflow-header h1 {
    font-size: 26px;
    color: #0a0a0a;
    margin: 0 0 8px 0;
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 800;
    letter-spacing: -.02em;
}

.store-mm-workflow-header .store-mm-icon { font-size: 26px; }

.store-mm-workflow-description {
    font-size: 15px;
    color: #6b6b6b;
    margin: 0;
    line-height: 1.6;
}

/* ---- Role notices ------------------------------------------------------ */
.store-mm-role-notice {
    background: #fff;
    border-radius: 8px;
    padding: 20px 22px;
    margin-bottom: 28px;
    border-left: 4px solid #0a0a0a;
    box-shadow: 0 2px 8px rgba(0,0,0,.07);
}

.store-mm-notice-designer  { border-left-color: #0a0a0a; background: #fafafa; }
.store-mm-notice-moderator { border-left-color: #e67e22; background: #fffaf5; }
.store-mm-notice-admin     { border-left-color: #c0392b; background: #fff8f8; }

.store-mm-role-notice h3 {
    margin: 0 0 6px 0;
    color: #0a0a0a;
    font-size: 15px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
}

.store-mm-role-notice p {
    margin: 0;
    color: #555;
    line-height: 1.5;
    font-size: .9rem;
}

/* ---- Filters ----------------------------------------------------------- */
.store-mm-workflow-filters {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
    padding: 20px 22px;
    background: #fafafa;
    border-radius: 8px;
    border: 1px solid #e8e8e8;
}

/* compact dev filters (no search bar, just selects + action buttons) */
.smm-dev-filters {
    grid-template-columns: repeat(auto-fit, minmax(180px, max-content));
    align-items: end;
    padding: 14px 18px;
}
.store-mm-filter-group--actions label { visibility: hidden; }
.store-mm-filter-group--actions .store-mm-filter-inline { display: flex; gap: 8px; }

.store-mm-filter-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.store-mm-filter-group label {
    font-weight: 700;
    color: #0a0a0a;
    font-size: .75rem;
    text-transform: uppercase;
    letter-spacing: .06em;
}

.store-mm-filter-select,
.store-mm-search-input {
    padding: 10px 14px;
    border: 1px solid #d8d8d8;
    border-radius: 6px;
    font-size: 14px;
    color: #1a1a1a;
    background: #fff;
    transition: border-color .15s ease, box-shadow .15s ease;
    font-family: inherit;
}

.store-mm-filter-select:focus,
.store-mm-search-input:focus {
    outline: none;
    border-color: #0a0a0a;
    box-shadow: 0 0 0 3px rgba(10,10,10,.08);
}

/* ---- Buttons ----------------------------------------------------------- */
.store-mm-button {
    padding: 10px 22px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    border: none;
    transition: background .15s ease, box-shadow .15s ease, opacity .15s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    letter-spacing: .01em;
    line-height: 1.3;
}

.store-mm-button-primary {
    background: #0a0a0a;
    color: #fff;
}
.store-mm-button-primary:hover:not(:disabled) {
    background: #333;
    box-shadow: 0 4px 12px rgba(0,0,0,.2);
}

.store-mm-button-secondary {
    background: #f5f5f5;
    color: #1a1a1a;
    border: 1px solid #d8d8d8;
}
.store-mm-button-secondary:hover:not(:disabled) {
    background: #ebebeb;
}

.store-mm-button:disabled {
    opacity: .5;
    cursor: not-allowed;
}

/* ---- Table ------------------------------------------------------------- */
.store-mm-workflow-table-container {
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 24px;
    border: 1px solid #e8e8e8;
    box-shadow: 0 2px 8px rgba(0,0,0,.05);
}

.store-mm-workflow-table {
    width: 100%;
    border-collapse: collapse;
}

.store-mm-workflow-table th {
    background: #fafafa;
    padding: 14px 18px;
    text-align: left;
    font-weight: 700;
    color: #8a8a8a;
    border-bottom: 2px solid #f0f0f0;
    font-size: .72rem;
    text-transform: uppercase;
    letter-spacing: .06em;
    white-space: nowrap;
}

.store-mm-workflow-table td {
    padding: 16px 18px;
    border-bottom: 1px solid #f0f0f0;
    vertical-align: middle;
    color: #1a1a1a;
    font-size: .88rem;
}

.store-mm-workflow-table tbody tr.smm-wf-product-row:hover td { background: #fafafa; }
.store-mm-workflow-table tr:last-child td { border-bottom: none; }

/* ---- State badges ------------------------------------------------------ */
.store-mm-state-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: .7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .05em;
    white-space: nowrap;
}

.state-submitted           { background: #f0f0f0; color: #1a1a1a; }
.state-changes_requested   { background: #fff0e0; color: #a05000; }
.state-prototyping         { background: #0a0a0a; color: #fff; }
.state-prototype_validation{ background: #c0392b; color: #fff; }
.state-approved            { background: #e8f7ee; color: #1a7f4b; }
.state-rejected            { background: #ffeaea; color: #8b1a1a; }

/* ---- Action buttons ---------------------------------------------------- */
.store-mm-action-buttons {
    display: flex;
    gap: 7px;
    flex-wrap: wrap;
    align-items: center;
}

.store-mm-action-button {
    padding: 7px 14px;
    border-radius: 5px;
    font-size: .76rem;
    font-weight: 700;
    border: none;
    cursor: pointer;
    transition: background .15s ease, opacity .15s ease;
    text-transform: uppercase;
    letter-spacing: .03em;
    line-height: 1.3;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    white-space: nowrap;
    text-decoration: none;
}

.store-mm-action-button:hover:not(:disabled) {
    opacity: .85;
}

.store-mm-action-button:disabled {
    opacity: .45;
    cursor: not-allowed;
}

/* Individual action colours */
.action-changes     { background: #fff0e0; color: #a05000; border: 1px solid #f5d8b0; }
.action-prototyping { background: #f0f0f0; color: #1a1a1a; border: 1px solid #d8d8d8; }
.action-approve     { background: #e8f7ee; color: #1a7f4b; border: 1px solid #b8e8cc; }
.action-reject      { background: #ffeaea; color: #8b1a1a; border: 1px solid #f5c0c0; }
.action-edit        { background: #0a0a0a; color: #fff; border: 1px solid #0a0a0a; }
.action-view        { background: #f5f5f5; color: #1a1a1a; border: 1px solid #d8d8d8; }
.action-set-price   { background: #0a0a0a; color: #fff; border: 1px solid #0a0a0a; }
.action-pipeline    { background: #0a0a0a; color: #fff; border: 1px solid #0a0a0a; }
.action-pipeline.is-active { background: #c0392b; border-color: #c0392b; }

/* ---- Pipeline drawer row ----------------------------------------------- */
.smm-wf-pipeline-row .smm-wf-pipeline-cell {
    padding: 0;
    border-bottom: 2px solid #e8e8e8;
    background: #f7f7f7;
}

.smm-wf-pipeline-row .psm-pl-wrap {
    margin: 0;
    border-radius: 0;
    border: none;
    background: #f7f7f7;
    padding: 20px 24px;
}

/* ---- Pagination -------------------------------------------------------- */
.store-mm-workflow-pagination {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background: #fafafa;
    border-radius: 8px;
    border: 1px solid #e8e8e8;
}

.store-mm-pagination-info {
    font-size: .83rem;
    color: #6b6b6b;
    font-weight: 500;
}

/* ---- Modal ------------------------------------------------------------- */
.store-mm-modal {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.65);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 20px;
}

.store-mm-modal-content {
    background: #fff;
    border-radius: 10px;
    width: 90%;
    max-width: 580px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,.25);
    animation: smm-modal-fade .25s ease;
}

@keyframes smm-modal-fade {
    from { opacity: 0; transform: translateY(-16px); }
    to   { opacity: 1; transform: translateY(0);     }
}

.store-mm-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid #f0f0f0;
    position: sticky;
    top: 0;
    background: #fff;
    z-index: 1;
}

.store-mm-modal-header h3 {
    margin: 0;
    font-size: 18px;
    color: #0a0a0a;
    font-weight: 700;
}

.store-mm-modal-close {
    background: none;
    border: none;
    font-size: 26px;
    color: #8a8a8a;
    cursor: pointer;
    padding: 0;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background .15s ease, color .15s ease;
}

.store-mm-modal-close:hover { background: #f0f0f0; color: #0a0a0a; }

.store-mm-modal-body { padding: 24px; }

.store-mm-modal-field { margin-bottom: 20px; }

.store-mm-modal-field label {
    display: block;
    margin-bottom: 7px;
    font-weight: 700;
    color: #0a0a0a;
    font-size: .83rem;
    text-transform: uppercase;
    letter-spacing: .04em;
}

.store-mm-modal-field .store-mm-input,
.store-mm-modal-field .store-mm-textarea,
.store-mm-modal-field .store-mm-select {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #d8d8d8;
    border-radius: 6px;
    font-size: 14px;
    color: #1a1a1a;
    background: #fff;
    transition: border-color .15s ease, box-shadow .15s ease;
    font-family: inherit;
}

.store-mm-modal-field .store-mm-input:focus,
.store-mm-modal-field .store-mm-textarea:focus,
.store-mm-modal-field .store-mm-select:focus {
    outline: none;
    border-color: #0a0a0a;
    box-shadow: 0 0 0 3px rgba(10,10,10,.08);
}

.store-mm-modal-field .store-mm-textarea {
    min-height: 90px;
    resize: vertical;
}

.store-mm-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 20px 24px;
    border-top: 1px solid #f0f0f0;
    position: sticky;
    bottom: 0;
    background: #fff;
}

/* ---- Loading / error --------------------------------------------------- */
.store-mm-loading-row {
    text-align: center;
    padding: 56px 20px !important;
}

.store-mm-spinner {
    display: inline-block;
    width: 22px;
    height: 22px;
    border: 3px solid #f0f0f0;
    border-top-color: #0a0a0a;
    border-radius: 50%;
    animation: smm-spin .9s linear infinite;
    margin-right: 12px;
    vertical-align: middle;
}

@keyframes smm-spin {
    to { transform: rotate(360deg); }
}

.store-mm-error-box {
    background: #fff8f8;
    border: 1px solid #f5c0c0;
    border-radius: 8px;
    padding: 28px;
    text-align: center;
}

.store-mm-error-box h3 { color: #c0392b; margin: 0 0 12px; font-size: 18px; }
.store-mm-error-box p  { margin: 8px 0; color: #555; line-height: 1.6; }

/* ---- File modal -------------------------------------------------------- */
.store-mm-files-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 12px;
    margin-top: 12px;
}

.store-mm-file-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px;
    background: #fafafa;
    border-radius: 7px;
    border: 1px solid #e8e8e8;
}

.store-mm-file-thumb,
.store-mm-file-icon {
    width: 52px;
    height: 52px;
    border-radius: 5px;
    overflow: hidden;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.store-mm-file-thumb img { max-width: 100%; max-height: 100%; object-fit: contain; }
.store-mm-file-icon { font-size: 28px; }

.store-mm-file-info { flex: 1; min-width: 0; }
.store-mm-file-name { font-weight: 600; color: #0a0a0a; margin-bottom: 3px; word-break: break-word; font-size: .85rem; }
.store-mm-file-meta { font-size: .75rem; color: #8a8a8a; }

.store-mm-file-actions { display: flex; flex-direction: column; gap: 5px; }

.store-mm-button-small { padding: 5px 11px; font-size: .75rem; }

/* ---- Notes box --------------------------------------------------------- */
.store-mm-notes-box {
    background: #fafafa;
    border-radius: 7px;
    padding: 16px 18px;
    border-left: 4px solid #c0392b;
}

.store-mm-notes-box h4 { margin: 0 0 8px; color: #0a0a0a; font-size: .9rem; font-weight: 700; }
.store-mm-notes-box p  { margin: 0; color: #444; line-height: 1.5; white-space: pre-wrap; font-size: .88rem; }

/* ---- Upload zone ------------------------------------------------------- */
.store-mm-upload-zone {
    border: 2px dashed #c8c8c8;
    border-radius: 7px;
    padding: 28px 20px;
    text-align: center;
    cursor: pointer;
    transition: border-color .15s ease, background .15s ease;
    margin-bottom: 14px;
}

.store-mm-upload-zone:hover { border-color: #0a0a0a; background: #fafafa; }

.store-mm-upload-placeholder { color: #6b6b6b; }
.store-mm-upload-icon { font-size: 32px; display: block; margin-bottom: 8px; }
.store-mm-upload-placeholder p { margin: 0 0 5px; font-size: .88rem; font-weight: 600; }
.store-mm-upload-subtext { font-size: .75rem; color: #9a9a9a; }

.store-mm-upload-preview {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
    gap: 8px;
    margin-bottom: 14px;
}

.store-mm-upload-preview-item {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 5px;
    padding: 8px;
    text-align: center;
    position: relative;
}

.store-mm-upload-preview-item img { max-width: 100%; height: 56px; object-fit: contain; margin-bottom: 6px; }
.store-mm-upload-preview-name { font-size: .69rem; color: #333; word-break: break-all; }

.store-mm-upload-preview-remove {
    position: absolute;
    top: -6px;
    right: -6px;
    width: 18px;
    height: 18px;
    background: #c0392b;
    color: #fff;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    font-size: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ---- Misc -------------------------------------------------------------- */
.store-mm-hint {
    font-size: .75rem;
    color: #8a8a8a;
    margin-top: 4px;
    line-height: 1.4;
}

.store-mm-input-with-prefix { position: relative; display: flex; align-items: center; }
.store-mm-input-with-prefix .store-mm-input { padding-left: 38px; }
.store-mm-input-prefix { position: absolute; left: 14px; font-weight: 700; color: #0a0a0a; font-size: .88rem; }

.store-mm-no-actions { font-size: .77rem; color: #b0b0b0; }

/* ================================================================
   Live products card list  (.smm-lv-*)
   Shares thumbnail + card shell from all-products-dev.css
   ================================================================ */

.smm-lv-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 24px;
}

/* filter row inline */
.store-mm-filter-inline {
    display: flex;
    gap: 8px;
    align-items: center;
}
.store-mm-filter-inline .store-mm-search-input { flex: 1; }

/* card overrides specific to live view */
.smm-lv-card .smm-apd-card__content {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* meta chips row */
.smm-lv-card__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
    margin-top: 2px;
}

.smm-lv-card__meta-chip {
    font-size: .72rem;
    color: #6b6b6b;
    background: #f5f5f5;
    border-radius: 4px;
    padding: 2px 8px;
    border: 1px solid #ebebeb;
}

.smm-lv-card__num {
    font-size: .72rem;
    color: #9a9a9a;
    font-variant-numeric: tabular-nums;
    letter-spacing: .02em;
}

/* price */
.smm-lv-card__price {
    font-size: .9rem;
    font-weight: 700;
    color: #c0392b;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}
.smm-lv-card__price--proposed {
    color: #9a9a9a;
    font-style: italic;
    font-weight: 500;
}

/* metrics row */
.smm-lv-card__metrics {
    display: flex;
    gap: 24px;
    align-items: baseline;
    padding: 10px 0;
    border-top: 1px solid #f0f0f0;
    border-bottom: 1px solid #f0f0f0;
}

.smm-lv-metric {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.smm-lv-metric__val {
    font-size: .92rem;
    font-weight: 700;
    color: #0a0a0a;
    font-variant-numeric: tabular-nums;
}

.smm-lv-metric__val--date {
    font-size: .78rem;
    font-weight: 600;
}

.smm-lv-metric__lbl {
    font-size: .62rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .07em;
    color: #9a9a9a;
}

/* action buttons row */
.smm-lv-card__actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
}

.smm-lv-btn {
    padding: 7px 16px;
    border-radius: 5px;
    font-size: .74rem;
    font-weight: 700;
    letter-spacing: .05em;
    text-transform: uppercase;
    border: none;
    cursor: pointer;
    transition: background .15s ease, opacity .15s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    white-space: nowrap;
    line-height: 1.3;
}

.smm-lv-btn--primary {
    background: #0a0a0a;
    color: #fff;
}
.smm-lv-btn--primary:hover { background: #333; color: #fff; text-decoration: none; }

.smm-lv-btn--outline {
    background: #fff;
    color: #1a1a1a;
    border: 1px solid #d8d8d8;
}
.smm-lv-btn--outline:hover { background: #f5f5f5; color: #1a1a1a; text-decoration: none; }

.smm-lv-btn--danger {
    background: #ffeaea;
    color: #8b1a1a;
    border: 1px solid #f5c0c0;
}
.smm-lv-btn--danger:hover { background: #ffd5d5; }

/* loading / empty states */
.smm-mypd-loading-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 48px 20px;
    color: #6b6b6b;
    font-size: .9rem;
}
.smm-mypd-empty {
    text-align: center;
    padding: 48px 20px;
    color: #9a9a9a;
    font-size: .9rem;
}

/* ================================================================
   Responsive
   ================================================================ */
@media (max-width: 768px) {
    .store-mm-workflow-container { padding: 0 12px 40px; }
    .store-mm-workflow-header h1 { font-size: 21px; }
    .store-mm-workflow-filters { grid-template-columns: 1fr; padding: 16px; }
    .store-mm-workflow-table th,
    .store-mm-workflow-table td { padding: 12px 14px; font-size: .82rem; }
    .store-mm-action-buttons { flex-direction: column; gap: 5px; }
    .store-mm-action-button { width: 100%; text-align: center; justify-content: center; }
    .store-mm-workflow-pagination { flex-direction: column; gap: 12px; text-align: center; }
    .store-mm-files-grid { grid-template-columns: 1fr; }
    .store-mm-modal-content { width: 95%; max-height: 95vh; }
    .smm-wf-pipeline-row .psm-pl-wrap { padding: 16px 12px; }
    .smm-lv-card__metrics { gap: 14px; flex-wrap: wrap; }
    .smm-lv-card__actions { flex-wrap: wrap; }
    .smm-lv-btn { flex: 1 1 auto; justify-content: center; }
    .store-mm-filter-inline { flex-wrap: wrap; }
}
