/* VietEco Aluminum - E-Catalogue Tech Minimalist Stylesheet */

:root {
  /* Dark Mode (Default) */
  --bg-app: #09090b;
  --bg-surface: #121215;
  --bg-card: #18181b;
  --bg-card-hover: #202025;
  --bg-input: #1b1b20;
  --bg-chip: #27272a;
  --bg-chip-active: #059669;
  
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.16);
  --border-active: #10b981;

  --text-main: #f4f4f5;
  --text-muted: #a1a1aa;
  --text-dim: #71717a;
  --text-inv: #09090b;

  --primary: #10b981;
  --primary-hover: #059669;
  --primary-glow: rgba(16, 185, 129, 0.2);

  --accent-blue: #38bdf8;
  --accent-amber: #f59e0b;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-full: 9999px;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.6);

  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  --header-height: 52px;
}

[data-theme="light"] {
  --bg-app: #f8fafc;
  --bg-surface: #ffffff;
  --bg-card: #ffffff;
  --bg-card-hover: #f1f5f9;
  --bg-input: #f1f5f9;
  --bg-chip: #e2e8f0;
  --bg-chip-active: #059669;

  --border-subtle: #e2e8f0;
  --border-strong: #cbd5e1;
  --border-active: #059669;

  --text-main: #0f172a;
  --text-muted: #475569;
  --text-dim: #94a3b8;
  --text-inv: #ffffff;

  --primary: #059669;
  --primary-hover: #047857;
  --primary-glow: rgba(5, 150, 105, 0.15);

  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08);
  --shadow-md: 0 4px 14px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.12);
}

@media (min-width: 768px) {
  :root {
    --header-height: 60px;
  }
}

/* Base Reset */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-family: var(--font-sans);
  background-color: var(--bg-app);
  color: var(--text-main);
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding-bottom: 74px; /* Space for mobile floating nav */
}

@media (min-width: 768px) {
  body {
    padding-bottom: 0;
  }
}

a {
  color: inherit;
  text-decoration: none;
}

button, input, select {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

.cat-container {
  max-width: 1380px;
  margin: 0 auto;
  padding: 0 12px;
}

@media (min-width: 768px) {
  .cat-container {
    padding: 0 20px;
  }
}

/* Visibility Utilities */
.show-mobile-only {
  display: none !important;
}

@media (max-width: 767px) {
  .show-mobile-only {
    display: inline-flex !important;
  }
  .hide-mobile {
    display: none !important;
  }
}

@media (max-width: 1023px) {
  .hide-tablet {
    display: none !important;
  }
}

/* Icons */
.icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  border: 1px solid transparent;
  white-space: nowrap;
}

.btn-sm {
  padding: 5px 10px;
  font-size: 12px;
}

.btn-primary {
  background: var(--primary);
  color: #ffffff;
  box-shadow: 0 2px 8px var(--primary-glow);
}

.btn-primary:hover {
  background: var(--primary-hover);
}

.btn-secondary {
  background: var(--bg-chip);
  color: var(--text-main);
  border-color: var(--border-subtle);
}

.btn-secondary:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-strong);
}

.btn-outline {
  background: transparent;
  color: var(--text-main);
  border-color: var(--border-strong);
}

.btn-outline:hover {
  background: var(--bg-card-hover);
  border-color: var(--primary);
  color: var(--primary);
}

.btn-icon {
  width: 34px;
  height: 34px;
  padding: 0;
  border-radius: var(--radius-sm);
  background: var(--bg-chip);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn-icon:hover {
  color: var(--text-main);
  border-color: var(--border-strong);
}

/* Header */
.cat-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(9, 9, 11, 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-subtle);
}

[data-theme="light"] .cat-header {
  background: rgba(255, 255, 255, 0.92);
}

