body {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

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

/* Navbar */
.topnav {
  background-color: #333;
  display: flex;
  justify-content: center;
  position: sticky;
  top: 0;
  border-bottom: 3px solid #e63946;
  z-index: 100;
}

.topnav a {
  color: #f2f2f2;
  text-align: center;
  padding: 14px 16px;
  text-decoration: none;
  font-size: 17px;
}

.topnav a:hover {
  background-color: #ddd;
  color: black;
}

.topnav a.active {
  background-color: #04AA6D;
  color: white;
}

header {
  background-color: #333;
  color: white;
  padding: 20px;
  text-align: center;
}

.main-container {
  text-align: center;
  padding: 20px;
  min-height: 500px;
  flex: 1;
}

footer {
  background-color: #111;
  color: #aaa;
  text-align: center;
  padding: 20px;
  font-size: 0.85rem;
  border-top: 3px solid #e63946;
}

.model-interaction-buttons {
  text-align: center;
}

.model-camera-buttons {
  text-align: center;
}

.model-camera-buttons button.cam-active {
  background-color: #e63946;
  border-color: #e63946;
  color: white;
}

.model-light-buttons {
  text-align: center;
}

.model-light-buttons button.light-on {
  background-color: #e63946;
  border-color: #e63946;
  color: white;
}

.model-light-buttons button.light-off {
  background-color: black;
  border-color: #555;
  color: #555;
}

button {
  background-color: black;
  border: none;
  color: white;
  padding: 15px 32px;
  text-align: center;
  text-decoration: none;
  display: inline-block;
  font-size: 16px;
  cursor: pointer;
  border: 3px solid #e63946;
  margin: 20px 0;
}

.car-title {
  text-align: center;
}

/* Lighting controller container */
#gui-container {
  position: absolute;
  top: 270px;
  left: 20px;
  z-index: 1000;
}

table {
  border-collapse: collapse;
  width: 100%;
  text-align: center;
  margin: 0 auto;
}

table.table-bordered th,
table.table-bordered td {
  border: 4px solid black;
  padding: 10px;
}

.viewer-layout {
  display: flex;
  gap: 16px;
  align-items: stretch;
  box-sizing: border-box; 
  width: 100%;    
  padding: 16px;       
}

.viewer-left {
  flex: 0 0 65%;
  position: relative;
  height: calc(100vh - 220px);
}

.viewer-left #three-canvas {
  width: 100%;
  height: 100%;
  display: block;
  overflow: hidden;
}

/* Info panel */
.car-info-panel {
  flex: 1;
  min-width: 0;
  border: 1px solid #ddd;
  border-radius: 8px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 0;
  background: #fff;
  border: 3px solid #e63946;
}

.info-title {
  font-size: 20px;
  font-weight: 600;
  margin: 0 0 4px 0;
}

.info-subtitle {
  font-size: 13px;
  color: #777;
  margin: 0;
}

.info-price {
  font-size: 28px;
  font-weight: 700;
  color: #cc0000;
  padding: 8px 0;
}

.info-divider {
  border-top: 1px solid #eee;
  margin: 12px 0;
}

/* Specs grid */
.specs-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px 8px;
}

.spec-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.spec-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #999;
}

.spec-value {
  font-size: 14px;
  font-weight: 600;
  color: #222;
}

.info-description {
  font-size: 13px;
  color: #555;
  line-height: 1.6;
  margin: 0;
}

/* Header text */
header {
  background: linear-gradient(135deg, #0a0a0a 0%, #1a1a2e 50%, #0a0a0a 100%);
  padding: 20px 40px;
  border-bottom: 3px solid #e63946;
  display: flex;
  align-items: center;
  justify-content: center;
}

.header-logo {
  display: flex;
  align-items: center;
  gap: 20px;
}

/* The icon */
.logo-mark {
  background: #e63946;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 1.4rem;
  font-weight: 900;
  letter-spacing: -1px;
  font-family: 'Arial Black', sans-serif;
  line-height: 1;
  box-shadow: 0 0 18px rgba(230, 57, 70, 0.6);
}

.logo-w  { color: #ffffff; }
.logo-3d { color: #0a0a0a; background: #fff; padding: 0 3px; border-radius: 3px; }
.logo-m  { color: #ffffff; }

/* The text beside it */
.logo-title {
  font-size: 1.8rem;
  font-weight: 900;
  color: #ffffff;
  margin: 0;
  letter-spacing: 2px;
  text-transform: uppercase;
  font-family: 'Arial Black', sans-serif;
}

.logo-strapline {
  margin: 2px 0 0 0;
  font-size: 0.8rem;
  color: #e63946;
  letter-spacing: 3px;
  text-transform: uppercase;
  font-style: italic;
}

/* Sitemap CSS */
.sitemap-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
  margin: 30px auto;
  max-width: 1000px;
  text-align: left;
}

.sitemap-card {
  border: 3px solid #e63946;
  border-radius: 8px;
  padding: 20px;
  background: #fff;
}

.sitemap-card h2 {
  font-size: 1.1rem;
  margin: 0 0 8px 0;
  color: #111;
}

.sitemap-card p {
  font-size: 0.85rem;
  color: #555;
  margin: 0 0 12px 0;
}

.sitemap-card ul {
  font-size: 0.85rem;
  color: #333;
  padding-left: 18px;
  margin: 0 0 12px 0;
}

.sitemap-card a {
  font-size: 0.85rem;
  color: #e63946;
  text-decoration: none;
  font-weight: 600;
}

.sitemap-card a:hover {
  text-decoration: underline;
}

.paint-colours {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.paints {
  width: 30px;
  height: 30px;
  border: 2px solid #fff;
  cursor: pointer;
}

.paints:hover {
  border-color: #e63946;
}

img {
  transition: transform 0.3s ease;
  cursor: pointer;
  width: 35%;
  height: auto;
}

img.clicked {
  transform: scale(1.5);
}

@media (max-width: 768px) {
  .viewer-layout {
    flex-direction: column;
  }

  .viewer-left {
    flex: none;
    width: 100%;
    height: 50vh;
    overflow: hidden;
  }

  .car-info-panel {
    width: 100%;
  }
}