/* ==========================================================================
   Apex 3D Automotive Studio & Component X-Ray Inspection Suite
   Aesthetic Dark Luxury Automotive UI Design
   ========================================================================== */

:root {
  --bg-primary: #07090e;
  --bg-secondary: #0f131a;
  --bg-surface: rgba(18, 24, 38, 0.75);
  --bg-surface-hover: rgba(28, 36, 56, 0.85);
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-active: rgba(255, 230, 0, 0.5);
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --accent-yellow: #ffe600; /* Component X-Ray Highlight Color */
  --accent-cyan: #06b6d4;
  --accent-blue: #3b82f6;
  --accent-crimson: #ef4444;
  --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-full: 9999px;
  --shadow-card: 0 12px 36px rgba(0, 0, 0, 0.45);
  --shadow-glow-yellow: 0 0 20px rgba(255, 230, 0, 0.25);
}

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

body {
  font-family: var(--font-family);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  overflow: hidden;
  user-select: none;
  -webkit-font-smoothing: antialiased;
}

/* App Container */
.app-container {
  display: flex;
  flex-direction: column;
  height: 100vh;
  width: 100vw;
  position: relative;
}

/* --- Top Header Navigation --- */
.top-header {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 40;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 28px;
  background: linear-gradient(180deg, rgba(7, 9, 14, 0.95) 0%, rgba(7, 9, 14, 0.6) 80%, transparent 100%);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-subtle);
}

.brand-badge {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-logo-icon {
  width: 32px;
  height: 32px;
  background: linear-gradient(135deg, #3b82f6, #06b6d4);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 16px rgba(59, 130, 246, 0.4);
}

.brand-title {
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  background: linear-gradient(90deg, #ffffff, #cbd5e1);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.brand-subtitle {
  font-size: 0.72rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* Category Navigation Pills */
.category-nav {
  display: flex;
  align-items: center;
  background: rgba(15, 19, 26, 0.85);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  padding: 4px;
  gap: 4px;
}

.category-tab {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 0.84rem;
  font-weight: 500;
  padding: 8px 18px;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 6px;
}

.category-tab:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.05);
}

.category-tab.active {
  background: #2563eb;
  color: #ffffff;
  box-shadow: 0 2px 12px rgba(37, 99, 235, 0.4);
}

.category-tab .car-count {
  font-size: 0.7rem;
  background: rgba(0, 0, 0, 0.3);
  padding: 2px 6px;
  border-radius: 10px;
}

/* View Mode Selector (Photorealistic Studio vs 3D 3-Axis X-Ray) */
.view-mode-selector {
  display: flex;
  align-items: center;
  background: rgba(10, 14, 22, 0.85);
  border: 1px solid rgba(255, 230, 0, 0.35);
  border-radius: var(--radius-full);
  padding: 3px;
  gap: 3px;
  box-shadow: 0 0 15px rgba(255, 230, 0, 0.15);
}

.mode-tab {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  align-items: center;
  gap: 6px;
}

.mode-tab:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.06);
}

.mode-tab.active {
  background: linear-gradient(135deg, #f59e0b, #eab308);
  color: #000000;
  box-shadow: 0 2px 10px rgba(234, 179, 8, 0.4);
}

/* Header Action Controls */
.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.icon-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.icon-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  color: var(--text-primary);
}

/* --- Viewport Containers (Studio & 3D WebGL) --- */
.viewport-container {
  flex: 1;
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

/* 1. Photorealistic 8K Studio Viewport */
.studio-viewport {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  touch-action: none;
}

.studio-viewport.active {
  opacity: 1;
  pointer-events: auto;
  z-index: 20;
}

.studio-zoom-container {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: grab;
  user-select: none;
  touch-action: none;
  overflow: hidden;
}

.studio-zoom-container:active {
  cursor: grabbing;
}

.studio-car-img {
  max-width: 86vw;
  max-height: 70vh;
  object-fit: contain;
  border-radius: 14px;
  box-shadow: 0 25px 70px rgba(0, 0, 0, 0.85);
  transform-origin: center center;
  transition: transform 0.05s linear;
  will-change: transform;
  pointer-events: none;
}

/* Studio Zoom HUD */
.studio-zoom-hud {
  position: absolute;
  bottom: 120px;
  right: 28px;
  z-index: 35;
  background: rgba(15, 20, 30, 0.85);
  backdrop-filter: blur(14px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  box-shadow: var(--shadow-card);
}

.studio-badge-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: #38bdf8;
}

.pulse-dot {
  width: 8px;
  height: 8px;
  background-color: #10b981;
  border-radius: 50%;
  box-shadow: 0 0 8px #10b981;
  animation: pulse-glow 2s infinite;
}

@keyframes pulse-glow {
  0% { transform: scale(0.9); opacity: 0.8; }
  50% { transform: scale(1.2); opacity: 1; }
  100% { transform: scale(0.9); opacity: 0.8; }
}

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

.studio-zoom-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-subtle);
  color: #ffffff;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  font-size: 1rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
}

