/* NOVIA 4.2.006 — shared visual treatment based on Corolla Cross. 
   Does not modify vehicle image frame lists, color ids or image files. */
section.novia-color-layout-v006 {
  --nv006-size: 1150px;
  --nv006-swatch: 35px;
  --nv006-red: #eb0a1e;
}
/* Corolla Cross and RAV4: preserve the reference viewer dimensions */
section.novia-color-layout-v006 > .viewer {
  width: 100%;
  max-width: var(--nv006-size);
  aspect-ratio: 930 / 328;
  margin: 48px auto 0;
}
/* Other 4 vehicles use their own existing images/JS, but the same image stage */
section.novia-color-layout-v006 .retained-viewer {
  box-sizing: border-box;
  width: 100%;
  max-width: var(--nv006-size);
  margin-inline: auto;
  display: flex;
  flex-direction: column;
  align-items: stretch;
}
section.novia-color-layout-v006 .retained-viewer :is(#stage, .spin-stage, .stage) {
  box-sizing: border-box;
  order: 1;
  position: relative;
  width: 100%;
  max-width: var(--nv006-size);
  aspect-ratio: 930 / 328;
  height: auto;
  min-height: 0;
  margin: 48px auto 0;
  padding: 0;
  background: #fff;
  border: 0;
  border-radius: 0;
  overflow: hidden;
  touch-action: pan-y;
}
section.novia-color-layout-v006 .retained-viewer :is(#stage, .spin-stage, .stage) > img {
  box-sizing: border-box;
  display: block;
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: none;
  margin: auto;
  object-fit: contain;
  object-position: center;
  user-select: none;
}
/* Existing arrow / enter-interior / fullscreen controls remain operational */
section.novia-color-layout-v006 .retained-viewer :is(.controls, .spin-controls) {
  order: 2;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin: 25px 0 32px;
}
section.novia-color-layout-v006 .retained-viewer :is(.controls, .spin-controls) :is(#prev, #next) {
  box-sizing: border-box;
  width: 40px;
  height: 40px;
  min-width: 40px;
  padding: 0;
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 50%;
  font-size: 20px;
  line-height: 1;
}
section.novia-color-layout-v006 .retained-viewer :is(.controls, .spin-controls) :is(#prev, #next):hover {
  background: #eee;
}
section.novia-color-layout-v006 .retained-viewer :is(.controls, .spin-controls) :is(#enter-interior, #auto, #full) {
  box-sizing: border-box;
  min-height: 40px;
  padding: 8px 15px;
  border: 1px solid #ddd;
  border-radius: 25px;
  background: #fff;
  color: #171717;
  font-size: 12px;
}
section.novia-color-layout-v006 .retained-viewer :is(.controls, .spin-controls) #angle {
  font-size: 11px;
  color: #6b6b6b;
  white-space: nowrap;
}
/* Coaster is still single-angle; its zoom action replaces spin controls. */
section.novia-color-layout-v006 .retained-viewer > .actions.center {
  order: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 20px auto 26px;
}
section.novia-color-layout-v006 .retained-viewer #expand {
  padding: 10px 20px;
  border: 1px solid #ddd;
  border-radius: 24px;
  background: #fff;
  color: #171717;
  font-size: 12px;
}
/* Same swatch dimensions, spacing and selected black halo as Corolla Cross */
section.novia-color-layout-v006 .retained-viewer :is(.colors, .coaster-colors, .novia-one-color) {
  order: 3;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 17px;
  max-width: 850px;
  margin: 0 auto;
  padding: 6px;
}
section.novia-color-layout-v006 .retained-viewer :is(.colors, .coaster-colors, .novia-one-color) > button {
  box-sizing: border-box;
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 var(--nv006-swatch);
  width: var(--nv006-swatch);
  height: var(--nv006-swatch);
  min-width: var(--nv006-swatch);
  min-height: var(--nv006-swatch);
  margin: 0;
  padding: 0;
  background: none;
  border: 1px solid #8886;
  border-radius: 50%;
  font-size: 0;
  line-height: 0;
  color: transparent;
  cursor: pointer;
}
section.novia-color-layout-v006 .retained-viewer :is(.colors, .coaster-colors, .novia-one-color) > button > span {
  display: block;
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  border: 0;
  border-radius: 50%;
  background: var(--paint, var(--color, #f5f5f0));
}
section.novia-color-layout-v006 .retained-viewer .colors > button[data-name*="سقف مشکی"] > span {
  background: linear-gradient(135deg, #202020 0 45%, var(--paint) 45% 100%);
}
section.novia-color-layout-v006 .retained-viewer .coaster-colors > button[data-code^="2"] > span {
  background: linear-gradient(135deg, #fafaf5 0 45%, var(--color) 45% 100%);
}
section.novia-color-layout-v006 .retained-viewer :is(.colors, .coaster-colors, .novia-one-color) > button[aria-pressed="true"] {
  border: 1px solid #8886;
}
section.novia-color-layout-v006 .retained-viewer :is(.colors, .coaster-colors, .novia-one-color) > button[aria-pressed="true"]::after {
  content: "";
  position: absolute;
  inset: -6px;
  border: 2px solid #111;
  border-radius: 50%;
  pointer-events: none;
}
section.novia-color-layout-v006 .retained-viewer :is(.colors, .coaster-colors, .novia-one-color) > button:focus-visible {
  outline: 3px solid var(--nv006-red);
  outline-offset: 7px;
}
section.novia-color-layout-v006 .retained-viewer :is(#color-name, .selection, .novia-one-name) {
  order: 4;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin: 27px auto 13px;
  padding: 0;
  text-align: center;
  font: 400 15px/1.8 Tahoma, Arial, sans-serif;
  color: #171717;
}
section.novia-color-layout-v006 .retained-viewer .selection b {
  font: inherit;
}
section.novia-color-layout-v006 .retained-viewer .selection #color-code {
  font: 12px/1.8 Arial,sans-serif;
  color: #888;
}
section.novia-color-layout-v006 .retained-viewer .note {
  order: 5;
  margin: 0 auto 12px;
  text-align: center;
  font-size: 11px;
  line-height: 1.9;
  color: #666;
}
section.novia-color-layout-v006 .retained-viewer > p:not(.note) {
  order: 5;
  text-align: center;
  font-size: 11px;
  color: #666;
}
/* Consistent controls and buttons under all viewer types */
section.novia-color-layout-v006 > .actions.center {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 16px;
  margin: 24px auto 0;
}
section.novia-color-layout-v006 > .actions.center :is(a.button, button.button) {
  box-sizing: border-box;
  min-width: 140px;
  min-height: 50px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 30px;
  padding: 13px 25px;
  font-size: 14px;
  font-weight: 700;
  text-align: center;
  text-decoration: none;
}
/* Exempt fullscreen viewers and interior panoramas from fixed aspect ratio. */
section.novia-color-layout-v006 .retained-viewer :is(#stage, .spin-stage, .stage):fullscreen {
  display: flex;
  width: 100vw;
  height: 100dvh;
  max-width: none;
  max-height: none;
  aspect-ratio: auto;
  align-items: center;
  justify-content: center;
  margin: 0;
  padding: 0;
  background: #fff;
}
section.novia-color-layout-v006 .retained-viewer :is(#stage, .spin-stage, .stage):fullscreen > img {
  width: 100%;
  height: 100%;
  max-height: 100%;
  object-fit: contain;
}
@media (max-width: 700px) {
  section.novia-color-layout-v006 { --nv006-swatch: 32px; }
  section.novia-color-layout-v006 > .viewer,
  section.novia-color-layout-v006 .retained-viewer :is(#stage, .spin-stage, .stage):not(:fullscreen) {
    margin-top: 25px;
    min-height: 210px;
    aspect-ratio: auto;
  }
  section.novia-color-layout-v006 .retained-viewer :is(.controls, .spin-controls) { gap: 8px; margin: 15px 0 26px; }
  section.novia-color-layout-v006 .retained-viewer :is(.colors, .coaster-colors, .novia-one-color) { gap: 14px; max-width: 100%; }
  section.novia-color-layout-v006 .retained-viewer :is(#color-name, .selection, .novia-one-name) { font-size: 14px; }
  section.novia-color-layout-v006 > .actions.center :is(a.button, button.button) { min-height: 45px; }
}
