/* ==========================================================================
   CXO Fahrzeug-Übersicht – Responsive Styles für Divi 4 Code Module
   Version: 4.1 – Optimiert & konsolidiert
   ========================================================================== */

/* ---------- Fonts ---------- */
@font-face {
  font-family: "Helvetica Now Display - Bold";
  src: url("/wp-content/uploads/et-fonts/helvetica-now-display-bold.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Helvetica Now Display - ExtraBold";
  src: url("/wp-content/uploads/et-fonts/hhelvetica-now-display-extra-bold.woff2") format("woff2");
  font-weight: 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Helvetica Now Display - Light";
  src: url("/wp-content/uploads/et-fonts/helvetica-now-display-light.woff2") format("woff2");
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}

/* ---------- CSS Custom Properties ---------- */
:root {
  --cxo-bg: #172d40;
  --cxo-card: #223a59;
  --cxo-surface: rgba(209, 218, 225, 0.1);
  --cxo-surface-solid: #d1dae1;
  --cxo-surface-hover: rgba(209, 218, 225, 0.18);
  --cxo-accent: #7066ad;
  --cxo-accent-light: #a799ff;
  --cxo-accent-hover: #8a7be0;
  --cxo-accent-glow: rgba(167, 153, 255, 0.2);
  --cxo-text: #d1dae1;
  --cxo-text-white: #fff;
  --cxo-text-dark: #172d40;
  --cxo-border: rgba(209, 218, 225, 0.15);
  --cxo-border-light: rgba(209, 218, 225, 0.08);
  --cxo-radius: 0.5em;
  --cxo-radius-sm: 5px;
  --cxo-font-bold: "Helvetica Now Display - Bold", Helvetica, Arial, Lucida, sans-serif;
  --cxo-font-extrabold: "Helvetica Now Display - ExtraBold", Helvetica, Arial, Lucida, sans-serif;
  --cxo-font-light: "Helvetica Now Display - Light", Helvetica, Arial, Lucida, sans-serif;
  --cxo-font: var(--cxo-font-light);
  --cxo-transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --cxo-max-width: 1240px;
  --cxo-gap: 16px;
  --cxo-shimmer: linear-gradient(
    90deg,
    rgba(209, 218, 225, 0.1) 25%,
    rgba(255, 255, 255, 0.06) 50%,
    rgba(209, 218, 225, 0.1) 75%
  );
}

/* ---------- Reset (scoped) ---------- */
.cxo-wrapper,
.cxo-wrapper * {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* ---------- Container ---------- */
.cxo-wrapper {
  background-color: var(--cxo-bg);
  font-family: var(--cxo-font);
  color: var(--cxo-text);
  font-size: 16px;
  letter-spacing: 0.02em;
  width: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  /* Divi 5 isolation: prevent style bleeding */
  container-type: inline-size;
  isolation: isolate;
}

.cxo-inner {
  max-width: var(--cxo-max-width);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin-bottom:2em;
}

/* ========== FILTER FORM / GRID ========== */
.cxo-filter-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.cxo-filter-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  align-items: end;
}

.cxo-filter-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: opacity var(--cxo-transition), transform var(--cxo-transition);
}

.cxo-filter-group.cxo-filter-checkbox-group {
  justify-content: flex-end;
}

/* Disabled filter group (no available options) */
.cxo-filter-group.cxo-filter-disabled {
  opacity: 0.35;
  pointer-events: none;
  transform: scale(0.98);
}

.cxo-filter-group.cxo-filter-disabled .cxo-filter-label {
  opacity: 1;
}

/* ---------- Checkbox Options Row ---------- */
.cxo-filter-options-row {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: end;
}

.cxo-filter-options-row .cxo-filter-group {
  flex: 0 0 auto;
  min-width: 160px;
}

/* ---------- Weitere Filter (Desktop Collapse) ---------- */
.cxo-filter-extra {
  display: none;
}

.cxo-filter-extra.cxo-filter-expanded {
  display: contents;
}

.cxo-btn-more-filters {
  color: var(--cxo-accent-light);
  border-top: 1px solid var(--cxo-border) !important;
  grid-column: 1 / -1;
  justify-content: center;
  margin-top: 4px;
  font-family: var(--cxo-font-light) !important;
  font-weight: 300;
  letter-spacing: 0.04em;
  background: none;
  border-radius: 0 !important;
}

/* ---------- Filter Actions ---------- */
.cxo-filter-actions {
  display: flex;
  justify-content: flex-end;
  padding-top: 4px;
  margin-bottom: 1em;
}

.cxo-btn-reset {
  background: var(--cxo-surface);
  color: var(--cxo-accent-light);
  font-family: var(--cxo-font-light);
  font-weight: 300;
}

.cxo-btn-reset:hover {
  background: var(--cxo-accent-glow);
  transform: scale(1.02);
}

/* ---------- Labels ---------- */
.cxo-filter-label {
  font-size: 12px;
  font-family: var(--cxo-font-bold);
  font-weight: 700;
  color: var(--cxo-text);
  letter-spacing: 0.12px;
  text-transform: none;
}

