/*
 * Fresh Bazaar Wholesale.
 *
 * Reuses the site's existing design tokens (--green-*, --radius-*, --shadow-*)
 * from main.css so the wholesale surface reads as the SAME shop at shopkeeper
 * rates, not a second website. Everything here is namespaced with .ws- so it
 * can never leak into a retail page.
 *
 * Mobile-first: two compact, finger-friendly columns on phones so a shopkeeper
 * can scan many rates quickly; wider grids on tablet and desktop.
 */

.ws-app { padding-bottom: 28px; }

.ws-visually-hidden {
    position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ── Identity bar ─────────────────────────────────────────────────────────── */

.ws-topbar {
    background: linear-gradient(135deg, var(--green-900), var(--green-700));
    color: #fff;
    padding: 10px 0;
}

.ws-topbar-inner {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.ws-brand { display: flex; align-items: center; gap: 9px; color: #fff; flex: 0 0 auto; }

.ws-brand-mark {
    width: 34px; height: 34px;
    display: grid; place-items: center;
    border-radius: 10px;
    background: rgba(255,255,255,.16);
    font-weight: 900; font-size: 16px;
}

.ws-brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.ws-brand-text strong { font-size: 14px; font-weight: 800; letter-spacing: -.01em; }
.ws-brand-text small { font-size: 10.5px; opacity: .85; letter-spacing: .1em; text-transform: uppercase; }

.ws-search {
    display: flex;
    flex: 1 1 220px;
    min-width: 0;
    background: #fff;
    border-radius: var(--radius-full, 999px);
    overflow: hidden;
    height: 38px;
}

.ws-search input {
    flex: 1; min-width: 0; border: 0; outline: 0;
    padding: 0 14px; font-size: 14px; font-family: inherit; color: var(--dark);
    background: transparent;
}

.ws-search button {
    border: 0; background: var(--green-600); color: #fff;
    padding: 0 14px; display: grid; place-items: center; cursor: pointer;
}

.ws-cart-pill {
    display: flex; align-items: center; gap: 6px;
    background: rgba(255,255,255,.16);
    color: #fff; font-weight: 700; font-size: 13px;
    padding: 8px 12px; border-radius: var(--radius-full, 999px);
    flex: 0 0 auto;
}

.ws-cart-count {
    min-width: 20px; height: 20px; padding: 0 6px;
    display: grid; place-items: center;
    border-radius: 999px; background: var(--orange); color: #fff;
    font-size: 11px; font-weight: 900;
}

.ws-cart-count.is-empty { display: none; }

/* ── Category rail ────────────────────────────────────────────────────────── */

.ws-cat-rail {
    background: var(--green-50);
    border-bottom: 1px solid var(--green-100);
    position: sticky; top: 0; z-index: 5;
}

.ws-cat-rail-inner,
.ws-sub-rail {
    display: flex; gap: 7px; overflow-x: auto; padding: 9px 0;
    scrollbar-width: none; -webkit-overflow-scrolling: touch;
}

.ws-cat-rail-inner::-webkit-scrollbar,
.ws-sub-rail::-webkit-scrollbar { display: none; }

.ws-cat-chip,
.ws-sub-chip {
    flex: 0 0 auto;
    padding: 6px 13px; border-radius: 999px;
    background: #fff; border: 1px solid var(--green-100);
    color: var(--green-800); font-size: 12.5px; font-weight: 700;
    white-space: nowrap;
}

.ws-cat-chip.is-active,
.ws-sub-chip.is-active {
    background: var(--green-700); border-color: var(--green-700); color: #fff;
}

.ws-sub-rail { padding: 4px 0 10px; }

/* ── Page head ────────────────────────────────────────────────────────────── */

.ws-main { padding-top: 14px; }

.ws-head {
    display: flex; align-items: flex-end; justify-content: space-between;
    gap: 12px; flex-wrap: wrap; margin-bottom: 8px;
}

.ws-head h1 { margin: 0; font-size: 19px; font-weight: 800; color: var(--dark); }
.ws-head p { margin: 3px 0 0; font-size: 13px; color: var(--muted); }

.ws-sort select {
    border: 1px solid var(--border); border-radius: 9px;
    padding: 7px 10px; font-size: 12.5px; font-family: inherit;
    background: #fff; color: var(--dark);
}

.ws-result-label { margin: 6px 0 12px; font-size: 12.5px; color: var(--muted); }
.ws-didyoumean { margin: 0 0 12px; font-size: 13px; }
.ws-didyoumean a { color: var(--green-700); font-weight: 700; text-decoration: underline; }
.ws-crumb { margin: 12px 0; font-size: 12.5px; color: var(--muted); }
.ws-crumb a { color: var(--green-700); font-weight: 700; }

/* ── Card grid ────────────────────────────────────────────────────────────── */

.ws-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.ws-card {
    background: #fff;
    border: 1px solid rgba(15,23,42,.07);
    border-radius: var(--radius-lg, 14px);
    overflow: hidden;
    display: flex; flex-direction: column;
    box-shadow: 0 2px 8px rgba(15,23,42,.05);
}

.ws-card-image {
    display: block; position: relative;
    height: 112px;
    background: linear-gradient(145deg, #f8fafc, #eefbf3);
}

.ws-card-image img { width: 100%; height: 100%; object-fit: cover; }

.ws-card-flag {
    position: absolute; top: 7px; left: 7px;
    background: var(--orange); color: #fff;
    font-size: 10px; font-weight: 800;
    padding: 3px 7px; border-radius: 999px;
}

.ws-card-body { padding: 9px 10px 10px; display: flex; flex-direction: column; gap: 5px; flex: 1; }

.ws-card-body h3 { margin: 0; font-size: 13px; line-height: 1.3; font-weight: 700; color: var(--dark); }
.ws-card-size { margin: 0; font-size: 11px; color: var(--muted-lt); }

.ws-card-price { display: flex; align-items: baseline; gap: 5px; flex-wrap: wrap; }
.ws-card-price strong { font-size: 16px; font-weight: 900; color: var(--green-800); letter-spacing: -.02em; }
.ws-card-price span { font-size: 11px; color: var(--muted); }

.ws-card-price em {
    font-style: normal;
    font-size: 10.5px; font-weight: 800;
    color: var(--green-700); background: var(--green-50);
    padding: 2px 6px; border-radius: 999px;
}

.ws-card-pack {
    margin: 0; font-size: 11px; color: var(--muted);
    background: var(--light); border-radius: 8px; padding: 5px 7px;
}
.ws-card-pack strong { color: var(--dark); font-weight: 800; }

.ws-tier-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 1px; }

.ws-tier-list li {
    display: flex; justify-content: space-between; align-items: center;
    font-size: 11px; color: var(--muted);
    padding: 2px 5px; border-radius: 6px;
}

.ws-tier-list li strong { font-weight: 800; color: var(--dark-800); }

.ws-tier-list li.is-active {
    background: var(--green-50); color: var(--green-800);
}
.ws-tier-list li.is-active strong { color: var(--green-800); }

.ws-card-rule { margin: 0; font-size: 10.5px; color: var(--muted-lt); text-align: center; }
.ws-card-oos { margin: 4px 0 0; font-size: 12px; font-weight: 700; color: var(--red); }

/* ── Quantity stepper + add ───────────────────────────────────────────────── */

.ws-card-form { margin-top: auto; display: grid; gap: 6px; }

.ws-qty {
    display: grid;
    grid-template-columns: 38px 1fr 38px;
    align-items: stretch;
    border: 1.5px solid var(--green-100);
    border-radius: 10px;
    overflow: hidden;
    background: #fff;
}

.ws-qty-btn {
    border: 0; background: var(--green-50); color: var(--green-800);
    font-size: 19px; font-weight: 800; line-height: 1;
    cursor: pointer; min-height: 38px;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.ws-qty-btn:disabled { opacity: .35; cursor: not-allowed; }
.ws-qty-btn:active:not(:disabled) { background: var(--green-100); }

.ws-qty-input {
    border: 0; outline: 0; text-align: center;
    font-size: 14px; font-weight: 800; font-family: inherit; color: var(--dark);
    min-width: 0; width: 100%;
    -moz-appearance: textfield;
}

.ws-qty-input::-webkit-outer-spin-button,
.ws-qty-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

.ws-add-btn {
    border: 0; cursor: pointer;
    background: linear-gradient(135deg, var(--green-700), var(--green-600));
    color: #fff; font-family: inherit; font-weight: 800; font-size: 13px;
    border-radius: 10px; min-height: 40px;
    display: flex; align-items: center; justify-content: center; gap: 7px;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    transition: filter .15s ease, transform .12s ease;
}

.ws-add-btn:active:not(:disabled) { transform: scale(.985); }
.ws-add-btn:disabled { opacity: .6; cursor: progress; }
.ws-add-btn .ws-add-total { font-size: 12px; font-weight: 700; opacity: .9; }

/* ── Empty / pagination ───────────────────────────────────────────────────── */

.ws-empty { text-align: center; padding: 40px 16px; color: var(--muted); }
.ws-empty-btn {
    display: inline-block; margin-top: 10px;
    background: var(--green-700); color: #fff; font-weight: 700; font-size: 13px;
    padding: 9px 16px; border-radius: 10px;
}

.ws-pagination {
    display: flex; align-items: center; justify-content: center; gap: 14px;
    margin: 22px 0 0; font-size: 13px; color: var(--muted);
}
.ws-pagination a { color: var(--green-700); font-weight: 700; }

/* ── Detail ───────────────────────────────────────────────────────────────── */

.ws-detail { display: grid; gap: 16px; }
.ws-detail-media { border-radius: var(--radius-lg, 14px); overflow: hidden; background: var(--light); }
.ws-detail-media img { width: 100%; height: auto; display: block; }
.ws-detail-info h1 { margin: 0 0 4px; font-size: 20px; font-weight: 800; }
.ws-detail-meta { margin: 0 0 10px; font-size: 12px; color: var(--muted-lt); }
.ws-detail-desc { margin: 0 0 12px; font-size: 14px; color: var(--muted); }
.ws-detail-card { max-width: 340px; }
.ws-detail-long { margin-top: 16px; font-size: 14px; color: var(--muted); }

/* ── Toast ────────────────────────────────────────────────────────────────── */

.ws-toast {
    position: fixed; left: 50%; bottom: 84px;
    transform: translate(-50%, 12px);
    z-index: 1200;
    max-width: min(90vw, 380px);
    padding: 11px 16px; border-radius: 12px;
    font-size: 13.5px; font-weight: 700; color: #fff;
    box-shadow: 0 10px 30px rgba(15,23,42,.25);
    opacity: 0; pointer-events: none;
    transition: opacity .2s ease, transform .2s ease;
}

.ws-toast.is-visible { opacity: 1; transform: translate(-50%, 0); }
.ws-toast.is-success { background: var(--green-700); }
.ws-toast.is-error { background: var(--red); }

/* ── Tablet / desktop ─────────────────────────────────────────────────────── */

@media (min-width: 640px) {
    .ws-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
    .ws-card-image { height: 150px; }
    .ws-head h1 { font-size: 22px; }
    .ws-toast { bottom: 28px; }
}

@media (min-width: 900px) {
    .ws-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .ws-detail { grid-template-columns: minmax(0, 420px) minmax(0, 1fr); align-items: start; }
    .ws-brand-text strong { font-size: 15.5px; }
}

@media (min-width: 1200px) {
    .ws-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); }
}

/* ── Cart ─────────────────────────────────────────────────────────────────── */

.ws-cart-title { margin: 4px 0 2px; font-size: 20px; font-weight: 800; }
.ws-cart-sub { margin: 0 0 16px; font-size: 12.5px; color: var(--muted); }

.ws-cart-list { list-style: none; margin: 0 0 16px; padding: 0; display: grid; gap: 8px; }

.ws-cart-line {
    display: grid;
    grid-template-columns: 52px minmax(0, 1fr) auto;
    gap: 10px; align-items: center;
    background: #fff; border: 1px solid var(--border-lt);
    border-radius: 12px; padding: 9px 11px;
}

.ws-cart-line.is-busy { opacity: .55; pointer-events: none; }

.ws-cart-thumb {
    width: 52px; height: 52px; border-radius: 9px; overflow: hidden;
    background: var(--light); display: block;
}
.ws-cart-thumb img { width: 100%; height: 100%; object-fit: cover; }

.ws-cart-info { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.ws-cart-info strong { font-size: 13px; font-weight: 700; color: var(--dark); }
.ws-cart-info small { font-size: 11.5px; color: var(--muted); }
.ws-cart-info em { font-style: normal; font-size: 11px; font-weight: 800; color: var(--green-700); }

.ws-cart-total { font-size: 14px; font-weight: 900; color: var(--green-800); white-space: nowrap; }

.ws-cart-summary {
    background: #fff; border: 1px solid var(--border-lt); border-radius: 12px;
    padding: 12px 14px; display: grid; gap: 7px; margin-bottom: 14px;
}

.ws-cart-summary div { display: flex; justify-content: space-between; font-size: 13px; color: var(--muted); }
.ws-cart-summary strong { color: var(--dark); font-weight: 800; }
.ws-cart-save strong { color: var(--green-700); }

.ws-cart-grand {
    border-top: 1px dashed var(--border); padding-top: 8px;
    font-size: 15px !important;
}
.ws-cart-grand strong { font-size: 17px; color: var(--green-800); }


/* ── Cart line editing ────────────────────────────────────────────────────── */

.ws-cart-line { grid-template-columns: 52px minmax(0, 1fr) auto; }

.ws-cart-qty {
    display: inline-grid;
    grid-template-columns: 32px 46px 32px;
    align-items: stretch;
    border: 1.5px solid var(--green-100);
    border-radius: 9px;
    overflow: hidden;
    margin-top: 4px;
    width: max-content;
}

.ws-cart-qty .ws-qty-btn { min-height: 32px; font-size: 17px; }
.ws-cart-qty .ws-qty-input { font-size: 13px; }

.ws-cart-right { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.ws-cart-right strong { font-size: 14px; font-weight: 900; color: var(--green-800); white-space: nowrap; }

.ws-cart-remove {
    border: 0; background: none; cursor: pointer;
    font-family: inherit; font-size: 11px; font-weight: 700;
    color: var(--muted-lt); text-decoration: underline; padding: 2px;
}
.ws-cart-remove:hover { color: var(--red); }

.ws-cart-warn {
    background: var(--yellow-50); border: 1px solid #fde68a;
    border-radius: 10px; padding: 9px 12px;
    font-size: 12.5px; color: #92400e; margin: 0 0 12px;
}

.ws-cart-actions { display: flex; gap: 9px; align-items: center; }

.ws-btn-primary,
.ws-btn-ghost {
    flex: 1; text-align: center;
    padding: 12px 16px; border-radius: 11px;
    font-size: 14px; font-weight: 800;
}

.ws-btn-primary {
    background: linear-gradient(135deg, var(--green-700), var(--green-600));
    color: #fff;
}
.ws-btn-primary.is-disabled { opacity: .45; pointer-events: none; }

.ws-btn-ghost { background: #fff; border: 1.5px solid var(--green-100); color: var(--green-800); }

/* ── Checkout ─────────────────────────────────────────────────────────────── */

.ws-checkout { display: grid; gap: 12px; max-width: 620px; }

.ws-form-card {
    background: #fff; border: 1px solid var(--border-lt);
    border-radius: 13px; padding: 14px; display: grid; gap: 10px;
}

.ws-form-card h2 { margin: 0; font-size: 14px; font-weight: 800; color: var(--dark); }

.ws-field { display: grid; gap: 4px; }
.ws-field > span { font-size: 12px; font-weight: 700; color: var(--muted); }

.ws-field input[type="text"],
.ws-field input[type="tel"],
.ws-field textarea,
.ws-checkout .form-control {
    width: 100%; box-sizing: border-box;
    border: 1.5px solid var(--border); border-radius: 10px;
    padding: 11px 12px; font-size: 15px; font-family: inherit; color: var(--dark);
    background: #fff;
}

.ws-field input:focus,
.ws-field textarea:focus,
.ws-checkout .form-control:focus {
    outline: 0; border-color: var(--green-500);
    box-shadow: 0 0 0 3px var(--green-50);
}

.ws-field-error { font-style: normal; font-size: 11.5px; font-weight: 700; color: var(--red); }

.ws-form-error {
    background: var(--red-50); border: 1px solid #fecaca; color: #991b1b;
    border-radius: 10px; padding: 10px 12px; font-size: 13px;
}

.ws-radio-group ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.ws-radio-group li { display: flex; align-items: center; }
.ws-radio-group label {
    display: flex; align-items: center; gap: 8px;
    font-size: 14px; font-weight: 600; color: var(--dark);
    padding: 9px 11px; border: 1.5px solid var(--border);
    border-radius: 10px; width: 100%; cursor: pointer;
}
.ws-radio-group input[type="radio"] { accent-color: var(--green-600); width: 18px; height: 18px; }

.ws-loc-btn {
    border: 1.5px dashed var(--green-200); background: var(--green-50);
    color: var(--green-800); font-family: inherit; font-size: 13px; font-weight: 700;
    padding: 10px; border-radius: 10px; cursor: pointer;
}

.ws-loc-status { margin: 0; font-size: 12px; color: var(--muted); }

.ws-advance { display: grid; gap: 8px; background: var(--light); border-radius: 10px; padding: 10px; }
.ws-advance-hint { margin: 0; font-size: 12px; color: var(--muted); }
.ws-advance-acc { margin: 0; font-size: 12.5px; color: var(--dark); }
.ws-advance-acc code { background: #fff; padding: 1px 6px; border-radius: 5px; font-size: 12px; }

.ws-review-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.ws-review-list li { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; color: var(--muted); }
.ws-review-list li strong { color: var(--dark); font-weight: 800; white-space: nowrap; }

.ws-place-order {
    border: 0; cursor: pointer; width: 100%;
    background: linear-gradient(135deg, var(--green-700), var(--green-600));
    color: #fff; font-family: inherit; font-size: 15px; font-weight: 800;
    padding: 15px; border-radius: 12px; min-height: 52px;
}

.ws-checkout-foot { text-align: center; margin: 4px 0 0; font-size: 13px; }
.ws-checkout-foot a { color: var(--green-700); font-weight: 700; }

/* ── Order success ────────────────────────────────────────────────────────── */

.ws-success { max-width: 520px; margin: 0 auto; text-align: center; display: grid; gap: 10px; }

.ws-success-tick {
    width: 56px; height: 56px; margin: 8px auto 0;
    display: grid; place-items: center; border-radius: 50%;
    background: var(--green-100); color: var(--green-700);
    font-size: 28px; font-weight: 900;
}

.ws-success h1 { margin: 0; font-size: 21px; font-weight: 800; }
.ws-success-num { margin: 0; font-size: 14px; font-weight: 800; color: var(--dark); }

.ws-success-badge {
    background: var(--green-800); color: #fff;
    font-size: 10px; font-weight: 900; letter-spacing: .08em;
    padding: 3px 8px; border-radius: 999px; vertical-align: middle;
}

.ws-success-note { margin: 0 0 6px; font-size: 13.5px; color: var(--muted); }
.ws-success .ws-cart-summary,
.ws-success .ws-review-list { text-align: left; }


/* ── Mobile polish ────────────────────────────────────────────────────────── */
/* Phones are the primary device for a shopkeeper standing in their shop, so
   the three things they touch constantly — minus, plus, Add — get full
   finger-sized targets, and the identity bar stays readable on a 360px screen. */

@media (max-width: 639px) {
    .ws-topbar-inner { gap: 8px; }

    /* Brand + cart on row one, full-width search on row two. */
    .ws-brand { flex: 1 1 auto; min-width: 0; }
    .ws-brand-text strong { font-size: 13px; }
    .ws-search { order: 3; flex: 1 0 100%; height: 40px; }

    .ws-qty { grid-template-columns: 44px 1fr 44px; }
    .ws-qty-btn { min-height: 42px; font-size: 21px; }
    .ws-qty-input { font-size: 15px; }

    .ws-add-btn { min-height: 46px; font-size: 14px; }
    .ws-add-btn .ws-add-total { font-size: 12.5px; }

    .ws-card-image { height: 104px; }
    .ws-card-body { padding: 8px 9px 9px; gap: 4px; }

    /* Keep the price ladder from making cards tall on small screens. */
    .ws-tier-list li { font-size: 10.5px; padding: 1px 4px; }

    .ws-cart-line { grid-template-columns: 46px minmax(0, 1fr) auto; padding: 8px 9px; }
    .ws-cart-thumb { width: 46px; height: 46px; }
    .ws-cart-qty { grid-template-columns: 36px 44px 36px; }
    .ws-cart-qty .ws-qty-btn { min-height: 36px; }

    .ws-cart-actions { position: sticky; bottom: 74px; z-index: 6; }

    .ws-place-order { position: sticky; bottom: 74px; z-index: 6; }

    /* Clear the site's mobile bottom nav. */
    .ws-app { padding-bottom: 84px; }
    .ws-toast { bottom: 96px; }
}


/* ── Quick Restock ────────────────────────────────────────────────────────── */
/* Compact rows so a shopkeeper can scan and add 30-50 products without
   scrolling forever, with a sticky running total that never leaves the screen. */

.ws-quick { padding-bottom: 76px; }

.ws-quick-head {
    display: flex; align-items: flex-start; justify-content: space-between;
    gap: 12px; flex-wrap: wrap; margin-bottom: 12px;
}
.ws-quick-head h1 { margin: 0; font-size: 20px; font-weight: 800; color: var(--dark); }
.ws-quick-head p { margin: 3px 0 0; font-size: 12.5px; color: var(--muted); }

.ws-quick-browse {
    flex: 0 0 auto; font-size: 12.5px; font-weight: 700; color: var(--green-700);
    background: var(--green-50); border: 1px solid var(--green-100);
    padding: 7px 12px; border-radius: 999px;
}

.ws-quick-searchbar {
    position: sticky; top: 44px; z-index: 6;
    display: flex; align-items: center; gap: 9px;
    background: #fff; border: 2px solid var(--green-200);
    border-radius: 12px; padding: 0 12px; height: 48px;
    box-shadow: 0 4px 14px rgba(15,23,42,.07);
    color: var(--muted-lt);
}

.ws-quick-searchbar:focus-within { border-color: var(--green-500); box-shadow: 0 0 0 4px var(--green-50); }

.ws-quick-searchbar input {
    flex: 1; min-width: 0; border: 0; outline: 0; background: transparent;
    font-size: 16px; font-family: inherit; font-weight: 600; color: var(--dark);
}

.ws-quick-clear {
    border: 0; background: var(--light); color: var(--muted);
    width: 26px; height: 26px; border-radius: 50%;
    font-size: 18px; line-height: 1; cursor: pointer;
}

.ws-quick-spin {
    width: 16px; height: 16px; flex: 0 0 auto;
    border: 2px solid var(--green-100); border-top-color: var(--green-600);
    border-radius: 50%; animation: ws-spin .7s linear infinite;
}

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

.ws-quick-hint { margin: 9px 0 10px; font-size: 12px; color: var(--muted); }

.ws-quick-dym {
    border: 0; background: none; padding: 0; cursor: pointer;
    font: inherit; color: var(--green-700); font-weight: 800; text-decoration: underline;
}

/* ── Rows ─────────────────────────────────────────────────────────────────── */

.ws-qlist { list-style: none; margin: 0; padding: 0; display: grid; gap: 7px; }

.ws-qrow {
    display: grid;
    grid-template-columns: 46px minmax(0, 1fr) auto;
    gap: 10px; align-items: center;
    background: #fff; border: 1px solid var(--border-lt);
    border-radius: 11px; padding: 8px 10px;
}

.ws-qrow:focus-within { border-color: var(--green-300); }

.ws-qrow-thumb {
    width: 46px; height: 46px; border-radius: 8px; overflow: hidden;
    background: var(--light); display: block;
}
.ws-qrow-thumb img { width: 100%; height: 100%; object-fit: cover; }

.ws-qrow-main { min-width: 0; display: flex; flex-direction: column; gap: 2px; }

.ws-qrow-name {
    margin: 0; font-size: 13px; font-weight: 700; color: var(--dark);
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

.ws-qrow-rates { margin: 0; font-size: 11.5px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 6px; align-items: baseline; }
.ws-qrow-rates strong { font-size: 14px; font-weight: 900; color: var(--green-800); }
.ws-qrow-rates span { font-size: 10.5px; background: var(--green-50); color: var(--green-800); padding: 1px 6px; border-radius: 999px; font-weight: 700; }

.ws-qrow-stock { margin: 0; font-size: 10.5px; font-weight: 700; }
.ws-stock--ok { color: var(--green-700); }
.ws-stock--low { color: #b45309; }
.ws-stock--out { color: var(--red); }

.ws-qrow-actions { display: flex; align-items: center; gap: 7px; }

.ws-qrow-actions .ws-qty { grid-template-columns: 32px 42px 32px; border-radius: 9px; }
.ws-qrow-actions .ws-qty-btn { min-height: 36px; font-size: 18px; }
.ws-qrow-actions .ws-qty-input { font-size: 13.5px; }

.ws-qrow-add {
    border: 0; cursor: pointer; min-height: 36px; padding: 0 12px;
    background: linear-gradient(135deg, var(--green-700), var(--green-600));
    color: #fff; font-family: inherit; font-weight: 800; font-size: 12.5px;
    border-radius: 9px; display: flex; flex-direction: column; align-items: center;
    justify-content: center; line-height: 1.15; white-space: nowrap;
    touch-action: manipulation; -webkit-tap-highlight-color: transparent;
}
.ws-qrow-add:disabled { opacity: .6; cursor: progress; }
.ws-qrow-total { font-size: 10px; font-weight: 700; opacity: .9; }

.ws-qrow-oos { font-size: 11.5px; font-weight: 700; color: var(--red); }

.ws-quick-empty {
    background: #fff; border: 1px dashed var(--border);
    border-radius: 11px; padding: 22px 14px; text-align: center;
    font-size: 13px; color: var(--muted);
}

/* ── Sticky running order ─────────────────────────────────────────────────── */

.ws-quick-bar {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
    display: flex; align-items: center; gap: 10px;
    padding: 9px 14px calc(9px + env(safe-area-inset-bottom));
    background: var(--green-900); color: #fff;
    box-shadow: 0 -6px 20px rgba(15,23,42,.18);
}

.ws-quick-bar-meta { font-size: 12px; opacity: .9; }
.ws-quick-bar-meta strong { font-size: 14px; font-weight: 900; }
.ws-quick-bar-total { margin-left: auto; font-size: 15px; font-weight: 900; }

.ws-quick-bar-btn {
    flex: 0 0 auto; background: #fff; color: var(--green-800);
    font-size: 13px; font-weight: 800; padding: 9px 14px; border-radius: 999px;
}

@media (max-width: 639px) {
    .ws-qrow { grid-template-columns: 40px minmax(0, 1fr); row-gap: 7px; padding: 8px 9px; }
    .ws-qrow-thumb { width: 40px; height: 40px; }
    .ws-qrow-actions { grid-column: 1 / -1; }
    .ws-qrow-actions .ws-qty { flex: 0 0 auto; grid-template-columns: 40px 48px 40px; }
    .ws-qrow-actions .ws-qty-btn { min-height: 40px; font-size: 20px; }
    .ws-qrow-add { flex: 1; min-height: 40px; }

    .ws-quick-searchbar { top: 40px; height: 46px; }
    /* The sticky order bar replaces the site bottom nav on this screen. */
    .ws-quick { padding-bottom: 86px; }
    .ws-quick-bar { bottom: 0; }
    /* Scoped by the body class the Quick Restock script adds, so the
       site bottom nav is untouched on every other wholesale page. */
    body.ws-quick-page .mobile-bottom-nav { display: none; }
    body.ws-quick-page .wa-float { bottom: 78px; }
}

/* Quick Restock shortcut in the wholesale identity bar. */
.ws-quick-pill {
    display: flex; align-items: center; gap: 6px;
    background: rgba(255,255,255,.16); color: #fff;
    font-weight: 700; font-size: 13px;
    padding: 8px 12px; border-radius: var(--radius-full, 999px);
    flex: 0 0 auto;
}
.ws-quick-pill:hover { background: rgba(255,255,255,.24); }

@media (max-width: 479px) {
    .ws-quick-pill span { display: none; }
    .ws-quick-pill { padding: 8px 10px; }
}

/* ── Regular items (star) ─────────────────────────────────────────────────── */

.ws-fav {
    border: 0; background: rgba(255,255,255,.92); cursor: pointer;
    width: 28px; height: 28px; border-radius: 50%;
    display: inline-grid; place-items: center; padding: 0;
    color: var(--muted-lt);
    box-shadow: 0 1px 4px rgba(15,23,42,.12);
    transition: color .15s ease, transform .12s ease;
    -webkit-tap-highlight-color: transparent; touch-action: manipulation;
}
.ws-fav:active { transform: scale(.9); }
.ws-fav.is-on { color: var(--yellow); }
.ws-fav:disabled { opacity: .6; }

/* On a catalogue card the star floats over the image. */
.ws-card { position: relative; }
.ws-card > .ws-fav { position: absolute; top: 7px; right: 7px; z-index: 2; }

/* In a Quick Restock row it sits inline before the name. */
.ws-qrow-name .ws-fav {
    width: 22px; height: 22px; box-shadow: none; background: transparent;
    vertical-align: -5px; margin-right: 2px;
}

.ws-cat-chip--star { color: var(--yellow); font-weight: 800; }

.ws-quick-shortcuts { display: flex; gap: 6px; flex-wrap: wrap; }

/* ── Order Again ──────────────────────────────────────────────────────────── */

.ws-order-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 9px; }

.ws-order-card {
    background: #fff; border: 1px solid var(--border-lt);
    border-radius: 12px; padding: 12px; display: grid; gap: 7px;
}

.ws-order-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ws-order-num { font-size: 13px; font-weight: 900; color: var(--dark); }

.ws-order-status {
    font-size: 10px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase;
    padding: 3px 8px; border-radius: 999px; background: var(--light); color: var(--muted);
}
.ws-order-status--pending { background: var(--yellow-50); color: #92400e; }
.ws-order-status--confirmed,
.ws-order-status--packing { background: var(--blue-50); color: #1d4ed8; }
.ws-order-status--outfordelivery { background: var(--green-50); color: var(--green-800); }
.ws-order-status--delivered { background: var(--green-100); color: var(--green-800); }
.ws-order-status--cancelled { background: var(--red-50); color: #991b1b; }

.ws-order-meta { margin: 0; font-size: 11.5px; color: var(--muted-lt); }

.ws-order-items { margin: 0; display: flex; flex-wrap: wrap; gap: 5px; }
.ws-order-items span {
    font-size: 11px; background: var(--light); color: var(--muted);
    padding: 3px 8px; border-radius: 999px;
    max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.ws-order-more { font-weight: 700; }

.ws-order-foot {
    display: flex; align-items: center; justify-content: space-between;
    gap: 10px; border-top: 1px dashed var(--border); padding-top: 9px;
}
.ws-order-foot > strong { font-size: 16px; font-weight: 900; color: var(--green-800); }
.ws-order-actions { display: flex; align-items: center; gap: 7px; }
.ws-order-actions form { margin: 0; }
.ws-order-actions .ws-btn-ghost,
.ws-order-actions .ws-btn-primary {
    flex: 0 0 auto; padding: 9px 14px; font-size: 13px; border: 0; cursor: pointer;
    font-family: inherit; border-radius: 10px;
}
.ws-order-actions .ws-btn-ghost { border: 1.5px solid var(--green-100); }

/* ── Order Again — items that need attention ──────────────────────────────── */

.ws-reorder-issues {
    background: var(--yellow-50); border: 1px solid #fde68a;
    border-radius: 12px; padding: 12px 14px; margin-bottom: 14px;
}
.ws-reorder-issues h2 { margin: 0 0 7px; font-size: 13.5px; font-weight: 800; color: #92400e; }
.ws-reorder-issues ul { margin: 0 0 7px; padding-left: 18px; display: grid; gap: 3px; }
.ws-reorder-issues li { font-size: 12.5px; color: #78350f; }
.ws-reorder-issues p { margin: 0; font-size: 11.5px; color: #92400e; }

/* ── Deals ────────────────────────────────────────────────────────────────── */

.ws-deal-badge {
    position: absolute; top: 7px; left: 7px; z-index: 2;
    background: linear-gradient(135deg, var(--orange), #ea580c); color: #fff;
    font-size: 10px; font-weight: 900; letter-spacing: .04em;
    padding: 3px 8px; border-radius: 999px;
    box-shadow: 0 3px 10px rgba(249,115,22,.4);
}

.ws-deal-chip {
    background: var(--orange-50) !important; color: #c2410c !important;
    font-weight: 800;
}

.ws-cat-chip--deal { color: #c2410c; font-weight: 800; }

.ws-card-price del,
.ws-qrow-rates del {
    color: var(--muted-lt); font-size: 11px; font-weight: 600;
}

/* ── Stock wording ────────────────────────────────────────────────────────── */

.ws-card-stock { margin: 0; font-size: 10.5px; font-weight: 700; }

/* ── Khata ────────────────────────────────────────────────────────────────── */

.ws-khata-hint {
    margin: 8px 0 0; font-size: 12px; color: var(--muted);
    background: var(--green-50); border: 1px solid var(--green-100);
    border-radius: 9px; padding: 8px 10px;
}
.ws-khata-hint strong { color: var(--green-800); }
.ws-khata-hint a { color: var(--green-700); font-weight: 700; text-decoration: underline; }

.ws-khata-cards {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 9px; margin-bottom: 12px;
}
.ws-khata-card {
    background: #fff; border: 1px solid var(--border-lt);
    border-radius: 12px; padding: 11px 13px;
}
.ws-khata-card span {
    display: block; font-size: 10.5px; font-weight: 700; color: var(--muted);
    text-transform: uppercase; letter-spacing: .06em;
}
.ws-khata-card strong { display: block; margin-top: 3px; font-size: 19px; font-weight: 900; color: var(--dark); }
.ws-khata-card--owed strong { color: #b45309; }
.ws-khata-card--available strong { color: var(--green-700); }
.ws-khata-card--advance strong { color: var(--green-700); }

.ws-khata-due {
    margin: 0 0 12px; font-size: 12.5px; font-weight: 700;
    background: var(--green-50); color: var(--green-800);
    border-radius: 9px; padding: 8px 11px;
}
.ws-khata-due.is-overdue { background: var(--red-50); color: #991b1b; }

.ws-khata-heading { margin: 16px 0 8px; font-size: 15px; font-weight: 800; }

.ws-khata-list { list-style: none; margin: 0 0 12px; padding: 0; display: grid; gap: 6px; }
.ws-khata-row {
    display: grid; grid-template-columns: minmax(0,1fr) auto auto; gap: 10px; align-items: center;
    background: #fff; border: 1px solid var(--border-lt); border-radius: 11px; padding: 9px 11px;
}
.ws-khata-what { min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.ws-khata-what strong { font-size: 13px; font-weight: 700; color: var(--dark); }
.ws-khata-what small { font-size: 11px; color: var(--muted-lt); }
.ws-khata-amount { font-size: 13.5px; font-weight: 900; white-space: nowrap; }
.ws-khata-amount.is-debit { color: #b45309; }
.ws-khata-amount.is-credit { color: var(--green-700); }
.ws-khata-running { font-size: 11.5px; color: var(--muted-lt); white-space: nowrap; }

.ws-khata-total {
    display: flex; justify-content: space-between; align-items: center;
    background: var(--green-900); color: #fff;
    border-radius: 12px; padding: 12px 14px; font-size: 13px;
}
.ws-khata-total strong { font-size: 19px; font-weight: 900; }

@media (max-width: 479px) {
    .ws-khata-row { grid-template-columns: minmax(0,1fr) auto; }
    .ws-khata-running { grid-column: 2; font-size: 11px; }
}

/* ── Back-in-stock alerts ─────────────────────────────────────────────────── */

.ws-notify {
    width: 100%; border: 1.5px solid var(--green-200); cursor: pointer;
    background: var(--green-50); color: var(--green-800);
    font-family: inherit; font-size: 12.5px; font-weight: 800;
    border-radius: 10px; min-height: 38px; padding: 0 10px;
    touch-action: manipulation; -webkit-tap-highlight-color: transparent;
    transition: background .15s ease;
}
.ws-notify:active { background: var(--green-100); }
.ws-notify.is-on { background: var(--green-700); border-color: var(--green-700); color: #fff; }
.ws-notify:disabled { opacity: .6; cursor: progress; }

.ws-qrow-actions .ws-notify { width: auto; min-height: 36px; white-space: nowrap; }

.ws-chip-badge {
    display: inline-grid; place-items: center;
    min-width: 17px; height: 17px; padding: 0 5px; margin-left: 3px;
    border-radius: 999px; background: var(--orange); color: #fff;
    font-size: 10px; font-weight: 900; vertical-align: 1px;
}

@media (max-width: 639px) {
    .ws-notify { min-height: 42px; font-size: 13px; }
}
