/* ===================================
   Film Tinting Simulator - Premium Styles
   Apple-inspired, minimal, dynamic design
   =================================== */

/* CSS Variables - Premium Palette */
:root {
  /* Colors - GLASSIFY Dynamic Palette */
  --primary-dark: #0f172a;
  --accent-gold: #3b82f6;
  --accent-gold-rgb: 59, 130, 246;
  --accent-silver: #94a3b8;
  --white: #ffffff;
  --off-white: #f8faff;
  --gray-100: #eff3fb;
  --gray-200: #e0eaff;
  --gray-300: #cbd5e1;
  --gray-800: #1e293b;
  --gray-900: #0f172a;

  /* Premium Accent Colors */
  --success: #3b82f6;
  /* Unified with brand */
  --warning: #f59e0b;
  --error: #ef4444;
  --price-gold: #3b82f6;

  /* Gradients - GLASSIFY */
  --gradient-header: linear-gradient(180deg, #0f172a 0%, #1e293b 100%);
  --gradient-gold: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  --gradient-card: linear-gradient(180deg, rgba(255, 255, 255, 0.72) 0%, rgba(255, 255, 255, 0.88) 100%);

  /* Shadows */
  --shadow-sm: 0 4px 12px rgba(59, 130, 246, 0.1);
  --shadow-md: 0 8px 24px rgba(59, 130, 246, 0.15);
  --shadow-gold: 0 0 20px rgba(59, 130, 246, 0.3);

  /* Typography */
  --font-family: 'Outfit', 'Noto Sans Thai', sans-serif;
}

/* Reset & Base */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* Removed html and body rules to inherit from parent page */

/* App Container */
.app-container {
  max-width: 860px;
  margin: 0 auto;
  background: var(--white);
  min-height: auto;
  border-radius: 20px;
  box-shadow: var(--shadow-xl);
  position: relative;
  overflow: hidden;
}

/* ===================================
   Header & Tabs
   =================================== */
.header {
  background: var(--gradient-header);
  padding: 0.5rem 1rem;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.header-bg {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background:
    url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.05'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  opacity: 0.3;
  pointer-events: none;
}

.tabs {
  display: flex;
  gap: 0.5rem;
  position: relative;
  z-index: 1;
}

.tab-btn {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: rgba(255, 255, 255, 0.8);
  padding: 0.75rem 1.5rem;
  border-radius: var(--border-radius);
  font-family: var(--font-family);
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-fast);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.tab-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  color: var(--white);
}

.tab-btn.active {
  background: var(--gradient-gold);
  color: var(--primary-dark);
  border-color: #fff;
  box-shadow: var(--shadow-gold);
}

.tab-icon {
  font-size: 1.1rem;
}

.brand-logo {
  position: relative;
  z-index: 1;
}

.brand-logo img {
  height: 40px;
  width: auto;
}

/* ===================================
   Tab Content
   =================================== */
.main-content {
  position: relative;
  min-height: 600px;
}

.tab-content {
  display: none;
  padding: 1rem;
  animation: fadeIn 0.3s ease;
}

.tab-content.active {
  display: block;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ===================================
   Control Panel
   =================================== */
.control-panel {
  background: rgba(15, 17, 21, 0.8);
  backdrop-filter: blur(10px);
  border-radius: var(--border-radius-lg);
  padding: 1.5rem;
  margin-bottom: 1rem;
  box-shadow: var(--shadow-md);
  border: 1px solid rgba(197, 168, 128, 0.2);
}

.control-row {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 0.75rem;
}

.control-row:last-child {
  margin-bottom: 0;
}

.control-row.centered {
  justify-content: center;
}

.control-group {
  flex: 1;
  min-width: 180px;
}

.control-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--white);
  font-size: 0.85rem;
  font-weight: 500;
  margin-bottom: 0.5rem;
}

.label-badge {
  font-size: 0.7rem;
  opacity: 0.6;
}

/* Styled Select */
.select-wrapper {
  position: relative;
}

.styled-select {
  width: 100%;
  padding: 0.75rem 2.5rem 0.75rem 1rem;
  background: rgba(255, 255, 255, 0.95);
  border: 2px solid var(--gray-300);
  border-radius: var(--border-radius);
  font-family: var(--font-family);
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--gray-800);
  cursor: pointer;
  appearance: none;
  transition: all var(--transition-fast);
}

.styled-select:hover {
  border-color: var(--accent-blue);
}

.styled-select:focus {
  outline: none;
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 3px rgba(45, 125, 210, 0.2);
}

.select-arrow {
  position: absolute;
  right: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--gray-600);
  font-size: 0.7rem;
  pointer-events: none;
}

/* ===================================
   Vehicle Display (Exterior)
   =================================== */
.vehicle-display {
  display: flex;
  position: relative;
  min-height: 400px;
  background: radial-gradient(circle at center, #1a1c23 0%, #0f1115 100%);
  border-radius: var(--border-radius-lg);
  overflow: hidden;
}

.car-container {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  padding-left: 340px;
  /* Make room for spec panel */
  position: relative;
  /* Ensure absolute children align to this container */
}

/* Image-based vehicle display */
.vehicle-image-wrapper {
  position: relative;
  width: 100%;
  max-width: 600px;
  aspect-ratio: 1 / 1;
}

.vehicle-image {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 10px 30px rgba(0, 0, 0, 0.15));
  transition: filter var(--transition-normal);
}

.window-overlays {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.window-tint {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  transition: opacity var(--transition-normal), background var(--transition-normal);
  mix-blend-mode: multiply;
}

/* Legacy SVG support */
#car-svg {
  max-width: 100%;
  max-height: 350px;
  filter: drop-shadow(0 10px 30px rgba(0, 0, 0, 0.15));
}

/* ===================================
   Spec Panel
   =================================== */
.spec-panel {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 320px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: var(--shadow-lg);
  z-index: 10;
  transition: transform var(--transition-normal);
  display: flex;
}

.spec-panel.collapsed {
  transform: translateX(-290px);
}

.spec-toggle {
  position: absolute;
  right: -30px;
  top: 50%;
  transform: translateY(-50%);
  width: 30px;
  height: 60px;
  background: var(--accent-gold);
  border: none;
  border-radius: 0 var(--border-radius) var(--border-radius) 0;
  color: var(--primary-dark);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition-fast);
  z-index: 11;
}

.spec-toggle:hover {
  background: var(--primary-blue);
}

.toggle-icon {
  font-size: 1rem;
  transition: transform var(--transition-normal);
}

.spec-panel.collapsed .toggle-icon {
  transform: rotate(180deg);
}

.spec-content {
  flex: 1;
  padding: 1rem;
  overflow-y: auto;
}

.spec-table-container {
  margin-bottom: 1rem;
}

.spec-header {
  padding: 0.5rem 0.75rem;
  border-radius: var(--border-radius) var(--border-radius) 0 0;
  font-size: 0.85rem;
  font-weight: 600;
}

.spec-header.front-header {
  background: var(--gradient-gold);
  color: var(--primary-dark);
}

.spec-header.surround-header {
  background: linear-gradient(90deg, #1a1c23 0%, #2c2c2e 100%);
  color: var(--accent-gold);
  border: 1px solid rgba(197, 168, 128, 0.3);
}

.spec-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
  background: var(--white);
  border: 1px solid var(--gray-200);
}

.spec-table tbody tr {
  border-bottom: 1px solid var(--gray-200);
}

.spec-table tbody tr:nth-child(even) {
  background: var(--gray-100);
}

.spec-table td {
  padding: 0.5rem 0.75rem;
}

.spec-table td:first-child {
  color: var(--gray-700);
}

.spec-table td:last-child {
  text-align: right;
  font-weight: 600;
  color: var(--primary-blue);
}

/* ===================================
   Price Display Panel
   =================================== */
.price-panel {
  background: white;
  border: 1px solid var(--primary-light);
  border-radius: var(--border-radius-lg);
  padding: 1.25rem;
  margin-top: 1.5rem;
  margin-bottom: 1rem;
  box-shadow: var(--shadow-sm);
}

.price-panel-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--primary-blue);
  margin: 0 0 1rem 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.price-item {
  margin-bottom: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px dashed var(--gray-300);
}

.price-header {
  font-size: 0.9rem;
  color: var(--gray-600);
  margin-bottom: 0.25rem;
}

.price-detail {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
}