/* ---------- Select Dropdown ---------- */
.cxo-select {
  width: 100%;
  padding: 10px 36px 10px 14px;
  background: var(--cxo-surface-solid);
  border: 2px solid transparent;
  border-radius: var(--cxo-radius-sm);
  font-family: var(--cxo-font);
  font-size: 16px;
  font-weight: 400;
  color: var(--cxo-text-dark);
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23172d40' stroke-width='2' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 12px 8px;
  transition:
    border-color var(--cxo-transition),
    box-shadow var(--cxo-transition);
  line-height: 1.4;
}

.cxo-select:hover {
  border-color: var(--cxo-accent-light);
}

.cxo-select:focus {
  outline: none;
  border-color: var(--cxo-accent);
  box-shadow: 0 0 0 3px rgba(112, 102, 173, 0.25);
}

.cxo-select-half {
  max-width: calc(50% - 12px);
  flex: 1;
}

/* Range row */
.cxo-range-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.cxo-range-row .cxo-select {
  flex: 1;
  max-width: none;
}

.cxo-range-sep {
  font-size: 16px;
  color: var(--cxo-text);
  flex-shrink: 0;
}

/* ---------- Buttons ---------- */
.cxo-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0.7em 1.5em 0.5em;
  border: none;
  border-radius: var(--cxo-radius-sm);
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition:
    background var(--cxo-transition),
    transform var(--cxo-transition),
    box-shadow var(--cxo-transition);
  text-decoration: none;
  line-height: 1.4;
  font-family: var(--cxo-font-bold);
}

.cxo-btn-detail {
  background: var(--cxo-accent-light);
  color: var(--cxo-text-dark);
  border-radius: 100px;
  letter-spacing: 0.04em;
}

.cxo-btn-detail:hover {
  background: var(--cxo-accent-hover);
  color: var(--cxo-text-dark);
}

.cxo-btn-back {
  color: var(--cxo-accent-light);
  border-radius: var(--cxo-radius-sm);
  font-family: var(--cxo-font-light);
  font-weight: 300;
  letter-spacing: 0.04em;
  padding: 0 !important;
  /*margin-bottom: 1em;*/
}

/* ========== CHECKBOX ITEM ========== */
.cxo-checkbox-item {
  display: flex;
  align-items: center;
  height: 42px;
  border-radius: var(--cxo-radius-sm);
  overflow: hidden;
  background: var(--cxo-surface);
  cursor: pointer;
  transition: background var(--cxo-transition);
  user-select: none;
}

.cxo-checkbox-item:hover {
  background: var(--cxo-surface-hover);
}

.cxo-checkbox-box {
  width: 40px;
  min-width: 40px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--cxo-surface-solid);
  transition: background var(--cxo-transition);
}

.cxo-checkbox-item.checked .cxo-checkbox-box {
  background: var(--cxo-accent);
}

.cxo-checkbox-box svg {
  width: 16px;
  height: 12px;
  fill: none;
  stroke: var(--cxo-text-white);
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0;
  transform: scale(0.5);
  transition:
    opacity var(--cxo-transition),
    transform var(--cxo-transition);
}

.cxo-checkbox-item.checked .cxo-checkbox-box svg {
  opacity: 1;
  transform: scale(1);
}

.cxo-checkbox-label {
  padding: 0 14px;
  font-size: 14px;
  font-weight: 400;
  color: var(--cxo-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cxo-checkbox-item.checked .cxo-checkbox-label {
  font-weight: 700;
}

/* ========== ACTIVE FILTER TAGS ========== */
.cxo-active-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 12px 0;
  border-top: 1px solid var(--cxo-border);
  border-bottom: 1px solid var(--cxo-border);
  min-height: 20px;
}

.cxo-active-filters:empty {
  display: none;
}

.cxo-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: var(--cxo-surface);
  border-radius: var(--cxo-radius-sm);
  font-size: 14px;
  font-weight: 700;
  color: var(--cxo-accent-light);
  cursor: pointer;
  transition:
    background var(--cxo-transition),
    transform var(--cxo-transition),
    opacity var(--cxo-transition);
  user-select: none;
}

.cxo-tag:hover {
  background: var(--cxo-accent-glow);
  transform: scale(1.03);
}

.cxo-tag-x {
  font-size: 13px;
  opacity: 0.7;
  transition: opacity var(--cxo-transition);
}

.cxo-tag:hover .cxo-tag-x {
  opacity: 1;
}

/* ========== NO RESULTS ========== */
.cxo-no-results {
  text-align: center;
  padding: 48px 20px;
  font-size: 18px;
  color: var(--cxo-text);
  opacity: 0.7;
}

/* ========== RESULTS HEADER ========== */
.cxo-results-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  font-weight: 700;
  color: var(--cxo-text);
  letter-spacing: 0.05em;
  margin-bottom: 1em;
  margin-top: 1em;
}

.cxo-results-header-left span {
  font-weight: 300;
}

