/* =============================================================================
   NoSkip Portal — Portal Page Styles
   (portal.html, profile.html)
============================================================================= */

/* ── Portal Layout ───────────────────────────────────────────────────────── */
.ns-portal-wrap {
  display: flex;
  min-height: 100vh;
  padding-top: 68px; /* topbar height */
}

/* Sidebar */
.ns-sidebar {
  width: 260px;
  flex-shrink: 0;
  background: var(--ns-bg-alt);
  border-right: 1px solid var(--ns-border);
  position: sticky;
  top: 68px;
  height: calc(100vh - 68px);
  overflow-y: auto;
  padding: 1.5rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.ns-sidebar-section h3 {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--ns-text-xdim);
  padding: 0 0.75rem;
  margin-bottom: 0.5rem;
}

.ns-sidebar-link {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.6rem 0.75rem;
  border-radius: var(--ns-r-md);
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--ns-text-muted);
  cursor: pointer;
  transition: color var(--ns-tf), background var(--ns-tf);
  border: none;
  background: none;
  width: 100%;
  text-align: left;
}
.ns-sidebar-link i { width: 16px; text-align: center; font-size: 0.82rem; flex-shrink: 0; }
.ns-sidebar-link:hover { color: var(--ns-text); background: var(--ns-bg-card-hover); }
.ns-sidebar-link.is-active { color: var(--ns-red-bright); background: var(--ns-red-subtle); }
.ns-sidebar-link.is-active i { color: var(--ns-red); }

/* Category toggle */
.ns-cat-toggle {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.45rem 0.75rem;
  border-radius: var(--ns-r-full);
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--ns-text-muted);
  cursor: pointer;
  transition: color var(--ns-tf), background var(--ns-tf);
  width: 100%;
  border: none;
  background: none;
}
.ns-cat-toggle:hover { color: var(--ns-text); }
.ns-cat-toggle.is-active { color: var(--ns-red-bright); }
.ns-cat-toggle input[type="checkbox"] { accent-color: var(--ns-red); }

/* Tag pills in sidebar */
.ns-tag-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  padding: 0 0.5rem;
}

/* Sort select */
.ns-sort-select {
  width: 100%;
  background: var(--ns-bg-card);
  border: 1px solid var(--ns-border-med);
  border-radius: var(--ns-r-md);
  padding: 0.55rem 0.85rem;
  color: var(--ns-text);
  font-size: 0.85rem;
  font-family: var(--ns-font);
  cursor: pointer;
  outline: none;
  transition: border-color var(--ns-tf);
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='rgba(255,255,255,0.4)' viewBox='0 0 16 16'%3E%3Cpath d='M7.247 11.14l-4.796-5.481c-.566-.647-.106-1.659.753-1.659h9.592c.86 0 1.32 1.012.753 1.659l-4.796 5.481a1 1 0 0 1-1.506 0z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.85rem center;
  padding-right: 2.5rem;
}
.ns-sort-select:focus { border-color: var(--ns-red-border); }
.ns-sort-select option { background: var(--ns-bg-raised); }

/* ── Main Content ─────────────────────────────────────────────────────────── */
.ns-portal-main {
  flex: 1;
  min-width: 0;
  padding: 2rem;
}

/* Topbar Portal */
.ns-portal-topbar {
  background: rgba(8,8,8,0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--ns-border);
  padding: 0 1.5rem 0 1.75rem;
  height: 68px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 1rem;
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: var(--ns-z-topbar);
}

/* Logo pinned left */
.ns-topbar-logo { justify-self: start; }

/* Search in center column — perfectly centered regardless of logo/right widths */
.ns-portal-search {
  width: 380px;
  max-width: 100%;
}
.ns-portal-search input {
  width: 100%;
  background: var(--ns-bg-card);
  border: 1px solid var(--ns-border);
  border-radius: var(--ns-r-full);
  padding: 0.55rem 1rem 0.55rem 2.5rem;
  color: var(--ns-text);
  font-size: 0.9rem;
  font-family: var(--ns-font);
  outline: none;
  transition: border-color var(--ns-tf), background var(--ns-tf);
}
.ns-portal-search input::placeholder { color: var(--ns-text-xdim); }
.ns-portal-search input:focus {
  border-color: var(--ns-red-border);
  background: rgba(232,0,26,0.03);
}
.ns-portal-search i {
  position: absolute;
  left: 0.9rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--ns-text-dim);
  font-size: 0.82rem;
  pointer-events: none;
}

/* Right cluster — tight spacing, pinned right in grid */
.ns-topbar-right {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  justify-self: end;
}

.ns-user-avatar {
  width: 38px; height: 38px;
  border-radius: 50%;
  background: var(--ns-gradient);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.85rem; font-weight: 700;
  color: #fff;
  cursor: pointer;
  position: relative;
  flex-shrink: 0;
}
.ns-user-dropdown {
  position: absolute;
  top: calc(100% + 0.65rem);
  right: 0;
  width: 210px;
  background: var(--ns-bg-raised);
  border: 1px solid var(--ns-border-med);
  border-radius: var(--ns-r-lg);
  overflow: visible;
  box-shadow: 0 30px 70px rgba(0,0,0,0.6);
  opacity: 0;
  pointer-events: none;
  transform: translateY(-8px);
  transition: opacity var(--ns-tf), transform var(--ns-tf);
  z-index: calc(var(--ns-z-topbar) + 5);
}
/* Inner content clips to border-radius */
.ns-user-dropdown-head,
.ns-user-dropdown > .ns-dropdown-item:last-child,
.ns-dropdown-mobile-only { overflow: hidden; }
/* Arrow for profile dropdown */
.ns-user-dropdown::before {
  content: '';
  position: absolute;
  top: -6px; right: 1.1rem;
  width: 12px; height: 12px;
  background: var(--ns-bg-raised);
  border-left: 1px solid var(--ns-border-med);
  border-top: 1px solid var(--ns-border-med);
  transform: rotate(45deg);
  z-index: 1;
}
.ns-user-avatar.is-open .ns-user-dropdown {
  opacity: 1; pointer-events: all; transform: translateY(0);
}
.ns-user-dropdown-head {
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--ns-border);
}
.ns-user-dropdown-head strong { font-size: 0.88rem; display: block; }
.ns-user-dropdown-head span { font-size: 0.78rem; color: var(--ns-text-dim); }
.ns-dropdown-item {
  display: flex; align-items: center; gap: 0.6rem;
  padding: 0.65rem 1rem;
  font-size: 0.85rem;
  color: var(--ns-text-muted);
  cursor: pointer;
  transition: background var(--ns-tf), color var(--ns-tf);
  text-decoration: none;
  border: none; background: none; width: 100%;
}
.ns-dropdown-item:hover { background: var(--ns-bg-card-hover); color: var(--ns-text); }
.ns-dropdown-item.is-danger { color: var(--ns-red); }
.ns-dropdown-item.is-danger:hover { background: var(--ns-red-subtle); }
.ns-dropdown-item i { width: 14px; text-align: center; font-size: 0.8rem; }