.studio-zoom-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.3);
}

.studio-zoom-btn.reset-btn {
  width: auto;
  padding: 0 10px;
  font-size: 0.72rem;
  font-weight: 600;
}

.zoom-level-text {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-primary);
  min-width: 44px;
  text-align: center;
}

.zoom-hint-text {
  font-size: 0.65rem;
  color: var(--text-muted);
  max-width: 220px;
}

/* 2. WebGL 3D 3-Axis Canvas Container */
#webgl-canvas-container {
  width: 100%;
  height: 100%;
  position: absolute;
  top: 0;
  left: 0;
  cursor: grab;
  z-index: 5;
  transition: opacity 0.3s ease;
}

#webgl-canvas-container.active-mode {
  z-index: 20;
}

#webgl-canvas-container:active {
  cursor: grabbing;
}

/* --- Left HUD: Vehicle Info & Price / Mileage Banner --- */
.vehicle-info-card {
  position: absolute;
  top: 80px;
  left: 28px;
  z-index: 30;
  width: 340px;
  background: var(--bg-surface);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-card);
  transition: transform 0.3s ease;
}

.car-badge-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.car-category-pill {
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--accent-cyan);
  background: rgba(6, 182, 212, 0.12);
  padding: 3px 8px;
  border-radius: var(--radius-sm);
}

.car-year-badge {
  font-size: 0.74rem;
  color: var(--text-muted);
}

.car-title {
  font-size: 1.35rem;
  font-weight: 700;
  line-height: 1.25;
  color: #ffffff;
  margin-bottom: 6px;
}

.car-color-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.color-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.3);
}

/* Projected Price & Mileage Highlights (STRICT REQUIREMENT) */
.stat-highlight-block {
  background: rgba(10, 14, 22, 0.65);
  border-radius: var(--radius-md);
  padding: 12px;
  margin-bottom: 14px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.price-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 8px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.stat-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--text-muted);
}

.price-value {
  font-size: 1.15rem;
  font-weight: 700;
  color: #10b981; /* Green accent for price */
}

.mileage-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.mileage-value {
  font-size: 0.86rem;
  font-weight: 600;
  color: #38bdf8; /* Blue accent for mileage */
}

/* Technical Specs Grid */
.specs-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  font-size: 0.78rem;
}

.spec-item {
  background: rgba(255, 255, 255, 0.03);
  padding: 8px;
  border-radius: var(--radius-sm);
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.spec-name {
  color: var(--text-muted);
  font-size: 0.7rem;
}

.spec-data {
  color: var(--text-primary);
  font-weight: 600;
}

/* --- Right HUD: 3-Axis 360-Degree Rotation & Camera Controls --- */
.camera-controls-card {
  position: absolute;
  top: 80px;
  right: 28px;
  z-index: 30;
  width: 250px;
  background: var(--bg-surface);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 16px;
  box-shadow: var(--shadow-card);
}

.card-heading {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-muted);
  margin-bottom: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* 3-Axis Buttons Matrix */
.axis-buttons-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 14px;
}

.axis-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.axis-tag {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--accent-cyan);
  width: 50px;
}

.axis-btn {
  flex: 1;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  font-size: 0.74rem;
  padding: 6px 8px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s ease;
}

.axis-btn:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.2);
}

/* Camera Angle Presets */
.preset-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin-bottom: 14px;
}

.preset-btn {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-size: 0.72rem;
  padding: 6px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  text-align: center;
  transition: all 0.15s ease;
}

