/* Preserve the ZIP's visual design while sharing Odoo's native page chrome. */
.tm-catalog-page{background:#f3f4f5}
.tm-catalog-page #wrap{background:#f3f4f5;min-height:80vh}
.tm-catalog-page .tm-catalog-wrap{width:min(1480px,calc(100% - 48px));margin:0 auto;padding:0 0 64px}
.tm-catalog-page .tm-catalog-wrap [hidden]{display:none!important}
.tm-catalog-page .component-grid[hidden],.tm-catalog-page .catalog-pagination[hidden]{display:none!important}
.tm-catalog-page .system-tabs .tm-tab-count{margin-left:5px;opacity:.65;font-size:10px}
.tm-catalog-page .tm-card-link{display:block;height:100%;color:inherit;text-decoration:none}
.tm-catalog-page .tm-card-link:hover{color:inherit;text-decoration:none}
.tm-catalog-page .component-visual img{position:absolute;z-index:2;inset:0;width:100%;height:100%;object-fit:contain;padding:16px;background:#fafafa}
.tm-catalog-page .component-card footer span{font-size:22px;color:var(--red)}
.tm-catalog-page .tm-card-desc{min-height:0!important;margin-top:8px!important;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;overflow:hidden}
.tm-catalog-page .tm-catalog-status{padding:9px 3px;color:#777f87;font-size:12px}
.tm-catalog-page .tm-catalog-status:empty{display:none}
/* All category choices share the same left/right edges, including nested ones. */
.tm-catalog-page #categoryFilter .category-option{
  margin-inline:0;
  width:100%;
  box-sizing:border-box;
}
.tm-catalog-page .tm-detail-sections{margin-top:24px}
.tm-catalog-page .tm-detail-sections article{min-width:0}
.tm-catalog-page .tm-detail-sections .tm-public-html{line-height:1.7;font-size:14px}
.tm-catalog-page .tm-ficha-hint{margin-top:22px;font-size:12px;color:#68717c}
.tm-catalog-page .tm-return-catalog{display:inline-block;margin-top:18px;text-decoration:none;color:#d9002b;font-weight:750}
.tm-catalog-page #mainPhoto img{position:absolute;inset:0;width:100%;height:100%;object-fit:contain;z-index:2;background:#181a1e;padding:14px}
.tm-catalog-page .tm-dtc-entry{display:grid;grid-template-columns:minmax(70px,110px) 1fr;gap:12px;border-bottom:1px solid #e4e6e9;padding:11px 0;font-size:13px}
.tm-catalog-page .tm-dtc-entry strong{color:#d9002b}
.tm-catalog-page .tm-dtc-entry small{grid-column:2;color:#89919a}
.tm-catalog-page .tm-vehicle-list{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
.tm-catalog-page .tm-vehicle-entry{padding:12px;background:#f3f4f5;border-radius:7px;font-size:13px}
.tm-catalog-page .tm-gallery-list{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px}
.tm-catalog-page .tm-gallery-list figure{margin:0}
.tm-catalog-page .tm-gallery-list img,.tm-catalog-page .tm-public-step img{display:block;max-width:100%;max-height:290px;object-fit:contain;border-radius:8px}
.tm-catalog-page .tm-gallery-list figcaption{padding:6px 0;color:#6b727a;font-size:11px}
.tm-catalog-page .tm-public-step{margin-top:20px;border-top:1px solid #e5e7ea;padding-top:16px}
.tm-catalog-page .tm-public-step h3{font-size:17px}
@media(max-width:1000px){.tm-catalog-page .tm-catalog-wrap{width:calc(100% - 32px)}}
@media(max-width:650px){.tm-catalog-page .tm-catalog-wrap{width:calc(100% - 24px)}.tm-catalog-page .tm-vehicle-list,.tm-catalog-page .tm-gallery-list{grid-template-columns:1fr}.tm-catalog-page .product-copy h1{font-size:clamp(36px,10vw,56px)}.tm-catalog-page .catalog-hero{padding:28px 22px}.tm-catalog-page .system-tabs{scroll-snap-type:x proximity}.tm-catalog-page .system-tabs button{scroll-snap-align:start}}

.tm-catalog-page .tm-catalog-preview{margin:5px 0 22px;padding:12px 16px;border-left:3px solid #e3032e;background:#fff4f6;color:#4e3038;font-weight:650;font-size:12px;border-radius:5px}
.tm-catalog-page .tm-catalog-preview[hidden]{display:none}

/* Equal-width technical cards: faults / DTC; vehicles / references. */
.tm-catalog-page .technical-grid.tm-detail-sections {
  grid-template-columns:repeat(2,minmax(0,1fr));
  align-items:stretch;
}
.tm-catalog-page .tm-detail-sections article {min-width:0;}
.tm-catalog-page #referenceList.reference-list {
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:7px;
  max-height:530px;
  overflow-y:auto;
  align-content:start;
  scrollbar-width:thin;
}
.tm-catalog-page #referenceList span {
  min-width:0;
  overflow-wrap:anywhere;
  padding:10px 7px;
  font-size:10px;
  text-align:center;
}
/* Conventional page number navigation with first, last and nearby pages. */
.tm-catalog-page .catalog-pagination {
  display:flex;
  align-items:center;
  justify-content:center;
  gap:7px;
  flex-wrap:wrap;
  padding:26px 12px 8px;
}
.tm-catalog-page .catalog-pagination > .tm-page-numbers {
  display:flex;align-items:center;justify-content:center;gap:6px;flex-wrap:wrap;
  width:auto;height:auto;min-width:0;padding:0;
  border:0;border-radius:0;background:transparent;
}
.tm-catalog-page .results {position:relative;z-index:2}
.tm-catalog-page .catalog-explainer {position:relative;z-index:1}
.tm-catalog-page .catalog-pagination button {
  min-width:42px;height:42px;border-radius:9px;
  border:1px solid #dbe0e7;background:#fff;color:#111827;
  font-size:14px;font-weight:700;padding:0 10px;cursor:pointer;
}
.tm-catalog-page .catalog-pagination button.is-current,
.tm-catalog-page .catalog-pagination button[aria-current="page"] {
  background:#ed0032;color:#fff;border-color:#ed0032;
}
.tm-catalog-page .catalog-pagination button:disabled {opacity:.35;cursor:default}
.tm-catalog-page .tm-page-ellipsis {padding:0 4px;color:#6a7280;font-weight:700}
.tm-catalog-page .tm-gallery-stage {
  display:grid;grid-template-columns:48px minmax(0,1fr) 48px;align-items:center;gap:12px;
  background:#f4f5f6;border-radius:12px;padding:16px;
  min-height:300px;
}
.tm-catalog-page .tm-gallery-stage img {
  display:block;width:100%;height:370px;max-height:50vh;object-fit:contain;
  border-radius:10px;
}
.tm-catalog-page .tm-gallery-arrow {
  width:42px;height:42px;border-radius:50%;background:#fff;
  border:1px solid #d7dce3;color:#111;font-size:23px;cursor:pointer;
}
.tm-catalog-page .tm-gallery-arrow:hover {background:#ec0033;color:#fff;border-color:#ec0033}
.tm-catalog-page .tm-gallery-caption {display:flex;justify-content:space-between;gap:12px;padding:13px 4px;font-size:12px;color:#566170}
.tm-catalog-page .tm-gallery-thumbnails {
  display:flex;gap:10px;overflow-x:auto;padding:6px 1px 12px;scroll-snap-type:x proximity;
}
.tm-catalog-page .tm-gallery-thumb {
  flex:0 0 86px;height:76px;padding:5px;border-radius:9px;
  border:2px solid #dfe3e8;background:#fff;cursor:pointer;scroll-snap-align:center;
}
.tm-catalog-page .tm-gallery-thumb.is-active {border-color:#ed0032}
.tm-catalog-page .tm-gallery-thumb img {width:100%;height:100%;object-fit:contain}
@media (max-width:1100px) {
  .tm-catalog-page #referenceList.reference-list {grid-template-columns:repeat(2,minmax(0,1fr))}
  .tm-catalog-page .tm-detail-sections article {padding:30px 24px}
}
@media (max-width:750px) {
  .tm-catalog-page .technical-grid.tm-detail-sections {grid-template-columns:1fr}
  .tm-catalog-page .tm-gallery-stage {grid-template-columns:34px minmax(0,1fr) 34px;gap:5px;padding:8px}
  .tm-catalog-page .tm-gallery-arrow {width:32px;height:32px;font-size:19px}
  .tm-catalog-page .tm-gallery-stage img {height:290px}
}

/* Component identity is server-seeded so transient API downtime does not blank the page. */
.tm-catalog-page .tm-detail-feedback {
  display:flex;align-items:center;justify-content:space-between;
  gap:18px;padding:12px 18px;margin:12px 0;
  border:1px solid #e5bdc5;border-left:3px solid #ed0032;
  border-radius:7px;background:#fff5f6;color:#423139;font-size:13px;
}
.tm-catalog-page .tm-detail-feedback[hidden] {display:none!important}
.tm-catalog-page .tm-detail-feedback button {
  flex-shrink:0;cursor:pointer;background:#ed0032;border:0;color:#fff;
  padding:10px 16px;border-radius:7px;font-weight:700;
}
.tm-catalog-page #mainPhoto .tm-photo-state {
  position:absolute;bottom:22px;left:16px;right:16px;z-index:5;
  display:block;text-align:center;color:#c7cdd3;font-size:12px;
  background:#15191dcb;padding:8px;border-radius:6px;
}
@media(max-width:650px) {
 .tm-catalog-page .tm-detail-feedback {flex-direction:column;align-items:stretch}
}

/* Unified component image viewer: main image, carousel controls and thumbnails
   all live in the hero area. No separate gallery section appears below. */
.tm-catalog-page .tm-hero-gallery .photo-placeholder { min-height:380px; }
.tm-catalog-page .tm-hero-gallery #galleryMainImage {
  z-index:3;position:absolute;inset:0;width:100%;height:100%;
  max-height:none;object-fit:contain;padding:18px;background:#f9fafb;
}
.tm-catalog-page .tm-hero-gallery #galleryMainImage[hidden] {display:none!important}
.tm-catalog-page .tm-hero-gallery #mainPhoto .tm-gallery-arrow {
  position:absolute;top:50%;transform:translateY(-50%);z-index:6;
  width:42px;height:42px;border-radius:50%;background:#fffffff2;
  border:1px solid #d8dde3;color:#111;box-shadow:0 2px 10px #0002;
  font-size:21px;display:grid;place-items:center;padding:0;
}
.tm-catalog-page .tm-hero-gallery #mainPhoto .tm-gallery-arrow[hidden] {display:none!important}
.tm-catalog-page .tm-hero-gallery #mainPhoto .tm-gallery-arrow:hover {
  background:#ed0032;border-color:#ed0032;color:#fff;
}
.tm-catalog-page .tm-hero-prev {left:15px}
.tm-catalog-page .tm-hero-next {right:15px}
.tm-catalog-page .tm-hero-gallery .tm-gallery-caption {
  display:flex;justify-content:space-between;align-items:center;
  color:#bbc2ca;padding:10px 3px 1px;font-size:11px;min-height:26px;
}
.tm-catalog-page .tm-hero-gallery .tm-gallery-thumbnails {
  display:flex;gap:9px;overflow-x:auto;padding:10px 2px 8px;
  scroll-snap-type:x proximity;max-width:100%;scrollbar-width:thin;
}
.tm-catalog-page .tm-hero-gallery .tm-gallery-thumb {
  flex:0 0 76px;height:64px;background:#fff;border:2px solid #555e69;
  border-radius:8px;padding:3px;cursor:pointer;scroll-snap-align:center;
}
.tm-catalog-page .tm-hero-gallery .tm-gallery-thumb.is-active {border-color:#ed0032}
.tm-catalog-page .tm-hero-gallery .tm-gallery-thumb img {
  display:block;width:100%;height:100%;object-fit:contain;
}
.tm-catalog-page .tm-hero-gallery .gallery-note {
  padding-top:15px;flex-wrap:wrap;
}
@media(max-width:700px) {
  .tm-catalog-page .tm-hero-gallery .photo-placeholder {min-height:310px}
  .tm-catalog-page .tm-hero-gallery #mainPhoto .tm-gallery-arrow {
    width:34px;height:34px;font-size:18px;
  }
  .tm-catalog-page .tm-hero-gallery #galleryMainImage {padding:8px}
}

/* Keep the entire gallery (including thumbnails) in view on a normal laptop. */
.tm-catalog-page .tm-hero-gallery {
  min-height:0;
  padding:22px 24px;
  gap:6px;
}
.tm-catalog-page .tm-hero-gallery .photo-placeholder {
  flex:none;
  min-height:0;
  height:clamp(270px,42vh,420px);
}
.tm-catalog-page .tm-hero-gallery .tm-gallery-caption {min-height:22px;padding:5px 3px 0}
.tm-catalog-page .tm-hero-gallery .tm-gallery-thumbnails {padding:5px 2px 5px}
.tm-catalog-page .tm-hero-gallery .gallery-note {padding-top:10px}
@media(max-width:700px) {
  .tm-catalog-page .tm-hero-gallery {padding:14px;gap:3px}
  .tm-catalog-page .tm-hero-gallery .photo-placeholder {
    height:clamp(220px,38vh,310px);
    min-height:0;
  }
}

/* Give product photos more visual presence without stretching or cropping
   the source photos. Keep the arrows and thumbnails in the same viewer. */
.tm-catalog-page .tm-hero-gallery .photo-placeholder {
  flex: 0 0 auto;
  height: clamp(310px, 50vh, 460px);
  min-height: 0;
}
.tm-catalog-page .tm-hero-gallery #galleryMainImage {
  padding: 0;
  transform: scale(1.10);
  transform-origin: center;
}
@media (max-width: 700px) {
  .tm-catalog-page .tm-hero-gallery .photo-placeholder {
    height: clamp(250px, 39vh, 335px);
  }
  .tm-catalog-page .tm-hero-gallery #galleryMainImage {
    transform: scale(1.04);
  }
}

/* Square catalogue photographs: use a square stage instead of a landscape
   viewport and never zoom/crop the source image. */
.tm-catalog-page .tm-hero-gallery .photo-placeholder {
  flex: 0 0 auto;
  width: 100%;
  height: auto;
  min-height: 0;
  aspect-ratio: 1 / 1;
}
.tm-catalog-page .tm-hero-gallery #galleryMainImage {
  transform: none;
  padding: 0;
  object-fit: contain;
}
@media (max-width: 700px) {
  .tm-catalog-page .tm-hero-gallery .photo-placeholder {
    height: auto;
    aspect-ratio: 1 / 1;
  }
  .tm-catalog-page .tm-hero-gallery #galleryMainImage {
    transform: none;
  }
}

/* Igual que referencias: limitar la altura de vehículos compatibles cuando
   existen muchos, manteniendo dos columnas y desplazamiento independiente. */
.tm-catalog-page #vehiclesList.tm-vehicle-list {
  max-height: 530px;
  overflow-y: auto;
  align-content: start;
  scrollbar-width: thin;
  overscroll-behavior-y: contain;
  padding-right: 6px;
}

/* Navegación entre FICHAS, distinta de las flechas de la galería de fotos. */
.tm-catalog-page .tm-record-navigation {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; flex-wrap: wrap; margin: 0 0 14px;
}
.tm-catalog-page .tm-record-navigation a {
  display: inline-flex; align-items: center; gap: 7px;
  min-height: 40px; padding: 9px 15px; border: 1px solid #d7dce2;
  border-radius: 8px; background: #fff; color: #14171b;
  font-weight: 750; text-decoration: none; font-size: 13px;
  transition: border-color .15s, background .15s;
}
.tm-catalog-page .tm-record-navigation a:hover,
.tm-catalog-page .tm-record-navigation a:focus-visible {
  border-color: #e3032e; background: #fff7f9; color: #b80025;
}
.tm-catalog-page .tm-record-navigation a:last-child { margin-left: auto; }
.tm-catalog-page .tm-record-navigation #catalogRecordNavLabel {
  font-size: 12px; color: #78818c;
}
.tm-catalog-page .tm-editor-preview {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 12px; padding: 15px 20px;
  margin-bottom: 15px; border-radius: 9px;
  background: #dff4fa; border: 1px solid #b9e4f0;
  color: #064353; font-size: 13px;
}
.tm-catalog-page .tm-editor-preview strong { font-weight: 800; }
.tm-catalog-page .tm-editor-preview a {
  color: #005c70; font-weight: 850; text-decoration: none;
  border-bottom: 1px solid currentColor;
}
.tm-catalog-page .tm-editor-preview a:hover { color: #e3032e; }
.tm-catalog-page .tm-editor-preview[hidden],
.tm-catalog-page .tm-record-navigation[hidden],
.tm-catalog-page .tm-record-navigation a[hidden] { display: none!important; }
@media (max-width: 650px) {
  .tm-catalog-page .tm-record-navigation { gap: 7px; }
  .tm-catalog-page .tm-record-navigation a { font-size: 12px; padding: 9px 11px; }
  .tm-catalog-page .tm-record-navigation #catalogRecordNavLabel { display: none; }
  .tm-catalog-page .tm-editor-preview { align-items: flex-start; flex-direction: column; }
}

/* Directly request a repair without losing the selected catalogue item. */
.tm-catalog-request{display:inline-flex;align-items:center;justify-content:center;text-decoration:none;background:#c8143e;color:#fff !important;font-weight:800;border-radius:9px;padding:14px 18px;margin:13px 0;min-height:49px;max-width:100%;text-align:center}
.tm-catalog-request:hover{background:#a50b2f;color:#fff !important}

/* Compact actions: no horizontal overflow or cramped secondary link. */
.tm-catalog-detail-actions{display:flex;align-items:center;gap:14px;flex-wrap:wrap;margin-top:16px}
.tm-catalog-detail-actions .tm-catalog-request{margin:0;white-space:normal}
.tm-catalog-detail-actions .tm-return-catalog{display:inline-flex;align-items:center;margin:0;white-space:normal;padding:8px 2px}
@media(max-width:540px){
.tm-catalog-detail-actions{align-items:stretch;flex-direction:column;gap:10px}
.tm-catalog-detail-actions .tm-catalog-request{width:100%}
.tm-catalog-detail-actions .tm-return-catalog{justify-content:center}
}
