/* =====================================================================
   hardware/catalog.css — Cutescape Keychain Hardware Catalog
   Reuses Cutescape Studio's design tokens (--cream, --sage, --ink,
   --coral, --radius-card, .ws-readout, .ws-value-pill, .name-price-bar,
   and .preview-dim-overlay from style.css + name-clicker.css).
   ===================================================================== */

.hardware-catalog-page {
  min-height: 100vh;
  padding-bottom: 64px;
}

.hw-container {
  max-width: 1080px;
  margin: 0 auto;
}

.hw-customer-page .hw-container { width: 94%; max-width: 1510px; }
.hw-customer-page .hw-items-grid {
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
}
.hw-back-browse {
  display: inline-block;
  margin: 0 0 20px;
  padding: 9px 16px;
  border: 1px solid var(--border, #d8d2c5);
  border-radius: 999px;
  background: var(--panel, #fff);
  color: var(--ink);
  font-weight: 700;
  text-decoration: none;
}
.hw-back-browse:hover { background: var(--cream); }
.hw-shared-size-note { margin: 4px 0; color: var(--ink-soft); font-size: 13px; }
.hw-staff-field[hidden] { display: none; }
.hw-staff-field input[readonly] { background: #f3f1eb; }

.hw-header-title {
  margin: 8px auto 0;
  font-family: var(--font-display);
  font-size: clamp(20px, 2.2vw, 26px);
  font-weight: 700;
  color: var(--ink);
  line-height: 1.25;
}

.hw-header-subtitle {
  margin: 4px auto 0;
  max-width: 560px;
  color: var(--ink-soft);
  font-size: 15px;
  line-height: 1.5;
}

/* Subtle catalog-in-progress notice */
.hw-catalog-progress-note {
  display: flex;
  justify-content: center;
  margin: -14px auto 12px;
}

.hw-catalog-progress-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 12px;
  border-radius: 999px;
  background: rgba(253, 246, 230, 0.92);
  border: 1px solid var(--sage, #cddcbd);
  color: var(--ink-soft, #7a6b5e);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.35;
}

/* Category filter bar */
.hw-category-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin: 8px auto 24px;
  max-width: 920px;
}

.hw-category-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 15px;
  border-radius: 999px;
  border: 1.5px solid var(--sage);
  background: #ffffff;
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.12s ease;
  box-shadow: 0 2px 6px rgba(45, 52, 54, 0.05);
}

.hw-category-pill:hover {
  border-color: var(--sage-strong);
  background: var(--cream-deep);
}

.hw-category-pill[aria-pressed="true"] {
  background: var(--sage-strong);
  border-color: var(--sage-deep);
  color: #ffffff;
}

.hw-category-pill-icon {
  width: 24px;
  height: 24px;
  object-fit: contain;
  flex: 0 0 24px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.92);
  padding: 2px;
}

/* Category sections */
.hw-category-section {
  margin-bottom: 22px;
}

.hw-category-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 10px;
  padding: 5px 12px;
  background: var(--cream-deep);
  border: 1px solid var(--sage);
  border-radius: 10px;
}

.hw-category-header-icon {
  width: 24px;
  height: 24px;
  object-fit: contain;
  flex: 0 0 24px;
  padding: 2px;
  border-radius: 6px;
  background: #ffffff;
  border: 1px solid rgba(132, 177, 171, 0.4);
}

.hw-category-header-title {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.3;
  color: var(--ink);
}