/* Cart button — pill shape */
.ns-cart-btn {
  position: relative;
  width: 40px; height: 40px;
  border-radius: var(--ns-r-full);
  background: var(--ns-bg-card);
  border: 1px solid var(--ns-border);
  display: flex; align-items: center; justify-content: center;
  color: var(--ns-text-muted);
  font-size: 0.95rem;
  cursor: pointer;
  transition: color var(--ns-tf), border-color var(--ns-tf), background var(--ns-tf);
}
.ns-cart-btn:hover { color: var(--ns-text); border-color: var(--ns-red-border); background: var(--ns-red-subtle); }
.ns-cart-count {
  position: absolute;
  top: -5px; right: -5px;
  width: 18px; height: 18px;
  background: var(--ns-red);
  border-radius: 50%;
  font-size: 0.65rem;
  font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  color: #fff;
  display: none;
}
.ns-cart-count.is-visible { display: flex; }

/* ── Video Grid ───────────────────────────────────────────────────────────── */
.ns-portal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.ns-portal-header h1 {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.025em;
}
.ns-result-count {
  font-size: 0.82rem;
  color: var(--ns-text-dim);
  margin-top: 0.2rem;
}

.ns-video-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  column-gap: 1.25rem;
  row-gap: 1.25rem;
}

/* Video Card — video sits on top with rounded edges, info strip sits as a
   coloured "pedestal" directly beneath it. The card uses overflow:hidden so
   the seam between the two never shows. */
.ns-video-card {
  position: relative;
  cursor: pointer;
  transform: translateZ(0);
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--ns-border);
  background: var(--ns-bg-card);
  transition: transform var(--ns-tm), background var(--ns-tm), border-color var(--ns-tm), box-shadow var(--ns-tm);
}
.ns-video-card:hover {
  transform: translateY(-4px);
  background: var(--ns-bg-card-hover);
  border-color: var(--ns-red-border);
  box-shadow: 0 18px 40px rgba(0,0,0,0.45), 0 0 28px var(--ns-red-subtle);
}

/* LED aspect ratio: 4864:384 ≈ 12.67:1 — video stays on top (z above info) */
.ns-video-wrap {
  aspect-ratio: 4864 / 384;
  background: #0c0c0c;
  overflow: hidden;
  position: relative;
  z-index: 2;
  border-radius: 12px;
  transition: border-color var(--ns-tm), box-shadow var(--ns-tm);
}
.ns-video-wrap video,
.ns-video-wrap img { width: 100%; height: 100%; object-fit: cover; }

.ns-video-placeholder {
  width: 100%; height: 100%;
  background:
    radial-gradient(circle at 22% 50%, rgba(232,0,26,0.18) 0%, transparent 45%),
    linear-gradient(120deg, #141414 0%, #0d0d0d 55%, #161013 100%);
  display: flex; align-items: center; justify-content: center;
  color: var(--ns-text-xdim);
  font-size: 0.7rem; letter-spacing: 0.18em; text-transform: uppercase;
  gap: 0.4rem;
}

/* Card info strip — sits as a pedestal *under* the video. Margin-top is
   negative so it slips behind the video's bottom edge, and z-index is below
   the video so the video clips it cleanly (no seam). */
.ns-card-info {
  margin-top: -8px;
  padding: 1rem 0.9rem 0.8rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  position: relative;
  z-index: 1;
  background: transparent;
}
.ns-video-card:hover .ns-card-info {
  background: transparent;
}
.ns-card-info-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
}
.ns-card-title {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--ns-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
}
.ns-card-credits {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--ns-red-bright);
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 0.25rem;
  flex-shrink: 0;
}
.ns-card-credits i { font-size: 0.7rem; }
.ns-card-sub {
  font-size: 0.73rem;
  color: var(--ns-text-dim);
  display: flex;
  align-items: center;
  gap: 0.45rem;
}
.ns-card-sub i { font-size: 0.65rem; }

/* Small, understated credit chip top-left */
.ns-video-chip {
  position: absolute;
  top: 0.7rem; left: 0.9rem;
  display: inline-flex; align-items: center; gap: 0.3rem;
  padding: 0.18rem 0.55rem;
  background: rgba(0,0,0,0.45);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: var(--ns-r-full);
  font-size: 0.72rem; font-weight: 600; color: rgba(255,255,255,0.85);
}
.ns-video-chip i { font-size: 0.62rem; color: var(--ns-red-bright); }

/* Owned badge — vertically centred on the left edge of the video */
.ns-owned-badge {
  position: absolute;
  top: 50%; left: 0.75rem;
  transform: translateY(-50%);
  display: flex; align-items: center; gap: 0.3rem;
  padding: 0.18rem 0.6rem;
  background: rgba(0,230,80,0.18);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(0,230,80,0.4);
  border-radius: var(--ns-r-full);
  font-size: 0.68rem; font-weight: 700; color: #00e650;
  z-index: 5;
}

/* In-cart marker */
.ns-incart-badge {
  position: absolute;
  bottom: 0.6rem; right: 0.75rem;
  display: flex; align-items: center; gap: 0.3rem;
  padding: 0.18rem 0.55rem;
  background: var(--ns-red-subtle);
  backdrop-filter: blur(8px);
  border: 1px solid var(--ns-red-border);
  border-radius: var(--ns-r-full);
  font-size: 0.68rem; font-weight: 600; color: var(--ns-red-bright);
}

/* "NEU" badge — vertically centred on the left edge of the video */
.ns-new-badge {
  position: absolute;
  top: 50%; left: 0.75rem;
  transform: translateY(-50%);
  display: inline-flex; align-items: center; gap: 0.3rem;
  padding: 0.18rem 0.6rem;
  background: rgba(0,200,255,0.18);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(0,200,255,0.4);
  border-radius: var(--ns-r-full);
  font-size: 0.66rem; font-weight: 800; letter-spacing: 0.08em;
  color: #00c8ff;
  z-index: 5;
}
/* If a video is already "Gekauft" (which also sits centre-left), shift NEW to the right */
.ns-new-badge.with-owned { left: auto; right: 4rem; }

