/* Quick Tech — premium dark tech frontend */

:root {
  --qt-bg: #030712;
  --qt-surface: #0f172a;
  --qt-surface-2: #1e293b;
  --qt-border: rgba(148, 163, 184, 0.12);
  --qt-text: #f8fafc;
  --qt-muted: #94a3b8;
  --qt-brand: #6366f1;
  --qt-brand-2: #06b6d4;
  --qt-accent: #a855f7;
  --qt-success: #10b981;
  --qt-warning: #f59e0b;
  --qt-danger: #ef4444;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

html.lenis, html.lenis body {
  height: auto;
}

.lenis.lenis-smooth {
  scroll-behavior: auto !important;
}

body {
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--qt-bg);
  color: var(--qt-text);
  overflow-x: hidden;
  cursor: auto;
}

/* Scrollbar */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--qt-bg); }
::-webkit-scrollbar-thumb { background: #334155; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #475569; }

/* Selection */
::selection {
  background: rgba(99, 102, 241, 0.4);
  color: white;
}

/* Gradient text */
.gradient-text {
  background: linear-gradient(135deg, #fff 0%, #818cf8 40%, #22d3ee 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Animated mesh gradient background */
.mesh-bg {
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(at 0% 0%, rgba(99, 102, 241, 0.22) 0px, transparent 50%),
    radial-gradient(at 100% 0%, rgba(6, 182, 212, 0.18) 0px, transparent 50%),
    radial-gradient(at 100% 100%, rgba(168, 85, 247, 0.16) 0px, transparent 50%),
    radial-gradient(at 0% 100%, rgba(99, 102, 241, 0.12) 0px, transparent 50%);
  filter: blur(60px);
  animation: meshMove 20s ease-in-out infinite alternate;
}
@keyframes meshMove {
  0% { transform: scale(1) rotate(0deg); }
  100% { transform: scale(1.1) rotate(3deg); }
}

/* Noise overlay */
.noise-overlay {
  position: fixed;
  inset: 0;
  z-index: -1;
  opacity: 0.03;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
}

/* Glass card */
.glass {
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--qt-border);
}

.glass-strong {
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(24px);
  border: 1px solid var(--qt-border);
}

/* Glow effects */
.glow-brand { box-shadow: 0 0 40px rgba(99, 102, 241, 0.25); }
.glow-cyan { box-shadow: 0 0 40px rgba(6, 182, 212, 0.25); }
.glow-purple { box-shadow: 0 0 40px rgba(168, 85, 247, 0.25); }

/* Hover lift */
.hover-lift {
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.4s ease;
}
.hover-lift:hover {
  transform: translateY(-6px);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

/* Product card */
.product-card {
  position: relative;
  border-radius: 1.25rem;
  overflow: hidden;
  background: rgba(30, 41, 59, 0.5);
  border: 1px solid var(--qt-border);
  transition: border-color 0.3s ease;
  transform-style: preserve-3d;
}
.product-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.1), transparent 50%);
  opacity: 0;
  transition: opacity 0.4s ease;
  pointer-events: none;
}
.product-card:hover::before { opacity: 1; }
.product-card:hover { border-color: rgba(99, 102, 241, 0.3); }

/* Button styles */
.btn-glow {
  position: relative;
  overflow: hidden;
}
.btn-glow::after {
  content: '';
  position: absolute;
  inset: -2px;
  background: linear-gradient(135deg, var(--qt-brand), var(--qt-brand-2));
  border-radius: inherit;
  z-index: -1;
  opacity: 0;
  filter: blur(12px);
  transition: opacity 0.3s ease;
}
.btn-glow:hover::after { opacity: 0.6; }

/* Tags */
.qt-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.375rem 0.875rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}
.qt-tag-stock { background: rgba(16, 185, 129, 0.12); color: #34d399; border: 1px solid rgba(16, 185, 129, 0.2); }
.qt-tag-order { background: rgba(6, 182, 212, 0.12); color: #67e8f9; border: 1px solid rgba(6, 182, 212, 0.2); }

/* Price */
.qt-price {
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}

/* Table modern */
.qt-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0 0.5rem;
}
.qt-table thead th {
  padding: 0.75rem 1rem;
  text-align: left;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--qt-muted);
  font-weight: 600;
}
.qt-table tbody tr {
  background: rgba(30, 41, 59, 0.4);
  transition: all 0.3s ease;
}
.qt-table tbody tr:hover {
  background: rgba(30, 41, 59, 0.7);
  transform: scale(1.005);
}
.qt-table tbody td {
  padding: 1rem;
  border-top: 1px solid var(--qt-border);
  border-bottom: 1px solid var(--qt-border);
}
.qt-table tbody td:first-child {
  border-left: 1px solid var(--qt-border);
  border-radius: 0.75rem 0 0 0.75rem;
}
.qt-table tbody td:last-child {
  border-right: 1px solid var(--qt-border);
  border-radius: 0 0.75rem 0.75rem 0;
}

