/* ================================================================
   Smart Order List — Frontend Styles
   ================================================================ */

:root {
    --sol-radius:    8px;
    --sol-border:    #e2e8f0;
    --sol-header-bg: #f8fafc;
    --sol-hover-bg:  #f1f5f9;
    --sol-text:      #1e293b;
    --sol-muted:     #64748b;
    --sol-success:   #16a34a;
    --sol-danger:    #dc2626;
    --sol-sale:      #dc2626;
    --sol-shadow:    0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.06);
    --sol-transition: 0.2s ease;
}

/* ── Wrapper ──────────────────────────────────────────── */
.sol-wrapper {
    font-family: inherit;
    direction: rtl;
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 16px 80px;
    box-sizing: border-box;
}

.sol-title {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--sol-text);
    margin: 0 0 8px;
}

.sol-description {
    color: var(--sol-muted);
    margin: 0 0 24px;
    font-size: .95rem;
}

/* ── Notice ───────────────────────────────────────────── */
.sol-notice {
    padding: 12px 16px;
    border-radius: var(--sol-radius);
    margin-bottom: 20px;
    font-size: .92rem;
    font-weight: 500;
    border-right: 4px solid transparent;
}
.sol-notice--info    { background: #eff6ff; border-color: #3b82f6; color: #1d4ed8; }
.sol-notice--success { background: #f0fdf4; border-color: #22c55e; color: #15803d; }
.sol-notice--warning { background: #fffbeb; border-color: #f59e0b; color: #92400e; }

/* ── Accordion ────────────────────────────────────────── */
.sol-accordion {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.sol-accordion-item {
    border: 1px solid var(--sol-border);
    border-radius: var(--sol-radius);
    overflow: hidden;
    box-shadow: var(--sol-shadow);
    background: #fff;
}

.sol-accordion-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    padding: 14px 18px;
    background: var(--sol-header-bg);
    border: none;
    cursor: pointer;
    text-align: right;
    font-size: 1rem;
    font-weight: 600;
    color: var(--sol-text);
    transition: background var(--sol-transition);
    gap: 8px;
}
.sol-accordion-header:hover { background: #eef2f7; }

.sol-cat-name { flex: 1; }

.sol-cat-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.sol-badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 999px;
    color: #fff;
    font-size: .75rem;
    font-weight: 600;
    letter-spacing: .02em;
}

.sol-cat-count {
    font-size: .82rem;
    color: var(--sol-muted);
    font-weight: 400;
}

.sol-chevron {
    display: inline-block;
    transition: transform var(--sol-transition);
    font-size: 1rem;
    color: var(--sol-muted);
}
.sol-accordion-item.sol-open .sol-chevron { transform: rotate(180deg); }

/* ── Accordion body ───────────────────────────────────── */
.sol-accordion-body {
    overflow: hidden;
    transition: none;
}
.sol-accordion-body[hidden] { display: none; }

.sol-cat-desc {
    padding: 12px 18px 0;
    color: var(--sol-muted);
    font-size: .88rem;
    margin: 0;
}

/* ── Product Table ────────────────────────────────────── */
.sol-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.sol-product-table {
    width: 100%;
    border-collapse: collapse;
    font-size: .9rem;
}

.sol-product-table thead th {
    background: #f8fafc;
    padding: 10px 12px;
    text-align: right;
    font-weight: 600;
    color: var(--sol-muted);
    font-size: .78rem;
    text-transform: uppercase;
    letter-spacing: .04em;
    border-bottom: 1px solid var(--sol-border);
    white-space: nowrap;
}

.sol-product-table tbody tr {
    border-bottom: 1px solid var(--sol-border);
    transition: background var(--sol-transition);
}
.sol-product-table tbody tr:last-child { border-bottom: none; }
.sol-product-table tbody tr:hover { background: var(--sol-hover-bg); }
.sol-product-table tbody tr.sol-out-of-stock { opacity: .55; }

.sol-product-table td {
    padding: 10px 12px;
    vertical-align: middle;
    color: var(--sol-text);
}

/* column widths */
.col-img   { width: 56px; padding: 6px 8px 6px 0; }
.col-name  { min-width: 140px; }
.col-sku   { width: 80px; }
.col-stock { width: 70px; }
.col-price { width: 120px; white-space: nowrap; }
.col-qty   { width: 120px; }
.col-subtotal { width: 110px; white-space: nowrap; font-weight: 600; }

.sol-thumb {
    width: 44px;
    height: 44px;
    object-fit: cover;
    border-radius: 6px;
    display: block;
}

.sol-product-name { font-weight: 500; }
.sol-sku { color: var(--sol-muted); font-size: .82rem; }

.sol-stock { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: .78rem; font-weight: 600; }
.sol-stock--in  { background: #dcfce7; color: #15803d; }
.sol-stock--out { background: #fee2e2; color: #dc2626; }

.sol-price { font-weight: 600; }
del.sol-regular-price { color: var(--sol-muted); font-size: .82rem; display: block; text-decoration: line-through; }
ins.sol-sale-price    { color: var(--sol-sale); font-weight: 700; text-decoration: none; }

/* ── Qty Spinner ──────────────────────────────────────── */
.sol-qty-wrap {
    display: flex;
    align-items: center;
    gap: 4px;
    direction: ltr; /* spinner خودش چپ‌به‌راست باشد */
}

.sol-qty-btn {
    width: 28px;
    height: 28px;
    border: 1px solid var(--sol-border);
    background: #fff;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1rem;
    line-height: 1;
    color: var(--sol-text);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background var(--sol-transition);
    padding: 0;
}
.sol-qty-btn:hover:not(:disabled) { background: var(--sol-hover-bg); }
.sol-qty-btn:disabled { opacity: .4; cursor: default; }

.sol-qty-input {
    width: 48px;
    height: 28px;
    text-align: center;
    border: 1px solid var(--sol-border);
    border-radius: 6px;
    font-size: .88rem;
    padding: 0 4px;
    -moz-appearance: textfield;
}
.sol-qty-input::-webkit-inner-spin-button,
.sol-qty-input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }

.sol-row-subtotal { color: var(--sol-text); }

/* ── Footer Bar ───────────────────────────────────────── */
.sol-footer-bar {
    position: fixed;
    bottom: 0;
    right: 0;
    left: 0;
    z-index: 999;
    background: #fff;
    border-top: 1px solid var(--sol-border);
    box-shadow: 0 -2px 12px rgba(0,0,0,.1);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 20px;
    gap: 16px;
    flex-wrap: wrap;
    direction: rtl;
}

.sol-footer-info { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }

.sol-totals, .sol-savings {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: .95rem;
}
.sol-total-label { color: var(--sol-muted); }
.sol-total-value { font-weight: 700; font-size: 1.05rem; color: var(--sol-text); }
.sol-savings-label { color: var(--sol-muted); font-size: .85rem; }
.sol-savings-value { color: var(--sol-success); font-weight: 700; }

.sol-footer-actions { display: flex; align-items: center; gap: 12px; }

.sol-items-count { color: var(--sol-muted); font-size: .85rem; }

.sol-submit-btn {
    padding: 10px 28px;
    border: none;
    border-radius: var(--sol-radius);
    font-size: .95rem;
    font-weight: 700;
    cursor: pointer;
    transition: opacity var(--sol-transition), transform var(--sol-transition);
    white-space: nowrap;
}
.sol-submit-btn:hover:not(:disabled) { opacity: .9; transform: translateY(-1px); }
.sol-submit-btn:disabled { opacity: .5; cursor: default; }
.sol-submit-btn.sol-loading { opacity: .7; }

/* ── Messages ─────────────────────────────────────────── */
.sol-messages {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-width: 360px;
}
.sol-msg {
    padding: 12px 16px;
    border-radius: var(--sol-radius);
    font-size: .88rem;
    font-weight: 500;
    box-shadow: var(--sol-shadow);
    animation: sol-slide-in .25s ease;
}
.sol-msg--error   { background: #fee2e2; color: #991b1b; }
.sol-msg--warning { background: #fffbeb; color: #92400e; }
.sol-msg--success { background: #dcfce7; color: #15803d; }
@keyframes sol-slide-in {
    from { opacity: 0; transform: translateX(20px); }
    to   { opacity: 1; transform: translateX(0); }
}

/* ── Empty ────────────────────────────────────────────── */
.sol-empty {
    text-align: center;
    color: var(--sol-muted);
    padding: 40px;
    font-size: 1rem;
}

/* ── Responsive ───────────────────────────────────────── */
@media (max-width: 640px) {
    .sol-product-table { font-size: .82rem; }
    .sol-product-table td, .sol-product-table th { padding: 8px 6px; }
    .col-sku, .col-stock { display: none; }
    .sol-footer-bar { padding: 8px 12px; }
    .sol-total-value { font-size: .95rem; }
    .sol-submit-btn  { padding: 9px 18px; font-size: .88rem; }
}
