/* Ashley Availability (merchandising) view — js/views/availability.js.
   Reuses the shared design vocabulary (data-table, view-tab) and adds the
   bits unique to this view: filter chip rows, the category tile grid with
   the gold Best Sellers tile, delivery badges, and Low Stock tags. All
   colors from tokens.css; the gold gradient is local to the Best Sellers
   concept (carried over from Cory Jones' original standalone page). */

.avail-empty {
  padding: 40px; text-align: center; color: #6b7280;
  font-family: var(--font-stack); font-size: 14px;
}
.avail-empty code { background: #f1f3f5; padding: 1px 5px; border-radius: 4px; }

/* Data-as-of stamp. Data-driven from availability.json (as_of + weeks). */
.avail-stamp {
  font-size: 12px; color: #6b7280; font-family: var(--font-stack);
  margin: 2px 0 10px;
}
.avail-stamp strong { color: var(--navy); }

/* Filter rows: delivery-window chips + threshold chips + search. */
.avail-filter-row {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  margin: 0 0 8px;
}
.avail-filter-lbl {
  font-size: 11px; font-weight: 700; color: #6b7280; min-width: 150px;
  text-transform: uppercase; letter-spacing: 0.4px; font-family: var(--font-stack);
}
.avail-chip {
  display: inline-flex; align-items: center; gap: 6px; white-space: nowrap;
  padding: 5px 12px; border: 1px solid var(--table-border); border-radius: 6px;
  background: #fff; color: var(--navy); font-size: 12px; font-weight: 500;
  font-family: var(--font-stack); cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.avail-chip:hover { border-color: var(--ashley-orange); }
.avail-chip.active { background: var(--navy); color: #fff; border-color: var(--navy); }
.avail-chip-count {
  background: var(--table-header-bg); color: #6b7280; border-radius: var(--radius-pill);
  padding: 1px 8px; font-size: 11px; font-weight: 700;
}
.avail-chip.active .avail-chip-count { background: rgba(255,255,255,0.18); color: #fff; }
.avail-dot { width: 8px; height: 8px; border-radius: 50%; }
.avail-dot-fast { background: var(--success-green); }
.avail-dot-medium { background: #d4a12a; }
.avail-dot-slow { background: var(--danger-red); }
.avail-search {
  flex: 1; min-width: 220px; margin-left: auto; padding: 7px 14px;
  border: 1px solid var(--table-border); border-radius: 6px;
  font-size: 13px; color: var(--navy); background: #fff; font-family: var(--font-stack);
}
.avail-search:focus { outline: 0; border-color: var(--ashley-orange); }

/* "How to use this" explainer callout. */
.avail-callout {
  background: var(--contest-soft); border-left: 4px solid var(--ashley-orange);
  border-radius: 6px; padding: 12px 16px; margin: 8px 0 14px;
  display: flex; align-items: flex-start; gap: 12px;
  font-family: var(--font-stack); font-size: 13px; color: #5a4a2f;
}
.avail-callout-tag {
  flex-shrink: 0; font-size: 10px; font-weight: 700; letter-spacing: 0.5px;
  text-transform: uppercase; color: #fff; background: var(--ashley-orange);
  border-radius: 4px; padding: 3px 8px; margin-top: 1px;
}
.avail-callout-text strong { color: var(--navy); }

/* DC banner: which account / stores the active tab covers. */
.avail-dc-banner {
  background: var(--navy); color: #fff; border-radius: 6px;
  padding: 10px 16px; margin: 0 0 14px; font-size: 13px;
  line-height: 1.6; font-family: var(--font-stack);
}
.avail-dc-pip {
  display: inline-block; margin-right: 8px; vertical-align: 1px;
  background: var(--ashley-orange); color: #fff; border-radius: 4px;
  padding: 2px 9px; font-size: 11px; font-weight: 700;
  letter-spacing: 0.5px; text-transform: uppercase;
}
.avail-dc-banner strong { color: var(--ashley-orange); }

/* Back button + breadcrumb row. */
.avail-nav-row { display: flex; align-items: center; gap: 12px; margin: 0 0 12px; min-height: 20px; }
.avail-back {
  display: none; align-items: center; gap: 8px; padding: 7px 14px;
  background: var(--navy); color: #fff; border: none; border-radius: 6px;
  font-size: 13px; font-weight: 600; cursor: pointer; font-family: var(--font-stack);
}
.avail-back:hover { background: var(--navy-hover); }
.avail-back::before { content: "\2190"; font-size: 15px; line-height: 1; }
.avail-crumb { color: #6b7280; font-size: 12px; font-family: var(--font-stack); }
.avail-crumb a { color: var(--ashley-orange); font-weight: 600; cursor: pointer; text-decoration: none; }
.avail-crumb a:hover { text-decoration: underline; }
.avail-crumb-sep { color: #c5b48f; }
.avail-crumb-here { color: var(--navy); font-weight: 600; }
.avail-crumb-best { color: #b8873a; font-weight: 700; }

/* Category tile grid. */
.avail-section-title {
  display: flex; align-items: center; gap: 8px; margin: 0 0 12px;
  font-size: 13px; font-weight: 600; color: var(--navy);
  letter-spacing: 0.8px; text-transform: uppercase; font-family: var(--font-stack);
}
.avail-section-title::before {
  content: ""; width: 8px; height: 8px; background: var(--ashley-orange); border-radius: 2px;
}
.avail-cat-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px;
}
.avail-tile {
  background: #fff; border: 1px solid var(--table-border); border-radius: var(--radius);
  padding: 20px 16px; text-align: center; cursor: pointer;
  font-family: var(--font-stack); box-shadow: var(--shadow);
  transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s;
}
.avail-tile:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); border-color: var(--ashley-orange); }
.avail-tile-icon { font-size: 2.2rem; display: block; margin-bottom: 8px; }
.avail-tile-name { font-weight: 600; font-size: 14px; color: var(--navy); }
.avail-tile-count { color: #6b7280; font-size: 12px; margin-top: 4px; }

/* Gold Best Sellers tile + header (Cory's concept, kept). */
.avail-tile-gold {
  background: linear-gradient(135deg, #d4a574 0%, #b8873a 100%);
  border-color: #a3762d; box-shadow: 0 3px 12px rgba(184, 135, 58, 0.35);
}
.avail-tile-gold:hover { border-color: #8b5f21; box-shadow: 0 8px 20px rgba(184, 135, 58, 0.5); }
.avail-tile-gold .avail-tile-name { color: #fff; font-weight: 700; font-size: 15px; }
.avail-tile-gold .avail-tile-count { color: rgba(255, 255, 255, 0.85); }
.avail-best-header {
  background: linear-gradient(135deg, #d4a574 0%, #b8873a 100%); color: #fff;
  border-radius: 10px; padding: 14px 20px; margin: 0 0 16px;
  display: flex; align-items: center; gap: 14px;
  box-shadow: 0 4px 14px rgba(184, 135, 58, 0.3); font-family: var(--font-stack);
}
.avail-best-trophy { font-size: 30px; }
.avail-best-header h2 { font-size: 18px; font-weight: 700; margin: 0; }
.avail-best-header p { font-size: 12.5px; opacity: 0.92; margin: 2px 0 0; }

/* Products header + count badge. */
.avail-products-header { display: flex; align-items: center; gap: 10px; margin: 0 0 10px; }
.avail-products-header h2 {
  font-size: 16px; font-weight: 700; color: var(--navy); margin: 0;
  font-family: var(--font-stack);
}
.avail-count-badge {
  background: var(--ashley-orange); color: #fff; border-radius: var(--radius-pill);
  padding: 3px 10px; font-size: 11px; font-weight: 600; letter-spacing: 0.5px;
}

/* Product table. Reuses .data-table; adds badges + risky tint. */
.avail-table-wrap { overflow-x: auto; }
.avail-table { min-width: 860px; }
.avail-table th { cursor: pointer; user-select: none; white-space: nowrap; }
.avail-table td.avail-num { text-align: right; font-variant-numeric: tabular-nums; }
.avail-sku {
  font-family: 'SF Mono', Menlo, Consolas, monospace; font-weight: 600;
  font-size: 12px; color: var(--navy);
}
.avail-gold-star { color: #b8873a; font-size: 14px; margin-left: 5px; }
.avail-table tr.avail-row-risky td { background: #fdf6f2; }
.avail-table tr.avail-row-risky:hover td { background: #fce9de; }
.avail-risk-tag {
  display: inline-block; background: var(--signal-red-bg-soft); color: var(--signal-red-text);
  border-radius: 4px; padding: 1px 7px; font-size: 10.5px; font-weight: 700; margin-left: 6px;
}
.avail-del-badge {
  display: inline-flex; align-items: center; padding: 4px 10px; border-radius: 6px;
  font-size: 12px; font-weight: 700; white-space: nowrap;
}
.avail-del-fast { background: var(--signal-green-bg-soft); color: var(--signal-green-text); }
.avail-del-medium { background: var(--signal-yellow-bg); color: var(--signal-yellow-text); }
.avail-del-slow { background: var(--signal-red-bg-soft); color: var(--signal-red-text); }
.avail-min-warn { color: var(--danger-red); font-weight: 700; }

/* Best Sellers category badges. */
.avail-bs-badge {
  display: inline-flex; padding: 2px 8px; border-radius: 4px; color: #fff;
  font-size: 10.5px; font-weight: 700; letter-spacing: 0.5px; text-transform: uppercase;
}
.avail-bs-dining { background: #7a9c3f; }
.avail-bs-motion { background: #3f7a9c; }
.avail-bs-stationary { background: #9c3f7a; }
.avail-bs-bedroom { background: #9c6b3f; }