.film-name {
  font-weight: 500;
  color: var(--primary-dark);
  flex: 1;
}

.film-price {
  font-weight: 700;
  color: var(--accent-gold);
  white-space: nowrap;
}

.price-discount {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 0.5rem;
  padding: 0.5rem 0;
  border-top: 1px dashed var(--gray-300);
}

.discount-label {
  font-size: 0.9rem;
  font-weight: 600;
  color: #27ae60;
}

.discount-value {
  font-size: 1rem;
  font-weight: 700;
  color: #27ae60;
}

.price-total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 0.5rem;
  margin-top: 0.5rem;
}

.total-label {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--primary-dark);
}

.total-value {
  font-size: 1.4rem;
  font-weight: 800;
  color: #e74c3c;
}

/* VLT Selectors */
.vlt-select {
  margin-top: 0.5rem;
}

.vlt-select-input {
  background-color: var(--gray-100);
  font-size: 0.9rem;
  color: var(--primary-blue);
  font-weight: 600;
}

/* ===================================
   Interior View
   =================================== */
.interior-display {
  position: relative;
  min-height: 450px;
  border-radius: var(--border-radius-lg);
  overflow: hidden;
}

.interior-container {
  position: relative;
  width: 100%;
  height: auto;
  min-height: 400px;
  overflow: hidden;
  border-radius: var(--border-radius-lg);
  background: #1a1a2e;
}

.interior-image {
  width: 100%;
  height: auto;
  display: block;
}

.interior-background {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
}

.sky {
  flex: 1;
  background: var(--gradient-sky);
}

.road {
  height: 45%;
  background:
    linear-gradient(180deg, #4a7c4e 0%, #3d6b40 40%, #505050 40%, #404040 100%);
  position: relative;
}

.road::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 100%;
  height: 4px;
  background: repeating-linear-gradient(90deg,
      #ffffff 0px,
      #ffffff 40px,
      transparent 40px,
      transparent 80px);
}

/* Comparison Row */
.comparison-row {
  display: flex;
  gap: 1.5rem;
  justify-content: center;
}

.comparison-side {
  flex: 1;
  max-width: 280px;
  text-align: center;
}

.interior-price {
  margin-top: 0.5rem;
  padding: 0.5rem;
  background: var(--gray-100);
  border-radius: var(--border-radius);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--primary-blue);
}

/* Tint Overlay - Two Sided */
.tint-overlay {
  position: absolute;
  top: 0;
  height: 100%;
  background: rgba(26, 26, 46, 0.7);
  transition: background var(--transition-normal), opacity var(--transition-normal);
  mix-blend-mode: multiply;
  pointer-events: none;
}

.tint-left {
  left: 0;
  width: 50%;
}

.tint-right {
  right: 0;
  width: 50%;
}

/* Boundary Slider */
.boundary-slider-container {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 30;
}

.boundary-slider {
  position: absolute;
  top: 0;
  left: 50%;
  width: 4px;
  height: 100%;
  background: transparent;
  cursor: ew-resize;
  pointer-events: all;
  z-index: 20;
}

.slider-handle {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 50px;
  height: 50px;
  background: var(--accent-gold);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-md);
  cursor: ew-resize;
  pointer-events: all;
  transition: transform var(--transition-fast), background var(--transition-fast);
  border: 2px solid #fff;
}

.slider-handle:hover {
  transform: translate(-50%, -50%) scale(1.1);
  background: var(--accent-light);
}

.slider-arrows {
  color: var(--white);
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -2px;
}

/* Dashboard Overlay */
.dashboard-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 100px;
  pointer-events: none;
}

.dashboard-shape {
  width: 100%;
  height: 100%;
  background: linear-gradient(180deg, transparent 0%, rgba(30, 50, 70, 0.8) 30%, #1a2a3a 100%);
  border-radius: 50% 50% 0 0 / 100% 100% 0 0;
  transform: scaleX(1.2);
}

/* Tint Labels */
.tint-labels {
  display: flex;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  background: var(--gray-100);
  border-radius: 0 0 var(--border-radius-lg) var(--border-radius-lg);
}

.tint-label {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--gray-700);
}

.tint-label.left {
  color: var(--primary-blue);
}

/* ===================================
   CTA Panel
   =================================== */
.cta-panel {
  position: absolute;
  bottom: 1rem;
  right: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  z-index: 20;
}

.cta-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.25rem;
  border-radius: var(--border-radius);
  font-family: var(--font-family);
  font-size: 0.85rem;
  font-weight: 500;
  text-decoration: none;
  transition: all var(--transition-fast);
  box-shadow: var(--shadow-sm);
}

.cta-btn.primary {
  background: var(--primary-blue);
  color: var(--white);
}

.cta-btn.primary:hover {
  background: var(--accent-blue);
  transform: translateX(-5px);
}

.cta-btn.secondary {
  background: var(--white);
  color: var(--primary-blue);
  border: 1px solid var(--gray-300);
}

.cta-btn.secondary:hover {
  background: var(--gray-100);
  transform: translateX(-5px);
}

.cta-btn.tertiary {
  background: var(--gray-100);
  color: var(--gray-700);
}

.cta-btn.tertiary:hover {
  background: var(--gray-200);
  transform: translateX(-5px);
}

.cta-icon {
  font-size: 1rem;
}

/* ===================================
   Footer
   =================================== */
.footer {
  background: var(--primary-dark);
  color: var(--gray-500);
  text-align: center;
  padding: 1rem;
  font-size: 0.85rem;
}

/* ===================================
   Responsive Design
   =================================== */
@media (max-width: 768px) {
  .header {
    flex-direction: column;
    padding: 0.75rem;
  }

  .tabs {
    width: 100%;
    justify-content: center;
  }

  .tab-btn {
    flex: 1;
    justify-content: center;
    padding: 0.6rem 0.75rem;
    font-size: 0.85rem;
  }

  .brand-logo {
    display: none;
  }

  .control-row {
    flex-direction: column;
    gap: 0.75rem;
  }

  .control-group {
    min-width: 100%;
  }

  .spec-panel {
    position: relative;
    width: 100%;
    transform: none !important;
    margin-bottom: 1rem;
  }

  .spec-toggle {
    display: none;
  }

  .vehicle-display {
    flex-direction: column;
  }

  .car-container {
    padding: 1rem;
    padding-left: 1rem;
    /* Reset for mobile */
  }

  .cta-panel {
    position: relative;
    bottom: auto;
    right: auto;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    margin-top: 1rem;
  }

  .cta-btn {
    flex: 1 1 calc(50% - 0.5rem);
    min-width: 150px;
    justify-content: center;
  }

  .interior-container {
    height: 300px;
  }
}

@media (max-width: 480px) {
  .tab-btn {
    font-size: 0.75rem;
    padding: 0.5rem;
  }

  .tab-icon {
    display: none;
  }

  .cta-btn {
    flex: 1 1 100%;
    font-size: 0.8rem;
  }
}

/* ===================================
   Animations
   =================================== */
@keyframes pulse {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.7;
  }
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateX(-20px);
  }

  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.spec-table-container {
  animation: slideIn 0.5s ease;
}

/* ===================================
   Film Select Button
   =================================== */
.film-select-btn {
  width: 100%;
  padding: 0.75rem 1rem;
  background: var(--white);
  border: 2px solid var(--gray-300);
  border-radius: var(--border-radius);
  font-family: var(--font-family);
  font-size: 0.95rem;
  color: var(--primary-dark);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: all 0.2s ease;
}

.film-select-btn:hover {
  border-color: var(--accent-blue);
  background: var(--gray-100);
}

.film-select-btn .select-arrow {
  color: var(--gray-500);
  font-size: 0.8rem;
}

/* ===================================
   Film Popup Modal
   =================================== */
.film-popup-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  padding: 1rem;
}

.film-popup-overlay.active {
  display: flex;
}

.film-popup {
  background: var(--white);
  border-radius: var(--border-radius-lg);
  max-width: 600px;
  width: 100%;
  max-height: 85vh;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
}

.film-popup-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.25rem;
  background: var(--gradient-header);
  color: var(--white);
}

.film-popup-title {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 600;
}

.film-popup-close {
  background: transparent;
  border: none;
  color: var(--white);
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0.25rem;
  line-height: 1;
  opacity: 0.8;
  transition: opacity 0.2s;
}