/* ========== VIEW TOGGLE ========== */
.cxo-view-toggle {
  display: flex;
  gap: 4px;
}

.cxo-view-btn {
  background: var(--cxo-surface);
  border: none;
  border-radius: var(--cxo-radius-sm);
  color: var(--cxo-text);
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0.5;
  transition:
    background var(--cxo-transition),
    opacity var(--cxo-transition);
}

.cxo-view-btn:hover {
  opacity: 0.8;
  background: var(--cxo-surface-hover);
}

.cxo-view-btn.active {
  opacity: 1;
  background: var(--cxo-accent);
  color: var(--cxo-text-dark);
}

/* Swipe button only on mobile */
.cxo-view-btn-swipe {
  display: none;
}

@media (max-width: 768px) {
  .cxo-view-btn[data-view="grid"] {
    display: none;
  }
  .cxo-view-btn-swipe {
    display: flex;
  }
}

/* ========== PAGINATION ========== */
.cxo-pagination-info {
  text-align: center;
  font-size: 12px;
  font-weight: 300;
  color: var(--cxo-text);
  opacity: 0.7;
  padding-bottom: 1em;
  margin-top: 1em;
  letter-spacing: 0.05em;
}

/* ========== VEHICLE CARDS ========== */
.cxo-vehicles {
  display: flex;
  flex-direction: column;
  gap: var(--cxo-gap);
}

.cxo-vehicle-card {
  background: var(--cxo-card);
  border-radius: var(--cxo-radius);
  overflow: hidden;
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: auto auto auto;
  transition:
    transform var(--cxo-transition),
    box-shadow var(--cxo-transition);
  animation: cxo-fadeUp 0.45s var(--cxo-transition) both;
  border: 1px solid var(--cxo-card);
}

.cxo-vehicle-card:nth-child(2) {
  animation-delay: 0.08s;
}
.cxo-vehicle-card:nth-child(3) {
  animation-delay: 0.16s;
}
.cxo-vehicle-card:nth-child(4) {
  animation-delay: 0.24s;
}

.cxo-vehicle-card:hover {
  border-color: var(--cxo-accent-light);
}

/* Image */
.cxo-vehicle-image {
  grid-row: 1 / 3;
  padding: 8px;
  overflow: hidden;
  position: relative;
}

.cxo-vehicle-image a {
  display: block;
  height: 100%;
  overflow: hidden;
  border-radius: 6px;
}

.cxo-vehicle-image img {
  width: 100% !important;
  height: 100%;
  min-height: 180px;
  max-width: 100% !important;
  object-fit: cover;
  border-radius: 6px;
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
  transition: transform var(--cxo-transition);
}

.cxo-vehicle-image a:hover img {
  transform: scale(1.03);
}

/* Info area */
@media (max-width: 768px) {
  .cxo-vehicle-info {
  padding: 1em !important;
}
}
.cxo-vehicle-info {
  padding: 48px 20px 8px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.cxo-vehicle-title {
  font-size: 32px;
  font-family: var(--cxo-font-extrabold);
  font-weight: 800;
  line-height: 1.1em;
  letter-spacing: 0.02em;
}

.cxo-vehicle-title a {
  color: var(--cxo-accent-light);
  text-decoration: none;
  transition: color var(--cxo-transition);
}

.cxo-vehicle-title a:hover {
  color: var(--cxo-text-white);
}

.cxo-vehicle-anr {
  font-size: 12px;
  font-weight: 300;
  color: var(--cxo-text);
  letter-spacing: 0.02em;
}

/* Meta (EZ, KM, Leistung) */
.cxo-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  letter-spacing: 0.04em;
}

.cxo-meta-item {
  font-size: 16px;
  font-family: var(--cxo-font-light);
  font-weight: 300;
  color: var(--cxo-text);
  letter-spacing: 0.04em;
}

.cxo-meta-label {
  font-family: var(--cxo-font-bold);
  font-weight: 700;
  margin-right: 4px;
  letter-spacing: 0.04em;
}

/* Badges */
.cxo-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.cxo-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: var(--cxo-bg);
  border-radius: var(--cxo-radius-sm);
  font-size: 16px;
  font-family: var(--cxo-font-bold);
  font-weight: 700;
  color: var(--cxo-text);
  white-space: nowrap;
  letter-spacing: 0.04em;
}

.cxo-color-swatch {
  width: 18px;
  height: 18px;
  border-radius: 3px;
  border: 1px solid var(--cxo-border);
  flex-shrink: 0;
}

/* Price */
.cxo-vehicle-price {
  grid-column: 2;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 24px;
  padding: 8px 20px;
}

.cxo-price-label {
  text-align: right;
}

.cxo-price-label strong {
  display: block;
  font-size: 14px;
  font-weight: 700;
  color: var(--cxo-text);
}

.cxo-price-label small {
  font-size: 12px;
  font-weight: 300;
  color: var(--cxo-text);
  opacity: 0.8;
}

.cxo-price-value {
  font-size: 26px;
  font-family: var(--cxo-font-bold);
  font-weight: 700;
  color: var(--cxo-text-white);
  white-space: nowrap;
  letter-spacing: 0.24px;
}