/* Recently viewed strip tiles */
.ns-recent-tile {
  flex: 0 0 auto;
  width: 200px;
  aspect-ratio: 12 / 3;
  border-radius: 10px;
  overflow: hidden;
  position: relative;
  border: 1px solid var(--ns-border);
  background: #0c0c0c;
  cursor: pointer;
  transition: border-color var(--ns-tf), transform var(--ns-tf);
}
.ns-recent-tile:hover { border-color: var(--ns-red-border); transform: translateY(-2px); }
.ns-recent-tile video, .ns-recent-tile img { width: 100%; height: 100%; object-fit: cover; }
.ns-recent-tile-label {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 4px 8px;
  background: linear-gradient(180deg, transparent, rgba(0,0,0,0.85));
  font-size: 0.7rem; font-weight: 600; color: #fff;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* Related videos mini cards */
.ns-related-card {
  display: block; cursor: pointer;
  background: var(--ns-bg-card);
  border: 1px solid var(--ns-border);
  border-radius: var(--ns-r-lg);
  overflow: hidden;
  transition: border-color var(--ns-tf), transform var(--ns-tf);
}
.ns-related-card:hover { border-color: var(--ns-red-border); transform: translateY(-2px); }
.ns-related-card .ns-related-media { aspect-ratio: 12 / 3; background: #0c0c0c; overflow: hidden; }
.ns-related-card video, .ns-related-card img { width: 100%; height: 100%; object-fit: cover; pointer-events: none; }
.ns-related-card-info { padding: 0.6rem 0.75rem; }
.ns-related-card-title { font-size: 0.82rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ns-related-card-meta { font-size: 0.7rem; color: var(--ns-text-dim); margin-top: 0.15rem; }

/* Profile stat tiles */
.ns-profile-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 0.85rem; margin-bottom: 1.25rem; }
.ns-profile-stat {
  padding: 1.1rem 1.25rem;
  background: var(--ns-bg-card);
  border: 1px solid var(--ns-border);
  border-radius: var(--ns-r-lg);
  display: flex; gap: 0.85rem; align-items: center;
}
.ns-profile-stat-icon {
  width: 38px; height: 38px; flex-shrink: 0;
  border-radius: var(--ns-r-md);
  background: var(--ns-red-subtle); border: 1px solid var(--ns-red-border);
  color: var(--ns-red); font-size: 0.95rem;
  display: flex; align-items: center; justify-content: center;
}
.ns-profile-stat strong { display: block; font-size: 1.35rem; font-weight: 800; letter-spacing: -0.02em; }
.ns-profile-stat span { font-size: 0.78rem; color: var(--ns-text-dim); }

/* Wishlist heart badge on card */
.ns-wishlist-badge {
  position: absolute;
  bottom: 0.6rem; left: 0.75rem;
  color: var(--ns-red-bright);
  font-size: 0.85rem;
  filter: drop-shadow(0 0 5px rgba(232,0,26,0.65));
  pointer-events: none;
}

/* Prevent right-click save on media */
.ns-video-wrap video,
.ns-video-wrap img,
.ns-panel-video-wrap video,
.ns-panel-video-wrap img,
.ns-preview-video-wrap video,
.ns-preview-video-wrap img {
  -webkit-user-select: none;
  user-select: none;
  pointer-events: none;
}

/* Action button — perfectly centred on the video on hover only.
   Lives inside the video wrap so it's always centred to the video, not the card. */
.ns-video-wrap .ns-video-fab {
  position: absolute;
  left: 50%; top: 50%;
  transform: translate(-50%, -50%) scale(0.8);
  z-index: 6;
  width: 44px; height: 44px;
  border-radius: 50%;
  background: rgba(232,0,26,0.92);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.88rem;
  border: 1px solid rgba(255,255,255,0.18);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 6px 22px rgba(0,0,0,0.55), 0 0 0 1px rgba(0,0,0,0.25);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--ns-tf), transform 0.28s var(--ns-ease), box-shadow var(--ns-tm), background var(--ns-tf);
}
.ns-video-wrap .ns-video-fab i { transform: translateX(1px); }
.ns-video-card:hover .ns-video-fab {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
  pointer-events: auto;
  background: var(--ns-red);
  box-shadow: 0 12px 30px var(--ns-red-glow), 0 0 22px var(--ns-red-glow);
}
.ns-video-wrap .ns-video-fab:active { transform: translate(-50%, -50%) scale(0.94) !important; }
@media (hover: none) {
  /* Touch devices have no hover — keep the FAB visible (still centred) */
  .ns-video-wrap .ns-video-fab {
    opacity: 0.92; pointer-events: auto;
    transform: translate(-50%, -50%) scale(1);
  }
}

/* Loading state */
.ns-video-card.is-loading .ns-video-wrap { background: none; }
.ns-card-skeleton { border-radius: var(--ns-r-xl); overflow: hidden; }
.ns-card-skeleton .ns-video-wrap { background: var(--ns-bg-raised); }
.ns-skeleton-line { height: 12px; border-radius: 6px; margin: 0.5rem 1.1rem; }

/* Empty state */
.ns-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 5rem 2rem;
}
.ns-empty-icon { font-size: 3rem; color: var(--ns-text-xdim); margin-bottom: 1rem; }
.ns-empty h3 { font-size: 1.2rem; margin-bottom: 0.5rem; }
.ns-empty p { color: var(--ns-text-muted); font-size: 0.9rem; }

/* ── Detail Panel ─────────────────────────────────────────────────────────── */
.ns-panel-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: var(--ns-z-panel);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--ns-tm);
}
.ns-panel-backdrop.is-open { opacity: 1; pointer-events: all; }

.ns-detail-panel {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  z-index: calc(var(--ns-z-panel) + 1);
  background: var(--ns-bg-raised);
  border-top: 1px solid var(--ns-border-med);
  border-radius: var(--ns-r-xl) var(--ns-r-xl) 0 0;
  max-height: 72vh;
  overflow: visible;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(100%);
  transition: transform var(--ns-tm), opacity 0.2s ease, visibility var(--ns-tm);
  box-shadow: 0 -20px 70px rgba(0,0,0,0.55);
}
.ns-detail-panel.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: all;
  transform: translateY(0);
}
/* The real panel video stays *transparent* (not display:none) while the morph
   is flying — keeps layout stable so the clone lands on the right spot. */
.ns-detail-panel.is-morphing .ns-panel-video-wrap > * { opacity: 0; }

/* Morphing clone (shared-element transition) */
.ns-morph-clone {
  position: fixed;
  z-index: calc(var(--ns-z-modal) + 5);
  overflow: hidden;
  border-radius: 12px;
  pointer-events: none;
  background: #0c0c0c;
}
.ns-morph-clone video, .ns-morph-clone img { width: 100%; height: 100%; object-fit: cover; }

/* Drag handle — visibly clickable: "tap to close" affordance */
.ns-panel-drag {
  width: 64px; height: 5px;
  background: var(--ns-border-med);
  border-radius: 3px;
  margin: 0.85rem auto 0;
  cursor: pointer;
  transition: background var(--ns-tf), width var(--ns-tf);
}
.ns-panel-drag:hover { background: var(--ns-red); width: 80px; }