.header-inner {
  height: var(--header-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.brand-group {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.brand-logo-link {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.brand-logo {
  height: 32px;
  width: auto;
  object-fit: contain;
  flex-shrink: 0;
  display: block;
}

@media (min-width: 768px) {
  .brand-logo {
    height: 42px;
  }
}

.brand-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.brand-title {
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: var(--text-main);
  line-height: 1.1;
  white-space: nowrap;
}

@media (min-width: 768px) {
  .brand-title {
    font-size: 15px;
  }
}

.brand-subtitle {
  font-size: 10.5px;
  color: var(--text-muted);
  font-weight: 500;
  white-space: nowrap;
}

.badge-tech {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  padding: 2px 7px;
  border-radius: var(--radius-full);
  background: var(--primary-glow);
  color: var(--primary);
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.badge-count-mobile {
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.05em;
  padding: 2px 6px;
  border-radius: var(--radius-full);
  background: var(--primary-glow);
  color: var(--primary);
  border: 1px solid rgba(16, 185, 129, 0.3);
  font-family: var(--font-mono);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.quick-stats {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text-muted);
  padding: 5px 12px;
  background: var(--bg-surface);
  border-radius: var(--radius-full);
  border: 1px solid var(--border-subtle);
}

.quick-stats strong {
  color: var(--primary);
  font-weight: 700;
}

.stat-dot {
  color: var(--text-dim);
}

.btn-group-header {
  display: flex;
  align-items: center;
  gap: 6px;
}

.btn-header-action {
  padding: 6px 8px;
  font-size: 12px;
}

@media (min-width: 768px) {
  .btn-header-action {
    padding: 6px 12px;
    font-size: 12.5px;
  }
}

/* Theme Toggle */
.theme-toggle .sun-icon {
  display: none;
}
.theme-toggle .moon-icon {
  display: block;
}

[data-theme="light"] .theme-toggle .sun-icon {
  display: block;
}
[data-theme="light"] .theme-toggle .moon-icon {
  display: none;
}

/* Hero Bar (Desktop) */
.hero-bar {
  background: linear-gradient(180deg, var(--bg-surface) 0%, var(--bg-app) 100%);
  border-bottom: 1px solid var(--border-subtle);
  padding: 14px 0;
}

.hero-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.hero-heading {
  font-size: 17px;
  font-weight: 700;
  color: var(--text-main);
  letter-spacing: -0.02em;
}

.hero-desc {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* Sticky Toolbar */
.toolbar-sticky {
  position: sticky;
  top: var(--header-height);
  z-index: 40;
  background: rgba(9, 9, 11, 0.96);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-subtle);
  padding: 8px 0 6px 0;
}

[data-theme="light"] .toolbar-sticky {
  background: rgba(255, 255, 255, 0.96);
}

.toolbar-search-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

/* Search Box */
.search-box {
  position: relative;
  flex: 1;
  min-width: 0;
}

.search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-dim);
  pointer-events: none;
  width: 15px;
  height: 15px;
}

.search-box input {
  width: 100%;
  height: 38px;
  padding: 0 34px 0 36px;
  border-radius: var(--radius-md);
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  font-size: 13px;
  transition: all 0.2s ease;
}

.search-box input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 2px var(--primary-glow);
}

.btn-clear {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  font-size: 16px;
  color: var(--text-dim);
  cursor: pointer;
  padding: 4px;
  line-height: 1;
}

.search-shortcut {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 10.5px;
  font-family: var(--font-mono);
  background: var(--bg-chip);
  color: var(--text-dim);
  padding: 2px 5px;
  border-radius: 4px;
  pointer-events: none;
}

/* Mobile Filter Trigger Button */
.btn-filter-trigger {
  height: 38px;
  padding: 0 12px;
  border-radius: var(--radius-md);
  background: var(--bg-chip);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  font-size: 12.5px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  flex-shrink: 0;
  position: relative;
}

.filter-active-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--primary);
  box-shadow: 0 0 6px var(--primary);
}

/* View Switcher (Desktop) */
.view-switcher {
  display: flex;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 2px;
  gap: 2px;
  flex-shrink: 0;
}

.view-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.view-btn:hover {
  color: var(--text-main);
}

.view-btn.active {
  background: var(--bg-chip);
  color: var(--primary);
  box-shadow: var(--shadow-sm);
}

/* Category Navigation Wrapper */
.category-nav-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  margin-top: 6px;
}

.cat-scroll-arrow {
  width: 26px;
  height: 26px;
  border-radius: var(--radius-full);
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  cursor: pointer;
  flex-shrink: 0;
  z-index: 2;
}

.cat-scroll-arrow:hover {
  color: var(--text-main);
  border-color: var(--border-strong);
}

