/* ============================================
   Newton Store Search — Apple-Inspired
   Lightweight rewrite. Clean. Elegant. Yours.
   ============================================ */

:root {
  --ns-text: #1D1D1F;
  --ns-text-secondary: #6E6E73;
  --ns-text-tertiary: #86868B;
  --ns-link: #0066CC;
  --ns-link-hover: #0077ED;
  --ns-bg: #FBFBFD;
  --ns-white: #FFFFFF;
  --ns-body: #FFFFFF;
  --ns-border: #D2D2D7;
  --ns-border-light: #E8E8ED;
  --ns-highlight-new: #BF4800;
  --ns-highlight-refurbished: #AF52DE;
  --ns-highlight-reduced: #FF3B30;
  --ns-highlight-exdemo: #FF9500;
  --ns-highlight-repackaged: #5856D6;
  --ns-highlight-endofline: #FF2D55;
  --ns-highlight-clearance: #FF2D55;
  --ns-highlight-preorder: #007AFF;
  --ns-green: #34C759;
  --ns-red: #FF3B30;
  --ns-orange: #FF9500;
  --navbar-height: 60px;
}

body {
background: var(--ns-body);
}

body.ns-landing-active {
  background: #F5F5F7;
}

body.ns-landing-active .ns-search-bar {
  background: #F5F5F7;
  border-bottom-color: transparent;
}

/* ── Container ─────────────────────────────── */
.ns-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 24px;
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Helvetica Neue', sans-serif;
  -webkit-font-smoothing: antialiased;
  color: var(--ns-text);
}

/* Prevent sticky flicker when content barely fills the viewport */
.ns-container { min-height: 100vh; }

/* ── Search Bar ────────────────────────────── */
.ns-search-bar {
  position: sticky;
  top: var(--navbar-height, 60px);
  z-index: 100;
  background: rgba(251, 251, 253, 0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  will-change: transform;
  padding: 16px 0;
  border-bottom: 1px solid var(--ns-border-light);
  /* Break out of container to full viewport width */
  margin-left: calc(-50vw + 50%);
  margin-right: calc(-50vw + 50%);
  padding-left: 24px;
  padding-right: 24px;
}

.ns-search-wrap {
  max-width: 680px;
  margin: 0 auto;
  position: relative;
}

.ns-search-input-wrap {
  position: relative;
  display: flex;
  align-items: stretch;
  flex-wrap: wrap;
}

/* Inner group: icon + home + input + clear stay on one row, always. */
.ns-search-input-group {
  position: relative;
  display: flex;
  align-items: center;
  flex: 1 1 auto;
  min-width: 0;
}

/* "Browse by category" custom dropdown — appended to search input as an input group */
.ns-cat-browse {
  display: flex;
  align-items: stretch;
  align-self: stretch;
  flex-shrink: 0;
  position: relative;
}

.ns-cat-browse:empty {
  display: none;
}

/* When the dropdown is present, flatten the right side of the search input
   and keep the clear button anchored to the input (not over the dropdown). */
.ns-search-input-wrap:has(.ns-cat-browse:not(:empty)) .ns-search-input {
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
  border-right: none;
}

.ns-catb-toggle {
  font-family: inherit;
  font-size: 14px;
  color: var(--ns-text-secondary);
  background: var(--ns-white);
  border: 1px solid var(--ns-border);
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
  border-top-right-radius: 12px;
  border-bottom-right-radius: 12px;
  padding: 0 32px 0 14px;
  margin: 0;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 200px;
  max-width: 240px;
  transition: border-color 0.2s, color 0.2s, background-color 0.2s;
  position: relative;
  text-align: left;
}

.ns-catb-label {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ns-catb-chevron {
  position: absolute;
  right: 12px;
  top: 50%;
  width: 10px;
  height: 6px;
  pointer-events: none;
  background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 6'><path d='M1 1l4 4 4-4' fill='none' stroke='%236E6E73' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/></svg>") center / contain no-repeat;
  transform: translateY(-50%);
  transition: transform 0.2s;
}

.ns-catb-toggle[aria-expanded="true"] .ns-catb-chevron {
  transform: translateY(-50%) rotate(180deg);
}

.ns-catb-toggle:hover {
  background-color: rgba(0, 0, 0, 0.02);
}

.ns-catb-toggle.has-value {
  border-color: var(--ns-link);
  color: var(--ns-link);
}

.ns-catb-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 280px;
  max-width: 360px;
  max-height: 60vh;
  overflow-y: auto;
  background: var(--ns-white);
  border: 1px solid var(--ns-border-light);
  border-radius: 12px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.14);
  z-index: 200;
  padding: 6px 0;
  font-size: 12px;
  -webkit-overflow-scrolling: touch;
}

.ns-catb-menu[hidden] {
  display: none;
}

.ns-catb-group {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--ns-text-tertiary);
  padding: 8px 12px 4px;
  font-weight: 600;
  background: var(--ns-white);
}

.ns-catb-item {
  padding: 6px 12px;
  cursor: pointer;
  color: var(--ns-text);
  line-height: 1.3;
  user-select: none;
  transition: background-color 0.12s;
}

.ns-catb-item:hover {
  background: rgba(0, 102, 204, 0.08);
  color: var(--ns-link);
}

.ns-catb-item.is-active {
  background: rgba(0, 102, 204, 0.12);
  color: var(--ns-link);
  font-weight: 500;
}

