/* World Famous Autos: photos first and uncropped inventory photography. */
body.cvms-world-famous-autos .carsmark-detail .hedgehog-theme-wrapper {
  display: flex;
  flex-direction: column;
}
body.cvms-world-famous-autos .carsmark-detail .hedgehog-theme-wrapper > * { order: 65; }
body.cvms-world-famous-autos .carsmark-detail .hedgehog-theme-wrapper > .cm-back { order: 0 !important; }
body.cvms-world-famous-autos .carsmark-detail .hedgehog-theme-wrapper > .detail-wrapper { order: 10 !important; }
body.cvms-world-famous-autos .carsmark-detail .hedgehog-theme-wrapper > .cvms-vdp-pricing-panel { order: 15 !important; }
body.cvms-world-famous-autos .carsmark-detail .hedgehog-theme-wrapper > #cm-lower { order: 20 !important; margin-top: 20px; }
body.cvms-world-famous-autos .carsmark-detail .hedgehog-theme-wrapper > .cm-overview-wrap { order: 30 !important; }
body.cvms-world-famous-autos .carsmark-detail .hedgehog-theme-wrapper > .cm-options { order: 40 !important; }
body.cvms-world-famous-autos .carsmark-detail .hedgehog-theme-wrapper > .cm-actions { order: 50 !important; }
body.cvms-world-famous-autos .carsmark-detail .hedgehog-theme-wrapper > #cm-image-area { order: 25 !important; }
body.cvms-world-famous-autos .carsmark-detail .hedgehog-theme-wrapper > .cm-similar { order: 70 !important; }

/* Override fixed crop rules, including inline styles and Theme Studio rules. */
body.cvms-world-famous-autos .corevms-wrap img[data-cvms-vehicle-image] {
  object-fit: contain !important;
  object-position: center center !important;
  transform: none !important;
}
body.cvms-world-famous-autos .corevms-wrap .inventory-vehicle-image {
  height: auto !important;
  aspect-ratio: auto !important;
  background: var(--cv-surface-alt);
}
body.cvms-world-famous-autos .corevms-wrap .inventory-vehicle-image .cm-vehicle-photo-link {
  display: block;
  height: auto !important;
  aspect-ratio: auto !important;
}
body.cvms-world-famous-autos .corevms-wrap .inventory-vehicle-image img[data-cvms-vehicle-image],
body.cvms-world-famous-autos .corevms-wrap .cm-similar-image img[data-cvms-vehicle-image],
body.cvms-world-famous-autos .corevms-wrap .cm-thumb img[data-cvms-vehicle-image],
body.cvms-world-famous-autos .corevms-wrap .cvms-primary-photo img[data-cvms-vehicle-image] {
  display: block;
  width: 100% !important;
  height: auto !important;
  max-height: none !important;
  aspect-ratio: auto !important;
}
body.cvms-world-famous-autos .carsmark-detail #cm-image-area .swiper-wrapper {
  height: auto !important;
  grid-template-rows: auto auto !important;
  align-items: start;
}
body.cvms-world-famous-autos .carsmark-detail #cm-image-area .swiper-slide img[data-cvms-vehicle-image] {
  height: auto !important;
}
body.cvms-world-famous-autos .carsmark-detail .cm-spin-frame { object-fit: contain !important; }
body.cvms-world-famous-autos .carsmark-detail .cm-lease-details,
body.cvms-world-famous-autos .carsmark-detail .cm-lease-card { min-width: 0; }
body.cvms-world-famous-autos .carsmark-detail .cm-lease-details .cm-spin { margin-top: 0; }
body.cvms-world-famous-autos .carsmark-detail .cvms-primary-photo { display: block; margin-bottom: 22px; }

body.cvms-world-famous-autos .carsmark-detail .cvms-vehicle-enquiry-cta {
  margin: 0 0 22px !important;
  padding: 20px !important;
  border-radius: 12px;
  background: var(--cv-secondary);
  color: #fff !important;
  font-size: clamp(22px, 2vw, 28px) !important;
  font-weight: 800 !important;
  line-height: 1.3 !important;
  text-align: left;
}
body.cvms-world-famous-autos .carsmark-detail .cm-embedded-form .gform_wrapper select {
  box-sizing: border-box !important;
  min-height: 52px !important;
  height: auto !important;
  padding: 12px 40px 12px 14px !important;
  font-size: 16px !important;
  line-height: 1.5 !important;
  text-indent: 0 !important;
}
@media (max-width: 767px) {
  body.cvms-world-famous-autos .carsmark-detail #cm-lower {
    display: flex !important;
    flex-direction: column !important;
  }
  body.cvms-world-famous-autos .carsmark-detail #cm-lower > .cm-lease-details { order: 0 !important; width: 100%; }
  body.cvms-world-famous-autos .carsmark-detail #cm-lower > .cm-lease-card { order: 1 !important; width: 100%; }
  body.cvms-world-famous-autos .carsmark-detail .cvms-vehicle-enquiry-cta { padding: 18px !important; font-size: 24px !important; }
}