.hw-category-header-price {
  font-size: 14px;
  font-weight: 700;
  line-height: 1.3;
  color: var(--sage-deep, #55703f);
}

.hw-active-category-price {
  display: flex;
  justify-content: center;
  margin: -10px auto 14px;
}

.hw-active-category-price-pill {
  display: inline-flex;
  align-items: center;
  padding: 4px 13px;
  border-radius: 999px;
  background: var(--cream-deep, #f5e8c8);
  border: 1px solid var(--sage, #cddcbd);
  color: var(--sage-deep, #55703f);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.35;
}

/* Item grid */
.hw-items-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(224px, 1fr));
  gap: 14px;
}

.hw-item-card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--panel, #ffffff);
  border: 1.5px solid var(--border, #d8d2c5);
  border-radius: var(--radius-card, 18px);
  padding: 12px;
  box-shadow: var(--shadow, 0 4px 12px rgba(58, 47, 40, 0.06));
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

/* Customer catalog cards are self-contained 1:1 square tiles with nothing hanging below */
.hw-item-card.hw-customer-tile {
  aspect-ratio: 1 / 1;
  padding: 0;
  border-radius: 18px;
  overflow: hidden;
  border: 1.5px solid var(--sage, #cddcbd);
  background: var(--cream, #fdf6e6);
  box-shadow: 0 4px 12px rgba(58, 47, 40, 0.06);
}

.hw-item-card.hw-customer-tile .hw-image-stage {
  width: 100%;
  height: 100%;
  aspect-ratio: auto;
  border: 0;
  border-radius: inherit;
  overflow: hidden;
}

.hw-item-card.is-sold-out {
  background: #f5f3ee;
  border-color: #d5d0c8;
}

/* Square (1:1) PNG stage + 2D dimension overlay on plain solid background */
.hw-image-stage {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  height: auto;
  border-radius: 14px;
  border: 1.5px solid var(--sage, #cddcbd);
  background-color: var(--cream, #fdf6e6);
  background-image: none;
  overflow: hidden;
  user-select: none;
}

.hw-image-stage.is-interactive {
  cursor: zoom-in;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.hw-item-card.hw-customer-tile:hover,
.hw-item-card.hw-customer-tile:focus-within {
  border-color: var(--sage-strong, #9bb886);
  box-shadow: 0 0 0 2px rgba(155, 184, 134, 0.28);
}

.hw-image-stage.is-interactive:focus-visible {
  outline: none;
}

.hw-item-card.is-sold-out .hw-image-stage {
  background-color: #efede7;
  background-image: none;
  border-color: #d5d0c8;
}

.hw-image-frame {
  position: absolute;
  left: 16px;
  top: 12px;
  right: 36px;
  bottom: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.hw-item-card.hw-customer-tile .hw-image-frame {
  left: 12px;
  top: 10px;
  right: 32px;
  bottom: 46px;
}

.hw-item-image {
  max-width: min(100%, 148px);
  max-height: min(100%, 148px);
  width: auto;
  height: auto;
  object-fit: contain;
  display: block;
  transition: opacity 0.15s ease, filter 0.15s ease;
}

.hw-item-card.hw-customer-tile .hw-item-image {
  max-width: min(100%, 198px);
  max-height: min(100%, 198px);
}

.hw-item-card.is-sold-out .hw-item-image {
  opacity: 0.48;
  filter: grayscale(0.65);
}

/* Inside-tile footer for centered product name at bottom of square card */
.hw-tile-footer {
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 6px;
  z-index: 4;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 22px;
  pointer-events: none;
}

.hw-tile-footer .hw-item-title {
  margin: 0;
  font-size: 14.5px;
  font-weight: 700;
  line-height: 1.24;
  color: var(--ink, #3a2f28);
  text-align: center;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-break: break-word;
}

.hw-restock-btn {
  pointer-events: auto;
  padding: 4px 11px;
  border-radius: 999px;
  border: 1.5px solid var(--sage-strong, #9bb886);
  background: rgba(255, 255, 255, 0.96);
  color: var(--sage-deep, #55703f);
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.25;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(58, 47, 40, 0.14);
  transition: background 0.14s ease, color 0.14s ease, border-color 0.14s ease;
}

.hw-restock-btn:hover:not(:disabled) {
  background: var(--sage-strong, #9bb886);
  border-color: var(--sage-deep, #55703f);
  color: #ffffff;
}

.hw-restock-btn.is-requested,
.hw-restock-btn:disabled {
  background: #e6f6f2;
  border-color: #84b1ab;
  color: #0f6f64;
  cursor: default;
}

.hw-staff-restock-demand {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 999px;
  background: #fff3d6;
  border: 1px solid #e2b96b;
  color: #7d5310;
  font-size: 12px;
  font-weight: 700;
}

.hw-image-stage .preview-dim-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.hw-image-stage .preview-dim-overlay > * {
  position: absolute;
}

.hw-image-stage .name-dim-label {
  white-space: nowrap;
}

/* Status badge on top-left of stage */
.hw-availability-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.35;
}

.hw-availability-badge.is-available {
  background: rgba(230, 246, 242, 0.95);
  color: #0f6f64;
  border: 1px solid #84b1ab;
}

.hw-availability-badge.is-sold-out {
  background: rgba(253, 232, 230, 0.96);
  color: #b43c32;
  border: 1px solid #e69a92;
}

/* Sold-out overlay banner across the square image area on customer cards */
.hw-sold-out-banner {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding-top: 24px;
  background: rgba(58, 47, 40, 0.12);
  pointer-events: none;
}

.hw-sold-out-banner-pill {
  padding: 5px 14px;
  border-radius: 999px;
  background: rgba(180, 60, 50, 0.94);
  color: #ffffff;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.02em;
  box-shadow: 0 2px 8px rgba(58, 47, 40, 0.22);
}

/* Staff card status badge (used only in /hardware/staff/) */
.hw-sold-out-ribbon {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 3;
  padding: 3px 10px;
  border-radius: 999px;
  background: #b43c32;
  color: #ffffff;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.01em;
}

/* Card body */
.hw-card-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-top: 12px;
  flex: 1;
}

.hw-card-category-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  align-self: flex-start;
  padding: 2px 9px;
  border-radius: 999px;
  background: var(--cream-deep);
  border: 1px solid rgba(132, 177, 171, 0.55);
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 600;
}

.hw-card-category-tag img {
  width: 16px;
  height: 16px;
  object-fit: contain;
}

.hw-item-title {
  margin: 0;
  font-size: 17px;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.35;
  word-break: break-word;
}

.hw-item-card.is-sold-out .hw-item-title {
  color: var(--ink-soft);
}

.hw-card-body .ws-readouts {
  margin-top: 2px;
}

.hw-card-body .ws-readout {
  margin-top: 0;
}

.hw-card-body .name-price-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
  padding-top: 8px;
  border-top: 1px dashed rgba(132, 177, 171, 0.45);
  font-size: 15px;
}

.hw-card-body .name-price-bar strong {
  font-size: 17px;
  color: var(--sage-deep);
}

.hw-item-card.is-sold-out .name-price-bar strong {
  color: var(--ink-soft);
}

/* Empty & status states */
.hw-state-card {
  max-width: 520px;
  margin: 32px auto;
  padding: 28px 22px;
  text-align: center;
  background: var(--panel);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow);
}

.hw-state-card h2 {
  margin: 0 0 8px;
  font-size: 19px;
  color: var(--ink);
}

.hw-state-card p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 14px;
  line-height: 1.6;
}

/* =====================================================================
   Staff Management (/hardware/staff/)
   ===================================================================== */

.hw-staff-topbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 0 auto 20px;
  padding: 12px 16px;
  background: var(--cream-deep);
  border: 1.5px solid var(--sage);
  border-radius: 16px;
}

.hw-staff-topbar-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.hw-staff-link-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: 999px;
  border: 1.5px solid var(--sage);
  background: #ffffff;
  color: var(--sage-deep);
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}

.hw-staff-link-btn:hover {
  background: var(--sage-strong);
  color: #ffffff;
}

.hw-staff-layout {
  display: grid;
  grid-template-columns: 360px 1fr;
  gap: 20px;
  align-items: start;
}

.hw-staff-panel {
  background: var(--panel);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-card);
  padding: 18px;
  box-shadow: var(--shadow);
  margin-bottom: 20px;
}

.hw-staff-panel h2 {
  margin: 0 0 14px;
  font-size: 18px;
  color: var(--ink);
}

.hw-staff-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.hw-staff-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
  text-align: left;
}

.hw-staff-field label {
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
}

.hw-staff-field input[type="text"],
.hw-staff-field input[type="number"],
.hw-staff-field select {
  width: 100%;
  padding: 9px 12px;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  font-family: var(--font-body);
  font-size: 14px;
  background: #ffffff;
  color: var(--ink);
}

.hw-staff-row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.hw-unit-toggle {
  display: inline-flex;
  border: 1.5px solid var(--sage);
  border-radius: 999px;
  overflow: hidden;
  background: #ffffff;
}

.hw-unit-btn {
  border: 0;
  background: transparent;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 700;
  color: var(--ink-soft);
  cursor: pointer;
}

.hw-unit-btn[aria-pressed="true"] {
  background: var(--sage-strong);
  color: #ffffff;
}

.hw-upload-preview-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px;
  border: 1px dashed var(--sage);
  border-radius: 12px;
  background: var(--cream, #fdf6e6);
}

.hw-upload-preview-img {
  width: 68px;
  height: 68px;
  object-fit: contain;
  border-radius: 8px;
  background: var(--cream, #fdf6e6);
  border: 1px solid var(--sage, #cddcbd);
  padding: 4px;
}

.hw-upload-meta {
  font-size: 12px;
  color: var(--ink-soft);
  line-height: 1.45;
}

.hw-staff-checkbox {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  cursor: pointer;
}

.hw-staff-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}

.hw-btn-primary {
  flex: 1;
  padding: 10px 16px;
  border: 0;
  border-radius: 12px;
  background: var(--sage-strong);
  color: #ffffff;
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}

.hw-btn-primary:hover:not(:disabled) {
  background: var(--sage-deep);
}

.hw-btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.hw-btn-secondary {
  padding: 9px 14px;
  border: 1.5px solid var(--border);
  border-radius: 12px;
  background: #ffffff;
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.hw-btn-danger {
  padding: 6px 11px;
  border: 1px solid #e69a92;
  border-radius: 10px;
  background: #fff5f4;
  color: #b43c32;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.hw-btn-small {
  padding: 5px 10px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: #ffffff;
  color: var(--ink);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.hw-btn-small:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.hw-btn-toggle-avail {
  padding: 5px 11px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  border: 1px solid #84b1ab;
  background: #e6f6f2;
  color: #0f6f64;
}

.hw-btn-toggle-avail.is-sold-out {
  border-color: #e69a92;
  background: #fde8e6;
  color: #b43c32;
}

/* Staff category list */
.hw-staff-category-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 14px;
}

.hw-staff-category-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 9px 11px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: #faf8f4;
}

.hw-staff-category-row.is-hidden-cat {
  opacity: 0.72;
  background: #f2efe9;
}

.hw-staff-cat-info {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}

.hw-staff-cat-info img {
  width: 34px;
  height: 34px;
  object-fit: contain;
  border-radius: 8px;
  background: #ffffff;
  border: 1px solid #dce8e5;
  padding: 2px;
}

.hw-staff-cat-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
}

.hw-staff-cat-meta {
  font-size: 11px;
  color: var(--ink-soft);
}

.hw-staff-cat-controls,
.hw-staff-item-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px;
}

.hw-staff-item-controls {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid #ece8e0;
}

.hw-staff-alert {
  padding: 10px 13px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.45;
  margin-bottom: 12px;
  text-align: left;
}

.hw-staff-alert.is-error {
  background: #fde8e6;
  border: 1px solid #e69a92;
  color: #9e2a20;
}

.hw-staff-alert.is-success {
  background: #e6f6f2;
  border: 1px solid #84b1ab;
  color: #0f6f64;
}

/* =====================================================================
   Customer Enlarged Product Image Lightbox (/hardware/)
   ===================================================================== */

body.hw-lightbox-open {
  overflow: hidden;
}

.hw-lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
}

.hw-lightbox[hidden] {
  display: none;
}

.hw-lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(58, 47, 40, 0.52);
  backdrop-filter: blur(2px);
}

.hw-lightbox-dialog {
  position: relative;
  z-index: 1;
  width: min(92vw, 560px);
  max-height: calc(100vh - 36px);
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px 18px 18px;
  background: #ffffff;
  border: 2px solid var(--sage-strong, #9bb886);
  border-radius: 22px;
  box-shadow: 0 20px 48px rgba(58, 47, 40, 0.24);
}

.hw-lightbox-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.hw-lightbox-heading {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.hw-lightbox-title {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  color: var(--ink, #3a2f28);
  line-height: 1.35;
  word-break: break-word;
}

.hw-lightbox-close {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1.5px solid var(--sage, #cddcbd);
  background: var(--cream, #fdf6e6);
  color: var(--ink, #3a2f28);
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.hw-lightbox-close:hover {
  background: var(--sage-strong, #9bb886);
  border-color: var(--sage-deep, #55703f);
  color: #ffffff;
}

.hw-lightbox-stage {
  aspect-ratio: auto;
  height: min(62vh, 420px);
  min-height: 260px;
  background-color: var(--cream, #fdf6e6);
  background-image: none;
  border: 1.5px solid var(--sage, #cddcbd);
}

.hw-lightbox-stage .hw-image-frame {
  left: 28px;
  top: 24px;
  right: 48px;
  bottom: 44px;
}

.hw-lightbox-stage .hw-item-image {
  max-width: 100%;
  max-height: 100%;
  opacity: 1;
  filter: none;
}

@media (max-width: 920px) {
  .hw-staff-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 600px) {
  .hw-customer-page .hw-items-grid {
    grid-template-columns: 1fr;
  }
  .hw-items-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .hw-lightbox {
    padding: 12px;
  }

  .hw-lightbox-dialog {
    width: 100%;
    max-width: calc(100vw - 24px);
    padding: 12px 14px 14px;
    border-radius: 18px;
  }

  .hw-lightbox-stage {
    aspect-ratio: auto;
    height: min(54vh, 320px);
    min-height: 220px;
  }

  .hw-category-pill {
    padding: 6px 12px;
    font-size: 13px;
  }

  .hw-staff-row-2 {
    grid-template-columns: 1fr;
  }
}