.category-pills {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  scroll-behavior: smooth;
  scrollbar-width: none;
  -ms-overflow-style: none;
  padding: 2px 2px;
  flex: 1;
}

.category-pills::-webkit-scrollbar {
  display: none;
}

.cat-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 11px;
  border-radius: var(--radius-full);
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.12s ease;
  user-select: none;
  flex-shrink: 0;
}

.cat-pill:hover {
  border-color: var(--border-strong);
  color: var(--text-main);
  background: var(--bg-card-hover);
}

.cat-pill.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #ffffff;
  font-weight: 700;
  box-shadow: 0 2px 6px var(--primary-glow);
}

.cat-pill .count {
  font-size: 10px;
  opacity: 0.85;
  font-family: var(--font-mono);
}

/* Desktop Filter Subbar */
.filter-subbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
  padding-top: 6px;
  border-top: 1px solid var(--border-subtle);
  font-size: 12px;
}

.filter-left {
  display: flex;
  align-items: center;
  gap: 6px;
}

.results-badge {
  color: var(--text-muted);
}

.results-badge strong {
  color: var(--primary);
}

.filter-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 7px;
  border-radius: var(--radius-full);
  background: var(--bg-chip);
  border: 1px solid var(--border-subtle);
  font-size: 11px;
  color: var(--text-main);
}

.filter-right {
  display: flex;
  align-items: center;
  gap: 6px;
}

.select-wrapper select {
  height: 30px;
  padding: 0 8px;
  border-radius: var(--radius-sm);
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  font-size: 11.5px;
  cursor: pointer;
  outline: none;
}

.btn-reset-filters {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 30px;
  padding: 0 8px;
  border-radius: var(--radius-sm);
  background: transparent;
  border: 1px dashed var(--border-strong);
  color: var(--text-dim);
  font-size: 11.5px;
  cursor: pointer;
}

/* Mobile Mini Status Row */
.mobile-mini-status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 6px;
  padding-top: 4px;
  font-size: 11.5px;
  color: var(--text-muted);
}

.results-badge-mob strong {
  color: var(--primary);
}

.mob-active-tags {
  display: flex;
  align-items: center;
  gap: 4px;
  overflow-x: auto;
  white-space: nowrap;
}

.btn-clear-mob {
  background: transparent;
  border: none;
  color: var(--primary);
  font-size: 11px;
  font-weight: 600;
  text-decoration: underline;
  cursor: pointer;
  padding: 2px 4px;
}

/* Main Content Area */
.main-content {
  padding-top: 14px;
  padding-bottom: 30px;
  flex: 1;
}

@media (min-width: 768px) {
  .main-content {
    padding-top: 20px;
    padding-bottom: 40px;
  }
}

.view-panel {
  display: none;
}

.view-panel.active {
  display: block;
}

/* Cards Grid: Mobile 2-columns! Desktop 4-columns! */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

@media (min-width: 640px) {
  .cards-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
  }
}

@media (min-width: 860px) {
  .cards-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
  }
}

@media (min-width: 1180px) {
  .cards-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 18px;
  }
}

/* Compact Mobile Product Card */
.product-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 10px;
  display: flex;
  flex-direction: column;
  transition: all 0.15s ease;
  position: relative;
  cursor: pointer;
}

@media (min-width: 768px) {
  .product-card {
    padding: 14px;
  }
}

.product-card:hover {
  border-color: var(--border-strong);
  background: var(--bg-card-hover);
  box-shadow: var(--shadow-md);
}

.card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
}

.card-cat {
  font-size: 9.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--primary);
  background: var(--primary-glow);
  padding: 1px 5px;
  border-radius: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 90px;
}

@media (min-width: 768px) {
  .card-cat {
    font-size: 10.5px;
    padding: 2px 7px;
    max-width: 140px;
  }
}

.card-page {
  font-size: 10.5px;
  color: var(--text-dim);
  font-family: var(--font-mono);
}

.card-header-info {
  margin-bottom: 6px;
}

.card-code {
  font-family: var(--font-mono);
  font-size: 15px;
  font-weight: 700;
  color: var(--text-main);
  letter-spacing: -0.01em;
  line-height: 1.2;
}

@media (min-width: 768px) {
  .card-code {
    font-size: 17px;
  }
}