/* Scroll inside the panel-inner so the floating buttons stay visible */
.ns-panel-inner {
  padding: 1.5rem 2rem 2.5rem;
  max-height: calc(72vh - 30px);
  overflow-y: auto;
}

.ns-panel-video-wrap {
  aspect-ratio: 4864 / 384;
  background: #111;
  border-radius: var(--ns-r-lg);
  overflow: hidden;
  margin-bottom: 1.5rem;
}
.ns-panel-video-wrap video { width: 100%; height: 100%; object-fit: cover; }

.ns-panel-body {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 2rem;
  align-items: start;
}
.ns-panel-title {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.025em;
  margin-bottom: 0.5rem;
}
.ns-panel-meta {
  display: flex; align-items: center; gap: 0.75rem; flex-wrap: wrap;
  margin-bottom: 1rem;
  font-size: 0.85rem;
  color: var(--ns-text-dim);
}
.ns-panel-desc { font-size: 0.92rem; color: var(--ns-text-muted); line-height: 1.7; margin-bottom: 1rem; }
.ns-panel-tags { display: flex; flex-wrap: wrap; gap: 0.4rem; }

.ns-panel-actions {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  min-width: 200px;
}
.ns-panel-price {
  text-align: center;
  font-size: 1.75rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 0.25rem;
}
.ns-panel-price span { font-size: 0.85rem; font-weight: 400; color: var(--ns-text-dim); }
.ns-panel-close {
  position: absolute;
  top: 1.25rem; right: 1.5rem;
  width: 38px; height: 38px;
  border-radius: 50%;
  background: var(--ns-bg-card);
  border: 1px solid var(--ns-border);
  display: flex; align-items: center; justify-content: center;
  color: var(--ns-text-muted);
  cursor: pointer;
  font-size: 0.9rem;
  transition: background var(--ns-tf), color var(--ns-tf), border-color var(--ns-tf);
}
.ns-panel-close:hover { background: var(--ns-red-subtle); color: var(--ns-red); border-color: var(--ns-red-border); }

/* Fully round close buttons (cart, filter sheet) */
#ns-cart-close, #ns-filter-close {
  width: 34px; height: 34px;
  padding: 0;
  border-radius: 50%;
  justify-content: center;
  flex-shrink: 0;
}

/* ── Cart Dropdown ────────────────────────────────────────────────────────── */
.ns-cart-wrap {
  position: relative;
  flex-shrink: 0;
}

.ns-cart-pop {
  position: absolute;
  top: calc(100% + 0.65rem);
  right: 0;
  width: 360px;
  max-height: 500px;
  display: flex;
  flex-direction: column;
  background: var(--ns-bg-raised);
  border: 1px solid var(--ns-border-med);
  border-radius: var(--ns-r-lg);
  box-shadow: 0 30px 70px rgba(0,0,0,0.6);
  opacity: 0;
  pointer-events: none;
  transform: translateY(-8px);
  transition: opacity var(--ns-tf), transform var(--ns-tf);
  z-index: calc(var(--ns-z-topbar) + 5);
  overflow: visible;
}
/* Inner clip wrapper so content respects border-radius */
.ns-cart-pop-head,
.ns-cart-pop-footer { border-radius: 0; }
.ns-cart-pop-head { border-radius: var(--ns-r-lg) var(--ns-r-lg) 0 0; overflow: hidden; }
.ns-cart-pop-footer { border-radius: 0 0 var(--ns-r-lg) var(--ns-r-lg); overflow: hidden; }

/* Arrow callout */
.ns-cart-pop::before {
  content: '';
  position: absolute;
  top: -6px; right: 1.1rem;
  width: 12px; height: 12px;
  background: var(--ns-bg-raised);
  border-left: 1px solid var(--ns-border-med);
  border-top: 1px solid var(--ns-border-med);
  transform: rotate(45deg);
  z-index: 1;
}
.ns-cart-wrap.is-open .ns-cart-pop {
  opacity: 1; pointer-events: auto; transform: translateY(0);
}

.ns-cart-pop-head {
  padding: 1rem 1.25rem 0.75rem;
  border-bottom: 1px solid var(--ns-border);
  display: flex; align-items: center; justify-content: space-between;
  font-size: 0.92rem; font-weight: 700;
  flex-shrink: 0;
}
.ns-cart-pop-tally {
  font-size: 0.75rem; font-weight: 500;
  color: var(--ns-text-dim);
}

.ns-cart-pop-body {
  flex: 1;
  overflow-y: auto;
  padding: 0.5rem 1.25rem;
  min-height: 80px;
  max-height: 280px;
}

.ns-cart-pop-footer {
  padding: 0.85rem 1.25rem 1.1rem;
  border-top: 1px solid var(--ns-border);
  flex-shrink: 0;
  background: var(--ns-bg-alt);
}

.ns-cart-empty { text-align: center; padding: 2.5rem 1rem; color: var(--ns-text-dim); font-size: 0.88rem; }
.ns-cart-item {
  display: flex; align-items: center; gap: 0.65rem;
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--ns-border-soft);
}
.ns-cart-item-thumb {
  width: 72px;
  aspect-ratio: 4864 / 384;
  background: var(--ns-bg-card);
  border-radius: var(--ns-r-sm);
  overflow: hidden;
  flex-shrink: 0;
}
.ns-cart-item-thumb video,
.ns-cart-item-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ns-cart-item-info { flex: 1; min-width: 0; }
.ns-cart-item-title { font-size: 0.82rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ns-cart-item-price { font-size: 0.75rem; color: var(--ns-red-bright); font-weight: 700; margin-top: 0.15rem; }
.ns-cart-item-remove { color: var(--ns-text-dim); cursor: pointer; font-size: 0.8rem; padding: 0.25rem; transition: color var(--ns-tf); flex-shrink: 0; border: none; background: none; }
.ns-cart-item-remove:hover { color: var(--ns-red); }

.ns-cart-total {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 0.75rem; font-size: 0.9rem;
}
.ns-cart-total strong { font-size: 1.1rem; font-weight: 800; color: var(--ns-red-bright); }

/* ── Mobile Sidebar Toggle ────────────────────────────────────────────────── */
.ns-filter-toggle {
  display: none;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background: var(--ns-bg-card);
  border: 1px solid var(--ns-border);
  border-radius: var(--ns-r-full);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--ns-text-muted);
  cursor: pointer;
  transition: all var(--ns-tf);
}
.ns-filter-toggle:hover { color: var(--ns-text); border-color: var(--ns-border-med); }
.ns-mobile-filter-sheet {
  position: fixed;
  inset: 0;
  z-index: var(--ns-z-modal);
  background: rgba(0,0,0,0.8);
  opacity: 0; pointer-events: none; transition: opacity var(--ns-tm);
}
.ns-mobile-filter-sheet.is-open { opacity: 1; pointer-events: all; }
.ns-mobile-filter-inner {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  background: var(--ns-bg-raised);
  border-radius: var(--ns-r-xl) var(--ns-r-xl) 0 0;
  padding: 1.5rem;
  max-height: 80vh;
  overflow-y: auto;
  transform: translateY(100%);
  transition: transform var(--ns-tm);
}
.ns-mobile-filter-sheet.is-open .ns-mobile-filter-inner { transform: translateY(0); }

