:root {
  /* Premium Deep Obsidian Space Palette & Neon Glows */
  --bg-app: #05070f;
  --bg-sidebar: rgba(10, 15, 30, 0.55);
  --bg-main: #070a16;
  --bg-topbar: rgba(7, 10, 22, 0.6);
  --bg-card: rgba(16, 22, 45, 0.4);
  --bg-glass-panel: rgba(16, 22, 46, 0.5);
  
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  
  --accent-blue: #00f2fe;
  --accent-indigo: #6366f1;
  --accent-gradient: linear-gradient(135deg, #00f2fe 0%, #6366f1 100%);
  --accent-glow: 0 0 20px rgba(0, 242, 254, 0.25);
  
  --border-glass: rgba(255, 255, 255, 0.07);
  --border-glass-bright: rgba(255, 255, 255, 0.15);
  --hover-color: rgba(255, 255, 255, 0.05);
  
  --font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-headings: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
  
  --glass-blur: blur(24px) saturate(190%);
  --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.45);
  
  --grid-columns: 4;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-family);
  background-color: var(--bg-app);
  color: var(--text-primary);
  overflow: hidden;
  user-select: none;
}

/* Master Container */
.app-container {
  display: flex;
  height: 100dvh;
  width: 100vw;
  background-image: 
    radial-gradient(circle at 10% 20%, rgba(99, 102, 241, 0.08) 0%, transparent 40%),
    radial-gradient(circle at 90% 80%, rgba(0, 242, 254, 0.06) 0%, transparent 45%);
}

/* Sidebar with Frosted Glass Effect */
.sidebar {
  width: 280px;
  background-color: var(--bg-sidebar);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border-right: 1px solid var(--border-glass);
  display: flex;
  flex-direction: column;
  z-index: 10;
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.sidebar-content {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 24px 16px 16px;
}

.sidebar-section {
  margin-bottom: 28px;
}

.section-title {
  font-family: var(--font-headings);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 4px 12px;
  margin-bottom: 8px;
  letter-spacing: 1.5px;
}

.nav-list {
  list-style: none;
}

/* Premium folder-style items */
.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  background-color: transparent;
  border: 1px solid transparent;
  margin-bottom: 4px;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.nav-item svg {
  color: var(--text-muted);
  transition: color 0.25s;
}

.nav-item:hover {
  color: var(--text-primary);
  background-color: var(--hover-color);
  border-color: rgba(255, 255, 255, 0.03);
}

.nav-item:hover svg {
  color: var(--accent-blue);
}

.nav-item.active {
  background: var(--accent-gradient);
  color: white;
  border-color: transparent;
  box-shadow: 0 4px 15px rgba(0, 242, 254, 0.2);
}

.nav-item.active svg {
  color: white;
}

/* Nested subcategory items */
.sub-nav-list {
  margin-left: 24px;
  border-left: 1px solid rgba(255, 255, 255, 0.05);
  padding-left: 6px;
  list-style: none;
  margin-top: 2px;
}

.nav-item.sub-item {
  padding: 8px 12px;
  font-size: 12.5px;
  border-radius: 8px;
  color: var(--text-muted);
}

.nav-item.sub-item:hover {
  color: var(--text-primary);
  background-color: var(--hover-color);
}

.nav-item.sub-item.active {
  background: rgba(0, 242, 254, 0.1);
  color: var(--accent-blue);
  border: 1px solid rgba(0, 242, 254, 0.25);
  box-shadow: none;
}

/* Main Content Wrapper */
.main-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
  background-color: var(--bg-main);
  position: relative;
  overflow: hidden;
}

/* Topbar with Liquid Glass Reflection */
.topbar {
  height: 64px;
  background-color: var(--bg-topbar);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border-bottom: 1px solid var(--border-glass);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  z-index: 10;
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
}