.ns-catb-item.ns-catb-parent {
  color: var(--ns-text-secondary);
}

.ns-catb-item-all {
  border-bottom: 1px solid var(--ns-border-light);
  margin-bottom: 4px;
  padding-left: 12px !important;
  font-weight: 500;
}

/* Mobile: full-width dropdown under the search input */
@media (max-width: 640px) {
  .ns-search-input-wrap {
    row-gap: 8px;
  }
  .ns-search-input-group {
    flex-basis: 100%;
  }
  .ns-search-input-wrap:has(.ns-cat-browse:not(:empty)) .ns-search-input {
    border-top-right-radius: 12px;
    border-bottom-right-radius: 12px;
    border-right: 1px solid var(--ns-border);
  }
  .ns-cat-browse {
    width: 100%;
    flex-basis: 100%;
  }
  .ns-catb-toggle {
    min-width: 0;
    max-width: none;
    width: 100%;
    border-radius: 10px;
    padding: 8px 32px 8px 14px;
    font-size: 13px;
  }
  .ns-catb-menu {
    left: 0;
    right: 0;
    min-width: 0;
    max-width: none;
    max-height: 70vh;
    font-size: 13px;
  }
  .ns-catb-item {
    padding: 8px 12px;
  }
}

.ns-home-btn {
  display: none;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: none;
  background: none;
  color: var(--ns-text-tertiary);
  font-size: 16px;
  cursor: pointer;
  border-radius: 50%;
  transition: color 0.2s, background 0.2s;
  z-index: 2;
  flex-shrink: 0;
  order: -1;
  margin-right: 4px;
}

.ns-home-btn:hover {
  color: var(--ns-link);
  background: rgba(0,0,0,0.04);
}

.ns-home-btn.visible {
  display: flex;
}

/* Hide search icon when home button is visible */
.ns-search-input-group:has(.ns-home-btn.visible) .ns-search-icon {
  display: none;
}

.ns-search-icon {
  position: absolute;
  left: 14px;
  color: var(--ns-text-tertiary);
  font-size: 15px;
  pointer-events: none;
}

.ns-search-input {
  width: 100%;
  padding: 12px 40px 12px 42px;
  border: 1px solid var(--ns-border);
  border-radius: 12px;
  font-size: 17px;
  font-family: inherit;
  background: var(--ns-white);
  color: var(--ns-text);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.ns-search-input:focus {
  border-color: var(--ns-link);
  box-shadow: 0 0 0 4px rgba(0, 102, 204, 0.1);
}

.ns-search-input::placeholder {
  color: var(--ns-text-tertiary);
}

/* Hide native search clear button */
.ns-search-input::-webkit-search-cancel-button,
.ns-search-input::-webkit-search-decoration { -webkit-appearance: none; appearance: none; }

.ns-search-clear {
  position: absolute;
  right: 12px;
  background: none;
  border: none;
  color: var(--ns-text-tertiary);
  cursor: pointer;
  padding: 4px;
  font-size: 14px;
  display: none;
  line-height: 1;
  border-radius: 50%;
  width: 24px;
  height: 24px;
  display: none;
  align-items: center;
  justify-content: center;
}

.ns-search-clear:hover {
  background: rgba(0,0,0,0.06);
  color: var(--ns-text);
}

.ns-search-clear.visible {
  display: flex;
}

/* ── Compact search bar (on scroll) ────────── */
.ns-search-bar.ns-compact {
  padding-top: 8px;
  padding-bottom: 8px;
}

.ns-search-bar.ns-compact .ns-search-input {
  padding-top: 8px;
  padding-bottom: 8px;
  font-size: 15px;
}

/* Hide the tip text when compact */
.ns-search-bar.ns-compact .ns-search-wrap > *:not(.ns-search-input-wrap) {
  display: none;
}

/* ── Suggestions dropdown ──────────────────── */
.ns-suggestions {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  background: var(--ns-white);
  border: 1px solid var(--ns-border-light);
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.12);
  overflow: hidden;
  display: none;
  z-index: 200;
}

.ns-suggestions.open {
  display: block;
}

.ns-suggestion-item {
  display: flex;
  align-items: center;
  padding: 10px 16px;
  cursor: pointer;
  font-size: 15px;
  color: var(--ns-text);
  gap: 10px;
  transition: background 0.15s;
}

.ns-suggestion-item:hover,
.ns-suggestion-item.active {
  background: #F5F5F7;
}

.ns-suggestion-item i {
  color: var(--ns-text-tertiary);
  width: 18px;
  text-align: center;
  font-size: 13px;
}

/* ── Tabs ──────────────────────────────────── */
.ns-tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--ns-border-light);
  margin-top: 0;
  padding-top: 8px;
  position: sticky;
  top: var(--ns-bar-bottom, 130px);
  z-index: 11;
  background: var(--ns-white);
}

.ns-tab {
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 400;
  color: var(--ns-text-secondary);
  cursor: pointer;
  border: none;
  background: none;
  position: relative;
  transition: color 0.2s;
  font-family: inherit;
}

.ns-tab:hover {
  color: var(--ns-text);
}

.ns-tab.active {
  color: var(--ns-text);
  font-weight: 600;
}

.ns-tab.active::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--ns-text);
  border-radius: 2px 2px 0 0;
}