/* Sortable headers */
.qt-table th[data-sort] {
  cursor: pointer;
  user-select: none;
  position: relative;
  padding-right: 1.25rem;
  transition: color 0.2s ease;
}
.qt-table th[data-sort]:hover {
  color: #fff;
}
.qt-table th[data-sort]::after {
  content: '⇅';
  position: absolute;
  right: 0.25rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.65rem;
  color: var(--qt-muted);
  opacity: 0.5;
}
.qt-table th[data-sort].sort-asc::after {
  content: '↑';
  opacity: 1;
  color: var(--qt-brand);
}
.qt-table th[data-sort].sort-desc::after {
  content: '↓';
  opacity: 1;
  color: var(--qt-brand);
}

/* Specs */
.spec-row {
  display: flex;
  justify-content: space-between;
  padding: 0.875rem 0;
  border-bottom: 1px solid var(--qt-border);
}
.spec-row:last-child { border-bottom: none; }
.spec-label { color: var(--qt-muted); font-weight: 500; }
.spec-value { font-weight: 600; }

/* Gallery */
.gallery-main {
  width: 100%;
  height: 480px;
  object-fit: contain;
  border-radius: 1.5rem;
  background: rgba(30, 41, 59, 0.5);
  border: 1px solid var(--qt-border);
  transition: transform 0.3s ease;
}
.gallery-thumb {
  width: 80px;
  height: 80px;
  object-fit: cover;
  border-radius: 1rem;
  border: 2px solid transparent;
  cursor: pointer;
  opacity: 0.6;
  transition: all 0.25s ease;
}
.gallery-thumb:hover,
.gallery-thumb.active {
  opacity: 1;
  border-color: var(--qt-brand);
  transform: scale(1.05);
}

/* Filters */
.qt-input {
  background: rgba(30, 41, 59, 0.5);
  border: 1px solid var(--qt-border);
  border-radius: 0.75rem;
  color: var(--qt-text);
  padding: 0.625rem 1rem;
  width: 100%;
  transition: all 0.2s ease;
  outline: none;
}
.qt-input:focus {
  border-color: var(--qt-brand);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}
.qt-input::placeholder { color: #64748b; }

/* Select */
select.qt-input {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  padding-right: 2.25rem;
  cursor: pointer;
}
select.qt-input option {
  background: var(--qt-surface-2);
  color: var(--qt-text);
}

/* Checkbox */
.qt-checkbox {
  appearance: none;
  width: 1.125rem;
  height: 1.125rem;
  border: 2px solid #475569;
  border-radius: 0.375rem;
  background: transparent;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
}
.qt-checkbox:checked {
  background: var(--qt-brand);
  border-color: var(--qt-brand);
}
.qt-checkbox:checked::after {
  content: '';
  position: absolute;
  left: 5px;
  top: 1px;
  width: 5px;
  height: 10px;
  border: solid white;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

/* Article content */
.article-content {
  font-size: 1.125rem;
  line-height: 1.85;
  color: #cbd5e1;
}
.article-content h2 {
  color: var(--qt-text);
  font-size: 1.75rem;
  font-weight: 700;
  margin: 2.5rem 0 1rem;
}
.article-content p { margin-bottom: 1.25rem; }
.article-content img {
  max-width: 100%;
  border-radius: 1rem;
  margin: 2rem 0;
  border: 1px solid var(--qt-border);
}
.article-content ul { margin-bottom: 1.25rem; padding-left: 1.5rem; }
.article-content li { margin-bottom: 0.5rem; }

/* Hero floating cards */
.hero-float {
  animation: float 6s ease-in-out infinite;
}
.hero-float:nth-child(2) { animation-delay: -2s; }
.hero-float:nth-child(3) { animation-delay: -4s; }
@keyframes float {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-20px) rotate(2deg); }
}

/* Reveal animations base */
.reveal {
  opacity: 0;
  transform: translateY(30px);
}

