/* ============================================================
   WHOLESALE / B2B PAGE — PREMIUM REDESIGN
   Mobile Island · Brand: #f7cf04 yellow / #0f0f0f dark
   ============================================================ */

/* ── CSS Variables ─────────────────────────────────────── */
:root {
  --ws-yellow:      #f7cf04;
  --ws-yellow-dark: #e0bb00;
  --ws-black:       #0f0f0f;
  --ws-bg-light:    #f8f9fb;
  --ws-text:        #111111;
  --ws-text-muted:  #666666;
  --ws-border:      #e5e7eb;
  --ws-white:       #ffffff;
  --ws-price:       #111111;
  --ws-radius-sm:   8px;
  --ws-radius:      12px;
  --ws-radius-lg:   16px;
  --ws-shadow-sm:   0 2px 8px rgba(0,0,0,.06);
  --ws-shadow:      0 4px 20px rgba(0,0,0,.10);
  --ws-shadow-lg:   0 8px 40px rgba(0,0,0,.14);
  --ws-ease:        0.22s ease;
}

/* ── Global box-sizing ─────────────────────────────────── */
.ws-hero *,
.ws-container *,
.ws-float-panel * {
  box-sizing: border-box;
}

/* ============================================================
   SECTION 1 · HERO  (matches Smart Watches hero style)
   ============================================================ */
.ws-hero {
  background: #111111;
  padding: 30px 0 30px;
}

.ws-hero-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  text-align: center;
}

.ws-hero-eyebrow {
  margin: 0 0 10px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.8px;
  text-transform: uppercase;
  color: #f7cf04;
}

.ws-hero-title {
  margin: 0;
  font-size: 44px;
  line-height: 1.1;
  font-weight: 800;
  color: #ffffff;
}

.ws-hero-title span {
  color: #f7cf04;
}

.ws-hero-sub {
  margin: 14px auto 0;
  max-width: 700px;
  font-size: 15px;
  line-height: 1.65;
  color: rgba(255,255,255,.74);
}

/* ============================================================
   MAIN CONTENT WRAPPER
   ============================================================ */
.ws-container {
  max-width: 1320px;
  margin: 0 auto;
  padding: 52px 28px 100px;
  background: var(--ws-bg-light);
}

/* ============================================================
   SECTION 2 · SEARCH BAR
   ============================================================ */
.ws-search-wrapper {
  display: flex;
  justify-content: center;
  margin-bottom: 24px;
}

/* ============================================================
   SECTION 2b · CATEGORY FILTER TABS
   ============================================================ */
.ws-category-bar {
  background: var(--ws-white);
  border: 1px solid var(--ws-border);
  border-radius: var(--ws-radius);
  margin-bottom: 32px;
  overflow: hidden;
}

.ws-category-bar-inner {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 0 8px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.ws-category-bar-inner::-webkit-scrollbar {
  display: none;
}

.ws-category-tab {
  flex-shrink: 0;
  padding: 14px 18px;
  font-family: "Inter", Arial, sans-serif;
  font-size: 13.5px;
  font-weight: 600;
  color: #777;
  background: none;
  border: none;
  border-bottom: 2.5px solid transparent;
  cursor: pointer;
  transition: color 0.18s ease, border-color 0.18s ease;
  white-space: nowrap;
  outline: none;
}

.ws-category-tab:hover {
  color: #111;
}

.ws-category-tab.is-active {
  color: #111;
  border-bottom-color: var(--ws-yellow);
  font-weight: 700;
}

.ws-category-tab:focus-visible {
  outline: 2px solid var(--ws-yellow);
  outline-offset: -2px;
}

.ws-search-bar {
  position: relative;
  width: 100%;
  max-width: 580px;
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--ws-white);
  border: 1.5px solid var(--ws-border);
  border-radius: 8px;
  padding: 0 16px;
  box-shadow: var(--ws-shadow-sm);
  transition: border-color var(--ws-ease), box-shadow var(--ws-ease);
}

.ws-search-bar:focus-within {
  border-color: var(--ws-yellow);
  box-shadow: 0 0 0 4px rgba(247,207,4,.12), var(--ws-shadow-sm);
}

.ws-search-icon {
  color: var(--ws-text-muted);
  flex-shrink: 0;
}