.preset-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
}

/* Zoom Slider & Auto Rotate */
.zoom-control-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.zoom-slider {
  flex: 1;
  accent-color: var(--accent-blue);
  cursor: pointer;
}

.toggle-btn {
  width: 100%;
  background: rgba(59, 130, 246, 0.15);
  border: 1px solid rgba(59, 130, 246, 0.3);
  color: #60a5fa;
  font-size: 0.74rem;
  font-weight: 600;
  padding: 8px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s ease;
}

.toggle-btn.active {
  background: #2563eb;
  color: #ffffff;
}

/* --- Bottom Center: 10 Interactive Components Inspection Bar --- */
.components-drawer {
  position: absolute;
  bottom: 120px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 35;
  background: var(--bg-surface);
  backdrop-filter: blur(18px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  padding: 6px 14px;
  display: flex;
  align-items: center;
  gap: 6px;
  box-shadow: var(--shadow-card);
  max-width: 90vw;
  overflow-x: auto;
}

.components-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--accent-yellow);
  letter-spacing: 0.8px;
  white-space: nowrap;
  padding-right: 6px;
  border-right: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  gap: 5px;
}

.component-pill {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-size: 0.75rem;
  font-weight: 500;
  padding: 6px 12px;
  border-radius: var(--radius-full);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
}

.component-pill:hover {
  background: rgba(255, 230, 0, 0.1);
  color: var(--accent-yellow);
  border-color: rgba(255, 230, 0, 0.3);
}

.component-pill.active {
  background: var(--accent-yellow);
  color: #000000; /* Pure black text on solid yellow */
  font-weight: 700;
  border-color: var(--accent-yellow);
  box-shadow: 0 0 14px rgba(255, 230, 0, 0.4);
}

.component-reset-btn {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #f87171;
  font-size: 0.72rem;
  padding: 6px 10px;
  border-radius: var(--radius-full);
  cursor: pointer;
  white-space: nowrap;
}

/* --- Bottom Bar: Vehicle Selection Carousel (10 Cars per Category) --- */
.car-carousel-container {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 30;
  background: linear-gradient(0deg, rgba(7, 9, 14, 0.98) 0%, rgba(7, 9, 14, 0.7) 80%, transparent 100%);
  backdrop-filter: blur(12px);
  border-top: 1px solid var(--border-subtle);
  padding: 10px 28px 16px;
}

.carousel-scroll {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  scroll-behavior: smooth;
  padding-bottom: 4px;
}

.carousel-scroll::-webkit-scrollbar {
  height: 4px;
}

.carousel-scroll::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 4px;
}

.car-thumb-card {
  min-width: 195px;
  background: rgba(20, 26, 38, 0.7);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 8px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.car-thumb-card:hover {
  background: rgba(30, 40, 60, 0.9);
  border-color: rgba(255, 255, 255, 0.25);
  transform: translateY(-3px);
}

.car-thumb-card.active {
  border-color: #3b82f6;
  background: rgba(37, 99, 235, 0.22);
  box-shadow: 0 6px 20px rgba(37, 99, 235, 0.35);
}

.thumb-img-wrapper {
  width: 100%;
  height: 94px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: #090c12;
  margin-bottom: 2px;
  position: relative;
}

.thumb-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.car-thumb-card:hover .thumb-img {
  transform: scale(1.06);
}

.thumb-title {
  font-size: 0.8rem;
  font-weight: 700;
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.thumb-price {
  font-size: 0.72rem;
  color: #10b981;
  font-weight: 600;
}

.thumb-mileage {
  font-size: 0.66rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* --- Pop-up Modal Window for Component Description & Purpose --- */
/* (STRICT REQUIREMENT: "a pop up window describes the component and its purpose") */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 100;
  background: rgba(3, 5, 8, 0.6);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.modal-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.component-modal-window {
  width: 90%;
  max-width: 520px;
  background: rgba(15, 20, 30, 0.95);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 230, 0, 0.4);
  border-radius: var(--radius-lg);
  padding: 28px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6), 0 0 30px rgba(255, 230, 0, 0.15);
  transform: translateY(20px) scale(0.96);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
}

.modal-overlay.open .component-modal-window {
  transform: translateY(0) scale(1);
}

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

.modal-badge-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.modal-yellow-tag {
  background: var(--accent-yellow);
  color: #000000;
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  letter-spacing: 0.5px;
}

.modal-car-name {
  font-size: 0.78rem;
  color: var(--text-secondary);
}

.modal-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: #ffffff;
  line-height: 1.3;
}