.card-name {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Card Profile CAD Image Container */
.card-image-wrap {
  width: 100%;
  height: 80px;
  background: #ffffff;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px;
  position: relative;
  overflow: hidden;
  margin-bottom: 8px;
  border: 1px solid rgba(0, 0, 0, 0.08);
}

@media (min-width: 768px) {
  .card-image-wrap {
    height: 110px;
    margin-bottom: 10px;
  }
}

.card-image-wrap img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.card-zoom-badge {
  position: absolute;
  right: 4px;
  bottom: 4px;
  background: rgba(0, 0, 0, 0.65);
  color: #ffffff;
  padding: 2px 5px;
  border-radius: 3px;
  font-size: 9px;
  display: flex;
  align-items: center;
  gap: 3px;
  opacity: 0.85;
}

@media (min-width: 768px) {
  .card-zoom-badge {
    opacity: 0;
    transition: opacity 0.2s;
  }
  .card-image-wrap:hover .card-zoom-badge {
    opacity: 1;
  }
}

/* Card Specs Layout */
.card-specs {
  display: flex;
  flex-direction: column;
  gap: 4px;
  background: var(--bg-surface);
  border-radius: var(--radius-sm);
  padding: 5px 6px;
  border: 1px solid var(--border-subtle);
  margin-bottom: 8px;
}

.spec-dim-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px dashed var(--border-subtle);
  padding-bottom: 3px;
  gap: 4px;
}

.spec-dim-label {
  font-size: 8.5px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  flex-shrink: 0;
}

.spec-dim-val {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  color: var(--text-main);
  text-align: right;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.spec-meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2px;
}

.spec-pill-item {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  font-family: var(--font-mono);
  font-size: 9.5px;
  font-weight: 600;
  color: var(--text-muted);
  white-space: nowrap;
}

.spec-pill-item.thick {
  color: var(--accent-primary);
}

.spec-pill-item.weight {
  color: var(--text-dim);
}

@media (min-width: 768px) {
  .spec-dim-val {
    font-size: 12px;
  }
  .spec-pill-item {
    font-size: 10.5px;
  }
}

/* Card Actions */
.card-actions {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: auto;
}

.btn-card-copy {
  width: 32px;
  height: 30px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  flex-shrink: 0;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-card-copy:hover {
  background: var(--bg-card-hover);
  color: var(--text-main);
  border-color: var(--border-strong);
}

.btn-card-link,
.btn-card-share {
  flex: 1;
  height: 30px;
  padding: 0 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  border-radius: var(--radius-sm);
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.35);
  color: var(--accent-primary);
  font-size: 11px;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-card-link:hover,
.btn-card-share:hover {
  background: var(--accent-primary);
  color: #ffffff;
}

.btn-card-link:active,
.btn-card-share:active {
  transform: scale(0.96);
}

.mob-list-btn.link,
.mob-list-btn.share {
  background: rgba(16, 185, 129, 0.12);
  border-color: rgba(16, 185, 129, 0.35);
  color: var(--accent-primary);
}

.mob-list-btn.link:hover,
.mob-list-btn.share:hover {
  background: var(--accent-primary);
  color: #ffffff;
}

.permalink-val {
  color: var(--accent-primary) !important;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
  word-break: break-all;
}

.permalink-val:hover {
  opacity: 0.8;
}

@media (min-width: 768px) {
  .card-actions .btn {
    padding: 6px 10px;
    font-size: 12px;
  }
}

.btn-copy-code {
  background: var(--bg-chip);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
}

.btn-copy-code:hover {
  color: var(--text-main);
  border-color: var(--border-strong);
}

.mob-list-btn.link {
  background: rgba(16, 185, 129, 0.12);
  border-color: rgba(16, 185, 129, 0.35);
  color: var(--accent-primary);
}

.mob-list-btn.link:hover {
  background: var(--accent-primary);
  color: #ffffff;
}

/* Mobile List View (Alternate to Table on phone) */
.mobile-list-container {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.mobile-list-item {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 8px 10px;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.mobile-list-item:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-strong);
}

.mob-item-img {
  width: 58px;
  height: 42px;
  background: #ffffff;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  flex-shrink: 0;
}

.mob-item-img img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.mob-item-content {
  flex: 1;
  min-width: 0;
}

.mob-item-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.mob-item-code {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 14px;
  color: var(--text-main);
}

.mob-item-tag {
  font-size: 9px;
  color: var(--primary);
  background: var(--primary-glow);
  padding: 1px 5px;
  border-radius: 3px;
}

.mob-item-specs {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mob-item-action {
  flex-shrink: 0;
}

/* Desktop Table View */
.table-responsive-wrapper {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  overflow-x: auto;
  box-shadow: var(--shadow-sm);
}

.tech-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 13px;
  white-space: nowrap;
}

.tech-table th {
  background: var(--bg-surface);
  color: var(--text-muted);
  font-weight: 600;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border-subtle);
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: 0.05em;
  position: sticky;
  top: 0;
  z-index: 10;
}