.ns-tab .ns-tab-count {
  font-size: 12px;
  color: var(--ns-text-tertiary);
  margin-left: 4px;
  font-weight: 400;
}

.ns-tab.active .ns-tab-count {
  color: var(--ns-text-secondary);
}

/* ── Filters merged into tabs row (compact scroll) ── */
.ns-tab-filters {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  margin-left: auto;
  padding-right: 4px;
}

.ns-tab-filters .ns-acc-filter-select {
  padding: 4px 24px 4px 8px;
  font-size: 12px;
  border-radius: 6px;
}

.ns-tab-filters .ns-acc-filters-reset {
  font-size: 12px;
}

/* Hide the standalone filter row when merged */
.ns-acc-filters.ns-filters-merged {
  display: none !important;
}

/* ── Results count ─────────────────────────── */
.ns-results-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0 8px;
}

.ns-results-count {
  font-size: 13px;
  color: var(--ns-text-tertiary);
}

/* ── Inline filter pills ───────────────────── */
.ns-filter-pills {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  padding: 8px 0;
}

.ns-filter-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 12px;
  background: #F5F5F7;
  border: 1px solid var(--ns-border-light);
  border-radius: 20px;
  font-size: 12px;
  color: var(--ns-text-secondary);
}

.ns-filter-pill .remove {
  cursor: pointer;
  margin-left: 4px;
  font-size: 14px;
  line-height: 1;
  opacity: 0.5;
}

.ns-filter-pill .remove:hover {
  opacity: 1;
}

/* ── Loading ───────────────────────────────── */
.ns-loading {
  display: none;
  text-align: center;
  padding: 60px 0;
}

.ns-loading.visible {
  display: block;
}

.ns-spinner {
  width: 28px;
  height: 28px;
  border: 3px solid var(--ns-border-light);
  border-top-color: var(--ns-text-tertiary);
  border-radius: 50%;
  animation: ns-spin 0.7s linear infinite;
}

@keyframes ns-spin {
  to { transform: rotate(360deg); }
}

/* ── Skeleton loading ─────────────────────── */
.ns-skeleton {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 8px 0 0;
}

.ns-skeleton-card {
  display: flex;
  align-items: center;
  gap: 40px;
  padding: 40px 0;
  border-bottom: 1px solid var(--ns-border-light);
}

.ns-skeleton-card:last-child {
  border-bottom: none;
}

