/* ChaiBD wholesale page: quick order table for approved wholesalers (public/js/chai-ws.js). Uses the design's colours. */
@keyframes wq-in { from { opacity: 0; transform: translateY(10px); } }
@keyframes wq-sh { from { background-position: 200% 0; } to { background-position: -200% 0; } }
.wq svg, .wq-jump svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.wq { scroll-margin-top: 90px; }
.wq-card { position: relative; padding: 18px; border-radius: 22px; background: var(--card); border: 1px solid color-mix(in srgb, var(--card-b) 80%, transparent); box-shadow: 0 20px 40px -34px rgba(0,0,0,.4); }
.wq-head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.wq-head h2 { margin: 0; font-size: 20px; } .wq-head p { margin: 2px 0 0; font-size: 13.5px; color: var(--ink-soft); }
.wq-ic { display: grid; place-items: center; width: 44px; height: 44px; flex: none; border-radius: 14px; color: var(--on-accent, #fff); background: linear-gradient(145deg, color-mix(in srgb, var(--red) 70%, #ffb020), var(--red)); box-shadow: 0 10px 20px -12px var(--red); }
.wq-ic svg { width: 22px; height: 22px; }
.wq-tools { display: grid; grid-template-columns: minmax(0, 1fr) 200px auto; gap: 8px; margin-bottom: 12px; }
.wq-s { display: flex; align-items: center; gap: 8px; padding: 0 12px; border-radius: 12px; border: 1px solid color-mix(in srgb, var(--card-b) 90%, transparent); background: var(--bg, var(--card)); color: var(--ink-soft); }
.wq-s input { flex: 1; min-width: 0; height: 42px; border: 0; outline: 0; background: none; color: var(--ink); font: inherit; font-size: 14px; }
.wq-tools select, .wq-o select { height: 42px; padding: 0 10px; border-radius: 12px; border: 1px solid color-mix(in srgb, var(--card-b) 90%, transparent); background: var(--bg, var(--card)); color: var(--ink); font: inherit; font-size: 14px; min-width: 0; max-width: 100%; }
.wq-csv { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 42px; padding: 0 14px; border-radius: 12px; border: 1px solid color-mix(in srgb, #16a34a 40%, transparent); background: color-mix(in srgb, #16a34a 10%, var(--card)); color: #15803d; font: inherit; font-size: 13.5px; font-weight: 700; cursor: pointer; white-space: nowrap; }
.wq-csv:disabled { opacity: .6; cursor: progress; }
.wq-th, .wq-row { display: grid; grid-template-columns: minmax(0, 2.4fr) minmax(110px, 1fr) 110px 170px 110px; gap: 12px; align-items: center; }
.wq-th { padding: 8px 12px; border-radius: 10px; font-size: 12px; font-weight: 700; color: var(--ink-soft); background: color-mix(in srgb, var(--ink-soft) 8%, transparent); }
.wq-th span:nth-child(n+3) { text-align: right; } .wq-th span:nth-child(4) { text-align: center; }
.wq-list { display: grid; }
.wq-row { padding: 12px; border-bottom: 1px solid color-mix(in srgb, var(--card-b) 70%, transparent); border-left: 3px solid transparent; transition: background .2s, border-color .2s; animation: wq-in .35s both; }
.wq-row.on { background: color-mix(in srgb, var(--red) 5%, transparent); border-left-color: var(--red); }
.wq-row.bad { border-left-color: #f59e0b; }
.wq-row.out { opacity: .55; }
.wq-p { display: flex; align-items: center; gap: 10px; min-width: 0; color: inherit; text-decoration: none; }
.wq-img { display: grid; place-items: center; width: 54px; height: 54px; flex: none; border-radius: 12px; overflow: hidden; background: color-mix(in srgb, var(--ink-soft) 8%, transparent); color: var(--ink-soft); }
.wq-img img { width: 100%; height: 100%; object-fit: cover; }
.wq-n { display: grid; gap: 2px; min-width: 0; }
.wq-n b { font-size: 14px; line-height: 1.3; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.wq-n small { font-size: 12px; color: var(--ink-soft); } .wq-n small i { font-style: normal; color: #dc2626; }
.wq-chips { display: flex; flex-wrap: wrap; gap: 4px; }
.wq-chips em { display: inline-flex; align-items: center; gap: 3px; padding: 2px 7px; border-radius: 99px; font-style: normal; font-size: 11px; font-weight: 600; color: var(--ink-soft); background: color-mix(in srgb, var(--ink-soft) 10%, transparent); }
.wq-chips em svg { width: 12px; height: 12px; }
.wq-chips em.t { color: #15803d; background: color-mix(in srgb, #16a34a 12%, transparent); }
.wq-o select { width: 100%; height: 38px; font-size: 13px; } .wq-na { color: var(--ink-soft); }
.wq-u, .wq-t { text-align: right; } .wq-u { display: grid; } .wq-u b { font-size: 15px; } .wq-u s { font-size: 12px; color: var(--ink-soft); }
.wq-t b { font-size: 15px; color: var(--red); }
.wq-q { display: grid; justify-items: center; gap: 4px; }
.wq-step { display: inline-flex; align-items: center; border-radius: 12px; border: 1px solid color-mix(in srgb, var(--card-b) 90%, transparent); overflow: hidden; background: var(--bg, var(--card)); }
.wq-step button { display: grid; place-items: center; width: 34px; height: 36px; border: 0; background: none; color: var(--ink); cursor: pointer; }
.wq-step button:hover { background: color-mix(in srgb, var(--red) 10%, transparent); }
.wq-step input { width: 64px; height: 36px; border: 0; outline: 0; text-align: center; background: none; color: var(--ink); font: inherit; font-weight: 700; -moz-appearance: textfield; appearance: textfield; }
.wq-step input::-webkit-inner-spin-button, .wq-step input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.wq-ctn { padding: 3px 10px; border-radius: 99px; border: 1px dashed color-mix(in srgb, var(--red) 50%, transparent); background: none; color: var(--red); font: inherit; font-size: 12px; font-weight: 700; cursor: pointer; }
.wq-warn { font-size: 11.5px; color: #d97706; min-height: 0; } .wq-warn:empty { display: none; }
.wq-more { display: flex; justify-content: center; } .wq-more button { margin-top: 12px; padding: 10px 22px; border-radius: 12px; border: 1px solid color-mix(in srgb, var(--card-b) 90%, transparent); background: var(--card); color: var(--ink); font: inherit; font-weight: 700; cursor: pointer; }
.wq-empty { padding: 30px 10px; text-align: center; color: var(--ink-soft); }
.wq-skel { display: grid; gap: 10px; padding: 10px 0; } .wq-skel i { height: 64px; border-radius: 14px; background: linear-gradient(90deg, color-mix(in srgb, var(--ink-soft) 8%, transparent) 30%, color-mix(in srgb, var(--ink-soft) 16%, transparent) 50%, color-mix(in srgb, var(--ink-soft) 8%, transparent) 70%); background-size: 200% 100%; animation: wq-sh 1.2s linear infinite; }
.wq-bar { position: sticky; bottom: 14px; z-index: 5; display: flex; align-items: center; gap: 14px; margin-top: 14px; padding: 10px 10px 10px 16px; border-radius: 18px; background: var(--card); border: 1px solid color-mix(in srgb, var(--card-b) 90%, transparent); box-shadow: 0 16px 34px -20px rgba(0,0,0,.45); }
.wq-bar > div { display: grid; line-height: 1.25; min-width: 0; } .wq-bar small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } .wq-bar small { font-size: 11.5px; color: var(--ink-soft); } .wq-bar b { font-size: 15px; }
.wq-bar .wq-tot { font-size: 19px; color: var(--red); }
.wq-add { margin-left: auto; flex: none; white-space: nowrap; display: inline-flex; align-items: center; gap: 8px; padding: 12px 20px; border-radius: 14px; border: 0; font: inherit; font-weight: 800; color: var(--on-accent, #fff); background: var(--red); box-shadow: 0 10px 20px -12px var(--red); cursor: pointer; transition: transform .15s, opacity .2s; }
.wq-add:disabled { opacity: .45; box-shadow: none; cursor: not-allowed; }
.wq-add:not(:disabled):active { transform: scale(.97); }
.wq-jump { gap: 6px; }

/* tablets: the option and price columns get narrower */
@media (max-width: 1100px) { .wq-th, .wq-row { grid-template-columns: minmax(0, 2fr) minmax(100px, 1fr) 96px 160px 96px; gap: 10px; } }
/* phones and small tablets: each product is a small card (picture and name; option; price, quantity and total in a row) */
@media (max-width: 860px) {
  .wq-card { padding: 14px; border-radius: 18px; }
  .wq-tools { grid-template-columns: minmax(0, 1fr) auto; } .wq-s { grid-column: 1 / -1; }
  .wq-th { display: none; }
  .wq-row { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "p p" "o o" "u q" "t q"; gap: 8px 10px; padding: 12px 10px; }
  .wq-p { grid-area: p; } .wq-o { grid-area: o; } .wq-u { grid-area: u; text-align: left; } .wq-q { grid-area: q; justify-items: end; align-self: center; } .wq-t { grid-area: t; text-align: left; }
  .wq-o:has(.wq-na) { display: none; }
  .wq-u { display: flex; align-items: baseline; gap: 6px; }
  .wq-t b::before { content: "= "; color: var(--ink-soft); font-weight: 600; }
  .wq-bar { bottom: calc(80px + env(safe-area-inset-bottom)); gap: 10px; padding: 8px 8px 8px 12px; }
  .wq-add { padding: 11px 14px; }
}
@media (max-width: 380px) { .wq-add span { display: none; } .wq-step input { width: 52px; } .wq-step button { width: 30px; } }
@media (prefers-reduced-motion: reduce) { .wq-row, .wq-skel i { animation: none; } }
/* computers: room for the round chat button at the bottom right */
@media (min-width: 861px) { .wq-bar { margin-right: 64px; } }

.wq-chips em.c { color: #9a3412; background: color-mix(in srgb, #f97316 14%, transparent); }

/* phones: the page's buttons two to a row (quick order first, full width); an empty row hides its "= —" total */
@media (max-width: 620px) {
  .hero-cta:has(.wq-jump) { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .hero-cta:has(.wq-jump) .btn { width: 100%; min-width: 0; justify-content: center; padding: 11px 8px; font-size: 13.5px; white-space: nowrap; }
  .hero-cta:has(.wq-jump) .btn span { overflow: hidden; text-overflow: ellipsis; }
  .hero-cta:has(.wq-jump) .btn:last-child:nth-child(even) { grid-column: 1 / -1; }
  .hero-cta:has(.wq-jump) .btn:first-child { grid-column: 1 / -1; padding: 13px 8px; font-size: 15px; }
  .hero-cta:has(.wq-jump) .btn:not(:first-child) { color: var(--red); background: var(--card); border: 1.5px solid color-mix(in srgb, var(--red) 35%, transparent); box-shadow: none; }
}
@media (max-width: 860px) { .wq-row.wq-0 .wq-t { display: none; } }

/* tablets (621–860px): each product on two lines — picture and name on the left; option and price in the middle;
   quantity and total on the right — instead of the phone's tall card */
@media (min-width: 621px) and (max-width: 860px) {
  .wq-row { grid-template-columns: minmax(0, 1fr) minmax(130px, 190px) auto; grid-template-areas: "p o q" "p u t"; align-items: center; gap: 6px 14px; }
  .wq-q { justify-items: end; } .wq-t { text-align: right; } .wq-u { justify-content: flex-start; }
  .wq-o:has(.wq-na) { display: block; visibility: hidden; }
  .wq-row.wq-0 .wq-t { display: block; visibility: hidden; }
}