/* ── Cart polish ──────────────────────────────────────────────────────────── */
.ns-cart-panel { background: linear-gradient(180deg, var(--ns-bg-raised) 0%, var(--ns-bg-alt) 100%); }
.ns-cart-item { transition: background var(--ns-tf); border-radius: var(--ns-r-md); padding-left: 0.5rem; padding-right: 0.5rem; }
.ns-cart-item:hover { background: var(--ns-bg-card); }
.ns-cart-item-thumb .ns-video-placeholder { font-size: 0.55rem; letter-spacing: 0.1em; }
.ns-cart-note {
  display: flex; align-items: flex-start; gap: 0.5rem;
  font-size: 0.75rem; color: var(--ns-text-dim);
  background: var(--ns-red-subtle); border: 1px solid var(--ns-red-border);
  border-radius: var(--ns-r-md); padding: 0.6rem 0.75rem; margin-bottom: 1rem; line-height: 1.5;
}
.ns-cart-note i { color: var(--ns-red); margin-top: 1px; }
.ns-cart-total strong { transition: transform var(--ns-tf); display: inline-block; }

/* Panel content reveal helpers */
.ns-panel-reveal { opacity: 0; transform: translateY(16px); }

/* Detail tag pills clickable look */
.ns-panel-tags .ns-tag { font-size: 0.7rem; }