.ns-skeleton-image {
  width: 180px;
  height: 180px;
  border-radius: 16px;
  flex-shrink: 0;
  background: linear-gradient(90deg, #f0f0f2 25%, #e8e8ed 37%, #f0f0f2 63%);
  background-size: 400% 100%;
  animation: ns-shimmer 1.4s ease infinite;
}

.ns-skeleton-lines {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.ns-skeleton-line {
  height: 14px;
  border-radius: 7px;
  background: linear-gradient(90deg, #f0f0f2 25%, #e8e8ed 37%, #f0f0f2 63%);
  background-size: 400% 100%;
  animation: ns-shimmer 1.4s ease infinite;
}

.ns-skeleton-line.ns-skel-title {
  height: 22px;
  width: 45%;
  border-radius: 8px;
}

.ns-skeleton-line.ns-skel-subtitle {
  width: 70%;
}

.ns-skeleton-line.ns-skel-text {
  width: 55%;
}

.ns-skeleton-line.ns-skel-link {
  width: 20%;
  height: 12px;
  margin-top: 4px;
}

@keyframes ns-shimmer {
  0%   { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

@media (max-width: 768px) {
  .ns-skeleton-card {
    flex-direction: column;
    text-align: center;
    gap: 20px;
    padding: 30px 0;
  }
  .ns-skeleton-image {
    width: 140px;
    height: 140px;
  }
}

/* ── Welcome state ─────────────────────────── */
/* ── Landing: Category strip ── */
.ns-landing-cats {
  display: flex;
  gap: 16px;
  justify-content: center;
  padding: 28px 0 20px;
  border-bottom: 1px solid var(--ns-border-light);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.ns-landing-cats::-webkit-scrollbar { display: none; }

.ns-landing-cat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 0;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--ns-text);
  font-size: 12px;
  font-family: inherit;
  font-weight: 500;
  white-space: nowrap;
  transition: color 0.2s, transform 0.2s;
  flex-shrink: 0;
  width: 100px;
}

.ns-landing-cat:hover { color: var(--ns-link); transform: scale(1.04); }

.ns-landing-cat-img {
  width: 100px;
  height: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.ns-landing-cat-img img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

/* ── Landing: Section rows ── */
.ns-landing-section {
  padding: 32px 0 8px;
}

.ns-landing-header {
  font-size: 20px;
  color: var(--ns-text);
  margin-bottom: 16px;
  line-height: 1.3;
}

.ns-landing-header span {
  color: var(--ns-text-secondary);
}

.ns-landing-header-link {
  float: right;
  font-size: 14px;
  font-weight: 400;
  color: var(--ns-link);
  cursor: pointer;
  text-decoration: none;
}

.ns-landing-header-link:hover {
  text-decoration: underline;
}

.ns-landing-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  margin: 0 -24px;
  padding: 0 24px;
}
.ns-landing-scroll::-webkit-scrollbar { display: none; }


.ns-landing-row {
  display: flex;
  gap: 16px;
  padding: 8px 0 12px;
}

/* ── Landing: Cards (Apple-style) ── */
.ns-landing-card {
  flex: 0 0 280px;
  min-height: 400px;
  background: var(--ns-white);
  border-radius: 20px;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  position: relative;
  box-shadow: 0 2px 12px rgba(0,0,0,0.06), 0 0 1px rgba(0,0,0,0.08);
  transition: box-shadow 0.25s, transform 0.25s;
}



.ns-landing-card:hover {
  box-shadow: 0 8px 30px rgba(0,0,0,0.12);
  transform: translateY(-2px);
  text-decoration: none;
  color: inherit;
}

.ns-landing-card-info {
  padding: 24px 22px 0;
}

.ns-landing-card-name {
  font-size: 22px;
  font-weight: 600;
  color: var(--ns-text);
  margin-bottom: 2px;
  line-height: 1.2;
}

.ns-landing-card-desc {
  font-size: 14px;
  color: var(--ns-text);
  line-height: 1.35;
  margin-bottom: 4px;
  font-weight: 500;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.ns-landing-card-price {
  font-size: 13px;
  font-weight: 400;
  color: var(--ns-text-tertiary);
}

.ns-landing-price-deal {
  color: #C62828;
  font-weight: 600;
}

.ns-landing-badge {
  display: block;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--ns-orange);
  margin-bottom: 4px;
}

.ns-landing-card-img {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 16px 16px 0;
  max-height: 260px;
}

.ns-landing-card-img img {
  max-width: 100%;
  max-height: 220px;
  object-fit: contain;
  opacity: 0;
  transition: opacity 0.3s;
  transform: scale(1.1);
}

.ns-card-wide .ns-landing-card-img {
  max-height: 320px;
}
.ns-card-wide.ns-card-gradient-mba img {
  max-height: 360px;
  transform: scale(1.1);
}

.ns-card-wide .ns-landing-card-img img {
  max-height: 280px;
}

.ns-landing-card-img img.ns-img-loaded {
  opacity: 1;
}
.ns-landing-card.ns-card-gradient-mba img {
  margin-top:30px !important;
  transform: scale(1.4);
}
.ns-landing-card.ns-card-17e-img .ns-landing-card-img {
  align-items: flex-end;
  max-height: none;
  padding: 0;
}
.ns-landing-card.ns-card-17e-img .ns-landing-card-img img {
  max-height: none;
}

/* ── Landing card modifiers ── */
/* Width */
.ns-landing-card.ns-card-wide        { flex: 0 0 420px; }

/* Dark theme */
.ns-landing-card.ns-card-dark         { background: #1D1D1F; }
.ns-card-dark .ns-landing-card-name  { color: #fff; }
.ns-card-dark .ns-landing-card-desc  { color: #A1A1A6; }
.ns-card-dark .ns-landing-card-price { color: #A1A1A6; }
.ns-card-dark .ns-landing-badge      { color: #BF5AF2; }

/* Gradient dark */
.ns-landing-card.ns-card-gradient-dark { background: linear-gradient(to bottom, #2C2C2E, #1D1D1F); }
.ns-landing-card.ns-card-gradient-mba { background: linear-gradient(to bottom, #d2e6f6, #fefefe); }
.ns-card-gradient-dark .ns-landing-card-name  { color: #000000; }
.ns-card-gradient-dark .ns-landing-card-desc  { color: #A1A1A6; }
.ns-card-gradient-dark .ns-landing-card-price { color: #A1A1A6; }
.ns-card-gradient-dark .ns-landing-badge      { color: #BF5AF2; }

/* Midnight blue */
.ns-landing-card.ns-card-midnight     { background: #0A1628; }
.ns-card-midnight .ns-landing-card-name  { color: #fff; }
.ns-card-midnight .ns-landing-card-desc  { color: #7EB0D5; }
.ns-card-midnight .ns-landing-card-price { color: #7EB0D5; }
.ns-card-midnight .ns-landing-badge      { color: #5AC8FA; }

/* Light grey */
.ns-landing-card.ns-card-light        { background: #F5F5F7; }

/* ── Landing: Skeleton loading ── */
.ns-landing-skeleton {
  background: var(--ns-white);
}

.ns-landing-skeleton .ns-landing-card-img {
  background: linear-gradient(90deg, #ececec 25%, #e2e2e2 50%, #ececec 75%);
  background-size: 200% 100%;
  animation: nsShimmer 1.4s ease infinite;
  border-radius: 12px;
  margin: 16px;
}

.ns-skel-line {
  height: 12px;
  border-radius: 6px;
  background: #eee;
  margin-bottom: 8px;
}

.ns-skel-line.short { width: 40%; }

@keyframes nsShimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ── Landing: Mobile ── */
@media (max-width: 640px) {
  .ns-landing-cats { gap: 10px; justify-content: flex-start; padding: 20px 16px; }
  .ns-landing-cat { width: 76px; font-size: 11px; }
  .ns-landing-cat-img { width: 60px; height: 60px; }
  .ns-landing-card { flex: 0 0 220px; min-height: 320px; }
  .ns-card-wide { flex: 0 0 300px; }
  .ns-landing-card-name { font-size: 18px; }
  .ns-landing-card-desc { font-size: 13px; }
  .ns-landing-header { font-size: 17px; }
  .ns-landing-section { padding: 24px 0 4px; }
}

/* ── Legacy quick links (kept for compatibility) ── */
.ns-quick-link {
  padding: 8px 16px;
  border: 1px solid var(--ns-border);
  border-radius: 20px;
  font-size: 14px;
  color: var(--ns-text);
  background: var(--ns-white);
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
}

.ns-quick-link:hover {
  background: #F5F5F7;
  border-color: var(--ns-text-tertiary);
}

.ns-quick-link i {
  margin-right: 6px;
  color: var(--ns-text-tertiary);
  font-size: 13px;
}

/* ── No results ────────────────────────────── */
.ns-empty {
  text-align: center;
  padding: 60px 20px;
  color: var(--ns-text-secondary);
  font-size: 15px;
}

.ns-results-notice {
  padding: 4px 0 8px;
  color: var(--ns-link);
  font-size: 13px;
}

/* ============================================
   EXPLORE TAB — Apple-style product list
   ============================================ */

.ns-explore-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

/* ── Group card (Apple "Explore" style) ────── */
.ns-group-card {
  display: flex;
  align-items: center;
  padding: 40px 0;
  border-bottom: 1px solid var(--ns-border-light);
  gap: 40px;
}

.ns-group-card:last-child {
  border-bottom: none;
}

.ns-group-image {
  flex-shrink: 0;
  width: 180px;
  height: 180px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ns-group-image img,
.ns-product-image img,
.ns-acc-image img {
  opacity: 0;
  transition: opacity 0.3s ease;
}

.ns-group-image img.ns-img-loaded,
.ns-product-image img.ns-img-loaded,
.ns-acc-image img.ns-img-loaded {
  opacity: 1;
}

.ns-group-image img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.ns-group-info {
  flex: 1;
  min-width: 0;
}

.ns-group-name {
  font-size: 28px;
  font-weight: 600;
  color: var(--ns-text);
  margin: 0 0 8px;
  line-height: 1.15;
  letter-spacing: -0.015em;
}

.ns-group-headline {
  font-size: 15px;
  color: var(--ns-text-secondary);
  margin: 0 0 12px;
  line-height: 1.5;
}

.ns-group-description {
  margin: 0 0 16px;
  position: relative;
}

.ns-group-description p {
  font-size: 14px;
  color: var(--ns-text-tertiary);
  line-height: 1.5;
  margin: 0;
}

.ns-group-description.ns-truncated p {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.ns-desc-toggle {
  background: none;
  border: none;
  padding: 0;
  margin-top: 4px;
  font-size: 13px;
  color: var(--ns-link);
  cursor: pointer;
  font-family: inherit;
}

.ns-desc-toggle:hover {
  color: var(--ns-link-hover);
  text-decoration: underline;
}

.ns-group-price {
  margin: 12px 0 4px;
  display: flex;
  align-items: baseline;
  gap: 6px;
  flex-wrap: wrap;
}

.ns-price-from-label {
  font-size: 13px;
  color: var(--ns-text-secondary);
}

.ns-price-from-amount {
  font-size: 20px;
  font-weight: 600;
  color: var(--ns-text);
}

.ns-price-from-eur,
.ns-landing-card-eur {
  color: var(--ns-text-secondary);
  font-weight: 400;
  font-size: 0.85em;
}

.ns-group-links {
  display: flex;
  gap: 20px;
  align-items: center;
}

.ns-group-link {
  font-size: 14px;
  color: var(--ns-link);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-weight: 400;
  transition: color 0.15s;
}

.ns-group-link:hover {
  color: var(--ns-link-hover);
  text-decoration: underline;
}

.ns-group-link::after {
  content: '\203A';
  font-size: 18px;
  line-height: 1;
  margin-top: -1px;
}

/* ── Offers section heading ───────────────── */
.ns-offers-heading {
  font-size: 22px;
  font-weight: 600;
  color: var(--ns-text);
  padding: 32px 0 8px;
  margin-top: 8px;
  border-top: 1px solid var(--ns-border-light);
  letter-spacing: -0.01em;
}

/* ── Standalone product card (list view) ───── */
.ns-product-card {
  display: flex;
  align-items: center;
  padding: 24px 0;
  border-bottom: 1px solid var(--ns-border-light);
  gap: 24px;
}

.ns-product-card:last-child {
  border-bottom: none;
}

.ns-product-image {
  flex-shrink: 0;
  width: 100px;
  height: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ns-product-image img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.ns-product-info {
  flex: 1;
  min-width: 0;
}

.ns-product-name {
  font-size: 17px;
  font-weight: 600;
  color: var(--ns-text);
  margin: 0 0 4px;
  line-height: 1.3;
}

.ns-product-compat {
  font-size: 13px;
  color: var(--ns-text-tertiary);
  margin: 0 0 4px;
}

.ns-product-headline {
  font-size: 14px;
  color: var(--ns-text-secondary);
  margin: 0 0 8px;
  line-height: 1.4;
}

.ns-product-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.ns-product-links {
  display: flex;
  gap: 16px;
  align-items: center;
}

.ns-product-link {
  font-size: 14px;
  color: var(--ns-link);
  text-decoration: none;
  font-weight: 400;
  transition: color 0.15s;
}

.ns-product-link:hover {
  color: var(--ns-link-hover);
  text-decoration: underline;
}

.ns-product-link::after {
  content: ' \203A';
}

/* Price section in product cards */
.ns-product-price-section {
  flex-shrink: 0;
  text-align: right;
  min-width: 120px;
}

.ns-price {
  font-size: 17px;
  font-weight: 600;
  color: var(--ns-text);
}

.ns-price-struck {
  text-decoration: line-through;
  color: var(--ns-text-tertiary);
  font-weight: 400;
  font-size: 14px;
}

.ns-price-reduced {
  color: var(--ns-red);
  font-weight: 600;
}

.ns-price-secondary {
  font-size: 13px;
  color: var(--ns-text-tertiary);
  margin-top: 2px;
}

.ns-price-from {
  font-size: 14px;
  color: var(--ns-text-secondary);
}

/* ── Stock indicator ───────────────────────── */
.ns-stock {
  font-size: 12px;
  font-weight: 500;
  margin-top: 4px;
}

.ns-stock-in { color: var(--ns-green); }
.ns-stock-low { color: var(--ns-orange); }
.ns-stock-out { color: var(--ns-red); }
.ns-stock-preorder { color: #0066CC; }

.ns-stock-preorder .ns-price-info {
  background: var(--ns-red);
  color: #fff;
  width: 16px;
  height: 16px;
  font-size: 9px;
  vertical-align: baseline;
  position: relative;
  top: -1px;
}

.ns-stock-preorder .ns-price-info:hover { background: #E0342A; color: #fff; }

.ns-price-info {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: #F5F5F7;
  color: var(--ns-text-tertiary);
  font-size: 9px;
  cursor: pointer;
  vertical-align: middle;
  margin-left: 4px;
  position: relative;
}

.ns-price-info:hover { background: #E8E8ED; color: var(--ns-text-secondary); }

.ns-price-info::after {
  content: attr(data-tip);
  display: none;
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  background: #1D1D1F;
  color: #fff;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 400;
  white-space: normal;
  width: 260px;
  line-height: 1.5;
  z-index: 100;
  pointer-events: none;
}

.ns-price-info:hover::after { display: block; }
.ns-stock-restock {
  font-size: 11px;
  color: var(--ns-text-tertiary);
  font-weight: 400;
}

/* ── Highlight badge ───────────────────────── */
.ns-highlight {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 2px 8px;
  border-radius: 4px;
  line-height: 1.4;
}

.ns-highlight-new { background: #FFF3E0; color: var(--ns-highlight-new); }
.ns-highlight-refurbished { background: #F3E5F5; color: var(--ns-highlight-refurbished); }
.ns-highlight-reduced { background: #FFEBEE; color: var(--ns-highlight-reduced); }
.ns-highlight-ex-demo { background: #FFF8E1; color: var(--ns-highlight-exdemo); }
.ns-highlight-repackaged { background: #EDE7F6; color: var(--ns-highlight-repackaged); }
.ns-highlight-end-of-line { background: #FCE4EC; color: var(--ns-highlight-endofline); }
.ns-highlight-clearance { background: #FCE4EC; color: var(--ns-highlight-clearance); }
.ns-highlight-pre-order { background: #E3F2FD; color: var(--ns-highlight-preorder); }

/* ============================================
   ACCESSORIES TAB — Grid + Sidebar
   ============================================ */

.ns-accessories-layout {
  display: flex;
  gap: 32px;
  padding-top: 16px;
}

/* ── Compatibility sidebar ─────────────────── */
.ns-filter-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--ns-text);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 14px 0 4px;
}

.ns-compat-sidebar {
  width: 200px;
  flex-shrink: 0;
  position: sticky;
  top: var(--ns-tabs-bottom, 170px);
  max-height: calc(100vh - var(--ns-tabs-bottom, 170px) - 20px);
  overflow-y: auto;
  padding-right: 8px;
  align-self: flex-start;
}

.ns-compat-sidebar::-webkit-scrollbar {
  width: 4px;
}

.ns-compat-sidebar::-webkit-scrollbar-thumb {
  background: var(--ns-border);
  border-radius: 4px;
}

.ns-sidebar-section {
  margin-bottom: 4px;
}

.ns-sidebar-heading {
  font-size: 13px;
  font-weight: 600;
  color: var(--ns-text);
  padding: 8px 0;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  user-select: none;
}

.ns-sidebar-heading .ns-chevron {
  font-size: 10px;
  color: var(--ns-text-tertiary);
  transition: transform 0.2s;
}

.ns-sidebar-heading.collapsed .ns-chevron {
  transform: rotate(-90deg);
}

.ns-sidebar-items {
  padding: 0;
  margin: 0;
  list-style: none;
}

.ns-sidebar-items.collapsed {
  display: none;
}

.ns-sidebar-item {
  padding: 4px 0 4px 8px;
  font-size: 13px;
  color: var(--ns-text-secondary);
  cursor: pointer;
  transition: color 0.15s;
  line-height: 1.5;
}

.ns-sidebar-item:hover {
  color: var(--ns-link);
}

.ns-sidebar-item.active {
  color: var(--ns-text);
  font-weight: 600;
}

.ns-sidebar-clear {
  font-size: 12px;
  color: var(--ns-link);
  cursor: pointer;
  padding: 8px 0;
  display: none;
}

.ns-sidebar-clear.visible {
  display: block;
}

.ns-sidebar-clear:hover {
  text-decoration: underline;
}

/* ── Accessories grid ──────────────────────── */
.ns-accessories-grid {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
  align-content: start;
  padding-top: 8px;
}

.ns-acc-card {
  background: var(--ns-white);
  border: 1px solid var(--ns-border-light);
  border-radius: 12px;
  padding: 16px;
  transition: box-shadow 0.2s, transform 0.15s;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  cursor: pointer;
  text-decoration: none;
  color: inherit;
}

.ns-acc-card:hover {
  box-shadow: 0 4px 20px rgba(0,0,0,0.08);
  transform: translateY(-2px);
  text-decoration: none;
  color: inherit;
  z-index: 1;
}

.ns-acc-image {
  width: 100%;
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
}

.ns-acc-color-pill {
  position: absolute;
  top: 8px;
  left: 8px;
  font-size: 11px;
  font-weight: 500;
  line-height: 1;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--ns-white, #fff);
  color: var(--ns-text-secondary, #666);
  border: 1px solid var(--ns-border, #e0e0e0);
  z-index: 2;
  pointer-events: none;
}

.ns-acc-image img {
  max-width: 85%;
  max-height: 85%;
  object-fit: contain;
}

.ns-acc-badge {
  margin-bottom: 6px;
}

.ns-acc-name {
  font-size: 14px;
  font-weight: 500;
  color: var(--ns-text);
  margin: 0 0 4px;
  line-height: 1.35;
}

.ns-acc-compat {
  font-size: 12px;
  color: var(--ns-text-tertiary);
  margin-bottom: 4px;
}

.ns-acc-colors {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  justify-content: center;
  margin: 8px 0 4px;
}

.ns-color-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 1px solid var(--ns-border);
}


.ns-acc-price {
  font-size: 15px;
  font-weight: 600;
  color: var(--ns-text);
  margin-top: auto;
  padding-top: 8px;
}

.ns-acc-price .ns-price-struck {
  font-size: 13px;
}

.ns-acc-price .ns-price-reduced {
  font-size: 15px;
}

.ns-acc-eur {
  font-size: 12px;
  font-weight: 400;
  color: var(--ns-text-tertiary);
}

.ns-acc-eur .ns-price-struck {
  font-size: 11px;
}

.ns-acc-availability {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding-top: 6px;
  font-size: 12px;
  line-height: 1.4;
}

.ns-acc-stock {
  font-weight: 600;
}

.ns-stock-in {
  color: #16a34a;
}

.ns-stock-low {
  color: #d97706;
}

.ns-stock-out {
  color: var(--ns-text-tertiary);
}

.ns-acc-restock {
  color: var(--ns-text-secondary);
  font-size: 11px;
}

/* ── Compat check button ── */
.ns-acc-card {
  position: relative;
}

.ns-acc-compat-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  font-size: 18px;
  color: var(--ns-border);
  cursor: pointer;
  transition: color 0.15s;
  z-index: 2;
  line-height: 1;
}

.ns-acc-compat-btn i {
  pointer-events: none;
}

.ns-acc-compat-btn:hover,
.ns-acc-compat-btn.active {
  color: var(--ns-link);
}

/* Sidebar peek mode — dim non-matching items */
.ns-compat-sidebar.ns-compat-peek .ns-sidebar-item {
  opacity: 0.25;
}

.ns-compat-sidebar.ns-compat-peek .ns-sidebar-item.ns-compat-match {
  opacity: 1;
  color: var(--ns-link);
  font-weight: 600;
}

/* ── Dropdown filters row (Accessories tab) ── */
.ns-filter-toggle { display: none; }

.ns-acc-filters {
  display: flex;
  gap: 8px;
  padding: 12px 0 8px;
  flex-wrap: nowrap;
  align-items: center;
  position: sticky;
  top: var(--ns-tabs-bottom, 170px);
  z-index: 9;
  background: var(--ns-white);
  overflow-x: auto;
  scrollbar-width: none;
}

.ns-acc-filters::-webkit-scrollbar { display: none; }

.ns-acc-filter-select {
  padding: 6px 28px 6px 12px;
  border: 1px solid var(--ns-border);
  border-radius: 8px;
  font-size: 13px;
  font-family: inherit;
  color: var(--ns-text);
  background: var(--ns-white);
  appearance: none;
  -webkit-appearance: none;
  max-width: 160px;
  text-overflow: ellipsis;
  overflow: hidden;
  white-space: nowrap;
  background-image: url("data:image/svg+xml,%3Csvg width='10' height='6' viewBox='0 0 10 6' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L5 5L9 1' stroke='%2386868B' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  cursor: pointer;
  outline: none;
  transition: border-color 0.2s;
}

.ns-acc-filter-select:focus {
  border-color: var(--ns-link);
}

.ns-acc-filter-select.has-value {
  border-color: var(--ns-link);
  color: var(--ns-link);
}

.ns-acc-filters-reset {
  font-size: 13px;
  color: var(--ns-link);
  cursor: pointer;
  padding: 6px 0;
}

.ns-acc-filters-reset:hover {
  text-decoration: underline;
}

.ns-acc-sort {
  margin-left: auto;
  white-space: nowrap;
}

/* ── Breadcrumb ────────────────────────────── */
.ns-breadcrumb {
  display: flex;
  align-items: center;
  gap: 0;
  padding: 0 0 8px;
  font-size: 13px;
  color: var(--ns-text-tertiary);
  flex-wrap: wrap;
  min-height: 0;
}

.ns-breadcrumb-sep {
  margin: 0 6px;
  color: var(--ns-text-tertiary);
}

.ns-breadcrumb-link {
  color: var(--ns-link);
  cursor: pointer;
}

.ns-breadcrumb-link:hover {
  text-decoration: underline;
}

.ns-breadcrumb-current {
  color: var(--ns-text);
  font-weight: 500;
}

/* ── Load more ─────────────────────────────── */
.ns-load-more {
  display: block;
  width: 100%;
  padding: 14px;
  margin: 24px 0;
  border: 1px solid var(--ns-border);
  border-radius: 12px;
  background: var(--ns-white);
  font-size: 14px;
  font-family: inherit;
  color: var(--ns-link);
  cursor: pointer;
  transition: background 0.15s;
  text-align: center;
}

.ns-load-more:hover {
  background: #F5F5F7;
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 768px) {
  .ns-container {
    padding: 0 16px;
  }

  /* Home button — slightly smaller on mobile */
  .ns-home-btn {
    width: 32px;
    height: 32px;
    font-size: 14px;
  }

  /* Search bar */
  .ns-search-bar {
    padding: 12px 16px;
  }

  .ns-search-bar.ns-compact {
    padding-top: 6px;
    padding-bottom: 6px;
  }

  /* Explore cards */
  .ns-group-card {
    flex-direction: column;
    text-align: center;
    gap: 20px;
    padding: 30px 0;
  }

  .ns-group-image {
    width: 140px;
    height: 140px;
  }

  .ns-group-name {
    font-size: 22px;
  }

  .ns-group-links {
    justify-content: center;
  }

  .ns-group-description {
    max-width: none;
  }

  .ns-product-card {
    gap: 16px;
  }

  .ns-product-image {
    width: 70px;
    height: 70px;
  }

  .ns-product-price-section {
    min-width: 80px;
  }

  /* Tabs — smaller text, scroll if needed */
  .ns-tabs {
    gap: 0;
    padding-top: 4px;
  }

  .ns-tab {
    padding: 8px 14px;
    font-size: 13px;
  }

  /* Don't merge filters into tabs on mobile — not enough room */
  .ns-tab-filters {
    display: none !important;
  }

  .ns-acc-filters.ns-filters-merged {
    display: flex !important;
  }

  /* Filter toggle button — mobile only */
  .ns-filter-toggle {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    font-size: 13px;
    font-weight: 600;
    color: var(--ns-text);
    background: #F5F5F7;
    border: 1px solid var(--ns-border-light);
    border-radius: 8px;
    cursor: pointer;
    position: sticky;
    top: var(--ns-tabs-bottom, 120px);
    z-index: 9;
    margin: 8px 0 4px;
  }

  .ns-filter-toggle i { font-size: 12px; }

  .ns-filter-toggle .ns-filter-count {
    background: var(--ns-link);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    padding: 1px 6px;
    border-radius: 10px;
    margin-left: auto;
  }

  /* Filter dropdowns — hidden by default on mobile */
  .ns-acc-filters {
    display: none;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    padding: 8px 0;
    position: sticky;
  }

  .ns-acc-filters.ns-filters-open {
    display: grid;
  }

  .ns-acc-filter-select {
    width: 100%;
    font-size: 12px;
    padding: 8px 26px 8px 10px;
  }

  .ns-acc-filters-reset {
    font-size: 12px;
  }

  .ns-acc-sort {
    margin-left: 0;
    font-size: 12px;
    text-align: right;
  }

  /* Accessories layout — stack vertically */
  .ns-accessories-layout {
    flex-direction: column;
    gap: 0;
  }

  /* Compatibility sidebar — collapsible accordion on mobile */
  .ns-compat-sidebar {
    width: 100%;
    position: static;
    max-height: none;
    overflow: visible;
    display: block;
    padding: 0;
    border-bottom: 1px solid var(--ns-border-light);
  }

  .ns-sidebar-section {
    margin-bottom: 0;
    border-bottom: 1px solid var(--ns-border-light);
  }

  .ns-sidebar-section:last-child {
    border-bottom: none;
  }

  .ns-sidebar-heading {
    padding: 10px 4px;
    font-size: 13px;
    background: none;
    border-radius: 0;
    white-space: normal;
  }

  .ns-sidebar-items {
    display: block;
    padding: 0 0 8px 4px;
    columns: 2;
    column-gap: 8px;
  }

  .ns-sidebar-items.collapsed {
    display: none;
  }

  .ns-sidebar-item {
    padding: 5px 0 5px 4px;
    font-size: 12px;
    break-inside: avoid;
  }

  .ns-sidebar-clear {
    padding: 6px 4px;
    font-size: 12px;
  }
  

  /* Accessories grid — 2 columns */
  .ns-accessories-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }

  .ns-acc-card {
    padding: 10px;
  }

  .ns-acc-name {
    font-size: 12px;
  }

  .ns-acc-price {
    font-size: 13px;
  }

  .ns-acc-compat-btn {
    font-size: 15px;
    top: 6px;
    right: 6px;
  }

  /* Skeleton */
  .ns-skeleton-card {
    flex-direction: column;
    text-align: center;
    gap: 20px;
    padding: 30px 0;
  }

  .ns-skeleton-image {
    width: 140px;
    height: 140px;
  }
}

@media (max-width: 480px) {
  .ns-accessories-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }

  .ns-search-input {
    font-size: 16px;
  }

  .ns-acc-filter-select {
    font-size: 11px;
    padding: 7px 22px 7px 8px;
  }
}