/**
 * VISUAL CONFIGURATOR — CSS
 * Fire Power SFX — SFX card grid with real product images
 * Premium 'precision engineering' dark UI
 */

/* ── Layout: 2-column (categories + grid) ────────────────────────── */
.vc-shell {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 0;
  min-height: 560px;
  border: 1px solid var(--iron);
  border-radius: var(--r-lg);
  overflow: hidden;
  background: var(--obsidian-2);
}

/* ── Category sidebar ─────────────────────────────────────────────── */
.vc-sidebar {
  background: var(--obsidian-3);
  border-right: 1px solid var(--iron);
  padding: 1.25rem 0;
  display: flex;
  flex-direction: column;
}

.vc-sidebar__title {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--smoke);
  padding: 0 1.25rem 0.75rem;
  border-bottom: 1px solid var(--iron);
  margin-bottom: 0.5rem;
}

.vc-cat-btn {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.65rem 1.25rem;
  background: none;
  border: none;
  cursor: pointer;
  text-align: left;
  transition: background 0.2s, color 0.2s;
  position: relative;
}

.vc-cat-btn::before {
  content: '';
  position: absolute;
  left: 0; top: 50%; transform: translateY(-50%);
  width: 2px; height: 0;
  background: var(--ignition);
  transition: height 0.3s var(--ease-ignite);
  border-radius: 0 2px 2px 0;
}

.vc-cat-btn:hover { background: rgba(255,77,0,0.05); }
.vc-cat-btn:hover .vc-cat-label { color: var(--phosphor); }

.vc-cat-btn.active { background: rgba(255,77,0,0.08); }
.vc-cat-btn.active::before { height: 65%; }
.vc-cat-btn.active .vc-cat-label { color: var(--ignition); }
.vc-cat-btn.active .vc-cat-count { background: rgba(255,77,0,0.2); color: var(--ignition); }

.vc-cat-icon  { font-size: 1.1rem; flex-shrink: 0; }
.vc-cat-label { font-family: var(--font-ui); font-size: 0.82rem; font-weight: 500; color: var(--silver); flex: 1; transition: color 0.2s; }
.vc-cat-count { font-family: var(--font-mono); font-size: 0.6rem; background: var(--iron); color: var(--smoke); border-radius: var(--r-pill); padding: 1px 7px; flex-shrink: 0; transition: all 0.2s; }

/* ── Main card area ───────────────────────────────────────────────── */
.vc-main {
  display: flex;
  flex-direction: column;
  min-height: 0;
}

/* Top bar: search + sort */
.vc-topbar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--iron);
  flex-shrink: 0;
}

.vc-search {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--obsidian-3);
  border: 1px solid var(--iron);
  border-radius: var(--r-pill);
  padding: 0.45rem 0.9rem;
  transition: border-color 0.25s;
}
.vc-search:focus-within { border-color: rgba(255,77,0,0.4); }
.vc-search__icon { color: var(--smoke); font-size: 0.85rem; flex-shrink: 0; }
.vc-search input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--phosphor);
  letter-spacing: 0.04em;
}
.vc-search input::placeholder { color: var(--smoke); }

.vc-selected-count {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.1em;
  color: var(--silver);
  white-space: nowrap;
  flex-shrink: 0;
}
.vc-selected-count strong { color: var(--ignition); }

/* Card grid */
.vc-grid {
  flex: 1;
  overflow-y: auto;
  padding: 1.25rem;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(165px, 1fr));
  gap: 0.85rem;
  scrollbar-width: thin;
  scrollbar-color: var(--iron) transparent;
}
.vc-grid::-webkit-scrollbar { width: 4px; }
.vc-grid::-webkit-scrollbar-track { background: transparent; }
.vc-grid::-webkit-scrollbar-thumb { background: var(--iron); border-radius: 2px; }
.vc-grid::-webkit-scrollbar-thumb:hover { background: var(--ash); }

/* ── Individual SFX card ──────────────────────────────────────────── */
.vc-card {
  background: var(--coal);
  border: 1px solid var(--iron);
  border-radius: var(--r-md);
  overflow: hidden;
  cursor: pointer;
  position: relative;
  transition: border-color 0.25s var(--ease-ignite),
              transform 0.25s var(--ease-ignite),
              box-shadow 0.25s;
  display: flex;
  flex-direction: column;
}

.vc-card:hover {
  border-color: rgba(255,77,0,0.4);
  transform: translateY(-3px);
  box-shadow: 0 12px 30px rgba(0,0,0,0.4), 0 0 20px rgba(255,77,0,0.08);
}

.vc-card.selected {
  border-color: var(--ignition);
  box-shadow: 0 0 0 1px var(--ignition), 0 0 30px rgba(255,77,0,0.18);
}

/* Image area */
.vc-card__img-wrap {
  position: relative;
  aspect-ratio: 4/3;
  overflow: hidden;
  background: var(--obsidian-3);
  flex-shrink: 0;
}

.vc-card__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s var(--ease-ignite), filter 0.4s;
  filter: brightness(0.75) saturate(0.7);
}