.topbar-left, .topbar-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.page-title {
  font-family: var(--font-headings);
  font-size: 18px;
  font-weight: 700;
  background: linear-gradient(120deg, #ffffff 40%, var(--text-secondary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: -0.5px;
}

/* Prominent Centered Glass Search Bar */
.search-container {
  display: flex;
  align-items: center;
  background-color: rgba(4, 7, 20, 0.6);
  border: 1px solid var(--border-glass);
  border-radius: 20px;
  padding: 6px 16px;
  width: 280px;
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.3);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.search-icon {
  color: var(--text-muted);
  margin-right: 10px;
  transition: color 0.25s;
}

.search-container input {
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-size: 13.5px;
  width: 100%;
  outline: none;
}

.search-container input::placeholder {
  color: var(--text-muted);
}

.search-container:focus-within {
  width: 380px;
  border-color: var(--accent-blue);
  box-shadow: 0 0 25px rgba(0, 242, 254, 0.15), inset 0 1px 2px rgba(0,0,0,0.5);
  background-color: rgba(4, 7, 20, 0.95);
}

.search-container:focus-within .search-icon {
  color: var(--accent-blue);
}

/* Glass Scale Control */
.scale-control {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 20px;
  padding: 6px 12px;
  border: 1px solid var(--border-glass);
}

.slider {
  -webkit-appearance: none;
  width: 90px;
  height: 3px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
  outline: none;
  transition: background 0.2s;
}

.slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--text-primary);
  cursor: pointer;
  box-shadow: var(--accent-glow);
  transition: transform 0.15s;
}

.slider::-webkit-slider-thumb:hover {
  transform: scale(1.2);
  background: var(--accent-blue);
}

/* Premium Shopping Cart Button */
.cart-icon-container {
  position: relative;
  cursor: pointer;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-glass);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.cart-icon-container:hover {
  color: white;
  border-color: var(--accent-blue);
  background: rgba(0, 242, 254, 0.05);
  transform: scale(1.05);
  box-shadow: var(--accent-glow);
}

.cart-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  background: var(--accent-gradient);
  color: white;
  font-size: 10px;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 12px;
  min-width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 10px rgba(0, 242, 254, 0.4);
}

/* Content Frame & Scrollport */
.content-area {
  flex: 1;
  padding: 88px 24px 24px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

/* Elegant Apple Photos Style Photo Wall Grid */
.grid-container {
  display: grid;
  grid-template-columns: repeat(var(--grid-columns), 1fr);
  gap: 16px;
  transition: grid-template-columns 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Product Card - Sleek Glass Frame */
.product-card {
  position: relative;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background-color: rgba(10, 15, 30, 0.6);
  cursor: pointer;
  border-radius: 16px;
  border: 1px solid var(--border-glass);
  box-shadow: 0 4px 20px rgba(0,0,0,0.2);
  will-change: transform, box-shadow;
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.product-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(0, 242, 254, 0.15) 0%, rgba(99, 102, 241, 0.15) 100%);
  opacity: 0;
  z-index: 1;
  transition: opacity 0.4s ease;
}

.product-card:hover {
  transform: translateY(-6px) scale(1.02);
  border-color: rgba(0, 242, 254, 0.4);
  box-shadow: 0 12px 30px rgba(0, 242, 254, 0.15), 0 2px 4px rgba(0,0,0,0.5);
  z-index: 2;
}

.product-card:hover::before {
  opacity: 1;
}

.product-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.product-card:hover .product-img {
  transform: scale(1.05);
}

/* Information Strip - Liquid Glass Overlay */
.product-info {
  position: absolute;
  bottom: 12px;
  left: 12px;
  right: 12px;
  padding: 12px 16px;
  background: rgba(10, 12, 24, 0.7);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  color: white;
  z-index: 2;
  opacity: 0;
  transform: translateY(12px);
  box-shadow: 0 4px 20px rgba(0,0,0,0.3);
  transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.product-card:hover .product-info,
.grid-container[style*="--grid-columns: 2"] .product-info,
.grid-container[style*="--grid-columns: 3"] .product-info {
  opacity: 1;
  transform: translateY(0);
}

.product-name {
  font-family: var(--font-headings);
  font-size: 13.5px;
  font-weight: 600;
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.product-price {
  font-size: 12.5px;
  color: var(--accent-blue);
  font-weight: 700;
}

/* Loading Spinner & Empty Message */
.loading-state, .empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: calc(100vh - 200px);
  color: var(--text-secondary);
}

.spinner {
  width: 32px;
  height: 32px;
  border: 3px solid rgba(255,255,255,0.05);
  border-top-color: var(--accent-blue);
  border-radius: 50%;
  animation: spin 0.8s cubic-bezier(0.4, 0, 0.2, 1) infinite;
  box-shadow: var(--accent-glow);
  margin-bottom: 16px;
}

@keyframes spin { 
  to { transform: rotate(360deg); } 
}

/* Custom Premium Glass Scrollbars */
.content-area::-webkit-scrollbar,
.sidebar-content::-webkit-scrollbar,
.cart-items::-webkit-scrollbar,
.details-view::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
.content-area::-webkit-scrollbar-track,
.sidebar-content::-webkit-scrollbar-track,
.cart-items::-webkit-scrollbar-track,
.details-view::-webkit-scrollbar-track {
  background: transparent;
}
.content-area::-webkit-scrollbar-thumb,
.sidebar-content::-webkit-scrollbar-thumb,
.cart-items::-webkit-scrollbar-thumb,
.details-view::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 20px;
}
.content-area::-webkit-scrollbar-thumb:hover,
.sidebar-content::-webkit-scrollbar-thumb:hover,
.cart-items::-webkit-scrollbar-thumb:hover,
.details-view::-webkit-scrollbar-thumb:hover {
  background: var(--accent-blue);
}

/* Detail View overlay sheet */
.details-view {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: var(--bg-main);
  z-index: 5;
  display: flex;
  flex-direction: column;
  padding: 88px 32px 32px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
  transform: scale(0.97) translateY(20px);
  will-change: opacity, transform;
  transition: opacity 0.4s cubic-bezier(0.16, 1, 0.3, 1), transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.4s;
}

.details-view.open {
  opacity: 1;
  pointer-events: auto;
  visibility: visible;
  transform: scale(1) translateY(0);
}

.details-header {
  margin-bottom: 24px;
}

.details-content {
  display: flex;
  flex-direction: row;
  gap: 56px;
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
  align-items: flex-start;
}

/* Interactive Image Zoom Container */
.details-image-container {
  flex: 1.1;
  background-color: rgba(4, 7, 20, 0.6);
  border-radius: 20px;
  border: 1px solid var(--border-glass);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 1/1;
  position: relative;
  cursor: zoom-in;
  box-shadow: 0 10px 40px rgba(0,0,0,0.4);
}

.details-image-container img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform-origin: center center;
  transition: transform 0.15s cubic-bezier(0.2, 0, 0.2, 1);
  will-change: transform;
}