/* Loader skeleton */
.skeleton {
  background: linear-gradient(90deg, rgba(30,41,59,0.5) 25%, rgba(51,65,85,0.5) 50%, rgba(30,41,59,0.5) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 0.75rem;
}
@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* Modal */
.qt-modal {
  background: rgba(3, 7, 18, 0.8);
  backdrop-filter: blur(12px);
}

/* Range slider */
input[type=range] {
  -webkit-appearance: none;
  width: 100%;
  background: transparent;
}
input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none;
  height: 16px;
  width: 16px;
  border-radius: 50%;
  background: var(--qt-brand);
  cursor: pointer;
  margin-top: -6px;
  box-shadow: 0 0 10px rgba(99, 102, 241, 0.5);
}
input[type=range]::-webkit-slider-runnable-track {
  width: 100%;
  height: 4px;
  cursor: pointer;
  background: #334155;
  border-radius: 2px;
}

/* Page transition overlay */
.page-transition {
  position: fixed;
  inset: 0;
  background: var(--qt-bg);
  z-index: 9998;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.12s ease;
}
.page-transition.active { opacity: 1; }

/* Navbar */
.qt-navbar {
  background: transparent;
}
.qt-navbar.scrolled {
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-bottom: 1px solid var(--qt-border);
}

.qt-logo {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.25rem;
  line-height: 1.75rem;
  font-weight: 800;
  color: #fff;
  text-decoration: none;
  padding: 0.5rem;
  margin-left: -0.5rem;
  border-radius: 0.75rem;
  transition: background 0.2s ease;
}
.qt-logo:hover {
  background: rgba(255, 255, 255, 0.05);
}

/* Menu toggle */
.qt-menu-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.375rem;
  min-width: 44px;
  min-height: 44px;
  padding: 0.5rem 0.625rem;
  margin-right: -0.5rem;
  border-radius: 0.75rem;
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.15);
  cursor: pointer;
  transition: color 0.2s ease, background 0.2s ease, border-color 0.2s ease;
  position: relative;
  z-index: 60;
}
@media (min-width: 1024px) {
  .qt-menu-toggle { display: none; }
}
.qt-menu-toggle:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.3);
}
.qt-menu-toggle:focus-visible {
  outline: 2px solid var(--qt-brand);
  outline-offset: 2px;
}
.qt-menu-toggle[aria-expanded="true"] {
  background: rgba(255, 255, 255, 0.2);
}

.qt-menu-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}
.qt-menu-icon.hidden {
  display: none;
}
.qt-menu-label {
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1;
}
@media (max-width: 360px) {
  .qt-menu-label { display: none; }
}

/* Mobile menu */
.qt-mobile-menu {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 55;
  background: #0f172a !important;
  border-top: 1px solid var(--qt-border);
  border-bottom: 1px solid var(--qt-border);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
  max-height: calc(100vh - 64px);
  overflow-y: auto;
  transform-origin: top;
  opacity: 0;
  transform: scaleY(0.96);
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}
@media (min-width: 1024px) {
  .qt-mobile-menu { display: none !important; }
}
.qt-mobile-menu.open {
  opacity: 1;
  transform: scaleY(1);
  pointer-events: auto;
}

/* Mobile-first enhancements */

@media (max-width: 1024px) {
  .hero-section { padding-top: 6rem; }
  .hero-title { font-size: 2.5rem; line-height: 1.1; }
  .hero-title .word { display: inline; }
}

@media (max-width: 768px) {
  /* Typography */
  h1 { font-size: 2rem !important; }
  h2 { font-size: 1.5rem !important; }

  /* Tables as cards */
  .qt-table { border-spacing: 0 0.75rem; }
  .qt-table thead { display: none; }
  .qt-table tbody tr {
    display: block;
    border-radius: 1rem;
    padding: 1rem;
    margin-bottom: 0.75rem;
    background: rgba(30, 41, 59, 0.6);
    border: 1px solid var(--qt-border);
  }
  .qt-table tbody tr:hover { transform: none; }
  .qt-table tbody td {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    border: none !important;
    border-radius: 0 !important;
  }
  .qt-table tbody td[data-label]::before {
    content: attr(data-label);
    font-weight: 600;
    color: var(--qt-muted);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
  }
  .qt-table tbody td:last-child {
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--qt-border) !important;
    justify-content: flex-end;
  }

  /* Better touch targets */
  .btn { min-height: 44px; }
  .qt-input { min-height: 44px; }

  /* Sticky elements */
  .sticky.top-28 { position: relative; top: auto; }

  /* Gallery */
  .gallery-main { height: 280px; border-radius: 1rem; }
  .gallery-thumb { width: 56px; height: 56px; }

  /* Filters */
  .glass.rounded-2xl.p-4 .grid { gap: 0.75rem; }

  /* Footer */
  footer .grid { gap: 1.5rem; }
}

/* Reduce motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .mesh-bg { animation: none; }
}