/* Card Footer */
.cxo-card-footer {
  grid-column: 1 / -1;
  display: flex;
  justify-content: flex-end;
  padding: 8px 20px 16px;
  border-top: 1px solid var(--cxo-border-light);
}

/* ========== STICKY FILTER (Desktop) ========== */
@media (min-width: 769px) {
  .cxo-filter-section {
    position: sticky;
    top: 81px;
    z-index: 100;
    background: var(--cxo-bg);
    padding-bottom: 8px;
    padding-top: 1em;
    border-radius: 0;
  }
}

/* ========== INFINITE SCROLL ========== */
.cxo-scroll-sentinel {
  height: 1px;
  width: 100%;
}

.cxo-loading-more {
  text-align: center;
  padding: 24px 0;
  font-size: 14px;
  font-weight: 300;
  color: var(--cxo-text);
  opacity: 0.7;
  letter-spacing: 0.04em;
}

/* ========== SKELETON LOADING ========== */
.cxo-skeleton-card {
  border-radius: var(--cxo-radius);
  background: var(--cxo-card);
  border: 1px solid rgba(209, 218, 225, 0.12);
  overflow: hidden;
  animation: cxo-skeleton-pulse 1.8s ease-in-out infinite;
}

.cxo-vehicles:not(.cxo-view-grid) .cxo-skeleton-card {
  display: grid;
  grid-template-columns: 280px 1fr;
}

.cxo-skeleton-card .cxo-skeleton-image,
.cxo-skeleton-card .cxo-skeleton-line,
.cxo-skeleton-card .cxo-skeleton-badge,
.cxo-skeleton-card .cxo-skeleton-btn {
  background: var(--cxo-shimmer);
  background-size: 200% 100%;
  animation: cxo-skeleton-shimmer 1.5s ease-in-out infinite;
}

.cxo-skeleton-card .cxo-skeleton-image {
  width: 100%;
  height: 200px;
}

.cxo-skeleton-card .cxo-skeleton-line {
  height: 14px;
  border-radius: 7px;
  margin: 0 16px;
}

.cxo-skeleton-card .cxo-skeleton-line.short {
  width: 40%;
}
.cxo-skeleton-card .cxo-skeleton-line.medium {
  width: 65%;
}
.cxo-skeleton-card .cxo-skeleton-line.long {
  width: 85%;
}

.cxo-skeleton-card .cxo-skeleton-body {
  padding: 16px 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.cxo-skeleton-card .cxo-skeleton-badges {
  display: flex;
  gap: 8px;
  margin: 0 16px;
}

.cxo-skeleton-card .cxo-skeleton-badge {
  width: 60px;
  height: 24px;
  border-radius: 12px;
}

.cxo-skeleton-card .cxo-skeleton-btn {
  height: 40px;
  border-radius: var(--cxo-radius);
  margin: 4px 16px 16px;
}

@keyframes cxo-skeleton-shimmer {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

@keyframes cxo-skeleton-pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.7;
  }
}

/* ========== PAGER ========== */
.cxo-pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 16px 0;
}

.cxo-pager-btn {
  background: none;
  border: none;
  color: var(--cxo-accent-light);
  font-size: 22px;
  cursor: pointer;
  padding: 6px;
  line-height: 1;
  transition:
    transform var(--cxo-transition),
    opacity var(--cxo-transition);
  opacity: 0.7;
}

.cxo-pager-btn:hover {
  transform: scale(1.2);
  opacity: 1;
}

.cxo-pager-btn:disabled {
  opacity: 0.3;
  cursor: default;
  transform: none;
}

.cxo-pager-numbers {
  display: flex;
  gap: 12px;
}

.cxo-pager-num {
  font-size: 18px;
  font-weight: 300;
  color: var(--cxo-accent-light);
  cursor: pointer;
  padding: 4px 2px;
  border: none;
  border-bottom: 2px solid transparent;
  transition:
    color var(--cxo-transition),
    border-color var(--cxo-transition);
  background: none;
  font-family: var(--cxo-font);
}

.cxo-pager-num.active {
  color: var(--cxo-text-white);
  font-weight: 700;
  border-bottom-color: var(--cxo-text-white);
}

.cxo-pager-num:hover:not(.active) {
  color: var(--cxo-text-white);
}

/* ========== DETAIL VIEW ========== */
.cxo-detail-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 0;
}
.cxo-btn-details-link {
  margin-left: auto;
  color: var(--cxo-accent-light);
  font-family: var(--cxo-font-bold);
  font-weight: 700;
  letter-spacing: 0.04em;
}

.cxo-detail-content {
  background: var(--cxo-card);
  border-radius: var(--cxo-radius);
  overflow: hidden;
  animation: cxo-fadeUp 0.45s var(--cxo-transition) both;
}

.cxo-detail-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  padding: 24px 24px 16px;
  border-bottom: 1px solid var(--cxo-surface);
  background-color: var(--cxo-card);
}