/* CoreVMS 3.2.12: restore the original mosaic and retain complete photos. */
body.cvms-world-famous-autos .corevms-wrap.carsmark-detail.carsmark-detail .hedgehog-theme-wrapper > #cm-image-area { order: 25 !important; }
body.cvms-world-famous-autos .corevms-wrap.carsmark-detail.carsmark-detail #cm-image-area .swiper-per-view .swiper-wrapper {
  display: grid !important;
  grid-template-columns: 2fr 1fr 1fr !important;
  grid-template-rows: repeat(2, minmax(0, 1fr)) !important;
  gap: 10px !important;
  width: 100% !important;
  height: auto !important;
  aspect-ratio: 4 / 1;
  align-items: stretch !important;
  overflow: hidden;
}
body.cvms-world-famous-autos .corevms-wrap.carsmark-detail.carsmark-detail #cm-image-area .swiper-per-view .swiper-slide:nth-child(n) {
  display: block !important;
  width: auto !important;
  height: 100% !important;
  min-width: 0;
  min-height: 0;
  margin: 0 !important;
}
body.cvms-world-famous-autos .corevms-wrap.carsmark-detail.carsmark-detail #cm-image-area .swiper-per-view .swiper-slide:nth-child(1) { grid-column: 1 !important; grid-row: 1 / 3 !important; }
body.cvms-world-famous-autos .corevms-wrap.carsmark-detail.carsmark-detail #cm-image-area .swiper-per-view .swiper-slide:nth-child(2) { grid-column: 2 !important; grid-row: 1 !important; }
body.cvms-world-famous-autos .corevms-wrap.carsmark-detail.carsmark-detail #cm-image-area .swiper-per-view .swiper-slide:nth-child(3) { grid-column: 3 !important; grid-row: 1 !important; }
body.cvms-world-famous-autos .corevms-wrap.carsmark-detail.carsmark-detail #cm-image-area .swiper-per-view .swiper-slide:nth-child(4) { grid-column: 2 !important; grid-row: 2 !important; }
body.cvms-world-famous-autos .corevms-wrap.carsmark-detail.carsmark-detail #cm-image-area .swiper-per-view .swiper-slide:nth-child(5) { grid-column: 3 !important; grid-row: 2 !important; }
body.cvms-world-famous-autos .corevms-wrap.carsmark-detail.carsmark-detail #cm-image-area .swiper-per-view .swiper-slide img[data-cvms-vehicle-image] {
  display: block;
  width: 100% !important;
  height: 100% !important;
  object-fit: contain !important;
  object-position: center !important;
  transform: none !important;
}
/* Preserve the original Show all photos control instead of forcing it open. */
body.cvms-world-famous-autos .corevms-wrap.carsmark-detail.carsmark-detail #cm-image-area .cm-all-images[hidden] { display: none !important; }
body.cvms-world-famous-autos .corevms-wrap.carsmark-detail.carsmark-detail #cm-image-area .cm-all-images:not([hidden]) { display: grid !important; }
@media (max-width: 767px) {
  /* Keep the existing swipe gallery on mobile, sized to the actual photo box. */
  body.cvms-world-famous-autos .corevms-wrap.carsmark-detail.carsmark-detail #cm-image-area .swiper-per-view .swiper-wrapper {
    display: flex !important;
    height: auto !important;
    aspect-ratio: auto;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
  }
  body.cvms-world-famous-autos .corevms-wrap.carsmark-detail.carsmark-detail #cm-image-area .swiper-per-view .swiper-slide:nth-child(n) {
    flex: 0 0 100%;
    width: 100% !important;
    height: auto !important;
    aspect-ratio: 16 / 9;
    grid-column: auto !important;
    grid-row: auto !important;
    scroll-snap-align: start;
  }
}