.vc-card:hover .vc-card__img {
  transform: scale(1.08);
  filter: brightness(0.95) saturate(1.2);
}

.vc-card.selected .vc-card__img {
  filter: brightness(0.85) saturate(1.1);
}

/* Selection checkmark overlay */
.vc-card__check {
  position: absolute;
  top: 0.5rem; right: 0.5rem;
  width: 24px; height: 24px;
  background: rgba(10,10,10,0.7);
  border: 1.5px solid var(--ash);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.25s var(--ease-ignite);
  backdrop-filter: blur(4px);
}
.vc-card__check svg {
  width: 12px; height: 12px;
  stroke: transparent;
  fill: none;
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: stroke 0.2s;
}
.vc-card.selected .vc-card__check {
  background: var(--ignition);
  border-color: var(--ignition);
  box-shadow: 0 0 12px rgba(255,77,0,0.5);
}
.vc-card.selected .vc-card__check svg { stroke: white; }

/* Ignition glow on select */
.vc-card__img-wrap::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,77,0,0.25) 0%, transparent 60%);
  opacity: 0;
  transition: opacity 0.3s;
}
.vc-card.selected .vc-card__img-wrap::after { opacity: 1; }

/* Info area */
.vc-card__info {
  padding: 0.65rem 0.75rem 0.6rem;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.vc-card__name {
  font-family: var(--font-ui);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--phosphor);
  line-height: 1.3;
}

.vc-card__cat {
  font-family: var(--font-mono);
  font-size: 0.58rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--smoke);
}

/* Qty controls (shown when selected) */
.vc-card__qty {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0 0.75rem 0.6rem;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.25s, transform 0.25s;
  pointer-events: none;
}
.vc-card.selected .vc-card__qty {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.vc-qty-btn {
  width: 22px; height: 22px;
  border: 1px solid var(--ash);
  border-radius: 50%;
  background: none;
  color: var(--silver);
  font-size: 0.9rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  transition: all 0.2s;
  flex-shrink: 0;
}
.vc-qty-btn:hover { border-color: var(--ignition); color: var(--ignition); background: rgba(255,77,0,0.08); }

.vc-qty-num {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--ignition);
  min-width: 1.5rem;
  text-align: center;
}

.vc-qty-label {
  font-family: var(--font-mono);
  font-size: 0.58rem;
  letter-spacing: 0.06em;
  color: var(--smoke);
  text-transform: uppercase;
}

/* ── Floating basket / selection summary ──────────────────────────── */
.vc-basket {
  border-top: 1px solid var(--iron);
  background: var(--obsidian-3);
  padding: 0.9rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-shrink: 0;
  min-height: 62px;
  transition: background 0.3s;
}

.vc-basket__empty {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  color: var(--smoke);
  text-transform: uppercase;
  flex: 1;
  text-align: center;
}

.vc-basket__chips {
  display: flex;
  gap: 0.5rem;
  flex: 1;
  flex-wrap: nowrap;
  overflow: hidden;
}

.vc-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.3rem 0.65rem 0.3rem 0.5rem;
  background: rgba(255,77,0,0.1);
  border: 1px solid rgba(255,77,0,0.25);
  border-radius: var(--r-pill);
  white-space: nowrap;
  max-width: 160px;
}
.vc-chip__name {
  font-family: var(--font-ui);
  font-size: 0.72rem;
  color: var(--fog);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.vc-chip__qty {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--ignition);
  font-weight: 700;
  flex-shrink: 0;
}
.vc-chip__remove {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--smoke);
  font-size: 0.85rem;
  line-height: 1;
  padding: 0;
  margin-left: 0.1rem;
  transition: color 0.2s;
  flex-shrink: 0;
}
.vc-chip__remove:hover { color: #ef4444; }

.vc-basket__overflow {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--silver);
  white-space: nowrap;
  flex-shrink: 0;
}

/* ── Mobile: stack sidebar on top ─────────────────────────────────── */
@media (max-width: 768px) {
  .vc-shell {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
  }

  .vc-sidebar {
    border-right: none;
    border-bottom: 1px solid var(--iron);
    padding: 0.75rem 0;
    flex-direction: row;
    overflow-x: auto;
    scrollbar-width: none;
  }
  .vc-sidebar::-webkit-scrollbar { display: none; }
  .vc-sidebar__title { display: none; }

  .vc-cat-btn {
    flex-direction: column;
    gap: 0.25rem;
    padding: 0.5rem 0.85rem;
    min-width: 72px;
    align-items: center;
    white-space: nowrap;
  }
  .vc-cat-btn::before { display: none; }
  .vc-cat-btn.active { background: rgba(255,77,0,0.08); border-bottom: 2px solid var(--ignition); }
  .vc-cat-label { font-size: 0.72rem; text-align: center; }
  .vc-cat-count { display: none; }

  .vc-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }

  .vc-basket__chips { flex-wrap: wrap; overflow: visible; }
}

/* ── No results ───────────────────────────────────────────────────── */
.vc-no-results {
  grid-column: 1 / -1;
  text-align: center;
  padding: 3rem 1rem;
  color: var(--smoke);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.1em;
}