.modal-close-btn {
  background: rgba(255, 255, 255, 0.08);
  border: none;
  color: var(--text-secondary);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  transition: all 0.2s ease;
}

.modal-close-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  color: #ffffff;
}

.modal-section {
  margin-bottom: 16px;
}

.modal-section-title {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.modal-spec-text {
  font-size: 0.88rem;
  color: #38bdf8;
  font-weight: 600;
  line-height: 1.4;
  background: rgba(56, 189, 248, 0.08);
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border-left: 3px solid #38bdf8;
}

.modal-purpose-text {
  font-size: 0.92rem;
  color: var(--text-primary);
  line-height: 1.6;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 20px;
}

.modal-action-btn {
  background: var(--accent-yellow);
  color: #000000;
  border: none;
  font-size: 0.82rem;
  font-weight: 700;
  padding: 8px 18px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s ease;
}

.modal-action-btn:hover {
  background: #fcd34d;
}

/* Toast message */
.toast-msg {
  position: fixed;
  bottom: 24px;
  right: 28px;
  z-index: 90;
  background: rgba(16, 185, 129, 0.9);
  color: #ffffff;
  padding: 10px 18px;
  border-radius: var(--radius-md);
  font-size: 0.82rem;
  font-weight: 600;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  transform: translateY(60px);
  opacity: 0;
  transition: all 0.3s ease;
}

.toast-msg.show {
  transform: translateY(0);
  opacity: 1;
}

/* Default hidden states for mobile-only elements on desktop */
.card-close-btn {
  display: none;
}

.mobile-action-bar {
  display: none;
}

.mobile-car-pill {
  display: none;
}

#webgl-canvas-container canvas {
  touch-action: none;
  display: block;
  width: 100% !important;
  height: 100% !important;
}

/* ==========================================================================
   Comprehensive iPhone & Mobile Responsive Suite (iOS Safari & Android)
   ========================================================================== */