.ws-search-bar input {
  flex: 1;
  border: none;
  background: transparent;
  padding: 14px 0;
  font-size: .95rem;
  color: var(--ws-text);
  outline: none;
  min-width: 0;
}

.ws-search-bar input::placeholder {
  color: #aaa;
}

.ws-search-clear {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--ws-text-muted);
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  flex-shrink: 0;
  transition: color var(--ws-ease), background var(--ws-ease);
}

.ws-search-clear:hover {
  color: var(--ws-text);
  background: var(--ws-bg-light);
}

/* ============================================================
   SECTION 3 · PRODUCT GRID
   ============================================================ */
.ws-product-wrap {
  margin-bottom: 64px;
}

/* Override old overflow/max-height */
.wholesale-products-grid {
  max-height: none !important;
  overflow-y: visible !important;
  padding-right: 0 !important;
}

.ws-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 20px;
}

/* ── Card ──────────────────────────────────────────────── */
.ws-card {
  background: var(--ws-white);
  border: 1.5px solid var(--ws-border);
  border-radius: var(--ws-radius-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform var(--ws-ease), box-shadow var(--ws-ease), border-color var(--ws-ease);
}

.ws-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--ws-shadow-lg);
  border-color: #d1d5db;
}

.ws-card.is-selected {
  border-color: var(--ws-yellow);
  box-shadow: 0 0 0 3px rgba(247,207,4,.20), var(--ws-shadow);
  background: #fffef2;
}

/* Card image area */
.ws-card__img-wrap {
  background: #f4f4f5;
  padding: 18px;
  height: 148px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.ws-card__img-wrap img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  transition: transform var(--ws-ease);
}

.ws-card:hover .ws-card__img-wrap img {
  transform: scale(1.06);
}

/* Card text */
.ws-card__body {
  padding: 14px 16px 10px;
  flex: 1;
}

.ws-card__name {
  font-size: .875rem;
  font-weight: 700;
  color: var(--ws-text);
  margin: 0 0 6px;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.ws-card__price {
  font-size: .975rem;
  font-weight: 700;
  color: var(--ws-price);
  margin: 0;
}

/* Card actions area */
.ws-card__actions {
  padding: 12px 14px 14px;
  border-top: 1px solid var(--ws-border);
  background: #fafafa;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

/* ── Custom Checkbox ───────────────────────────────────── */
.custom-checkbox {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  margin: 0;
  user-select: none;
}

.custom-checkbox input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.custom-checkbox .checkmark {
  width: 22px;
  height: 22px;
  background: var(--ws-white);
  border: 2px solid var(--ws-border);
  border-radius: 6px;
  flex-shrink: 0;
  position: relative;
  transition: background var(--ws-ease), border-color var(--ws-ease);
}

.custom-checkbox:hover .checkmark {
  border-color: var(--ws-yellow);
}

.custom-checkbox input:checked ~ .checkmark {
  background: var(--ws-yellow);
  border-color: var(--ws-yellow);
}

.custom-checkbox .checkmark::after {
  content: '';
  position: absolute;
  display: none;
  left: 6px;
  top: 2px;
  width: 6px;
  height: 11px;
  border: solid #111;
  border-width: 0 2.5px 2.5px 0;
  transform: rotate(45deg);
}

.custom-checkbox input:checked ~ .checkmark::after {
  display: block;
}

.custom-checkbox .select-text {
  font-size: .835rem;
  font-weight: 600;
  color: var(--ws-text-muted);
  transition: color var(--ws-ease);
}

.custom-checkbox:hover .select-text {
  color: var(--ws-text);
}

/* ── Quantity pill ─────────────────────────────────────── */
.quantity-container {
  display: flex;
  align-items: center;
  border: 1.5px solid var(--ws-border);
  border-radius: 50px;
  overflow: hidden;
  background: var(--ws-white);
}

.quantity-btn {
  width: 34px;
  height: 34px;
  background: transparent;
  color: var(--ws-text);
  border: none;
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background var(--ws-ease), color var(--ws-ease);
}

.quantity-btn:hover {
  background: var(--ws-yellow);
  color: #111;
}

.quantity-btn:disabled,
.quantity-btn:disabled:hover {
  opacity: .38;
  cursor: not-allowed;
  background: transparent;
  color: var(--ws-text-muted);
}

.product-quantity {
  width: 44px;
  border: none;
  border-left: 1px solid var(--ws-border);
  border-right: 1px solid var(--ws-border);
  background: transparent;
  font-size: .85rem;
  font-weight: 700;
  text-align: center;
  color: var(--ws-text);
  padding: 6px 0;
  -moz-appearance: textfield;
}

.product-quantity::-webkit-outer-spin-button,
.product-quantity::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.product-quantity:disabled {
  opacity: .45;
}

/* Empty state */
.ws-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 56px 24px;
  color: var(--ws-text-muted);
  font-size: 1rem;
}

/* ============================================================
   SECTION 4 · FLOATING SUMMARY PANEL
   ============================================================ */
.ws-float-panel {
  position: fixed;
  bottom: 28px;
  right: 28px;
  background: var(--ws-black);
  color: #fff;
  border-radius: var(--ws-radius-lg);
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 20px;
  box-shadow: 0 8px 40px rgba(0,0,0,.32);
  z-index: 1000;
  /* Hidden by default — transitions in via JS class */
  transform: translateY(130%);
  opacity: 0;
  pointer-events: none;
  transition: transform .32s cubic-bezier(.34,1.56,.64,1), opacity .22s ease;
  min-width: 320px;
}

.ws-float-panel.is-visible {
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
}

.ws-float-panel__info {
  flex: 1;
  min-width: 0;
}

.ws-float-panel__count {
  font-size: .78rem;
  color: rgba(255,255,255,.55);
  margin-bottom: 3px;
}

.ws-float-panel__count span {
  font-weight: 800;
  color: var(--ws-yellow);
}

.ws-float-panel__total {
  font-size: 1.15rem;
  font-weight: 800;
  color: #fff;
  white-space: nowrap;
}

.ws-float-panel__cta {
  background: var(--ws-yellow);
  color: #111;
  border: none;
  border-radius: var(--ws-radius-sm);
  padding: 10px 18px;
  font-size: .875rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition: background var(--ws-ease), transform var(--ws-ease);
}

.ws-float-panel__cta:hover {
  background: var(--ws-yellow-dark);
  transform: scale(1.03);
}

/* ============================================================
   SECTION 5 · ORDER SUMMARY + FORM
   ============================================================ */
.ws-form-section {
  max-width: 920px;
  margin: 0 auto;
}

/* ── Order summary bar ─────────────────────────────────── */
.ws-order-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: var(--ws-white);
  border: 1.5px solid var(--ws-yellow);
  border-radius: var(--ws-radius);
  padding: 14px 22px;
  margin-bottom: 20px;
}