.cxo-detail-title {
  font-size: 48px;
  font-family: var(--cxo-font-bold);
  font-weight: 700;
  color: var(--cxo-text);
  line-height: 1.3;
}

.cxo-detail-price {
  font-size: 28px;
  font-family: var(--cxo-font-bold);
  font-weight: 700;
  color: var(--cxo-text-white);
  white-space: nowrap;
}

.cxo-detail-body {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 32px;
}

/* Gallery */
.cxo-detail-gallery {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.cxo-gallery-slider {
  position: relative;
  width: 100%;
}

.cxo-gallery-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10;
  background: rgba(239, 225, 206, 0.25);
  color: var(--cxo-accent-light);
  border: none;
  width: 44px;
  height: 44px;
  border-radius: var(--cxo-radius);
  font-size: 24px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.5em 0.5em 0.25em;
  backdrop-filter: blur(8px);
  transition:
    background var(--cxo-transition),
    opacity var(--cxo-transition);
  opacity: 0.8;
}

.cxo-gallery-arrow:hover {
  background: rgba(23, 45, 64, 0.95);
  opacity: 1;
}

.cxo-gallery-arrow:disabled {
  opacity: 0.3;
  cursor: default;
}

.cxo-gallery-prev {
  left: 12px;
}
.cxo-gallery-next {
  right: 12px;
}

/* Hide gallery arrows on touch/mobile devices */
@media (max-width: 768px) {
  .cxo-gallery-arrow {
    display: none !important;
  }
}

/* Gallery main container */
.cxo-gallery-main {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--cxo-bg);
  border-radius: var(--cxo-radius-sm);
  overflow: hidden;
  position: relative;
  touch-action: pan-y pinch-zoom;
  contain: layout style;
}

.cxo-gallery-main img,
.cxo-gallery-main iframe {
  width: 100%;
  object-fit: contain;
  display: block;
}