/* Glass magnifier lens overlay */
.zoom-lens {
  position: absolute;
  width: 160px;
  height: 160px;
  border-radius: 50%;
  border: 2px solid rgba(0, 242, 254, 0.8);
  box-shadow: 0 0 30px rgba(0,0,0,0.5), inset 0 0 15px rgba(0,242,254,0.3);
  pointer-events: none;
  opacity: 0;
  transform: translate(-50%, -50%);
  background-color: rgba(255, 255, 255, 0.05);
  backdrop-filter: saturate(140%) blur(2px);
  -webkit-backdrop-filter: saturate(140%) blur(2px);
  z-index: 3;
  transition: opacity 0.2s ease;
}

.details-image-container:hover .zoom-lens {
  opacity: 1;
}

.details-image-container.zoomed {
  cursor: zoom-out;
}

/* Details specs & description panel */
.details-info-container {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.detail-title {
  font-family: var(--font-headings);
  font-size: 32px;
  font-weight: 800;
  margin-bottom: 10px;
  letter-spacing: -0.5px;
}

.detail-price {
  font-size: 26px;
  color: var(--accent-blue);
  font-weight: 800;
  margin-bottom: 24px;
}

.detail-description {
  font-size: 15px;
  line-height: 1.7;
  color: var(--text-secondary);
  margin-bottom: 36px;
}

.specs-container {
  margin-bottom: 36px;
}

.specs-container h3 {
  font-family: var(--font-headings);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 12px;
  letter-spacing: 1.5px;
}

.specs-list {
  list-style: none;
  border-top: 1px solid var(--border-glass);
}

.specs-list li {
  display: flex;
  padding: 14px 0;
  border-bottom: 1px solid var(--border-glass);
  font-size: 14px;
}

.specs-list li span:first-child {
  width: 140px;
  color: var(--text-secondary);
  font-weight: 500;
}

.specs-list li span:last-child {
  color: var(--text-primary);
  font-weight: 600;
}

/* Premium Buttons & Click Micro-interactions */
.btn {
  padding: 14px 28px;
  border-radius: 12px;
  font-size: 15.5px;
  font-weight: 700;
  cursor: pointer;
  border: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.btn.primary {
  background: var(--accent-gradient);
  color: white;
  box-shadow: 0 4px 20px rgba(99, 102, 241, 0.3);
}

.btn.primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(0, 242, 254, 0.45);
}

.btn.success {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: white;
  box-shadow: 0 4px 15px rgba(16, 185, 129, 0.2);
}

.btn.success:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(16, 185, 129, 0.4);
}

.btn:active, .icon-btn:active, .nav-item:active, .qty-btn:active {
  transform: scale(0.96) !important;
}

.icon-btn {
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border-glass);
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  padding: 8px;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.icon-btn:hover {
  color: white;
  border-color: rgba(255,255,255,0.25);
  background-color: var(--hover-color);
}