@media (max-width: 850px) {
  /* Prevent iOS Safari bounce and use dynamic viewport height */
  body, html {
    height: 100%;
    height: 100dvh;
    overflow: hidden;
    position: fixed;
    width: 100%;
  }

  .app-container {
    height: 100dvh;
    width: 100vw;
    position: relative;
    overflow: hidden;
  }

  /* Compact Safe-Area Top Header */
  .top-header {
    padding: max(10px, env(safe-area-inset-top)) 12px 8px;
    gap: 8px;
  }

  .brand-badge {
    gap: 8px;
  }

  .brand-logo-icon {
    width: 26px;
    height: 26px;
  }

  .brand-title {
    font-size: 0.92rem;
  }

  .brand-subtitle {
    display: none; /* Hide subtitle to preserve screen width */
  }

  /* Horizontally Scrollable Category Pills */
  .category-nav {
    max-width: calc(100vw - 120px);
    overflow-x: auto;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding: 3px;
    gap: 3px;
  }

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

  .category-tab {
    padding: 5px 10px;
    font-size: 0.72rem;
    flex-shrink: 0;
  }

  .category-tab .car-count {
    display: none;
  }

  /* Mobile Top Summary Pill (Title & Price) */
  .mobile-car-pill {
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: absolute;
    top: 60px;
    left: 12px;
    z-index: 35;
    max-width: calc(100vw - 100px);
    background: rgba(15, 20, 30, 0.85);
    backdrop-filter: blur(16px);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-full);
    padding: 6px 12px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
    cursor: pointer;
    gap: 8px;
  }

  .mobile-pill-name {
    font-size: 0.76rem;
    font-weight: 700;
    color: #ffffff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .mobile-pill-price {
    font-size: 0.74rem;
    font-weight: 700;
    color: #10b981;
    white-space: nowrap;
  }

  .mobile-pill-badge {
    font-size: 0.65rem;
    color: #38bdf8;
    background: rgba(56, 189, 248, 0.15);
    padding: 2px 6px;
    border-radius: 6px;
    font-weight: 600;
    white-space: nowrap;
  }

  /* Mobile Floating Action Buttons (Right Side) */
  .mobile-action-bar {
    display: flex;
    flex-direction: column;
    position: absolute;
    right: 12px;
    top: 60px;
    z-index: 35;
    gap: 8px;
  }

  .mobile-fab {
    background: rgba(15, 20, 30, 0.85);
    backdrop-filter: blur(16px);
    border: 1px solid var(--border-subtle);
    color: var(--text-primary);
    border-radius: var(--radius-full);
    padding: 6px 10px;
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.72rem;
    font-weight: 600;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.45);
    cursor: pointer;
    transition: all 0.2s ease;
  }

  .mobile-fab:active {
    transform: scale(0.95);
    background: rgba(37, 99, 235, 0.4);
  }

  /* Sliding Bottom Sheet for Vehicle Specifications on Mobile */
  .vehicle-info-card {
    position: fixed;
    top: auto;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100vw;
    max-width: 100vw;
    max-height: 82vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: 20px 20px 0 0;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-bottom: none;
    z-index: 60;
    padding: 20px 18px max(24px, env(safe-area-inset-bottom));
    background: rgba(12, 16, 24, 0.96);
    backdrop-filter: blur(24px);
    box-shadow: 0 -12px 40px rgba(0, 0, 0, 0.8);
    transform: translateY(105%);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  }

  .vehicle-info-card.open {
    transform: translateY(0);
  }

  /* Sliding Drawer for 3-Axis Camera Controls on Mobile */
  .camera-controls-card {
    position: fixed;
    top: auto;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100vw;
    max-width: 100vw;
    max-height: 80vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: 20px 20px 0 0;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-bottom: none;
    z-index: 60;
    padding: 20px 18px max(24px, env(safe-area-inset-bottom));
    background: rgba(12, 16, 24, 0.96);
    backdrop-filter: blur(24px);
    box-shadow: 0 -12px 40px rgba(0, 0, 0, 0.8);
    transform: translateY(105%);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  }

  .camera-controls-card.open {
    transform: translateY(0);
  }

  /* Close Button on Sliding Drawers */
  .card-close-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: #ffffff;
    font-size: 0.9rem;
    cursor: pointer;
  }

  /* Component X-Ray Pills Strip (Above Carousel) */
  .components-drawer {
    bottom: 95px;
    left: 10px;
    right: 10px;
    transform: none;
    max-width: calc(100vw - 20px);
    padding: 5px 8px;
    border-radius: var(--radius-md);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .components-drawer::-webkit-scrollbar {
    display: none;
  }

  .components-label {
    font-size: 0.68rem;
    padding-right: 4px;
  }

  .component-pill {
    padding: 5px 10px;
    font-size: 0.72rem;
    flex-shrink: 0;
  }

  /* View Mode Selector in Mobile Header */
  .view-mode-selector {
    padding: 2px;
  }

  .mode-tab {
    padding: 5px 10px;
    font-size: 0.72rem;
  }

  .mode-tab svg {
    width: 13px;
    height: 13px;
  }

  /* Studio Zoom HUD on Mobile */
  .studio-zoom-hud {
    bottom: 145px;
    right: 10px;
    left: auto;
    padding: 6px 10px;
    border-radius: var(--radius-sm);
  }

  .studio-car-img {
    max-width: 95vw;
    max-height: 54vh;
  }

  /* Bottom Carousel on Mobile */
  .car-carousel-container {
    padding: 6px 10px max(10px, env(safe-area-inset-bottom));
  }

  .car-thumb-card {
    min-width: 145px;
    padding: 6px;
  }

  .thumb-img-wrapper {
    height: 75px;
  }

  .thumb-title {
    font-size: 0.75rem;
  }

  .thumb-price {
    font-size: 0.68rem;
  }

  .thumb-mileage {
    font-size: 0.64rem;
  }

  /* Mobile Component Modal */
  .component-modal-window {
    width: 94%;
    max-height: 85vh;
    overflow-y: auto;
    padding: 20px;
  }

  .modal-title {
    font-size: 1.1rem;
  }

  .modal-spec-text {
    font-size: 0.82rem;
  }

  .modal-purpose-text {
    font-size: 0.85rem;
  }
}