/* Slide transition animation */
@keyframes cxo-slide-in-right {
  from { opacity: 0; transform: translateX(40px); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes cxo-slide-in-left {
  from { opacity: 0; transform: translateX(-40px); }
  to   { opacity: 1; transform: translateX(0); }
}

.cxo-gallery-main.cxo-slide-right > * {
  animation: cxo-slide-in-right 0.3s cubic-bezier(0.4, 0, 0.2, 1) both;
}
.cxo-gallery-main.cxo-slide-left > * {
  animation: cxo-slide-in-left 0.3s cubic-bezier(0.4, 0, 0.2, 1) both;
}

.cxo-gallery-placeholder {
  color: var(--cxo-text);
  opacity: 0.5;
  font-size: 16px;
  padding: 48px;
}

.cxo-gallery-thumbs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

/* ===== SCROLL THUMBS VARIANT ===== */
.cxo-gallery-thumbs.cxo-thumbs-scroll {
  display: flex;
  flex-wrap: nowrap;
  overflow-x: auto;
  overflow-y: hidden;
  gap: 10px;
  padding: 12px 24px;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: #a799ff #efe1ce;
  /* Fade edges */
  mask-image: linear-gradient(to right, transparent 0%, black 32px, black calc(100% - 32px), transparent 100%);
  -webkit-mask-image: linear-gradient(to right, transparent 0%, black 32px, black calc(100% - 32px), transparent 100%);
}

/* Always show scrollbar on desktop */
@media (min-width: 769px) {
  .cxo-gallery-thumbs.cxo-thumbs-scroll {
    overflow-x: scroll;
  }
}

.cxo-gallery-thumbs.cxo-thumbs-scroll::-webkit-scrollbar {
  height: 6px;
}

.cxo-gallery-thumbs.cxo-thumbs-scroll::-webkit-scrollbar-track {
  background: #efe1ce;
  border-radius: 99px;
  margin: 0 24px;
}

.cxo-gallery-thumbs.cxo-thumbs-scroll::-webkit-scrollbar-thumb {
  background: linear-gradient(135deg, #a799ff, #8a79e6);
  border-radius: 99px;
  transition: background 0.2s ease;
}

.cxo-gallery-thumbs.cxo-thumbs-scroll::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(135deg, #8a79e6, #7060d0);
}

/* Scroll variant: all thumbs always visible, no row limit */
.cxo-gallery-thumbs.cxo-thumbs-scroll .cxo-gallery-thumb-wrap {
  flex: 0 0 auto;
  width: 140px;
}

.cxo-gallery-thumbs.cxo-thumbs-scroll .cxo-gallery-thumb-wrap:nth-child(n + 17) {
  display: block !important;
}

.cxo-gallery-thumbs.cxo-thumbs-scroll .cxo-thumb-img {
  width: 140px;
  height: 140px;
  object-fit: cover;
}

.cxo-gallery-thumbs.cxo-thumbs-scroll .cxo-thumb-video-placeholder {
  width: 140px;
  height: 140px;
}

.cxo-gallery-thumbs.cxo-thumbs-scroll .cxo-gallery-thumb-wrap:hover,
.cxo-gallery-thumbs.cxo-thumbs-scroll .cxo-gallery-thumb-wrap.cxo-thumb-active {
  transform: scale(1.05);
  border-color: #a799ff;
}

/* Thumb scroll arrow navigation – desktop only */
.cxo-thumbs-scroll-wrapper {
  position: relative;
}

.cxo-thumb-arrow {
  display: none;
}

@media (min-width: 769px) {
  .cxo-thumb-arrow {
    display: flex;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
    background: rgba(239, 225, 206, 0.25);
    color: var(--cxo-accent-light);
    border: none;
    width: 44px;
    height: 44px;
    border-radius: var(--cxo-radius);
    font-size: 24px;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    padding: 0.5em 0.5em 0.25em;
    backdrop-filter: blur(8px);
    opacity: 0;
    pointer-events: none;
    transition: background var(--cxo-transition), opacity var(--cxo-transition);
  }
  .cxo-thumbs-scroll-wrapper:hover .cxo-thumb-arrow {
    opacity: 0.8;
    pointer-events: auto;
  }
  .cxo-thumb-arrow:hover {
    background: rgba(23, 45, 64, 0.95);
    opacity: 1;
  }
  .cxo-thumb-arrow-prev {
    left: 0;
  }
  .cxo-thumb-arrow-next {
    right: 0;
  }
}

@media (max-width: 768px) {
  .cxo-gallery-thumbs.cxo-thumbs-scroll .cxo-gallery-thumb-wrap {
    width: 110px;
  }
  .cxo-gallery-thumbs.cxo-thumbs-scroll .cxo-thumb-img,
  .cxo-gallery-thumbs.cxo-thumbs-scroll .cxo-thumb-video-placeholder {
    width: 110px;
    height: 80px;
  }
  .cxo-gallery-thumbs.cxo-thumbs-scroll .cxo-gallery-thumb-wrap:nth-child(n + 13) {
    display: block !important;
  }
}

/* Desktop: max 4 rows (4 cols × 4 = 16 items) */
.cxo-gallery-thumbs:not(.cxo-thumbs-expanded) .cxo-gallery-thumb-wrap:nth-child(n + 17) {
  display: none;
}

.cxo-gallery-thumbs img {
  width: 100%;
  object-fit: cover;
  cursor: pointer;
  border: 2px solid transparent;
  border-radius: var(--cxo-radius-sm);
  transition:
    border-color var(--cxo-transition),
    transform var(--cxo-transition);
}

.cxo-gallery-thumbs img:hover {
  border-color: var(--cxo-accent-light);
  transform: scale(1.05);
}

.cxo-btn-more-thumbs {
  display: none;
  background: none;
  color: var(--cxo-accent-light);
  border: none;
  border-top: 1px solid var(--cxo-border);
  width: 100%;
  justify-content: center;
  margin-top: 4px;
  font-family: var(--cxo-font-light);
  font-weight: 300;
  letter-spacing: 0.04em;
  padding: 0.7em 1.5em 0.5em;
  font-size: 16px;
  cursor: pointer;
  transition: color var(--cxo-transition);
}

/* Similar vehicles section */
.cxo-similar-vehicles {
  margin-top: 2em;
  padding-top: 1em;
}

.cxo-similar-grid {
  grid-template-columns: repeat(4, 1fr) !important;
}

@media (max-width: 960px) {
  .cxo-similar-grid {
    grid-template-columns: repeat(3, 1fr) !important;
  }
}

@media (max-width: 768px) {
  .cxo-similar-grid {
    grid-template-columns: 1fr !important;
  }
}

/* Specs & Description */
.cxo-detail-specs h3,
.cxo-detail-description h3,
.cxo-detail-section h3,
.cxo-section-title {
  font-size: 32px;
  font-family: var(--cxo-font-light);
  font-weight: 300;
  color: var(--cxo-text);
  margin-bottom: 1em;
  margin-top: 2em;
}

.cxo-detail-section {
  margin-bottom: 6em;
}

.cxo-specs-list {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px 24px;
}

.cxo-spec-row {
  display: flex;
  gap: 8px;
  padding: 8px 0;
  border-bottom: 1px solid var(--cxo-border-light);
}

.cxo-spec-row dt {
  font-weight: 700;
  font-family: var(--cxo-font-bold);
  font-size: 21px;
  letter-spacing: 0.04em;
  color: var(--cxo-text-white);
  white-space: nowrap;
}

.cxo-spec-row dd {
  font-size: 21px;
  letter-spacing: 0.04em;
  color: var(--cxo-text);
  font-family: var(--cxo-font-light);
  font-weight: 300;
}

.cxo-spec-row.cxo-spec-bool dd {
  color: #EFE1CE;
}

.cxo-description-text {
  font-size: 21px;
  line-height: 1.7;
  letter-spacing: 0.04em;
  color: var(--cxo-text);
}

.cxo-description-text ul { padding-left: 1.5em; margin: 0.5em 0; }
.cxo-description-text li { margin-bottom: 0.3em; }
.cxo-description-text hr { border: none; border-top: 1px solid var(--cxo-border); margin: 1em 0; }
.cxo-description-text p { margin-bottom: 0.5em; }

/* MwSt */
.cxo-detail-mwst {
  font-size: 14px;
  font-weight: 300;
  color: var(--cxo-text);
  opacity: 0.8;
}

/* 360° */
.cxo-360-link {
  color: var(--cxo-accent-light);
  word-break: break-all;
  font-size: 16px;
}

/* Highlights */
.cxo-highlights-list {
  list-style: none;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.cxo-highlight {
  background: var(--cxo-surface);
  padding: 8px 16px;
  border-radius: var(--cxo-radius-sm);
  font-size: 16px;
  color: var(--cxo-accent-light);
  font-weight: 700;
}

/* Gallery thumbs with video support */
.cxo-gallery-thumb-wrap {
  cursor: pointer;
  border: 2px solid transparent;
  border-radius: var(--cxo-radius-sm);
  overflow: hidden;
  transition: border-color var(--cxo-transition), transform var(--cxo-transition);
}

.cxo-gallery-thumb-wrap:hover,
.cxo-gallery-thumb-wrap.cxo-thumb-active {
  border-color: var(--cxo-accent-light);
  transform: scale(1.05);
}

.cxo-thumb-img {
  width: 100%;
  height: 60px;
  object-fit: cover;
  display: block;
}

@media (min-width: 769px) {
  .cxo-gallery-thumbs img {
    height: 140px !important;
  }
.cxo-thumb-img {
    height: 140px !important;
  }
  .cxo-thumb-video-placeholder {
    height: 140px !important;
  }
}

.cxo-thumb-video-placeholder {
  width: 100%;
  height: 60px;
  background: var(--cxo-bg);
  background-size: cover;
  background-position: center;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cxo-thumb-play {
  font-size: 24px;
  color: var(--cxo-accent-light);
}

.cxo-gallery-counter {
  text-align: center;
  font-size: 13px;
  font-weight: 300;
  color: var(--cxo-text);
  opacity: 0.7;
  padding: 4px 0;
}

/* Gallery Overlay – removed (no longer used) */

/* ========== MOBILE FILTER FAB ========== */
.cxo-filter-fab {
  display: none;
}

/* ========== RESPONSIVE ========== */
@media (max-width: 960px) {
  .cxo-filter-grid {
    grid-template-columns: repeat(4, 1fr);
  }
  .cxo-vehicle-card {
    grid-template-columns: 240px 1fr;
  }
  .cxo-vehicle-title {
    font-size: 20px;
  }
  .cxo-price-value {
    font-size: 22px;
  }
  .cxo-detail-title {
    font-size: 24px;
  }
  .cxo-detail-price {
    font-size: 24px;
  }
}

@media (max-width: 768px) {
  .cxo-wrapper {
    padding: 0;
  }

  /* Sticky FAB */
  .cxo-filter-fab {
    display: flex;
    align-items: center;
    justify-content: center;
    position: fixed;
    top: 96px;
    right: 16px;
    z-index: 1000;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: none;
    background: var(--cxo-accent-light);
    color: #4b4573;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
    transition:
      background var(--cxo-transition),
      transform var(--cxo-transition);
  }

  .cxo-filter-fab:hover {
    background: var(--cxo-accent-hover);
    transform: scale(1.08);
  }

  /* Collapsed filter */
  .cxo-filter-section {
    display: none;
  }

  .cxo-filter-section.cxo-filter-open {
    display: block;
    animation: cxo-fadeUp 0.3s ease both;
  }

  .cxo-filter-grid {
    grid-template-columns: 1fr 1fr;
  }

  .cxo-vehicle-card {
    grid-template-columns: 1fr;
  }

  .cxo-vehicle-image {
    grid-row: auto;
  }

  .cxo-vehicle-image img {
    min-height: 200px;
    max-height: 260px;
  }

  .cxo-vehicle-price {
    grid-column: 1;
    justify-content: space-between;
  }

  .cxo-card-footer {
    justify-content: stretch;
  }

  .cxo-card-footer .cxo-btn-detail {
    width: 100%;
    justify-content: center;
  }

  /* Detail responsive */
  .cxo-detail-header {
    flex-direction: column;
    align-items: flex-start;
    padding: 16px;
  }

  .cxo-detail-body {
    padding: 16px;
  }

  .cxo-specs-list {
    grid-template-columns: 1fr;
  }

  /* Thumbs: 3 columns, max 4 rows visible (12 items) */
  .cxo-gallery-thumbs {
    grid-template-columns: repeat(3, 1fr);
  }

  .cxo-gallery-thumbs:not(.cxo-thumbs-expanded) .cxo-gallery-thumb-wrap:nth-child(n + 13) {
    display: none;
  }
}

@media (max-width: 480px) {
  .cxo-filter-grid {
    grid-template-columns: 1fr;
  }
  .cxo-vehicle-title {
    font-size: 18px;
  }
  .cxo-badge {
    font-size: 12px;
    padding: 4px 10px;
  }
  .cxo-card-meta {
    flex-direction: column;
    gap: 4px;
  }
  .cxo-detail-title {
    font-size: 20px;
  }
  .cxo-detail-price {
    font-size: 20px;
  }
}

/* ========== GRID (TILE) VIEW – Desktop ========== */
.cxo-vehicles.cxo-view-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--cxo-gap);
}

.cxo-vehicles.cxo-view-grid .cxo-vehicle-card {
  grid-template-columns: 1fr;
  grid-template-rows: auto auto auto auto;
}

.cxo-vehicles.cxo-view-grid .cxo-vehicle-image {
  grid-row: auto;
}

.cxo-vehicles.cxo-view-grid .cxo-vehicle-image img {
  min-height: 160px;
  max-height: 220px;
}

.cxo-vehicles.cxo-view-grid .cxo-vehicle-info {
  padding: 12px 16px 8px;
}

.cxo-vehicles.cxo-view-grid .cxo-vehicle-title {
  font-size: 16px;
}

.cxo-vehicles.cxo-view-grid .cxo-vehicle-price {
  grid-column: 1;
  justify-content: space-between;
  padding: 8px 16px;
}

.cxo-vehicles.cxo-view-grid .cxo-price-value {
  font-size: 18px;
}

.cxo-vehicles.cxo-view-grid .cxo-card-footer {
  justify-content: stretch;
}

.cxo-vehicles.cxo-view-grid .cxo-card-footer .cxo-btn-detail {
  width: 100%;
  justify-content: center;
  font-size: 14px;
}

.cxo-vehicles.cxo-view-grid .cxo-badge {
  font-size: 12px;
  padding: 4px 8px;
}

.cxo-vehicles.cxo-view-grid .cxo-card-meta {
  flex-direction: column;
  gap: 2px;
}

.cxo-vehicles.cxo-view-grid .cxo-meta-item {
  font-size: 13px;
}

@media (max-width: 960px) {
  .cxo-vehicles.cxo-view-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 768px) {
  .cxo-vehicles.cxo-view-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ========== SWIPE VIEW – Card Stack ========== */
.cxo-swipe-container {
  display: none;
  position: relative;
  width: 100%;
  min-height: 620px;
  overflow: hidden;
  touch-action: pan-y;
}

.cxo-swipe-container.cxo-swipe-active ~ .cxo-loading-more,
.cxo-swipe-active ~ #cxo-loading-more {
  display: none !important;
}

.cxo-swipe-container.cxo-swipe-active {
  display: block;
}

.cxo-swipe-track {
  position: relative;
  width: 100%;
  margin: 0 auto;
  min-height: 520px;
}

.cxo-stack-card {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  transform-origin: center bottom;
  will-change: transform, opacity;
}

.cxo-stack-card .cxo-vehicle-card {
  grid-template-columns: 1fr;
  pointer-events: auto;
  border-radius: var(--cxo-radius);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.cxo-stack-card .cxo-vehicle-image {
  grid-row: auto;
}

.cxo-stack-card .cxo-vehicle-image img {
  min-height: 220px;
  max-height: 340px;
}

.cxo-stack-card .cxo-vehicle-price {
  grid-column: 1;
  justify-content: space-between;
}

.cxo-stack-card .cxo-card-footer {
  justify-content: stretch;
}

.cxo-stack-card .cxo-card-footer .cxo-btn-detail {
  width: 100%;
  justify-content: center;
}

.cxo-swipe-counter {
  text-align: left;
  font-size: 12px;
  font-weight: 300;
  color: var(--cxo-text);
  opacity: 0.7;
  padding: 32px 0 8px;
  position: relative;
  z-index: 40;
}


/* ========== FLOATING CTA BUTTON ========== */
.cxo-floating-cta {
  display: none;
  position: sticky;
  bottom: 2em;
  z-index: 9999;
  width: fit-content;
  margin: 1em auto 0;
  background: var(--cxo-accent-light);
  color: var(--cxo-text-dark);
  font-family: var(--cxo-font-bold);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 0.85em 2.2em 0.7em;
  border-radius: 100px;
  text-decoration: none;
  white-space: nowrap;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.35), 0 0 0 0 var(--cxo-accent-glow);
  transition: background var(--cxo-transition), transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow var(--cxo-transition), opacity 0.4s ease;
  opacity: 0;
  pointer-events: none;
  cursor: pointer;
}

.cxo-floating-cta.cxo-cta-visible {
  display: block;
  opacity: 1;
  pointer-events: auto;
}

.cxo-floating-cta:hover {
  background: var(--cxo-accent-hover);
  color: var(--cxo-text-dark);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45), 0 0 20px var(--cxo-accent-glow);
  transform: translateY(-2px);
}

.cxo-floating-cta:active {
  transform: translateY(0);
}

@media (max-width: 768px) {
  .cxo-floating-cta {
    font-size: 14px;
    padding: 0.75em 1.6em 0.6em;
    max-width: calc(100% - 2em);
    text-align: center;
  }
}

/* ========== ANIMATION ========== */
@keyframes cxo-fadeUp {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
