/* wholesale-portal.css — B2B Qeshm Wholesale */
.ws-body {
    margin: 0;
    font-family: 'Vazirmatn', Tahoma, sans-serif;
    background: #f0f9ff;
    color: #0f172a;
    min-height: 100vh;
}

.ws-header {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 14px 24px;
    background: #fff;
    border-bottom: 1px solid #e0f2fe;
    flex-wrap: wrap;
}
.ws-brand { font-weight: 800; font-size: 1.1rem; color: #0c4a6e; text-decoration: none; }
.ws-nav { margin-right: auto; display: flex; gap: 16px; }
.ws-nav a { color: #0369a1; text-decoration: none; font-size: .9rem; }
.ws-tier {
    font-size: .78rem; background: #e0f2fe; color: #0369a1;
    padding: 4px 10px; border-radius: 999px;
}

.ws-hero {
    text-align: center;
    padding: 48px 24px 32px;
    background: linear-gradient(160deg, #0c4a6e 0%, #0369a1 50%, #0284c7 100%);
    color: #fff;
}
.ws-hero__badge {
    display: inline-block; font-size: .72rem; letter-spacing: .04em;
    background: rgba(255,255,255,.15); padding: 6px 14px; border-radius: 999px; margin-bottom: 16px;
}
.ws-hero h1 { font-size: clamp(1.6rem, 4vw, 2.4rem); margin: 0 0 12px; }
.ws-hero p { opacity: .9; max-width: 560px; margin: 0 auto 24px; }
.ws-hero-stats { display: flex; justify-content: center; gap: 32px; flex-wrap: wrap; }
.ws-stat strong { display: block; font-size: 1.8rem; }
.ws-stat span { font-size: .82rem; opacity: .85; }

.ws-demo { max-width: 900px; margin: 32px auto; padding: 0 20px; }
.ws-demo h2 { text-align: center; margin-bottom: 16px; }
.ws-demo-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.ws-demo-card {
    display: flex; flex-direction: column; align-items: center; gap: 8px;
    padding: 20px; border: 2px solid #bae6fd; border-radius: 16px; background: #fff;
    cursor: pointer; transition: transform .15s, box-shadow .15s;
}
.ws-demo-card:hover { transform: translateY(-2px); box-shadow: 0 12px 32px rgba(3,105,161,.12); }
.ws-demo-card span { font-size: 2rem; }
.ws-demo-card code { font-size: .75rem; color: #64748b; }
.ws-demo-card--admin { border-color: #fcd34d; background: #fffbeb; }
.ws-demo-note { text-align: center; font-size: .85rem; color: #64748b; margin-top: 12px; }

.ws-features {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 12px; max-width: 960px; margin: 0 auto 40px; padding: 0 20px;
}
.ws-feat {
    background: #fff; border: 1px solid #e0f2fe; border-radius: 14px;
    padding: 16px; text-align: center;
}
.ws-feat h3 { margin: 0 0 6px; font-size: .95rem; }
.ws-feat p { margin: 0; font-size: .78rem; color: #64748b; }

.ws-apply { max-width: 720px; margin: 0 auto 48px; padding: 24px; background: #fff; border-radius: 20px; border: 1px solid #e0f2fe; }
.ws-apply h2 { margin-top: 0; text-align: center; }
.ws-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 12px; }
.ws-apply label { display: flex; flex-direction: column; gap: 4px; font-size: .82rem; }
.ws-apply input, .ws-apply select, .ws-apply textarea {
    padding: 10px; border: 1px solid #cbd5e1; border-radius: 10px; font-family: inherit;
}

.ws-btn {
    border: 1px solid #cbd5e1; background: #fff; border-radius: 10px;
    padding: 10px 18px; cursor: pointer; font-family: inherit; font-weight: 600;
}
.ws-btn--primary { background: #0284c7; color: #fff; border-color: #0284c7; }
.ws-btn--ghost { background: transparent; }
.ws-btn--sm { padding: 6px 12px; font-size: .82rem; }
.ws-btn:disabled { opacity: .45; cursor: not-allowed; }

.ws-sel, .ws-inp {
    padding: 10px; border: 1px solid #cbd5e1; border-radius: 10px; font-family: inherit; width: 100%; max-width: 280px;
}
.ws-table { width: 100%; border-collapse: collapse; background: #fff; border-radius: 12px; overflow: hidden; }
.ws-table th, .ws-table td { padding: 10px 12px; border-bottom: 1px solid #f1f5f9; text-align: right; font-size: .88rem; }
.ws-checkout { margin-top: 20px; background: #fff; padding: 20px; border-radius: 16px; border: 1px solid #e0f2fe; }
.ws-checkout label { display: block; margin-bottom: 10px; font-size: .82rem; }
.ws-orders { display: flex; flex-direction: column; gap: 12px; }
.ws-order { background: #fff; border: 1px solid #e0f2fe; border-radius: 14px; padding: 16px; }
.ws-order__head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.ws-order__meta { display: flex; flex-wrap: wrap; gap: 12px; font-size: .82rem; color: #64748b; margin-bottom: 8px; }
.ws-badge { font-size: .72rem; background: #dbeafe; color: #1d4ed8; padding: 3px 10px; border-radius: 999px; }
.ws-order ul { margin: 8px 0; padding-right: 20px; font-size: .85rem; }
.ws-empty { text-align: center; padding: 48px; color: #64748b; }
.ws-link { background: none; border: none; color: #dc2626; cursor: pointer; font-family: inherit; }
.ws-pending-box {
    max-width: 420px; margin: 80px auto; text-align: center;
    background: #fff; padding: 32px; border-radius: 20px; border: 1px solid #e0f2fe;
}

.ws-msg { margin-top: 10px; font-size: .88rem; }
.ws-msg--ok { color: #166534; }
.ws-msg--err { color: #b91c1c; }

.ws-header--app {
    position: sticky; top: 0; z-index: 50;
}
.ws-logout-btn {
    position: relative; z-index: 2;
    flex-shrink: 0;
    cursor: pointer !important;
    pointer-events: auto !important;
}
.ws-tabs { display: flex; gap: 8px; margin-right: auto; }
.ws-tab {
    border: none; background: transparent; padding: 8px 14px; border-radius: 999px;
    cursor: pointer; font-family: inherit; font-size: .88rem;
}
.ws-tab--on { background: #e0f2fe; color: #0369a1; font-weight: 600; }

.ws-main { max-width: 1280px; margin: 0 auto; padding: 20px; }

/* ── Demo panel (مثل اقتصاد ملک) ── */
.ws-demo-toggle {
    border: 1px solid #bae6fd; background: #e0f2fe; color: #0369a1;
    border-radius: 999px; padding: 8px 16px; font-family: inherit; font-weight: 600;
    cursor: pointer; font-size: .85rem; transition: background .15s;
}
.ws-demo-toggle:hover, .ws-demo-toggle--active { background: #0284c7; color: #fff; border-color: #0284c7; }

.ws-demo-panel {
    position: sticky; top: 0; z-index: 20;
    background: linear-gradient(180deg, #fff 0%, #f0f9ff 100%);
    border-bottom: 1px solid #bae6fd;
    box-shadow: 0 8px 24px rgba(3,105,161,.08);
}
.ws-demo-panel__inner { max-width: 960px; margin: 0 auto; padding: 16px 20px 20px; }
.ws-demo-panel__head {
    display: flex; align-items: center; gap: 10px; margin-bottom: 8px;
    font-weight: 700; color: #0c4a6e;
}
.ws-demo-panel__title { flex: 1; font-size: .92rem; }
.ws-demo-close {
    border: 1px solid #e2e8f0; background: #fff; border-radius: 8px;
    width: 32px; height: 32px; cursor: pointer; color: #64748b;
}
.ws-demo-panel__note { font-size: .82rem; color: #64748b; margin: 0 0 12px; }
.ws-demo-panel__note code { background: #f1f5f9; padding: 2px 8px; border-radius: 6px; }

.ws-demo-list { display: flex; flex-direction: column; gap: 8px; }
.ws-demo-row {
    display: flex; align-items: center; gap: 12px; width: 100%;
    padding: 12px 14px; border: 1px solid #e0f2fe; border-radius: 14px;
    background: #fff; cursor: pointer; text-align: right; font-family: inherit;
    transition: transform .12s, box-shadow .12s, border-color .12s;
}
.ws-demo-row:hover { transform: translateX(-3px); border-color: #0284c7; box-shadow: 0 6px 20px rgba(2,132,199,.12); }
.ws-demo-row:hover .ws-demo-row__badge { opacity: 1; }
.ws-demo-row--loading { opacity: .7; pointer-events: none; }
.ws-demo-row--admin { border-color: #fcd34d; background: #fffbeb; }
.ws-demo-row--pending { border-color: #fdba74; background: #fff7ed; }
.ws-demo-row__icon { font-size: 1.6rem; flex-shrink: 0; }
.ws-demo-row__body { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.ws-demo-row__body strong { font-size: .92rem; color: #0f172a; }
.ws-demo-row__body small { font-size: .75rem; color: #64748b; }
.ws-demo-row__user { font-size: .72rem; color: #94a3b8; flex-shrink: 0; }
.ws-demo-row__badge { font-size: .72rem; color: #0284c7; opacity: .6; flex-shrink: 0; }

/* ── Landing preview ── */
.ws-preview { max-width: 1100px; margin: 0 auto 40px; padding: 0 20px; }
.ws-preview__head { text-align: center; margin-bottom: 20px; }
.ws-preview__head h2 { margin: 0 0 8px; color: #0c4a6e; }
.ws-preview__head p { margin: 0; color: #64748b; font-size: .9rem; }
.ws-preview-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px;
}
.ws-preview-card {
    background: #fff; border: 1px solid #e0f2fe; border-radius: 16px; padding: 16px;
    display: flex; flex-direction: column; gap: 6px;
}
.ws-preview-card__emoji { font-size: 2rem; }
.ws-preview-card code { font-size: .7rem; color: #94a3b8; }
.ws-preview-card__meta { font-size: .78rem; color: #64748b; }
.ws-preview-card__lock { font-size: .78rem; color: #0369a1; margin-top: 4px; }
.ws-preview__cta { text-align: center; margin-top: 20px; }

/* ── Catalog hub ── */
.ws-catalog-hub { display: flex; flex-direction: column; gap: 16px; }
.ws-catalog-top {
    display: flex; flex-wrap: wrap; gap: 12px; align-items: center;
    background: #fff; padding: 14px 16px; border-radius: 16px; border: 1px solid #e0f2fe;
}
.ws-search-wrap {
    flex: 1; min-width: 220px; position: relative; display: flex; align-items: center;
}
.ws-search-icon { position: absolute; right: 12px; font-size: .9rem; pointer-events: none; }
.ws-search {
    width: 100%; padding: 11px 40px 11px 36px; border: 1px solid #cbd5e1;
    border-radius: 12px; font-family: inherit; font-size: .92rem;
}
.ws-search-clear {
    position: absolute; left: 8px; border: none; background: #f1f5f9;
    border-radius: 50%; width: 24px; height: 24px; cursor: pointer; font-size: .7rem;
}
.ws-catalog-controls { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.ws-sel--sm { max-width: 180px; padding: 8px 10px; font-size: .82rem; }
.ws-check { font-size: .82rem; display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.ws-view-toggle { display: flex; border: 1px solid #cbd5e1; border-radius: 10px; overflow: hidden; }
.ws-view-btn {
    border: none; background: #fff; padding: 8px 12px; cursor: pointer; font-size: .9rem;
}
.ws-view-btn--on { background: #e0f2fe; color: #0369a1; }

.ws-cat-pills { display: flex; flex-wrap: wrap; gap: 8px; }
.ws-cat-pills--readonly .ws-cat-pill { cursor: default; pointer-events: none; }
.ws-cat-pill {
    border: 1px solid #bae6fd; background: #fff; color: #0369a1;
    border-radius: 999px; padding: 6px 14px; font-size: .82rem; cursor: pointer;
    font-family: inherit; transition: background .12s;
}
.ws-cat-pill em { font-style: normal; opacity: .7; margin-right: 4px; font-size: .75rem; }
.ws-cat-pill--on { background: #0284c7; color: #fff; border-color: #0284c7; }
.ws-cat-pill--on em { opacity: .85; }

.ws-catalog-summary {
    display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
    font-size: .82rem; color: #64748b;
}
.ws-filter-tag {
    background: #e0f2fe; color: #0369a1; padding: 3px 10px; border-radius: 999px; font-size: .75rem;
}

.ws-catalog--grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px;
}
.ws-catalog--list {
    display: flex; flex-direction: column; gap: 10px;
}
.ws-catalog--list .ws-product {
    flex-direction: row; flex-wrap: wrap; align-items: center; gap: 12px;
}
.ws-catalog--list .ws-product__top { flex-direction: row; align-items: center; gap: 8px; }
.ws-catalog--list .ws-product__name { flex: 1; min-width: 200px; }
.ws-catalog--list .ws-product__actions { margin-right: auto; margin-top: 0; }

.ws-product {
    background: #fff; border: 1px solid #e0f2fe; border-radius: 16px; padding: 16px;
    display: flex; flex-direction: column; gap: 6px; transition: box-shadow .15s;
}
.ws-product:hover { box-shadow: 0 8px 24px rgba(3,105,161,.08); }
.ws-product__top { display: flex; justify-content: space-between; align-items: flex-start; }
.ws-product__emoji { font-size: 2rem; }
.ws-product__name { font-size: .95rem; line-height: 1.4; }
.ws-product__sku { font-size: .72rem; color: #94a3b8; }
.ws-product__meta { font-size: .75rem; color: #64748b; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.ws-tag { background: #f1f5f9; padding: 2px 8px; border-radius: 6px; font-size: .7rem; }
.ws-product__price { font-size: 1.05rem; font-weight: 700; color: #0369a1; }
.ws-product__actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: auto; padding-top: 8px; }

.ws-stock { font-size: .68rem; padding: 3px 8px; border-radius: 999px; font-weight: 600; }
.ws-stock--ok { background: #dcfce7; color: #166534; }
.ws-stock--low { background: #fef3c7; color: #b45309; }
.ws-stock--out { background: #fee2e2; color: #b91c1c; }

.ws-breaks { font-size: .7rem; color: #64748b; line-height: 1.4; }
.ws-qty-row { display: flex; gap: 8px; align-items: center; }
.ws-qty-inp { width: 72px; padding: 8px; border-radius: 8px; border: 1px solid #cbd5e1; text-align: center; }

.ws-pager {
    display: flex; justify-content: center; align-items: center; gap: 16px;
    padding: 16px; background: #fff; border-radius: 12px; border: 1px solid #e0f2fe;
}
.ws-pager button:disabled { opacity: .4; cursor: not-allowed; }

.ws-empty--wide { grid-column: 1 / -1; padding: 60px 20px; }
.ws-empty--wide span { font-size: 2.5rem; display: block; margin-bottom: 8px; }

/* ── Modal ── */
.ws-modal {
    position: fixed; inset: 0; z-index: 100;
    display: flex; align-items: center; justify-content: center; padding: 20px;
}
/* display:flex overrides HTML [hidden] → کل صفحه بلاک می‌شد و هیچ دکمه‌ای کار نمی‌کرد */
.ws-modal[hidden] {
    display: none !important;
    pointer-events: none !important;
}
.ws-modal__backdrop { position: absolute; inset: 0; background: rgba(15,23,42,.45); }
.ws-modal__box {
    position: relative; background: #fff; border-radius: 20px; padding: 24px;
    max-width: 480px; width: 100%; max-height: 90vh; overflow-y: auto;
    box-shadow: 0 24px 64px rgba(0,0,0,.18);
}
.ws-modal__x {
    position: absolute; top: 12px; left: 12px; border: none; background: #f1f5f9;
    width: 32px; height: 32px; border-radius: 8px; cursor: pointer;
}
.ws-modal__hero { font-size: 3rem; text-align: center; margin-bottom: 8px; }
.ws-modal__desc { font-size: .88rem; color: #64748b; line-height: 1.55; }
.ws-modal__dl { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; font-size: .85rem; margin: 16px 0; }
.ws-modal__dl dt { color: #64748b; }
.ws-modal__qty { margin-top: 16px; }
.ws-table--compact { font-size: .82rem; margin: 12px 0; }

.ws-credit { font-size: .85rem; color: #0369a1; background: #e0f2fe; padding: 8px 12px; border-radius: 10px; }
.ws-badge--ok { background: #dcfce7; color: #166534; }
.ws-badge--ship { background: #dbeafe; color: #1d4ed8; }
.ws-badge--done { background: #d1fae5; color: #047857; }
.ws-badge--warn { background: #fef3c7; color: #b45309; }
.ws-pending-hint { font-size: .85rem; color: #64748b; }

@media (max-width: 640px) {
    .ws-form-grid { grid-template-columns: 1fr; }
    .ws-tabs { width: 100%; justify-content: center; }
    .ws-catalog-top { flex-direction: column; align-items: stretch; }
    .ws-demo-row__user { display: none; }
    .ws-catalog--list .ws-product { flex-direction: column; align-items: stretch; }
}