.ws-order-summary__left {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--ws-text-muted);
  flex-wrap: wrap;
}

.ws-order-summary__title {
  font-size: .825rem;
  font-weight: 700;
  color: var(--ws-text);
  text-transform: uppercase;
  letter-spacing: .055em;
}

.ws-order-summary__count {
  font-size: .875rem;
  color: var(--ws-text-muted);
}

.ws-order-summary__count span {
  font-weight: 700;
  color: var(--ws-text);
}

.ws-order-summary__total {
  font-size: .95rem;
  color: var(--ws-text-muted);
  white-space: nowrap;
}

.ws-order-summary__total strong {
  font-size: 1.05rem;
  color: var(--ws-price);
}

/* ── Form card ─────────────────────────────────────────── */
.ws-form {
  background: var(--ws-white);
  border-radius: var(--ws-radius-lg);
  border: 1.5px solid var(--ws-border);
  box-shadow: var(--ws-shadow);
  overflow: hidden;
}

.ws-form__header {
  padding: 30px 36px 22px;
  border-bottom: 1px solid var(--ws-border);
  background: linear-gradient(to right, #fafafa, var(--ws-white));
}

.ws-form__header h2 {
  font-size: 1.45rem;
  font-weight: 800;
  color: var(--ws-text);
  margin: 0 0 6px;
}

.ws-form__header p {
  font-size: .875rem;
  color: var(--ws-text-muted);
  margin: 0;
}

/* 2-column grid */
.ws-form__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px 24px;
  padding: 26px 36px 4px;
}

.ws-form__field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.ws-form__field--full {
  grid-column: 1 / -1;
}

.ws-form__field label {
  font-size: .85rem;
  font-weight: 600;
  color: var(--ws-text);
}

.ws-form__field label small {
  font-weight: 400;
  color: var(--ws-text-muted);
}

.ws-required {
  color: #ef4444;
}