/* Detail download (owned) */
.ns-detail-owned-row { display: flex; align-items: center; gap: 0.5rem; font-size: 0.8rem; color: #00e650; margin-bottom: 0.5rem; }

/* ── Wishlist heart next to the title (card) ──────────────────────────────── */
.ns-card-heart {
  color: var(--ns-red-bright);
  font-size: 0.8rem;
  flex-shrink: 0;
  filter: drop-shadow(0 0 5px rgba(232,0,26,0.55));
}

/* ── Panel title row + heart ──────────────────────────────────────────────── */
.ns-panel-title-row { display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap; }
.ns-panel-title-row .ns-panel-title { margin-bottom: 0; }
.ns-panel-heart {
  display: none;
  align-items: center;
  color: var(--ns-red-bright);
  font-size: 1rem;
  filter: drop-shadow(0 0 6px rgba(232,0,26,0.6));
}

/* ── Detail panel close: floats ABOVE the panel (desktop + mobile) ─────────── */
.ns-panel-close {
  top: -54px; right: 1.25rem;
  width: 42px; height: 42px;
  background: var(--ns-bg-raised);
  box-shadow: 0 10px 30px rgba(0,0,0,0.55);
  z-index: 3;
}

/* Filter-Presets row */
.ns-preset {
  display: flex; align-items: stretch; gap: 0.3rem;
}
.ns-preset-apply {
  flex: 1; display: flex; align-items: center; gap: 0.5rem;
  padding: 0.45rem 0.65rem;
  background: var(--ns-bg-card); border: 1px solid var(--ns-border);
  border-radius: var(--ns-r-md);
  color: var(--ns-text); font-size: 0.82rem;
  cursor: pointer; text-align: left;
  transition: background var(--ns-tf), border-color var(--ns-tf);
}
.ns-preset-apply:hover { background: var(--ns-red-subtle); border-color: var(--ns-red-border); color: var(--ns-red-bright); }
.ns-preset-apply i { color: var(--ns-red); }
.ns-preset-del {
  width: 28px; flex-shrink: 0;
  background: var(--ns-bg-card); border: 1px solid var(--ns-border);
  border-radius: var(--ns-r-md);
  color: var(--ns-text-dim); cursor: pointer;
  transition: color var(--ns-tf), border-color var(--ns-tf);
}
.ns-preset-del:hover { color: var(--ns-red); border-color: var(--ns-red-border); }

/* Floating slideshow buttons — sit above the panel, on its left */
.ns-panel-nav {
  position: absolute;
  top: -54px;
  width: 42px; height: 42px;
  border-radius: 50%;
  background: var(--ns-bg-raised);
  border: 1px solid var(--ns-border-med);
  color: var(--ns-text);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.95rem;
  cursor: pointer;
  box-shadow: 0 10px 30px rgba(0,0,0,0.55);
  z-index: 3;
  transition: background var(--ns-tf), border-color var(--ns-tf), transform var(--ns-tf);
}
.ns-panel-nav:hover { background: var(--ns-red-subtle); border-color: var(--ns-red-border); color: var(--ns-red-bright); transform: scale(1.06); }
.ns-panel-nav-prev      { left: 1.25rem; }
.ns-panel-nav-next      { left: 4.5rem; }
.ns-panel-nav-slideshow { left: 7.75rem; }
.ns-panel-nav-slideshow.is-on { background: var(--ns-red); color: #fff; border-color: var(--ns-red); }
@media (max-width: 768px) {
  .ns-panel-nav { width: 36px; height: 36px; top: -50px; }
  .ns-panel-nav-next      { left: 3.75rem; }
  .ns-panel-nav-slideshow { left: 6.5rem; }
}

/* ── Card action row — absolute in info strip, card height never grows */
.ns-card-actions {
  position: absolute;
  right: 0.7rem;
  bottom: 0.55rem;
  display: flex;
  align-items: center;
  gap: 0.3rem;
  opacity: 0;
  transition: opacity 0.18s ease;
  z-index: 3;
}
.ns-video-card:hover .ns-card-actions { opacity: 1; }
@media (hover: none) { .ns-card-actions { opacity: 1; } }
.ns-card-actions button {
  flex-shrink: 0;
  width: 26px; height: 26px;
  border-radius: 50%;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--ns-border);
  color: var(--ns-text-muted);
  font-size: 0.62rem;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: background var(--ns-tf), color var(--ns-tf), border-color var(--ns-tf);
}
.ns-card-actions .ns-card-quick-cart:hover { background: var(--ns-red-subtle); color: var(--ns-red-bright); border-color: var(--ns-red-border); }
.ns-card-actions .ns-card-quick-cart.in-cart { background: rgba(0,230,80,0.12); color: #00e650; border-color: rgba(0,230,80,0.3); }
.ns-card-actions .ns-card-note:hover { background: rgba(255,200,0,0.12); color: #ffd000; border-color: rgba(255,200,0,0.25); }
.ns-card-actions .ns-card-note.has-note { color: #ffd000; border-color: rgba(255,200,0,0.3); background: rgba(255,200,0,0.06); }
.ns-card-actions .ns-card-compare:hover,
.ns-card-actions .ns-card-compare.is-on { background: var(--ns-red-subtle); color: var(--ns-red-bright); border-color: var(--ns-red-border); }
.ns-card-actions .ns-card-compare.is-on { background: var(--ns-red); color: #fff; }

/* ── Compare-Bar (fixed bottom) — redesigned ─────────────────────────────── */
.ns-compare-bar {
  position: fixed;
  left: 50%; bottom: 1.25rem;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.65rem 1rem 0.65rem 1.25rem;
  background: linear-gradient(135deg, rgba(20,20,20,0.98), rgba(16,10,10,0.98));
  border: 1px solid var(--ns-red-border);
  border-radius: var(--ns-r-xl);
  box-shadow: 0 20px 60px rgba(0,0,0,0.7), 0 0 0 1px rgba(232,0,26,0.1), 0 0 30px rgba(232,0,26,0.12);
  z-index: calc(var(--ns-z-modal) - 1);
  font-size: 0.85rem;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  animation: ns-compare-bar-in 0.35s var(--ns-ease) forwards;
}
@keyframes ns-compare-bar-in {
  from { transform: translateX(-50%) translateY(120%); opacity: 0; }
  to { transform: translateX(-50%) translateY(0); opacity: 1; }
}
.ns-compare-bar-slots {
  display: flex; align-items: center; gap: 0.65rem;
}
.ns-compare-bar-slot {
  display: flex; align-items: center; gap: 0.5rem;
  font-size: 0.8rem; color: var(--ns-text-muted);
}
.ns-cbar-thumb {
  width: 56px;
  aspect-ratio: 12/1;
  background: rgba(232,0,26,0.08);
  border: 1px dashed var(--ns-red-border);
  border-radius: 6px;
  overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  color: var(--ns-text-xdim);
  font-size: 0.65rem;
  flex-shrink: 0;
  transition: border-color var(--ns-tf);
}
.ns-cbar-thumb.has-visual {
  border-style: solid;
  border-color: var(--ns-red-border);
}
.ns-cbar-thumb video { width: 100%; height: 100%; object-fit: cover; display: block; }
.ns-cbar-label {
  font-size: 0.75rem;
  max-width: 90px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  color: var(--ns-text-dim);
}
.ns-compare-bar-vs {
  font-size: 0.75rem; font-weight: 800; letter-spacing: 0.1em;
  color: var(--ns-red-bright);
  opacity: 0.7;
}
.ns-compare-bar-actions { display: flex; align-items: center; gap: 0.4rem; }

/* ── Compare-Modal — fully redesigned ────────────────────────────────────── */
.ns-compare-modal {
  padding: 1rem;
  align-items: center;
  overflow-y: auto;
}
.ns-compare-modal .ns-compare-stage {
  width: 100%; max-width: 1200px;
  background: var(--ns-bg-raised);
  border: 1px solid var(--ns-border-med);
  border-radius: var(--ns-r-xl);
  padding: 2rem;
  position: relative;
  transform: scale(0.94) translateY(20px);
  transition: transform var(--ns-tm), opacity var(--ns-tm);
  opacity: 0;
}
.ns-compare-modal.is-open .ns-compare-stage { transform: scale(1) translateY(0); opacity: 1; }

.ns-compare-stage-head {
  margin-bottom: 1.75rem;
  display: flex; flex-direction: column; gap: 0.25rem;
}
.ns-compare-stage-head h3 { font-size: 1.25rem; font-weight: 800; }

/* 3-column grid: item A | VS divider | item B */
.ns-compare-grid {
  display: grid;
  grid-template-columns: 1fr 48px 1fr;
  gap: 0;
  align-items: start;
}
.ns-compare-item {
  display: flex; flex-direction: column; gap: 1rem;
}
.ns-compare-video-wrap {
  background: #0c0c0c;
  border-radius: var(--ns-r-lg);
  overflow: hidden;
  aspect-ratio: 4864 / 384;
  border: 1px solid var(--ns-border);
}
.ns-compare-video-wrap video { width: 100%; height: 100%; object-fit: cover; display: block; }
.ns-compare-info {
  background: var(--ns-bg-card);
  border: 1px solid var(--ns-border);
  border-radius: var(--ns-r-lg);
  padding: 1rem 1.1rem;
  display: flex; flex-direction: column; gap: 0.75rem;
}
.ns-compare-title {
  font-size: 1rem; font-weight: 700;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.ns-compare-specs {
  display: flex; flex-direction: column; gap: 0.35rem;
}
.ns-spec-row {
  display: flex; align-items: center; gap: 0.6rem;
  font-size: 0.82rem;
}
.ns-spec-row dt {
  width: 16px; text-align: center; flex-shrink: 0;
  color: var(--ns-text-dim); font-size: 0.75rem;
}
.ns-spec-row dd {
  color: var(--ns-text-muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.ns-spec-tags-row dd { white-space: normal; display: flex; flex-wrap: wrap; gap: 0.25rem; }
.ns-compare-item-actions { display: flex; flex-direction: column; gap: 0.4rem; margin-top: auto; }

/* VS divider column */
.ns-compare-vs-col {
  display: flex; flex-direction: column;
  align-items: center;
  gap: 0;
  padding-top: 1.5rem;
}
.ns-compare-vs-line {
  flex: 1;
  width: 1px;
  min-height: 40px;
  background: linear-gradient(180deg, transparent, var(--ns-red-border), transparent);
}
.ns-compare-vs-badge {
  width: 36px; height: 36px; flex-shrink: 0;
  border-radius: 50%;
  background: var(--ns-red-subtle);
  border: 1px solid var(--ns-red-border);
  color: var(--ns-red-bright);
  font-size: 0.68rem; font-weight: 800; letter-spacing: 0.08em;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 0 14px rgba(232,0,26,0.2);
}

@media (max-width: 800px) {
  .ns-compare-grid { grid-template-columns: 1fr; }
  .ns-compare-vs-col { flex-direction: row; padding-top: 0; }
  .ns-compare-vs-line { flex: 1; min-height: 0; height: 1px; }
}

/* ── Trending Widget ─────────────────────────────────────────────────────── */
.ns-trending-tile {
  display: flex; align-items: center; gap: 0.55rem;
  padding: 0.4rem; width: 100%;
  background: var(--ns-bg-card); border: 1px solid var(--ns-border);
  border-radius: var(--ns-r-md);
  cursor: pointer; text-align: left;
  transition: background var(--ns-tf), border-color var(--ns-tf);
}
.ns-trending-tile:hover { background: var(--ns-red-subtle); border-color: var(--ns-red-border); }
.ns-trending-thumb {
  width: 56px; aspect-ratio: 4864/384;
  background: #0c0c0c; border-radius: var(--ns-r-sm);
  overflow: hidden; flex-shrink: 0;
}
.ns-trending-thumb video, .ns-trending-thumb img { width:100%; height:100%; object-fit:cover; }
.ns-trending-meta { flex: 1; min-width: 0; font-size: 0.78rem; line-height: 1.3; }
.ns-trending-meta strong { display: block; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--ns-text); }
.ns-trending-meta span { font-size: 0.7rem; color: var(--ns-red-bright); }

/* ── Clickable detail-panel tags ─────────────────────────────────────────── */
.ns-tag.ns-tag-click { cursor: pointer; transition: background var(--ns-tf), border-color var(--ns-tf); border: 1px solid var(--ns-border); }
.ns-tag.ns-tag-click:hover { background: var(--ns-red-subtle); border-color: var(--ns-red-border); color: var(--ns-red-bright); }

/* ── Header actions row + mobile search ───────────────────────────────────── */
.ns-header-actions {
  display: flex;
  gap: 0.65rem;
  align-items: center;
  flex-wrap: nowrap;
}
/* Action strip: inline on desktop, scrollable row on mobile */
.ns-action-strip {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}
.ns-mobile-search { display: none; position: relative; flex: 1; min-width: 0; }
.ns-mobile-search input {
  width: 100%;
  background: var(--ns-bg-card);
  border: 1px solid var(--ns-border);
  border-radius: var(--ns-r-full);
  padding: 0.55rem 1rem 0.55rem 2.4rem;
  color: var(--ns-text);
  font-size: 0.9rem;
  font-family: var(--ns-font);
  outline: none;
  transition: border-color var(--ns-tf), background var(--ns-tf);
}
.ns-mobile-search input::placeholder { color: var(--ns-text-xdim); }
.ns-mobile-search input:focus { border-color: var(--ns-red-border); background: rgba(232,0,26,0.03); }
.ns-mobile-search i { position: absolute; left: 0.85rem; top: 50%; transform: translateY(-50%); color: var(--ns-text-dim); font-size: 0.8rem; pointer-events: none; }

/* ── Mobile dropdown extras (credits + cart) ──────────────────────────────── */
.ns-dropdown-mobile-only { display: none; }
.ns-dropdown-credits-row {
  padding: 0.65rem 1rem 0.5rem;
}
.ns-dropdown-credits {
  display: flex; align-items: center; gap: 0.5rem;
  font-size: 0.85rem; font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--ns-text);
}
.ns-dropdown-credits i { width: 14px; text-align: center; }
.ns-dropdown-credits-btns {
  display: flex; gap: 0.35rem;
}
.ns-dropdown-credits-btns .ns-btn { font-size: 0.8rem; padding: 0.35rem 0; }
.ns-dropdown-cart-count {
  margin-left: auto;
  min-width: 20px; height: 20px; padding: 0 6px;
  background: var(--ns-red); color: #fff;
  border-radius: var(--ns-r-full);
  font-size: 0.68rem; font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center;
}

/* ── Filter sheet (hosts the real sidebar) ────────────────────────────────── */
.ns-filter-sheet-head {
  position: sticky; top: 0;
  display: flex; align-items: center; justify-content: space-between;
  padding-bottom: 1rem; margin-bottom: 1rem;
  border-bottom: 1px solid var(--ns-border);
  background: var(--ns-bg-raised);
  z-index: 2;
}
.ns-filter-sheet-head h3 { font-size: 1.05rem; font-weight: 700; }
.ns-sheet-close {
  width: 36px; height: 36px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--ns-bg-card); border: 1px solid var(--ns-border);
  color: var(--ns-text-muted); cursor: pointer; font-size: 0.9rem;
  transition: background var(--ns-tf), color var(--ns-tf), border-color var(--ns-tf);
}
.ns-sheet-close:hover { background: var(--ns-red-subtle); color: var(--ns-red); border-color: var(--ns-red-border); }
/* When the real sidebar is hosted inside the sheet, neutralise its layout */
.ns-mobile-filter-inner .ns-sidebar.in-sheet {
  display: flex !important;
  position: static !important;
  width: 100% !important;
  max-width: none !important;
  height: auto !important;
  top: auto !important;
  border: none !important;
  background: transparent !important;
  padding: 0 !important;
  overflow: visible !important;
}

/* ── Responsive Portal ────────────────────────────────────────────────────── */
@media (max-width: 1024px) {
  .ns-sidebar { display: none; }
  .ns-portal-wrap { flex-direction: column; }
  .ns-portal-main { padding: 1.5rem; }
  .ns-filter-toggle { display: flex; }
  .ns-panel-body { grid-template-columns: 1fr; }
  /* Bigger filter sheet — over 70% of the screen */
  .ns-mobile-filter-inner { min-height: 74vh; max-height: 90vh; }
}
@media (max-width: 768px) {
  .ns-video-grid { grid-template-columns: 1fr; }
  .ns-portal-topbar { padding: 0 1rem; gap: 0.5rem; grid-template-columns: auto 1fr auto; }

  /* Mobile topbar: only logo + avatar — hide search, credits, cart */
  .ns-portal-search { display: none; }
  .ns-credits-wrap { display: none; }
  .ns-cart-btn { display: none; }
  .ns-dropdown-mobile-only { display: block; }

  /* Header actions: 2 rows on mobile */
  .ns-mobile-search { display: flex; flex: 1 1 auto; min-width: 0; }
  .ns-header-actions {
    width: 100%;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
  }
  /* Row 1: search + custom + filter (stay inline) */
  .ns-mobile-search { order: 1; }
  #ns-custom-order-btn { order: 1; flex-shrink: 0; }
  .ns-filter-toggle { order: 1; flex-shrink: 0; }
  /* Row 2: scrollable action strip */
  .ns-action-strip {
    order: 2;
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 2px;
    gap: 0.5rem;
  }
  .ns-action-strip::-webkit-scrollbar { display: none; }

  /* Credits summary smaller */
  .ns-credits-summary { font-size: 0.75rem; padding: 0.55rem 0.75rem; }

  /* Taller cards so more of the video is visible */
  .ns-video-wrap { aspect-ratio: auto; height: 76px; }
  .ns-card-info { padding-top: 1rem; }

  /* Center everything in the detail panel on mobile */
  .ns-panel-body { text-align: center; }
  .ns-panel-title-row { justify-content: center; }
  .ns-panel-meta { justify-content: center; }
  .ns-panel-tags { justify-content: center; }
  .ns-panel-actions { align-items: stretch; }
}
@media (max-width: 480px) {
  .ns-panel-inner { padding: 1.25rem 1rem 2rem; }
  .ns-custom-btn-label, .ns-filter-btn-label { display: none; }
  .ns-video-wrap { height: 68px; }
}

/* ── Cart panel legacy rules removed — replaced by dropdown above ───────────── */
/* ── Cart polish ─────────────────────────────────────────────────────────── */
.ns-cart-pop-body { scrollbar-width: thin; scrollbar-color: var(--ns-border-med) transparent; }
.ns-cart-item { transition: background var(--ns-tf); border-radius: var(--ns-r-md); padding-left: 0.35rem; padding-right: 0.35rem; }
.ns-cart-item:hover { background: var(--ns-bg-card); }
.ns-cart-item-thumb .ns-video-placeholder { font-size: 0.5rem; letter-spacing: 0.1em; }
.ns-cart-note {
  display: flex; align-items: flex-start; gap: 0.5rem;
  font-size: 0.72rem; color: var(--ns-text-dim);
  background: var(--ns-red-subtle); border: 1px solid var(--ns-red-border);
  border-radius: var(--ns-r-md); padding: 0.5rem 0.65rem; margin-bottom: 0.75rem; line-height: 1.5;
}
.ns-cart-note i { color: var(--ns-red); margin-top: 1px; flex-shrink: 0; }

/* ── Additional panel nav buttons ─────────────────────────────────────────── */
.ns-panel-nav-fullscreen { left: 11rem; }
.ns-panel-nav-note      { left: 14.25rem; }
@media (max-width: 768px) {
  .ns-panel-nav-fullscreen { left: 9.5rem; }
  .ns-panel-nav-note      { left: 12.75rem; }
}

/* ── Grid Density Toggle ─────────────────────────────────────────────────── */
.ns-grid-toggle {
  display: flex;
  align-items: center;
  background: var(--ns-bg-card);
  border: 1px solid var(--ns-border);
  border-radius: var(--ns-r-md);
  overflow: hidden;
}
.ns-grid-btn {
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  color: var(--ns-text-dim);
  font-size: 0.75rem;
  border: none; background: none;
  cursor: pointer;
  transition: color var(--ns-tf), background var(--ns-tf);
}
.ns-grid-btn:hover { color: var(--ns-text); background: var(--ns-bg-card-hover); }
.ns-grid-btn.is-active { color: var(--ns-red-bright); background: var(--ns-red-subtle); }

/* 3-column grid variant */
.ns-video-grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.ns-video-grid.cols-1 {
  grid-template-columns: 1fr;
  max-width: 800px;
}

/* ── Affordable filter button (active state) ──────────────────────────────── */
.ns-affordable-btn.is-active { color: #00e650 !important; }

/* ── Note display in Detail Panel ───────────────────────────────────────── */
.ns-panel-note-wrap {
  margin-top: 0.85rem;
  padding: 0.75rem 0.85rem;
  background: rgba(255,200,0,0.05);
  border: 1px solid rgba(255,200,0,0.2);
  border-radius: var(--ns-r-md);
}
.ns-panel-note-label {
  font-size: 0.68rem; font-weight: 700; letter-spacing: 0.12em;
  text-transform: uppercase; color: #ffd000;
  margin-bottom: 0.35rem;
  display: flex; align-items: center; gap: 0.35rem;
}
.ns-panel-note-text {
  font-size: 0.88rem; color: var(--ns-text-muted);
  line-height: 1.55; white-space: pre-wrap; margin: 0;
}

/* ── Notes Modal ──────────────────────────────────────────────────────────── */
/* Uses existing .ns-confirm-backdrop, .ns-confirm etc. */

/* ── Shortcuts Overlay ────────────────────────────────────────────────────── */
.ns-shortcuts-overlay {
  position: fixed; inset: 0;
  z-index: var(--ns-z-modal);
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(8px);
  display: flex; align-items: center; justify-content: center;
  opacity: 0; pointer-events: none;
  transition: opacity var(--ns-tf);
}
.ns-shortcuts-overlay.is-open { opacity: 1; pointer-events: all; }
.ns-shortcuts-box {
  width: 480px; max-width: calc(100vw - 2rem);
  background: var(--ns-bg-raised);
  border: 1px solid var(--ns-border-med);
  border-radius: var(--ns-r-xl);
  padding: 1.75rem;
  box-shadow: 0 40px 80px rgba(0,0,0,0.7);
  transform: scale(0.93);
  transition: transform var(--ns-tm);
}
.ns-shortcuts-overlay.is-open .ns-shortcuts-box { transform: scale(1); }
.ns-shortcuts-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 1.25rem;
}
.ns-shortcuts-head h3 { font-size: 1rem; font-weight: 700; display: flex; align-items: center; gap: 0.5rem; }
.ns-shortcuts-close {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--ns-bg-card); border: 1px solid var(--ns-border);
  color: var(--ns-text-dim); cursor: pointer; font-size: 0.85rem;
  display: flex; align-items: center; justify-content: center;
  transition: background var(--ns-tf), color var(--ns-tf);
}
.ns-shortcuts-close:hover { background: var(--ns-red-subtle); color: var(--ns-red); }
.ns-shortcuts-grid { display: flex; flex-direction: column; gap: 0.45rem; }
.ns-shortcut-row {
  display: flex; align-items: center; gap: 0.75rem;
  font-size: 0.85rem; color: var(--ns-text-muted);
}
.ns-shortcut-row kbd {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 28px; height: 24px; padding: 0 0.4rem;
  background: var(--ns-bg-card); border: 1px solid var(--ns-border-med);
  border-radius: 5px; border-bottom-width: 2px;
  font-size: 0.72rem; font-weight: 700; font-family: var(--ns-font);
  color: var(--ns-text); letter-spacing: 0;
}
.ns-shortcut-row span { flex: 1; }

/* ── Fullscreen mode for panel video ─────────────────────────────────────── */
.ns-video-fullscreen {
  position: fixed !important;
  inset: 0 !important;
  z-index: var(--ns-z-modal) !important;
  border-radius: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  background: #000 !important;
  margin: 0 !important;
  display: flex; align-items: center; justify-content: center;
}
.ns-video-fullscreen video {
  width: 100%; height: 100%; object-fit: contain;
  border-radius: 0 !important;
}

/* ── Credits summary bar ──────────────────────────────────────────────────── */
.ns-credits-summary {
  display: flex; align-items: center; gap: 0.5rem;
  font-size: 0.72rem; color: var(--ns-text-dim);
  padding: 0.6rem 0; margin-bottom: 1rem;
  border-bottom: 1px solid var(--ns-border-soft);
}
.ns-credits-summary i { color: var(--ns-red); }
.ns-credits-summary strong { color: var(--ns-text); }

/* ── Responsive: hide extras on mobile ───────────────────────────────────── */
@media (max-width: 1024px) {
  .ns-grid-toggle { display: none; }
  .ns-affordable-btn { display: none; }
}
@media (max-width: 768px) {
  .ns-portal-search { display: none; }
  .ns-compare-bar { bottom: 4rem; }
}