.tech-table td {
  padding: 8px 12px;
  border-bottom: 1px solid var(--border-subtle);
  vertical-align: middle;
}

.tech-table tbody tr:hover {
  background: var(--bg-card-hover);
}

.table-code {
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--primary);
}

.table-profile-img {
  width: 64px;
  height: 34px;
  background: #ffffff;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2px;
  cursor: pointer;
  border: 1px solid rgba(0, 0, 0, 0.08);
}

.table-profile-img img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.table-dim, .table-thick, .table-weight {
  font-family: var(--font-mono);
}

.table-cat-badge {
  font-size: 11px;
  background: var(--bg-chip);
  padding: 2px 7px;
  border-radius: 4px;
  color: var(--text-muted);
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 40px 16px;
  background: var(--bg-card);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-lg);
  margin: 20px auto;
  max-width: 440px;
}

.empty-icon {
  font-size: 36px;
  margin-bottom: 10px;
}

.empty-state h3 {
  font-size: 16px;
  margin-bottom: 6px;
  color: var(--text-main);
}

.empty-state p {
  font-size: 12.5px;
  color: var(--text-muted);
  margin-bottom: 16px;
}

/* Flipbook / Mobile Slide Viewer */
.flipbook-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  max-width: 520px;
  margin: 0 auto;
}

.flipbook-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  gap: 8px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 6px 10px;
}

.flip-page-info {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  color: var(--text-muted);
}

.flip-page-info input {
  width: 40px;
  height: 26px;
  text-align: center;
  border-radius: 4px;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  font-weight: 700;
  font-family: var(--font-mono);
  font-size: 12px;
}

.flip-cat-tag {
  font-size: 11px;
  background: var(--primary-glow);
  color: var(--primary);
  padding: 2px 7px;
  border-radius: var(--radius-full);
}

.flipbook-stage-wrapper {
  width: 100%;
  display: flex;
  justify-content: center;
}

.flipbook-stage {
  position: relative;
  width: 100%;
  max-width: 420px;
  aspect-ratio: 9 / 16;
  background: #000000;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border-strong);
}

.flip-page-image {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #ffffff;
  user-select: none;
}

.flip-touch-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  z-index: 5;
}

.touch-zone {
  flex: 1;
  cursor: pointer;
}

.touch-zone.left:active {
  background: linear-gradient(90deg, rgba(0,0,0,0.2) 0%, transparent 100%);
}

.touch-zone.right:active {
  background: linear-gradient(270deg, rgba(0,0,0,0.2) 0%, transparent 100%);
}

.flip-page-actions {
  display: flex;
  gap: 8px;
  width: 100%;
  justify-content: center;
  flex-wrap: wrap;
}

.flip-thumbs-container {
  width: 100%;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 8px;
  overflow: hidden;
}

.flip-thumbs-scroll {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 2px;
  scrollbar-width: thin;
}

.flip-thumb-item {
  flex-shrink: 0;
  width: 48px;
  aspect-ratio: 9 / 16;
  border-radius: 4px;
  overflow: hidden;
  border: 2px solid transparent;
  cursor: pointer;
  position: relative;
  background: #ffffff;
}

.flip-thumb-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.flip-thumb-item .thumb-label {
  position: absolute;
  bottom: 0;
  inset-inline: 0;
  background: rgba(0, 0, 0, 0.75);
  color: #ffffff;
  font-size: 8.5px;
  text-align: center;
  padding: 1px 0;
  font-family: var(--font-mono);
}

.flip-thumb-item.active {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px var(--primary-glow);
}

/* Mobile Filter Bottom Sheet */
.sheet-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 120;
  display: flex;
  align-items: flex-end;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.sheet-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