.ws-form__field input,
.ws-form__field textarea {
  width: 100%;
  padding: 10px 13px;
  border: 1.5px solid var(--ws-border);
  border-radius: var(--ws-radius-sm);
  font-size: .9rem;
  color: var(--ws-text);
  background: var(--ws-white);
  outline: none;
  transition: border-color var(--ws-ease), box-shadow var(--ws-ease);
}

.ws-form__field input:focus,
.ws-form__field textarea:focus {
  border-color: var(--ws-yellow);
  box-shadow: 0 0 0 3px rgba(247,207,4,.14);
}

.ws-form__field input::placeholder,
.ws-form__field textarea::placeholder {
  color: #bbb;
}

.ws-form__field textarea {
  min-height: 108px;
  resize: vertical;
}

/* Total display row */
.ws-form__total-row {
  padding: 20px 36px 0;
}

.ws-total-display {
  background: var(--ws-bg-light);
  border: 1.5px solid var(--ws-border);
  border-radius: var(--ws-radius);
  padding: 13px 20px;
  font-size: 1rem;
  font-weight: 700;
  color: var(--ws-text);
  text-align: center;
}

/* Submit button */
.ws-form__submit {
  padding: 20px 36px 30px;
}

.ws-submit-btn {
  width: 100%;
  height: 52px;
  background: var(--ws-yellow);
  color: #111;
  border: none;
  border-radius: var(--ws-radius);
  font-size: .975rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  letter-spacing: .02em;
  transition: background var(--ws-ease), transform var(--ws-ease), box-shadow var(--ws-ease);
}

.ws-submit-btn:hover {
  background: var(--ws-yellow-dark);
  transform: scale(1.01);
  box-shadow: 0 4px 20px rgba(247,207,4,.38);
}

.ws-submit-btn:active {
  transform: scale(.99);
}

/* ============================================================
   RESPONSIVE BREAKPOINTS
   ============================================================ */

/* 4 columns */
@media (max-width: 1280px) {
  .ws-grid { grid-template-columns: repeat(4, 1fr); }
}

/* 3 columns */
@media (max-width: 1024px) {
  .ws-grid { grid-template-columns: repeat(3, 1fr); }

  .ws-hero-title      { font-size: 34px; }
}

/* Tablet / Mobile: 2 columns, stack form */
@media (max-width: 768px) {
  .ws-hero            { padding: 26px 0 26px; }
  .ws-hero-title      { font-size: 28px; }
  .ws-hero-sub        { font-size: 14px; }

  .ws-container {
    padding: 32px 16px 100px;
  }

  .ws-category-bar {
    margin-bottom: 24px;
    border-radius: var(--ws-radius-sm);
  }

  .ws-category-tab {
    padding: 12px 14px;
    font-size: 12.5px;
  }

  .ws-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }

  .ws-card__img-wrap  { height: 118px; padding: 14px; }
  .ws-card__body      { padding: 10px 12px 8px; }
  .ws-card__name      { font-size: .82rem; }
  .ws-card__price     { font-size: .88rem; }
  .ws-card__actions   { padding: 10px 10px 12px; gap: 8px; }

  /* Form: single column */
  .ws-form__header,
  .ws-form__grid,
  .ws-form__total-row,
  .ws-form__submit    { padding-left: 18px; padding-right: 18px; }

  .ws-form__grid           { grid-template-columns: 1fr; }
  .ws-form__field--full    { grid-column: 1; }

  /* Order summary stacks */
  .ws-order-summary {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    padding: 12px 16px;
  }

  /* Floating panel — full-width bottom bar */
  .ws-float-panel {
    bottom: 0;
    right: 0;
    left: 0;
    border-radius: var(--ws-radius-lg) var(--ws-radius-lg) 0 0;
    min-width: 0;
    padding: 14px 20px;
    gap: 12px;
  }
}

@media (max-width: 480px) {
  .ws-hero-title    { font-size: 24px; }

  .ws-search-bar input { font-size: .875rem; }

  .ws-card__img-wrap  { height: 98px; padding: 10px; }

  .quantity-btn       { width: 30px; height: 30px; }
  .product-quantity   { width: 38px; font-size: .8rem; }

  .ws-float-panel__total  { font-size: 1rem; }
  .ws-float-panel__cta    { font-size: .8rem; padding: 9px 14px; }
}
