/*
 * wholesale.css — styles for the B2B wholesale catalog (wholesale.html)
 *
 * Scope:
 *   - Page chrome (header, logo, cart button, main grid)
 *   - Product cards
 *   - Cart drawer + form fields
 *   - Toast notifications
 *   - Anti-leak overlays (watermark + blackout) — used by wholesale.security.js
 *
 * This stylesheet is self-contained; wholesale.html does NOT load css/style.css.
 */

:root {
  --dark: #0a0a0a;
  --dark-2: #141414;
  --dark-3: #1e1e1e;
  --red: #e53935;
  --red-hover: #c62828;
  --white: #fff;
  --gray: #8a8a8a;
  --border: rgba(255,255,255,0.08);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body {
  background: var(--dark);
  color: var(--white);
  font-family: 'Inter', -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
  user-select: none;
  -webkit-user-select: none;
}
a { color: inherit; text-decoration: none; }
img {
  -webkit-user-drag: none;
  user-drag: none;
  pointer-events: none;
}

.ws-header {
  position: sticky; top: 0; z-index: 10;
  background: rgba(10,10,10,0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  padding: 16px 24px;
}
.ws-header__inner {
  max-width: 1400px; margin: 0 auto;
  display: flex; align-items: center; gap: 16px;
}
.ws-logo { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 18px; }
.ws-logo img { height: 28px; width: auto; pointer-events: none; }
.ws-label {
  padding: 4px 12px; border-radius: 999px;
  background: rgba(229,57,53,0.12); color: var(--red);
  font-size: 12px; font-weight: 600;
}
.ws-cart-btn {
  margin-left: auto;
  background: var(--red); color: var(--white);
  border: none; padding: 10px 18px; border-radius: 10px;
  font-weight: 600; cursor: pointer; font-size: 14px;
  display: flex; align-items: center; gap: 8px;
  transition: background 0.2s;
}
.ws-cart-btn:hover { background: var(--red-hover); }
.ws-cart-btn__count {
  background: var(--white); color: var(--red);
  border-radius: 999px; padding: 2px 8px; font-size: 12px; font-weight: 700;
  min-width: 22px; text-align: center;
}

.ws-main {
  max-width: 1400px; margin: 0 auto; padding: 24px;
}
.ws-filters {
  display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 24px;
}
.ws-filters input, .ws-filters select {
  background: var(--dark-2); color: var(--white);
  border: 1px solid var(--border); border-radius: 10px;
  padding: 10px 14px; font-size: 14px; font-family: inherit;
  outline: none; user-select: text;
}
.ws-filters input:focus, .ws-filters select:focus {
  border-color: var(--red);
}
.ws-filters input { flex: 1; min-width: 220px; }

.ws-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
}
.ws-card {
  background: var(--dark-2);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  display: flex; flex-direction: column;
  transition: transform 0.2s, border-color 0.2s;
}
.ws-card:hover {
  transform: translateY(-2px);
  border-color: rgba(229,57,53,0.3);
}
.ws-card__img-wrap {
  position: relative;
  aspect-ratio: 1;
  background: var(--dark-3);
  overflow: hidden;
}
.ws-card__img {
  width: 100%; height: 100%;
  object-fit: contain;
  padding: 12px;
  box-sizing: border-box;
}
/* white tile only for real photos; the placeholder div keeps the dark bg */
img.ws-card__img { background: #fff; }
.ws-card__img--placeholder {
  display: flex; align-items: center; justify-content: center;
  color: rgba(255,255,255,0.2);
}
.ws-card__img--placeholder svg { width: 54px; height: 54px; }
.ws-card__wm {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; font-weight: 700;
  color: rgba(255,255,255,0.08);
  transform: rotate(-20deg);
  pointer-events: none;
  letter-spacing: 2px;
}
.ws-card__body {
  padding: 14px; display: flex; flex-direction: column; gap: 8px; flex: 1;
}
.ws-card__cat { font-size: 11px; color: var(--gray); text-transform: uppercase; letter-spacing: 0.5px; }
.ws-card__name {
  font-size: 14px; font-weight: 500; line-height: 1.35;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden; min-height: 38px;
}
.ws-card__sku { font-size: 11px; color: var(--gray); font-family: 'SF Mono', Menlo, monospace; }
.ws-card__footer {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: auto; padding-top: 10px;
}
.ws-card__price { font-size: 17px; font-weight: 700; color: var(--white); }
.ws-card__stock { font-size: 11px; color: var(--gray); }
.ws-card__stock--out { color: #ff5252; }
.ws-card__add {
  background: transparent; border: 1px solid var(--red); color: var(--red);
  border-radius: 8px; padding: 6px 12px; font-size: 12px; font-weight: 600;
  cursor: pointer; transition: all 0.2s;
}
.ws-card__add:hover { background: var(--red); color: var(--white); }
.ws-card__add--in { background: var(--red); color: var(--white); }

.ws-empty {
  text-align: center; padding: 80px 20px; color: var(--gray);
}

/* Cart drawer */
.ws-drawer-bg {
  position: fixed; inset: 0; background: rgba(0,0,0,0.6);
  opacity: 0; pointer-events: none; transition: opacity 0.2s;
  z-index: 100;
}
.ws-drawer-bg.open { opacity: 1; pointer-events: all; }
.ws-drawer {
  position: fixed; top: 0; right: 0; bottom: 0;
  width: min(420px, 100vw);
  background: var(--dark-2); border-left: 1px solid var(--border);
  transform: translateX(100%); transition: transform 0.25s;
  z-index: 101; display: flex; flex-direction: column;
}
.ws-drawer.open { transform: translateX(0); }
.ws-drawer__head {
  padding: 18px 20px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  font-size: 16px; font-weight: 600;
}
.ws-drawer__close {
  background: none; border: none; color: var(--gray);
  font-size: 24px; cursor: pointer; line-height: 1;
}
.ws-drawer__body { flex: 1; overflow-y: auto; padding: 16px 20px; }
.ws-drawer__foot {
  padding: 18px 20px; border-top: 1px solid var(--border);
}
.ws-cart-item {
  display: flex; gap: 10px; padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.ws-cart-item:last-child { border-bottom: none; }
.ws-cart-item__name { flex: 1; font-size: 13px; }
.ws-cart-item__qty {
  display: flex; align-items: center; gap: 6px;
}
.ws-cart-item__qty button {
  background: var(--dark-3); border: 1px solid var(--border); color: var(--white);
  width: 26px; height: 26px; border-radius: 6px; cursor: pointer; font-size: 14px;
}
.ws-cart-item__qty input {
  width: 44px; text-align: center; background: var(--dark-3);
  border: 1px solid var(--border); color: var(--white); border-radius: 6px;
  padding: 4px; font-size: 13px; user-select: text;
}
.ws-cart-item__rm {
  background: none; border: none; color: var(--gray); cursor: pointer;
  font-size: 18px; padding: 0 4px;
}
.ws-form-group { margin-bottom: 12px; }
.ws-form-group label { display: block; font-size: 12px; color: var(--gray); margin-bottom: 4px; }
.ws-form-group input, .ws-form-group textarea {
  width: 100%; background: var(--dark-3); border: 1px solid var(--border);
  color: var(--white); border-radius: 8px; padding: 10px 12px;
  font-size: 14px; font-family: inherit; outline: none; user-select: text;
}
.ws-form-group textarea { min-height: 70px; resize: vertical; }
.ws-submit {
  width: 100%; background: var(--red); color: var(--white);
  border: none; padding: 14px; border-radius: 10px;
  font-weight: 600; font-size: 15px; cursor: pointer;
  transition: background 0.2s;
}
.ws-submit:hover { background: var(--red-hover); }
.ws-submit:disabled { opacity: 0.5; cursor: not-allowed; }

.ws-error, .ws-loading {
  min-height: 60vh; display: flex; align-items: center; justify-content: center;
  flex-direction: column; gap: 12px; text-align: center; padding: 40px 20px;
}
.ws-error h2 { color: var(--red); font-size: 24px; }
.ws-error p { color: var(--gray); max-width: 400px; }

.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  background: var(--dark-3); color: var(--white);
  border: 1px solid var(--border); border-radius: 10px;
  padding: 12px 20px; font-size: 14px;
  opacity: 0; pointer-events: none; transition: opacity 0.2s;
  z-index: 200;
}
.toast.show { opacity: 1; }
.toast--success { border-color: #4caf50; }
.toast--error { border-color: var(--red); }

@media (max-width: 640px) {
  .ws-header { padding: 12px 16px; }
  .ws-main { padding: 16px; }
  .ws-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .ws-card__body { padding: 10px; }
  .ws-card__name { font-size: 12px; }
  .ws-card__price { font-size: 15px; }
}

/* ── Anti-leak overlay (watermark) ── */
.ws-watermark {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
  overflow: hidden;
  opacity: 0.07;
  mix-blend-mode: overlay;
  user-select: none;
}
.ws-watermark__row {
  display: flex;
  gap: 80px;
  transform: rotate(-30deg);
  white-space: nowrap;
  font-family: monospace;
  font-size: 14px;
  color: #fff;
  padding: 6px 0;
}
/* Black-out overlay shown the instant the tab loses focus — discourages
   OS screenshot tools (Win+Shift+S, Cmd+Shift+4) which steal focus first. */
.ws-blackout {
  position: fixed;
  inset: 0;
  z-index: 100000;
  background: #000;
  display: none;
  align-items: center;
  justify-content: center;
  color: #888;
  font-size: 14px;
  font-family: monospace;
  letter-spacing: 0.05em;
}
.ws-blackout.active { display: flex; }
/* Prevent image saving via long-press on iOS */
img { -webkit-touch-callout: none; pointer-events: none; }