.filter-bottom-sheet {
  background: var(--bg-card);
  border-top-left-radius: 20px;
  border-top-right-radius: 20px;
  border: 1px solid var(--border-strong);
  border-bottom: none;
  width: 100%;
  max-height: 82vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.6);
  transform: translateY(100%);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  padding-bottom: env(safe-area-inset-bottom, 12px);
}

.sheet-backdrop.open .filter-bottom-sheet {
  transform: translateY(0);
}

.sheet-handle {
  width: 36px;
  height: 4px;
  border-radius: var(--radius-full);
  background: var(--border-strong);
  margin: 8px auto 4px auto;
}

.sheet-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 16px 12px 16px;
  border-bottom: 1px solid var(--border-subtle);
}

.sheet-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-main);
}

.sheet-close {
  background: transparent;
  border: none;
  font-size: 22px;
  color: var(--text-dim);
  cursor: pointer;
  padding: 4px;
  line-height: 1;
}

.sheet-body {
  padding: 16px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.sheet-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sheet-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.sheet-pills-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px;
}

.sheet-pill {
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  font-size: 12px;
  text-align: center;
  cursor: pointer;
  font-weight: 500;
  transition: all 0.15s;
}

.sheet-pill.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #ffffff;
  font-weight: 700;
}

.sheet-footer {
  padding: 12px 16px;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  gap: 10px;
  background: var(--bg-surface);
}

.sheet-footer .btn {
  flex: 1;
}

/* Modal Lightbox */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
}

.modal-card {
  background: var(--bg-card);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  max-width: 520px;
  width: 100%;
  position: relative;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  animation: modalIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalIn {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

.modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 28px;
  height: 28px;
  border-radius: var(--radius-full);
  background: var(--bg-chip);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  z-index: 10;
}

.modal-header {
  padding: 16px 16px 10px 16px;
  border-bottom: 1px solid var(--border-subtle);
}

.modal-category {
  font-size: 10px;
  font-weight: 700;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.modal-code {
  font-size: 20px;
  font-weight: 800;
  font-family: var(--font-mono);
  color: var(--text-main);
  margin-top: 1px;
}

.modal-name {
  font-size: 12px;
  color: var(--text-muted);
}

.modal-body {
  padding: 14px 16px;
}

.modal-image-box {
  background: #ffffff;
  border-radius: var(--radius-md);
  padding: 12px;
  height: 160px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  border: 1px solid rgba(0, 0, 0, 0.08);
  margin-bottom: 12px;
}

@media (min-width: 768px) {
  .modal-image-box {
    height: 190px;
  }
}

.modal-image-box img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.zoom-hint {
  position: absolute;
  top: 6px;
  left: 8px;
  font-size: 9.5px;
  color: #64748b;
  background: rgba(255, 255, 255, 0.9);
  padding: 1px 5px;
  border-radius: 3px;
}

.modal-specs-table {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.spec-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  border-bottom: 1px solid var(--border-subtle);
  font-size: 12px;
}

.spec-row:last-child {
  border-bottom: none;
}

.spec-label {
  color: var(--text-muted);
}

.spec-value {
  color: var(--text-main);
  font-family: var(--font-mono);
}

.text-muted {
  color: var(--text-dim);
}

.modal-footer {
  padding: 10px 16px;
  border-top: 1px solid var(--border-subtle);
  background: var(--bg-surface);
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

.modal-footer .btn {
  flex: 1;
}

/* Toast */
.toast-container {
  position: fixed;
  bottom: 74px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--primary);
  color: #ffffff;
  padding: 8px 16px;
  border-radius: var(--radius-full);
  font-size: 12.5px;
  font-weight: 600;
  box-shadow: var(--shadow-lg);
  z-index: 200;
  opacity: 0;
  pointer-events: none;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  white-space: nowrap;
}

.toast-container.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* Mobile Floating Bottom Nav Bar */
.mobile-nav-bar {
  position: fixed;
  bottom: 0;
  inset-inline: 0;
  height: 56px;
  background: rgba(9, 9, 11, 0.94);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-around;
  z-index: 100;
  padding-bottom: env(safe-area-inset-bottom, 6px);
}

[data-theme="light"] .mobile-nav-bar {
  background: rgba(255, 255, 255, 0.94);
}

@media (min-width: 768px) {
  .mobile-nav-bar {
    display: none;
  }
}

.mob-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  background: transparent;
  border: none;
  color: var(--text-dim);
  font-size: 10px;
  font-weight: 600;
  cursor: pointer;
  flex: 1;
  height: 100%;
  transition: color 0.15s;
}

.mob-nav-item .icon {
  width: 17px;
  height: 17px;
}

.mob-nav-item.active {
  color: var(--primary);
}

.mob-nav-item.mob-call {
  color: var(--primary);
}

/* Footer */
.cat-footer {
  border-top: 1px solid var(--border-subtle);
  background: var(--bg-surface);
  padding: 16px 0;
  font-size: 11.5px;
  color: var(--text-muted);
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}

.footer-sub {
  font-size: 10.5px;
  color: var(--text-dim);
  margin-top: 2px;
}

.footer-link:hover {
  color: var(--primary);
}

/* ==========================================================================
   Share Modal & Bottom Sheet (Tech Minimalism)
   ========================================================================== */
.share-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  animation: fadeIn 0.2s ease;
}