.film-popup-close:hover {
  opacity: 1;
}

.film-popup-content {
  padding: 1rem;
  overflow-y: auto;
  flex: 1;
}

/* Brand Sections */
.brand-section {
  margin-bottom: 1.25rem;
  border: 1px solid var(--gray-200);
  border-radius: var(--border-radius);
  overflow: hidden;
}

.brand-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  background: var(--gray-100);
  border-bottom: 1px solid var(--gray-200);
}

.brand-logo-img {
  width: 40px;
  height: 40px;
  object-fit: contain;
  border-radius: 4px;
}

.brand-name {
  font-weight: 600;
  color: var(--primary-dark);
  font-size: 1rem;
}

.brand-films {
  padding: 0.5rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

/* Film Option Card */
.film-option {
  padding: 0.5rem 0.75rem;
  background: var(--white);
  border: 1px solid var(--gray-300);
  border-radius: var(--border-radius);
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 0.85rem;
  color: var(--primary-dark);
}

.film-option:hover {
  background: var(--accent-light);
  color: var(--white);
  border-color: var(--accent-blue);
}

.film-option.selected {
  background: var(--accent-blue);
  color: var(--white);
  border-color: var(--primary-blue);
}

.film-option-none {
  width: 100%;
  text-align: center;
  padding: 0.75rem;
  background: var(--gray-100);
  border: 2px dashed var(--gray-400);
  color: var(--gray-600);
}

/* Film with VLT Variants */
.film-option-group {
  width: 100%;
  border: 1px solid var(--gray-300);
  border-radius: var(--border-radius);
  overflow: hidden;
}

.film-option-header {
  display: block;
  width: 100%;
  padding: 0.6rem 0.75rem;
  background: var(--gray-50);
  font-weight: 600;
  color: var(--primary-dark);
  font-size: 0.9rem;
  border-bottom: 1px solid var(--gray-200);
}

.film-option-header.selected {
  background: var(--accent-blue);
  color: var(--white);
}

.film-variants {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  padding: 0.5rem;
  background: var(--white);
}

.variant-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0.4rem 0.6rem;
  min-width: 50px;
  background: var(--gray-100);
  border: 1px solid var(--gray-300);
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.variant-btn:hover {
  background: var(--accent-light);
  border-color: var(--accent-blue);
}

.variant-btn.selected {
  background: var(--accent-blue);
  border-color: var(--primary-blue);
  color: var(--white);
}

.variant-name {
  font-weight: 600;
  font-size: 0.85rem;
  color: inherit;
}

.variant-vlt {
  font-size: 0.7rem;
  color: var(--gray-500);
}

.variant-btn.selected .variant-vlt {
  color: rgba(255, 255, 255, 0.8);
}

/* ===================================
   Vehicle Select Button
   =================================== */
.vehicle-select-btn {
  width: 100%;
  padding: 0.75rem 1rem;
  background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
  border: 2px solid var(--gray-300);
  border-radius: var(--border-radius);
  font-family: var(--font-family);
  font-size: 0.95rem;
  color: var(--primary-dark);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: all 0.2s ease;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.vehicle-select-btn:hover {
  border-color: var(--accent-blue);
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.vehicle-select-btn .vehicle-icon {
  font-size: 1.2rem;
}

.vehicle-select-btn .select-arrow {
  margin-left: auto;
  color: var(--gray-500);
  font-size: 0.8rem;
}

/* ===================================
   Vehicle Type Popup Modal
   =================================== */
.vehicle-popup-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  padding: 1rem;
  animation: fadeIn 0.2s ease;
}

.vehicle-popup-overlay.active {
  display: flex;
}

.vehicle-popup {
  background: linear-gradient(180deg, #ffffff 0%, #f8f9fa 100%);
  border-radius: 20px;
  max-width: 700px;
  width: 100%;
  max-height: 85vh;
  overflow: hidden;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25), 0 0 0 1px rgba(255, 255, 255, 0.1);
  display: flex;
  flex-direction: column;
  animation: slideUp 0.3s ease;
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.98);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.vehicle-popup-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.25rem 1.5rem;
  background: linear-gradient(135deg, #1a3a5c 0%, #2d5a8c 50%, #3d7ac2 100%);
  color: var(--white);
}

.vehicle-popup-title {
  margin: 0;
  font-size: 1.3rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.vehicle-popup-close {
  background: rgba(255, 255, 255, 0.15);
  border: none;
  color: var(--white);
  font-size: 1.25rem;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.vehicle-popup-close:hover {
  background: rgba(255, 255, 255, 0.25);
  transform: scale(1.1);
}

.vehicle-popup-content {
  padding: 1.5rem;
  overflow-y: auto;
  flex: 1;
}

.vehicle-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

.vehicle-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 1.25rem 1rem;
  background: linear-gradient(180deg, #ffffff 0%, #f5f7fa 100%);
  border: 2px solid var(--gray-200);
  border-radius: 16px;
  cursor: pointer;
  transition: all 0.25s ease;
  position: relative;
  overflow: hidden;
}

.vehicle-option::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, rgba(45, 125, 210, 0.1) 0%, rgba(45, 125, 210, 0.05) 100%);
  opacity: 0;
  transition: opacity 0.25s ease;
}

.vehicle-option:hover {
  border-color: var(--accent-blue);
  transform: translateY(-4px);
  box-shadow: 0 12px 24px rgba(45, 125, 210, 0.15);
}

.vehicle-option:hover::before {
  opacity: 1;
}

.vehicle-option.selected {
  border-color: var(--accent-blue);
  background: linear-gradient(180deg, #ffffff 0%, #f5f7fa 100%);
  box-shadow: 0 8px 20px rgba(45, 125, 210, 0.2), inset 0 0 0 1px rgba(45, 125, 210, 0.3);
}

.vehicle-option.selected::after {
  content: '✓';
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  width: 24px;
  height: 24px;
  background: var(--accent-blue);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
}

.vehicle-option-icon {
  width: 120px;
  height: 60px;
  margin-bottom: 0.75rem;
  color: var(--primary-blue);
  transition: transform 0.25s ease, color 0.25s ease;
}

.vehicle-option:hover .vehicle-option-icon {
  transform: scale(1.1);
  color: var(--accent-blue);
}

.vehicle-option.selected .vehicle-option-icon {
  color: var(--accent-blue);
}

.vehicle-silhouette {
  width: 100%;
  height: 100%;
}

.vehicle-option-name {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--primary-dark);
  margin-bottom: 0.25rem;
}

.vehicle-option-desc {
  font-size: 0.8rem;
  color: var(--gray-600);
}

/* Vehicle Icon Images (replacing SVGs) */
.vehicle-icon-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: none;
  transition: transform 0.25s ease, filter 0.25s ease;
}

.vehicle-option:hover .vehicle-icon-img {
  transform: scale(1.08);
}

.vehicle-option.selected .vehicle-icon-img {
  filter: brightness(0.9) saturate(1.2);
}

/* Popup Title Icon */
.popup-title-icon {
  width: 40px;
  height: 40px;
  object-fit: contain;
  filter: brightness(0) invert(1);
  opacity: 0.9;
  vertical-align: middle;
  margin-right: 0.25rem;
}

/* No Film Option at Top of Popup */
.no-film-option-container {
  margin-bottom: 1rem;
}

.film-option-none-top {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  padding: 1rem 1.25rem;
  background: linear-gradient(180deg, #fff5f5 0%, #ffe8e8 100%);
  border: 2px dashed #e74c3c;
  border-radius: 12px;
  font-size: 1rem;
  font-weight: 600;
  color: #c0392b;
  cursor: pointer;
  transition: all 0.2s ease;
}

.film-option-none-top:hover {
  background: linear-gradient(180deg, #ffe0e0 0%, #ffd0d0 100%);
  border-style: solid;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(231, 76, 60, 0.2);
}

.film-option-none-top.selected {
  background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
  border-style: solid;
  border-color: #c0392b;
  color: white;
  box-shadow: 0 4px 12px rgba(231, 76, 60, 0.3);
}

/* ===================================
   Pickup Variant Selection Popup
   =================================== */
.pickup-variant-popup-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 1001;
  padding: 1rem;
  animation: fadeIn 0.2s ease;
}

.pickup-variant-popup-overlay.active {
  display: flex;
}

.pickup-variant-popup {
  background: linear-gradient(180deg, #ffffff 0%, #f8f9fa 100%);
  border-radius: 20px;
  max-width: 500px;
  width: 100%;
  max-height: 85vh;
  overflow: hidden;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  animation: slideUp 0.3s ease;
}

.pickup-variant-popup-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.25rem 1.5rem;
  background: linear-gradient(135deg, #2d5a8c 0%, #4da3ff 100%);
  color: var(--white);
}

.pickup-variant-popup-title {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.pickup-variant-popup-close {
  background: rgba(255, 255, 255, 0.15);
  border: none;
  color: var(--white);
  font-size: 1.25rem;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.pickup-variant-popup-close:hover {
  background: rgba(255, 255, 255, 0.25);
  transform: scale(1.1);
}

.pickup-variant-popup-content {
  padding: 1.5rem;
}

.pickup-variant-grid {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.pickup-variant-option {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.25rem;
  background: linear-gradient(180deg, #ffffff 0%, #f5f7fa 100%);
  border: 2px solid var(--gray-200);
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.25s ease;
}

.pickup-variant-option:hover {
  border-color: var(--accent-blue);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(45, 125, 210, 0.15);
}

.pickup-variant-option.selected {
  border-color: var(--accent-blue);
  box-shadow: 0 8px 20px rgba(45, 125, 210, 0.2), inset 0 0 0 1px rgba(45, 125, 210, 0.3);
}

.pickup-variant-icon {
  width: 80px;
  height: 45px;
  flex-shrink: 0;
}

.pickup-variant-icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.pickup-variant-info {
  flex: 1;
}

.pickup-variant-name {
  font-weight: 700;
  font-size: 1rem;
  color: var(--primary-dark);
  margin-bottom: 0.25rem;
}

.pickup-variant-desc {
  font-size: 0.85rem;
  color: var(--gray-600);
}

/* ===================================
   Secondary CTA Button
   =================================== */
.cta-btn-secondary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.875rem 1.5rem;
  background: transparent;
  color: var(--primary-blue);
  border: 2px solid var(--primary-blue);
  border-radius: var(--border-radius);
  font-family: var(--font-family);
  font-size: 0.95rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: all var(--transition-normal);
  margin-top: 0.75rem;
}

.cta-btn-secondary:hover {
  background: var(--primary-blue);
  color: var(--white);
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(0, 113, 227, 0.25);
}

.cta-btn-secondary .cta-icon {
  font-size: 1rem;
}

/* Mobile secondary CTA */
.sticky-cta-secondary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.75rem 1rem;
  background: transparent;
  color: var(--primary-blue);
  border: 2px solid var(--primary-blue);
  border-radius: var(--border-radius-lg);
  font-family: var(--font-family);
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
  margin-top: 0.5rem;
  transition: all 0.2s ease;
}

.sticky-cta-secondary:hover {
  background: var(--primary-blue);
  color: var(--white);
}

/* ===================================
   Upgraded Film Popup Styles
   =================================== */
.film-popup-overlay {
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  animation: fadeIn 0.2s ease;
}

.film-popup {
  background: linear-gradient(180deg, #ffffff 0%, #f8f9fa 100%);
  border-radius: 20px;
  max-width: 680px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25), 0 0 0 1px rgba(255, 255, 255, 0.1);
  animation: slideUp 0.3s ease;
}

.film-popup-header {
  background: linear-gradient(135deg, #0f2544 0%, #1a4a7a 50%, #2d7dd2 100%);
  padding: 1.25rem 1.5rem;
  border-radius: 20px 20px 0 0;
}

.film-popup-title {
  font-size: 1.3rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.film-popup-close {
  background: rgba(255, 255, 255, 0.15);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.film-popup-close:hover {
  background: rgba(255, 255, 255, 0.25);
  transform: scale(1.1);
}

.film-popup-content {
  padding: 1.25rem;
}

/* Upgraded Brand Sections */
.brand-section {
  margin-bottom: 1rem;
  border: 1px solid var(--gray-200);
  border-radius: 12px;
  overflow: hidden;
  background: white;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  transition: box-shadow 0.2s ease;
}

.brand-section:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.brand-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.875rem 1rem;
  background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
  border-bottom: 1px solid var(--gray-200);
  cursor: pointer;
  transition: background 0.2s ease;
}

.brand-header:hover {
  background: linear-gradient(135deg, #e9ecef 0%, #f8f9fa 100%);
}

.brand-logo-img {
  width: 44px;
  height: 44px;
  object-fit: contain;
  border-radius: 8px;
  background: white;
  padding: 4px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.brand-name {
  font-weight: 700;
  color: var(--primary-dark);
  font-size: 1.05rem;
  flex: 1;
}

.brand-badge {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  color: white;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.25rem 0.6rem;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.brand-toggle-icon {
  color: var(--gray-500);
  font-size: 0.8rem;
  transition: transform 0.2s ease;
}

.brand-section.collapsed .brand-toggle-icon {
  transform: rotate(-90deg);
}

.brand-section.collapsed .brand-films {
  display: none;
}

.brand-films {
  padding: 0.75rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  background: linear-gradient(180deg, #fafbfc 0%, #ffffff 100%);
}

/* Upgraded Film Options */
.film-option {
  padding: 0.6rem 0.9rem;
  background: linear-gradient(180deg, #ffffff 0%, #f8f9fa 100%);
  border: 1.5px solid var(--gray-300);
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--primary-dark);
  position: relative;
  overflow: hidden;
}

.film-option::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: var(--accent-blue);
  transform: scaleY(0);
  transition: transform 0.2s ease;
}

.film-option:hover {
  border-color: var(--accent-blue);
  background: linear-gradient(180deg, #e8f4ff 0%, #f0f7ff 100%);
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(45, 125, 210, 0.15);
}

.film-option:hover::before {
  transform: scaleY(1);
}

.film-option.selected {
  background: linear-gradient(135deg, var(--accent-blue) 0%, #1a5a9e 100%);
  color: var(--white);
  border-color: var(--primary-blue);
  box-shadow: 0 4px 12px rgba(45, 125, 210, 0.3);
}

.film-option.selected::before {
  background: white;
  transform: scaleY(1);
}

.film-option-none {
  width: 100%;
  text-align: center;
  padding: 0.875rem;
  background: linear-gradient(180deg, #f8f9fa 0%, #e9ecef 100%);
  border: 2px dashed var(--gray-400);
  color: var(--gray-600);
  font-weight: 500;
}

.film-option-none:hover {
  background: linear-gradient(180deg, #e9ecef 0%, #dee2e6 100%);
  border-color: var(--gray-500);
}

/* Upgraded Film Groups with Variants */
.film-option-group {
  width: 100%;
  border: 1.5px solid var(--gray-300);
  border-radius: 12px;
  overflow: hidden;
  background: white;
  transition: all 0.2s ease;
}

.film-option-group:hover {
  border-color: var(--accent-blue);
  box-shadow: 0 4px 12px rgba(45, 125, 210, 0.1);
}

.film-option-header {
  display: flex;
  align-items: center;
  width: 100%;
  padding: 0.75rem 1rem;
  background: linear-gradient(135deg, #f0f4f8 0%, #ffffff 100%);
  font-weight: 700;
  color: var(--primary-dark);
  font-size: 0.95rem;
  border-bottom: 1px solid var(--gray-200);
}

.film-option-header.selected {
  background: linear-gradient(135deg, var(--accent-blue) 0%, #1a5a9e 100%);
  color: var(--white);
}

.film-variants {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 0.75rem;
  background: linear-gradient(180deg, #fafbfc 0%, #ffffff 100%);
}

.variant-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0.5rem 0.75rem;
  min-width: 60px;
  background: linear-gradient(180deg, #ffffff 0%, #f5f7fa 100%);
  border: 1.5px solid var(--gray-300);
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
}

.variant-btn::before {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--accent-blue);
  transform: scaleX(0);
  transition: transform 0.2s ease;
}

.variant-btn:hover {
  border-color: var(--accent-blue);
  background: linear-gradient(180deg, #e8f4ff 0%, #f0f7ff 100%);
  transform: translateY(-2px);
}

.variant-btn:hover::before {
  transform: scaleX(1);
}

.variant-btn.selected {
  background: linear-gradient(135deg, var(--accent-blue) 0%, #1a5a9e 100%);
  border-color: var(--primary-blue);
  color: var(--white);
  box-shadow: 0 4px 12px rgba(45, 125, 210, 0.3);
}

.variant-name {
  font-weight: 700;
  font-size: 0.85rem;
  color: inherit;
}

.variant-vlt {
  font-size: 0.7rem;
  color: var(--gray-500);
  margin-top: 0.15rem;
}

.variant-btn.selected .variant-vlt {
  color: rgba(255, 255, 255, 0.85);
}

/* ===================================
   Responsive - Vertical Screens & Mobile
   =================================== */

/* Base Mobile / Vertical Screen Styles */
@media screen and (max-width: 768px) {
  html {
    font-size: 14px;
  }

  .app-container {
    max-width: 100%;
  }

  .header {
    padding: 0.5rem;
    flex-direction: column;
    gap: 0.5rem;
  }

  .tabs {
    width: 100%;
    gap: 0.25rem;
  }

  .tab-btn {
    padding: 0.5rem 0.75rem;
    font-size: 0.85rem;
    flex: 1;
  }

  .tab-icon {
    font-size: 1rem;
  }

  .brand-logo img {
    max-height: 30px;
  }

  /* Control Panel - Compact Vertical Layout */
  .control-panel {
    padding: 0.75rem;
  }

  .control-row {
    flex-direction: column;
    gap: 0.75rem;
  }

  .control-group {
    width: 100%;
  }

  .control-label {
    font-size: 0.85rem;
    padding: 0.4rem 0.75rem;
  }

  /* Vehicle Display - MAIN FOCUS */
  .vehicle-display {
    min-height: 50vh;
    flex-direction: column;
  }

  .car-container {
    padding: 1rem;
    padding-left: 1rem;
    /* Remove spec panel offset */
  }

  .vehicle-image-wrapper {
    max-width: 100%;
    width: 100%;
  }

  /* Hide spec panel on mobile, show on demand */
  .spec-panel {
    position: fixed;
    left: 0;
    top: auto;
    bottom: 0;
    width: 100%;
    height: auto;
    max-height: 50vh;
    border-radius: var(--border-radius-lg) var(--border-radius-lg) 0 0;
    transform: translateY(100%);
    z-index: 100;
  }

  .spec-panel:not(.collapsed) {
    transform: translateY(0);
  }

  .spec-toggle {
    top: -40px;
    right: auto;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 40px;
    border-radius: var(--border-radius) var(--border-radius) 0 0;
  }

  .toggle-icon {
    transform: rotate(90deg);
  }

  /* Price Panel */
  .price-panel {
    margin: 0.5rem;
    padding: 0.75rem;
  }

  .price-panel-title {
    font-size: 1rem;
  }

  .total-value {
    font-size: 1.2rem;
  }

  /* CTA Buttons */
  .cta-panel {
    padding: 0.5rem;
  }

  .cta-btn {
    padding: 0.75rem 1rem;
    font-size: 0.9rem;
  }

  /* Interior View */
  .comparison-row {
    flex-direction: column;
    gap: 0.75rem;
  }

  .comparison-side {
    max-width: 100%;
  }

  .interior-display {
    min-height: 45vh;
  }

  .interior-container {
    min-height: 40vh;
  }

  /* Film Popup */
  .film-popup {
    max-width: 100%;
    max-height: 90vh;
    margin: 0.5rem;
  }

  .brand-header {
    padding: 0.5rem 0.75rem;
  }

  .brand-logo-img {
    width: 32px;
    height: 32px;
  }

  .film-option {
    padding: 0.5rem 0.6rem;
    font-size: 0.8rem;
  }

  /* Vehicle Popup Mobile */
  .vehicle-popup {
    max-width: 100%;
    max-height: 90vh;
    margin: 0.5rem;
    border-radius: 16px;
  }

  .vehicle-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
  }

  .vehicle-option {
    padding: 1rem 0.75rem;
  }

  .vehicle-option-icon {
    width: 100px;
    height: 50px;
  }

  .vehicle-option-name {
    font-size: 0.85rem;
  }

  .vehicle-option-desc {
    font-size: 0.75rem;
  }
}

/* Portrait Vertical Signage (tall narrow screens) */
@media screen and (max-aspect-ratio: 9/16) {
  html {
    font-size: 18px;
  }

  .header {
    padding: 1rem;
  }

  .tab-btn {
    padding: 1rem 1.5rem;
    font-size: 1.1rem;
  }

  /* Vehicle takes up most of the screen */
  .vehicle-display {
    min-height: 55vh;
  }

  .vehicle-image-wrapper {
    max-width: 90vw;
  }

  .control-panel {
    padding: 1rem;
  }

  .control-label {
    font-size: 1rem;
    padding: 0.6rem 1rem;
  }

  .styled-select,
  .film-select-btn {
    padding: 1rem;
    font-size: 1rem;
  }

  /* Larger touch targets */
  .slider-handle {
    width: 70px;
    height: 70px;
  }

  .slider-arrows {
    font-size: 1.3rem;
  }

  /* Price display */
  .price-panel {
    padding: 1.5rem;
  }

  .total-value {
    font-size: 2rem;
  }

  /* Film popup for signage */
  .film-popup {
    max-width: 90vw;
  }

  .film-option {
    padding: 1rem 1.2rem;
    font-size: 1.1rem;
  }

  .brand-logo-img {
    width: 50px;
    height: 50px;
  }

  .brand-name {
    font-size: 1.2rem;
  }
}

/* Ultra narrow vertical (phone portrait) */
@media screen and (max-width: 480px) {
  html {
    font-size: 13px;
  }

  .tab-btn {
    padding: 0.4rem 0.5rem;
    font-size: 0.8rem;
  }

  .tab-icon {
    font-size: 0.9rem;
  }

  .control-label .label-icon {
    font-size: 0.8rem;
  }

  .vlt-select-input {
    font-size: 0.8rem;
    padding: 0.5rem;
  }

  .film-select-btn {
    padding: 0.6rem 0.75rem;
    font-size: 0.85rem;
  }

  /* Vehicle still main focus */
  .vehicle-display {
    min-height: 45vh;
  }

  .car-container {
    padding: 0.5rem;
  }

  .price-item {
    margin-bottom: 0.5rem;
    padding-bottom: 0.5rem;
  }

  .comparison-row {
    gap: 0.5rem;
  }

  .interior-price {
    font-size: 0.8rem;
    padding: 0.4rem;
  }
}

/* Landscape tablet/small desktop */
@media screen and (min-width: 769px) and (max-width: 1024px) {
  .car-container {
    padding-left: 280px;
  }

  .spec-panel {
    width: 260px;
  }
}

/* Touch device enhancements */
@media (hover: none) and (pointer: coarse) {

  .tab-btn,
  .film-select-btn,
  .styled-select,
  .cta-btn,
  .film-option {
    min-height: 44px;
    /* Apple touch target minimum */
  }

  .slider-handle {
    width: 60px;
    height: 60px;
  }

  .film-popup-close {
    width: 44px;
    height: 44px;
    font-size: 1.5rem;
  }
}

/* ===================================
   Mobile-First UI Components
   =================================== */

/* Desktop/Mobile visibility toggle classes */
.desktop-only {
  display: block;
}

.mobile-only {
  display: none;
}

@media screen and (max-width: 768px) {
  .desktop-only {
    display: none !important;
  }

  .mobile-only {
    display: block !important;
  }
}

/* ===================================
   Mobile Spec Accordion
   =================================== */
.mobile-spec-accordion {
  margin: 0.75rem;
  border-radius: var(--border-radius-lg);
  overflow: hidden;
  background: var(--white);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--gray-200);
}

.spec-accordion-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.875rem 1rem;
  background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
  border: none;
  cursor: pointer;
  font-family: var(--font-family);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--primary-dark);
  transition: background 0.2s ease;
}

.spec-accordion-toggle:hover {
  background: linear-gradient(135deg, #e9ecef 0%, #f8f9fa 100%);
}

.spec-accordion-icon {
  font-size: 1.1rem;
}

.spec-accordion-text {
  flex: 1;
  text-align: left;
}

.spec-accordion-arrow {
  font-size: 0.75rem;
  color: var(--gray-500);
  transition: transform 0.3s ease;
}

.mobile-spec-accordion.expanded .spec-accordion-arrow {
  transform: rotate(180deg);
}

.spec-accordion-content {
  display: none;
  padding: 0.75rem;
  background: var(--gray-50);
  border-top: 1px solid var(--gray-200);
}

.mobile-spec-accordion.expanded .spec-accordion-content {
  display: block;
  animation: slideDown 0.3s ease;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ===================================
   Mobile Sticky CTA Bar
   =================================== */
.mobile-sticky-cta {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 0.75rem 1rem;
  padding-bottom: calc(0.75rem + env(safe-area-inset-bottom, 0));
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.95) 0%, #ffffff 100%);
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.1);
  z-index: 100;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.sticky-cta-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  padding: 1rem 1.5rem;
  background: linear-gradient(135deg, #2d7dd2 0%, #1a5a9e 100%);
  color: var(--white);
  border: none;
  border-radius: var(--border-radius-lg);
  font-family: var(--font-family);
  font-size: 1rem;
  font-weight: 600;
  text-decoration: none;
  box-shadow: 0 4px 15px rgba(45, 125, 210, 0.35);
  transition: all 0.2s ease;
}

.sticky-cta-btn:hover {
  background: linear-gradient(135deg, #4da3ff 0%, #2d7dd2 100%);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(45, 125, 210, 0.45);
}

.sticky-cta-btn:active {
  transform: translateY(0);
}

.sticky-cta-btn .cta-icon {
  font-size: 1.2rem;
}

/* ===================================
   Mobile Price Panel Enhancements
   =================================== */
/* Mobile Price Panel Enhancements & Global Fixes
   =================================== */
@media screen and (max-width: 768px) {

  /* Global Layout Fixes */
  .app-container {
    width: 100%;
    overflow-x: hidden;
    min-height: auto;
  }

  /* Header Optimization */
  .header {
    padding: 0.5rem;
    gap: 0.5rem;
    justify-content: center;
  }

  .brand-logo img {
    height: 32px;
  }

  .tabs {
    width: 100%;
    justify-content: center;
  }

  .tab-btn {
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
    flex: 1;
    justify-content: center;
  }

  /* Car Container Critical Fix */
  .car-container {
    padding: 1rem 0.5rem !important;
    /* Force override desktop padding */
    padding-left: 0.5rem !important;
    /* Force override desktop padding */
    min-height: 250px;
    display: flex;
    justify-content: center;
    align-items: center;
  }

  /* Vehicle Display on mobile */
  .vehicle-display {
    min-height: auto;
    margin: 0.5rem;
    border-radius: var(--border-radius-lg);
    background: linear-gradient(180deg, #f0f2f5 0%, #e1e4e8 100%);
    /* Add background for contrast */
  }

  .vehicle-image-wrapper {
    max-width: 100%;
    width: 100%;
  }

  /* Price Panel & CTA */
  .price-panel {
    margin: 0.75rem;
    margin-bottom: 6rem;
    /* Space for sticky CTA */
    padding: 1rem;
    border-radius: var(--border-radius-lg);
    background: linear-gradient(180deg, #ffffff 0%, #f8f9fa 100%);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    border: 1px solid var(--gray-200);
  }

  .price-panel-title {
    font-size: 1.1rem;
    margin-bottom: 0.875rem;
    color: var(--primary-blue);
  }

  .price-item {
    margin-bottom: 0.75rem;
    padding-bottom: 0.75rem;
  }

  .price-header {
    font-size: 0.85rem;
    color: var(--gray-600);
  }

  .film-name {
    font-size: 0.9rem;
  }

  .film-price {
    font-size: 0.95rem;
    color: var(--accent-blue);
  }

  .total-label {
    font-size: 1rem;
  }

  .total-value {
    font-size: 1.3rem;
    color: #e74c3c;
  }

  .price-discount {
    background: linear-gradient(135deg, #e8f5e9 0%, #c8e6c9 100%);
    padding: 0.5rem 0.75rem;
    border-radius: var(--border-radius);
    border: none;
    margin-top: 0.5rem;
  }

  .discount-label,
  .discount-value {
    font-size: 0.9rem;
  }

  /* Hide old spec panel completely on mobile */
  .spec-panel.desktop-only {
    display: none !important;
  }

  /* Ensure content doesn't get hidden behind sticky CTA */
  #exterior-tab {
    padding-bottom: 1rem;
  }

  /* Popup Mobile Optimizations */
  .vehicle-popup,
  .pickup-variant-popup {
    width: 95%;
    max-height: 80vh;
    border-radius: 16px;
  }

  .vehicle-grid {
    grid-template-columns: repeat(2, 1fr);
    /* 2 cols on tablet/large mobile */
    gap: 0.5rem;
  }

  .vehicle-option {
    padding: 0.75rem 0.5rem;
  }

  .vehicle-option-icon {
    width: 80px;
    height: 40px;
    margin-bottom: 0.25rem;
  }

  .vehicle-option-name {
    font-size: 0.85rem;
  }

  /* Heat Vision Button Mobile */
  .recommendation-wrapper {
    flex-wrap: wrap;
    justify-content: center !important;
  }

  .heat-vision-btn,
  .recommend-btn {
    padding: 8px 12px;
    font-size: 0.85rem;
    width: auto;
    flex: 1;
    justify-content: center;
  }
}

/* Extra small screens (Phones) */
@media screen and (max-width: 480px) {
  .header {
    padding: 0.5rem 0.25rem;
  }

  .vehicle-grid {
    grid-template-columns: 1fr;
    /* 1 col on small phones */
  }

  .mobile-sticky-cta {
    padding: 0.5rem 0.75rem;
    padding-bottom: calc(0.5rem + env(safe-area-inset-bottom, 0));
  }

  .sticky-cta-btn {
    padding: 0.875rem 1rem;
    font-size: 0.95rem;
  }

  .price-panel {
    margin: 0.5rem;
    margin-bottom: 5.5rem;
    padding: 0.875rem;
  }

  .price-panel-title {
    font-size: 1rem;
  }

  .total-value {
    font-size: 1.2rem;
  }

  .mobile-spec-accordion {
    margin: 0.5rem;
  }

  .spec-accordion-toggle {
    padding: 0.75rem;
    font-size: 0.9rem;
  }

  .spec-accordion-content {
    padding: 0.5rem;
  }

  /* Compact Heat Vision */
  .heat-vision-btn .heat-icon,
  .recommend-btn .recommend-icon {
    font-size: 1rem;
  }
}

/* ===================================
   PREMIUM DESKTOP STYLES
   Apple-inspired, minimal, dynamic
   =================================== */

/* Premium Header Styling */
@media screen and (min-width: 769px) {
  .header {
    background: var(--gradient-header);
    padding: 1rem 2rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  }

  .tabs {
    gap: 0.5rem;
  }

  .tab-btn {
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.7);
    padding: 0.875rem 1.5rem;
    border-radius: 100px;
    font-size: 0.95rem;
    font-weight: var(--font-weight-medium);
    transition: all var(--transition-normal);
  }

  .tab-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--white);
  }

  .tab-btn.active {
    background: var(--white);
    color: var(--primary-dark);
    box-shadow: var(--shadow-md);
  }

  /* Premium Control Panel */
  .control-panel {
    background: var(--white);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    padding: 1.5rem 2rem;
    margin: 1.5rem;
    box-shadow: var(--shadow-sm);
  }

  .control-row {
    gap: 2rem;
  }

  .control-label {
    color: var(--gray-600);
    font-size: 0.8rem;
    font-weight: var(--font-weight-semibold);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.75rem;
  }

  .film-select-btn,
  .vehicle-select-btn {
    background: var(--white);
    border: 1.5px solid var(--gray-300);
    border-radius: var(--border-radius);
    padding: 0.875rem 1.25rem;
    font-size: 0.95rem;
    font-weight: var(--font-weight-medium);
    color: var(--primary-dark);
    transition: all var(--transition-fast);
  }

  .film-select-btn:hover,
  .vehicle-select-btn:hover {
    border-color: var(--primary-blue);
    box-shadow: var(--shadow-sm);
    transform: translateY(-1px);
  }

  /* Fixed Spec Panel - Desktop */
  .spec-panel.desktop-only {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 340px;
    background: var(--white);
    border-right: 1px solid var(--border-color);
    box-shadow: var(--shadow-md);
    z-index: 10;
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }

  .spec-panel.desktop-only .spec-content {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    padding-bottom: 2rem;
  }

  .spec-panel.desktop-only .spec-content::-webkit-scrollbar {
    width: 6px;
  }

  .spec-panel.desktop-only .spec-content::-webkit-scrollbar-track {
    background: var(--gray-100);
  }

  .spec-panel.desktop-only .spec-content::-webkit-scrollbar-thumb {
    background: var(--gray-300);
    border-radius: 3px;
  }

  .spec-panel.desktop-only .spec-content::-webkit-scrollbar-thumb:hover {
    background: var(--gray-400);
  }

  /* Spec Table Premium Styling */
  .spec-table-container {
    margin-bottom: 1.5rem;
    border-radius: var(--border-radius);
    overflow: hidden;
    border: 1px solid var(--border-color);
    background: var(--white);
  }

  .spec-header {
    padding: 0.75rem 1rem;
    font-size: 0.85rem;
    font-weight: var(--font-weight-semibold);
  }

  .spec-header.front-header {
    background: linear-gradient(135deg, var(--primary-blue) 0%, var(--accent-blue) 100%);
    color: var(--white);
  }

  .spec-header.surround-header {
    background: linear-gradient(135deg, var(--gray-700) 0%, var(--gray-800) 100%);
    color: var(--white);
  }

  .spec-table {
    font-size: 0.875rem;
  }

  .spec-table td {
    padding: 0.625rem 1rem;
  }

  .spec-table td:first-child {
    color: var(--gray-600);
    font-weight: var(--font-weight-regular);
  }

  .spec-table td:last-child {
    color: var(--primary-dark);
    font-weight: var(--font-weight-semibold);
  }

  /* Vehicle Display Area - Desktop */
  .vehicle-display {
    min-height: 480px;
    background: linear-gradient(180deg, var(--gray-50) 0%, var(--gray-100) 100%);
    border-radius: var(--border-radius-lg);
    margin: 0 1.5rem;
    overflow: hidden;
    position: relative;
  }

  .car-container {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    padding-left: 360px;
    /* Space for spec panel */
    min-height: 480px;
  }

  .vehicle-image-wrapper {
    max-width: 550px;
    transition: transform var(--transition-slow);
  }

  .vehicle-image-wrapper:hover {
    transform: scale(1.02);
  }

  /* Price Panel - Desktop Premium */
  .price-panel {
    background: var(--white);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    padding: 1.5rem 2rem;
    margin: 1.5rem;
    box-shadow: var(--shadow-sm);
  }

  .price-panel-title {
    font-size: 1.1rem;
    font-weight: var(--font-weight-semibold);
    color: var(--primary-dark);
    margin-bottom: 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
  }

  .price-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
    border-bottom: 1px solid var(--gray-200);
  }

  .price-item:last-of-type {
    border-bottom: none;
  }

  .price-header {
    font-size: 0.75rem;
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.25rem;
  }

  .film-name {
    font-size: 0.95rem;
    font-weight: var(--font-weight-medium);
    color: var(--primary-dark);
  }

  .film-price {
    font-size: 1rem;
    font-weight: var(--font-weight-semibold);
    color: var(--primary-blue);
  }

  .price-discount {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.875rem 1rem;
    margin-top: 0.5rem;
    background: linear-gradient(135deg, #e8f5e9 0%, #f1f8e9 100%);
    border-radius: var(--border-radius);
    border: none;
  }

  .discount-label {
    font-size: 0.9rem;
    font-weight: var(--font-weight-medium);
    color: var(--success);
  }

  .discount-value {
    font-size: 1rem;
    font-weight: var(--font-weight-bold);
    color: var(--success);
  }

  .price-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 1.25rem;
    margin-top: 0.75rem;
    border-top: 2px solid var(--gray-200);
  }

  .total-label {
    font-size: 1rem;
    font-weight: var(--font-weight-semibold);
    color: var(--primary-dark);
  }

  .total-value {
    font-size: 1.75rem;
    font-weight: var(--font-weight-bold);
    color: var(--price-red);
    letter-spacing: -0.02em;
  }

  /* Full-Width CTA Section - Desktop */
  .cta-section {
    margin: 0 1.5rem 2rem;
  }

  .cta-btn-full {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    width: 100%;
    padding: 1.125rem 2rem;
    background: var(--primary-dark, #111827);
    color: #ffffff;
    border: none;
    border-radius: var(--border-radius);
    font-family: var(--font-family);
    font-size: 1rem;
    font-weight: var(--font-weight-semibold);
    text-decoration: none;
    cursor: pointer;
    transition: all var(--transition-normal);
    box-shadow: var(--shadow-md), var(--shadow-glow);
  }

  .cta-btn-full:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg), 0 0 32px rgba(0, 113, 227, 0.3);
  }

  .cta-btn-full:active {
    transform: translateY(0);
  }

  .cta-btn-full .cta-icon {
    font-size: 1.1rem;
  }

  .cta-btn-full .cta-text {
    flex: 1;
    text-align: center;
  }

  .cta-btn-full .cta-arrow {
    font-size: 1.1rem;
    opacity: 0.8;
    transition: transform var(--transition-fast);
  }

  .cta-btn-full:hover .cta-arrow {
    transform: translateX(4px);
  }

  /* Premium Footer */
  .footer {
    background: var(--gray-100);
    color: var(--gray-500);
    text-align: center;
    padding: 1.5rem;
    font-size: 0.875rem;
    font-weight: var(--font-weight-medium);
    border-top: 1px solid var(--border-color);
  }

  /* Hide old CTA panel that was absolute */
  .cta-panel {
    display: none !important;
  }
}

/* Smooth entrance animations */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.price-panel,
.cta-section {
  animation: fadeInUp 0.5s ease forwards;
}

/* Vehicle Image Alignment Fixes */
.vehicle-image-wrapper {
  position: relative;
  width: 100%;
  height: auto;
  line-height: 0;
  /* Remove inline image gap */
  overflow: hidden;
  animation: fadeInUp 0.6s ease forwards;
}

.vehicle-image {
  display: block;
  width: 100%;
  height: auto;
  object-fit: contain;
}

.window-overlays {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 5;
}

/* Ensure tints scale with the image */
.window-tint {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  mix-blend-mode: multiply;
}

/* =========================================
   Environment Toggle (Day/Night)
   ========================================= */
.env-toggle-btn {
  position: absolute;
  top: 1rem;
  right: 1rem;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1rem;
  background: white;
  border: 1px solid var(--gray-300);
  border-radius: 50px;
  box-shadow: var(--shadow-md);
  cursor: pointer;
  transition: all 0.3s ease;
  font-family: 'Sarabun', sans-serif;
  font-weight: 600;
  color: var(--text-dark);
}

.env-toggle-btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.env-toggle-btn .env-icon {
  font-size: 1.2rem;
}

/* Night Mode Styles */
body.env-night {
  background-color: #0f172a;
  /* Slate 900 */
  color: #e2e8f0;
}

/* Darken Control Panel in Night Mode */
body.env-night .control-panel {
  background: #1e293b;
  /* Slate 800 */
  border-color: #334155;
}

body.env-night .control-label {
  color: #cbd5e1;
}

body.env-night .vehicle-select-btn,
body.env-night .film-select-btn {
  background: #0f172a;
  border-color: #334155;
  color: #e2e8f0;
}

body.env-night .spec-panel {
  background: rgba(30, 41, 59, 0.95);
  border-color: #334155;
}

body.env-night .spec-title {
  color: #e2e8f0;
  border-bottom-color: #334155;
}

body.env-night .spec-table th,
body.env-night .spec-table td {
  border-bottom-color: #334155;
  color: #cbd5e1;
}

/* Night Mode for Exterior View */
body.env-night .vehicle-display {
  background: radial-gradient(circle at center, #1e293b 0%, #0f172a 100%);
}

/* Night Mode for Interior View */
body.env-night .interior-container::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.4);
  /* Dark overlay */
  pointer-events: none;
  z-index: 1;
  /* Below controls */
}

/* Ensure controls stay visible/bright */
body.env-night .interior-controls,
body.env-night .boundary-slider-container {
  z-index: 10;
}

body.env-night .control-select-btn {
  background: rgba(15, 23, 42, 0.9);
  color: white;
  border-color: #475569;
}

/* =================================== */
/* Quiz Styles */
/* =================================== */

/* Recommendation Button */
.recommend-btn {
  background: linear-gradient(135deg, var(--accent-gold), #b8860b);
  color: #fff;
  border: none;
  padding: 0.6rem 1rem;
  border-radius: 20px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(212, 175, 55, 0.3);
  transition: transform 0.2s, box-shadow 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.recommend-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(212, 175, 55, 0.4);
}

/* Quiz Modal */
.quiz-modal-content {
  max-width: 500px;
  width: 90%;
  text-align: center;
  padding: 2rem;
  background: #fff;
  border-radius: 20px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.quiz-title {
  font-size: 1.5rem;
  margin-bottom: 2rem;
  color: var(--primary-dark);
}

.quiz-step {
  display: none;
  animation: fadeIn 0.3s ease;
}

.quiz-step.active {
  display: block;
}

.quiz-question {
  font-size: 1.2rem;
  margin-bottom: 1.5rem;
  color: var(--text-gray);
}

/* Quiz Options Grid */
.quiz-options {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

.quiz-option {
  background: var(--gray-100);
  border: 2px solid transparent;
  border-radius: 12px;
  padding: 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 1rem;
  transition: all 0.2s;
  text-align: left;
}

.quiz-option:hover {
  background: #fff;
  border-color: var(--primary-blue);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.option-icon {
  font-size: 1.8rem;
  background: #fff;
  width: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.option-text strong {
  display: block;
  font-size: 1rem;
  color: var(--primary-dark);
  margin-bottom: 0.2rem;
}

.option-text span {
  font-size: 0.85rem;
  color: var(--text-gray);
}

/* Quiz Actions */
.quiz-actions {
  margin-top: 2rem;
  display: flex;
  justify-content: center;
  gap: 1rem;
}

.close-quiz {
  position: absolute;
  top: 1rem;
  right: 1.5rem;
  font-size: 2rem;
  cursor: pointer;
  color: var(--text-gray);
  line-height: 1;
}

.close-quiz:hover {
  color: var(--primary-red);
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Main Modal Overlay */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(5px);
  justify-content: center;
  align-items: center;
}

.quiz-modal-content {
  animation: modalSlideUp 0.3s ease-out;
}

@keyframes modalSlideUp {
  from {
    transform: translateY(20px);
    opacity: 0;
  }

  to {
    transform: translateY(0);
    opacity: 1;
  }
}

/* =========================================
   Heat Vision Visualizer
   ========================================= */

/* Heat Vision Toggle Button */
.heat-vision-btn {
  background: linear-gradient(135deg, #ff4d4d 0%, #f9cb28 100%);
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 30px;
  font-family: 'Sukhumvit Set', sans-serif;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 4px 15px rgba(255, 77, 77, 0.3);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
  z-index: 10;
}

.heat-vision-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(255, 77, 77, 0.4);
}

.heat-vision-btn:active {
  transform: translateY(0);
}

.heat-vision-btn.active {
  background: linear-gradient(135deg, #ff3333 0%, #ff6600 100%);
  box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.2);
}

.heat-icon {
  font-size: 1.2em;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

/* Heat Vision Overlay Container */
.heat-vision-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  /* Let clicks pass through to car */
  z-index: 20;
  opacity: 0;
  transition: opacity 0.5s ease;
  overflow: hidden;
  border-radius: 20px;
  /* Match car container */
}

/* Heat Vision Active State - Darken the background */
.car-container.heat-active::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  /* Darken environment */
  z-index: 19;
  transition: opacity 0.5s ease;
  pointer-events: none;
}

.heat-vision-overlay.active {
  opacity: 1;
}

/* 1. The Sun Source */
.heat-source {
  position: absolute;
  top: -60px;
  left: 50%;
  transform: translateX(-50%);
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: radial-gradient(circle, #fff 0%, #ffaa00 40%, rgba(255, 69, 0, 0) 70%);
  filter: blur(10px);
  opacity: 0.9;
  animation: sunPulse 4s infinite alternate;
}

.sun-orb {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 60px;
  height: 60px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 0 40px #ff8800;
}

.sun-glow {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 150px;
  height: 150px;
  background: radial-gradient(circle, rgba(255, 165, 0, 0.4) 0%, rgba(255, 69, 0, 0) 70%);
  border-radius: 50%;
  animation: sunGlowPulse 3s infinite alternate;
}

@keyframes sunPulse {
  from {
    opacity: 0.8;
    transform: translateX(-50%) scale(1);
  }

  to {
    opacity: 1;
    transform: translateX(-50%) scale(1.1);
  }
}

@keyframes sunGlowPulse {
  from {
    transform: translate(-50%, -50%) scale(0.8);
    opacity: 0.5;
  }

  to {
    transform: translate(-50%, -50%) scale(1.2);
    opacity: 0.8;
  }
}

/* 2. Heat Rays (SVG) */
.heat-rays-outer,
.heat-rays-inner {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

/* Inner rays need to be below the shield glass but above car */
.heat-rays-inner {
  z-index: 1;
}

/* Outer rays are above everything */
.heat-rays-outer {
  z-index: 3;
}

/* SVG Path Styling */
.heat-ray-path {
  fill: none;
  stroke-linecap: round;
  vector-effect: non-scaling-stroke;
}

/* Incoming Rays (Red/Orange) */
.ray-incoming {
  stroke: #ff4d4d;
  /* Fallback */
  stroke-width: 2;
  stroke-dasharray: 20, 10;
  animation: flowIn 1.5s linear infinite;
  opacity: 0.6;
}

/* Reflected Rays (Bouncing off) */
.ray-reflected {
  stroke: #ffaa00;
  /* Fallback */
  stroke-width: 2;
  stroke-dasharray: 20, 10;
  animation: flowOut 1.5s linear infinite;
  opacity: 0.5;
}

/* Transmitted Rays (Passing through) */
.ray-transmitted {
  stroke: #ff0000;
  /* Fallback */
  stroke-width: 1;
  stroke-dasharray: 10, 20;
  animation: flowThrough 2s linear infinite;
  opacity: 0.3;
}

@keyframes flowIn {
  from {
    stroke-dashoffset: 100;
  }

  to {
    stroke-dashoffset: 0;
  }
}

@keyframes flowOut {
  from {
    stroke-dashoffset: 0;
  }

  to {
    stroke-dashoffset: -100;
  }
}

@keyframes flowThrough {
  from {
    stroke-dashoffset: 50;
  }

  to {
    stroke-dashoffset: 0;
  }
}

/* 3. Invisible Heat Shield (Glass surface) */
.heat-shield-glass {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 2;
}

/* 4. Stats Badge */
.heat-stats-badge {
  position: absolute;
  bottom: 20px;
  right: 20px;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 15px 25px;
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  transform: translateY(20px);
  opacity: 0;
  transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  z-index: 30;
}

.heat-vision-overlay.active .heat-stats-badge {
  transform: translateY(0);
  opacity: 1;
}

.heat-label {
  font-size: 0.9em;
  color: #aaa;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 5px;
}

.heat-value {
  font-size: 2.5em;
  font-weight: 700;
  background: -webkit-linear-gradient(#f9cb28, #ff4d4d);
  background: linear-gradient(#f9cb28, #ff4d4d);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: 0 5px 15px rgba(255, 77, 77, 0.3);
}

/* Advanced Stats Badge Layout */
.heat-stat-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  gap: 15px;
}

.heat-stat-divider {
  width: 100%;
  height: 1px;
  background: rgba(255, 255, 255, 0.2);
  margin: 10px 0;
}

.heat-stat-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 15px;
  width: 100%;
  text-align: center;
}

.heat-stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.heat-label-sm {
  font-size: 0.75em;
  color: #ccc;
  margin-bottom: 2px;
}

.heat-value-sm {
  font-size: 1.1em;
  font-weight: 700;
  color: #fff;
}

/* Mobile Adjustments */
@media screen and (max-width: 768px) {
  .heat-source {
    width: 80px;
    height: 80px;
    top: -40px;
  }

  .sun-orb {
    width: 40px;
    height: 40px;
  }

  .heat-stats-badge {
    bottom: 10px;
    right: 10px;
    padding: 10px 20px;
  }

  .heat-value {
    font-size: 1.8em;
  }

  .heat-stat-grid {
    gap: 8px;
  }

  .heat-label-sm {
    font-size: 0.65em;
  }

  .heat-value-sm {
    font-size: 0.9em;
  }
}