.icon-btn.small {
  padding: 4px;
}

/* Semi-transparent Frosted Cart Sidebar Drawer */
.cart-sidebar {
  position: fixed;
  top: 0;
  right: -420px;
  bottom: 0;
  width: 400px;
  background-color: rgba(10, 14, 30, 0.65);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border-left: 1px solid var(--border-glass);
  z-index: 100;
  display: flex;
  flex-direction: column;
  transition: right 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: -10px 0 40px rgba(0,0,0,0.6);
}

.cart-sidebar.open {
  right: 0;
}

.cart-header {
  height: 64px;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-glass);
}

.cart-header h2 {
  font-family: var(--font-headings);
  font-size: 18px;
  font-weight: 700;
}

.cart-items {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 24px;
}

.cart-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding-bottom: 18px;
  margin-bottom: 18px;
  border-bottom: 1px solid var(--border-glass);
}

.cart-item-img {
  width: 64px;
  height: 64px;
  border-radius: 10px;
  object-fit: cover;
  background-color: rgba(0,0,0,0.4);
  border: 1px solid var(--border-glass);
}

.cart-item-details {
  flex: 1;
}

.cart-item-title {
  font-family: var(--font-headings);
  font-size: 13.5px;
  font-weight: 600;
  margin-bottom: 4px;
}

.cart-item-price {
  font-size: 12.5px;
  color: var(--accent-blue);
  font-weight: 700;
  margin-bottom: 8px;
}

.cart-item-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.qty-btn {
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border-glass);
  color: white;
  width: 26px;
  height: 26px;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.qty-btn:hover {
  background: rgba(255,255,255,0.15);
  border-color: var(--accent-blue);
}

.remove-btn {
  margin-left: auto;
  background: transparent;
  border: none;
  color: #ef4444;
  cursor: pointer;
  font-size: 14px;
  padding: 4px;
}

.cart-footer {
  padding: 24px;
  border-top: 1px solid var(--border-glass);
  background-color: rgba(5, 7, 20, 0.8);
}

.cart-total {
  display: flex;
  justify-content: space-between;
  font-family: var(--font-headings);
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 24px;
}

/* Semi-transparent dim backdrops */
.sidebar-backdrop, .cart-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(3, 5, 12, 0.65);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 9;
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.cart-backdrop {
  z-index: 95;
}

.sidebar-backdrop.visible, .cart-backdrop.visible {
  opacity: 1;
  pointer-events: auto;
  visibility: visible;
}

/* View Transitions Support Visual Tweaks */
::view-transition-old(hero),
::view-transition-new(hero) {
  height: 100%;
  object-fit: cover;
}

/* Mobile Responsiveness & Tactile Tap Targets */
@media (max-width: 768px) {
  .details-content {
    flex-direction: column;
    gap: 32px;
    align-items: stretch;
  }
  .cart-sidebar {
    width: 100%;
    right: -100%;
  }
  .sidebar {
    position: fixed;
    top: 0;
    left: -280px;
    bottom: 0;
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 10;
  }
  .sidebar.open {
    transform: translateX(280px);
  }
  .hamburger-btn {
    display: flex;
  }
  .desktop-only {
    display: none !important;
  }
  .grid-container {
    --grid-columns: 2 !important;
    gap: 12px;
    padding: 12px;
  }
  .mobile-search-btn {
    display: flex;
  }
  
  .hamburger-btn, .cart-icon-container, .icon-btn, .qty-btn, .close-btn {
    min-width: 44px;
    min-height: 44px;
  }
  
  .btn {
    padding: 16px 32px;
  }
  
  .topbar {
    padding: 0 16px;
  }
  
  .page-title {
    font-size: 16px;
  }
  
  /* Mobile-active responsive search pill overlay */
  .search-container {
    display: none;
  }
  
  .search-container.mobile-active {
    display: flex !important;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100% !important;
    height: 100%;
    background-color: var(--bg-topbar);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    z-index: 20;
    padding: 0 16px;
    align-items: center;
    border-radius: 0;
    border: none;
    border-bottom: 1px solid var(--border-glass);
    gap: 12px;
  }
  
  .search-container.mobile-active input {
    font-size: 16px;
    flex: 1;
  }
  
  .search-container.mobile-active .search-cancel-btn {
    display: block;
  }
  
  .scale-control {
    display: none;
  }
}

@media (min-width: 769px) {
  .hamburger-btn {
    display: none !important;
  }
}

/* Helper utility class */
.hidden {
  display: none !important;
}