@media (min-width: 640px) {
  .share-modal-overlay {
    align-items: center;
    padding: 20px;
  }
}

.share-modal-content {
  width: 100%;
  max-width: 480px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-top-left-radius: 20px;
  border-top-right-radius: 20px;
  padding: 16px 20px 28px;
  box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.4);
  animation: slideUp 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  box-sizing: border-box;
}

@media (min-width: 640px) {
  .share-modal-content {
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.45);
    animation: zoomIn 0.2s ease;
  }
}

.share-sheet-handle {
  width: 44px;
  height: 5px;
  background: rgba(255, 255, 255, 0.3);
  border-radius: 3px;
  margin: 0 auto 16px;
}

@media (min-width: 640px) {
  .share-sheet-handle {
    display: none;
  }
}

.share-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-color);
}

.share-modal-info {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.share-modal-thumb {
  width: 50px;
  height: 50px;
  object-fit: contain;
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 4px;
  flex-shrink: 0;
}

.share-modal-text {
  min-width: 0;
}

.share-modal-badge {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--accent-primary);
  margin-bottom: 2px;
}

.share-modal-title {
  font-size: 18px;
  font-weight: 800;
  color: var(--text-primary);
  margin: 0 0 2px;
  font-family: var(--font-mono);
}

.share-modal-subtitle {
  font-size: 12px;
  color: var(--text-secondary);
  margin: 0;
}

.share-title-divider {
  display: flex;
  align-items: center;
  text-align: center;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 14px;
}

.share-title-divider::before,
.share-title-divider::after {
  content: '';
  flex: 1;
  border-bottom: 1px solid var(--border-color);
}

.share-title-divider span {
  padding: 0 10px;
}

.share-actions-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 16px;
}

.share-channel-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 8px;
  padding: 12px 6px;
  border-radius: 12px;
  border: 1px solid var(--border-color);
  background: var(--bg-card-hover);
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}

.share-channel-btn:hover {
  transform: translateY(-2px);
  border-color: var(--accent-primary);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.share-channel-btn:active {
  transform: scale(0.96);
}

.share-channel-icon-wrap {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.share-channel-icon-wrap.zalo-bg {
  background: #0068FF;
}

.share-channel-icon-wrap.facebook-bg {
  background: #1877F2;
}

.share-channel-icon-wrap.native-bg {
  background: #10B981;
  color: #ffffff;
}

.share-channel-icon {
  width: 24px;
  height: 24px;
}

.share-channel-labels {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.share-channel-name {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-primary);
}

.share-channel-sub {
  font-size: 10px;
  color: var(--text-muted);
}

/* Link copy section */
.share-link-box {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 12px;
}

.share-link-title {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.share-input-wrapper {
  display: flex;
  align-items: center;
  gap: 8px;
}

.share-link-field {
  flex: 1;
  height: 38px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 0 8px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-primary);
  outline: none;
  min-width: 0;
  letter-spacing: -0.2px;
}

.share-link-field:focus {
  border-color: var(--accent-primary);
}

.share-copy-action-btn {
  height: 38px;
  padding: 0 12px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11.5px;
  font-weight: 700;
  white-space: nowrap;
  flex-shrink: 0;
}
