#detalleRoot{
  display:grid;
  gap:24px;
  align-items:start;
}

/* Que nada fuerce ancho (tu fix clave) */
#detalleRoot,
#detalleRoot *{
  min-width:0;
}


#detalleRoot h3{
  margin:0 0 12px;
  font-size:0.95rem;
  text-transform:uppercase;
  letter-spacing:0.8px;
  opacity:0.75;
}

/* 
.sidebar {
  visibility:hidden;
}
*/

/* Cards */
.card{
  padding:10px;
  margin:0;
}

/* ===============================
   Carrusel / imagen (arriba)
   =============================== */

.detalle-carousel{
  max-width:900px;   
  margin:0 auto;      /* la centra */
}


.detalle-hero-img img{
  width:100%;
  height:auto;
  display:block;
  object-fit:contain;
}

.detalle-hero-img{
  border-radius:12px;
  overflow:hidden;
  background:var(--color-surface);
  box-shadow:var(--shadow-card-light);
}


/* Thumbnails */
.detalle-thumbs{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
}

.detalle-thumb{
  padding:0;
  border:0;
  background:transparent;
  flex:0 0 auto;
}

.detalle-thumb img{
  width:72px;
  height:56px;
  display:block;
  object-fit:cover;
}


.detalle-descripcion {
  margin: 16px auto;
  max-width: 1100px;
}

.detalle-descripcion p {
  margin: 0;
  line-height: 1.5;
  white-space: pre-line;
}


/* ===============================
   Contenido en 2 columnas iguales
   =============================== */

.detalle-content{
  display:grid;
  grid-template-columns:repeat(2, 1fr);
  gap:24px;
}

@media (max-width:900px){
  .detalle-content{
    grid-template-columns:1fr;
  }

  .detalle-thumb img{
    width:64px;
    height:50px;
  }
}

/* =========================================
   Ajustes bloque a bloque
   ========================================= */

/* Datos principales */
.spec-row {
  display: flex;
  width: 100%;          /* ocupa todo el ancho de la card */
  justify-content: space-between; /* etiqueta a la izquierda, valor a la derecha */
  align-items: center;
  padding: 8px 0;
  gap: 20px; 
}

/* Etiqueta izquierda */
.spec-label {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  opacity: 0.6;
}

/* Valor derecha */
.spec-value {
  font-weight: 600;
  font-size: 0.95rem;
  text-align: right;   /* se asegura que est¨¦ a la derecha */
}


/* Caracteristicas: 3 columnas que SIEMPRE caben */
.spec-grid{
  --gap: 6px;
  display:grid;
  gap:var(--gap);
  width:100%;
  max-width:100%;
  margin:0;
  grid-template-columns: repeat(3, calc((100% - (2 * var(--gap))) / 3));
}

/* Evita que el contenido fuerce el ancho */
.spec-card{ min-width:0; box-sizing:border-box; }
.spec-card .spec-title,
.spec-card .spec-value{
  min-width:0;
  overflow-wrap:normal;
  word-break:normal;
  hyphens:none;
  text-align:center;
}

.spec-card{
  background: var(--color-surface-soft);
  border-radius:12px;
  padding:14px;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap:6px;
  text-align:center;
}
.spec-card img{
  width:20px;
  height:auto;
  opacity:0.5;
}
.spec-title{
  font-size:0.75rem;
  text-transform:uppercase;
  letter-spacing:0.6px;
  opacity:0.6;
}
.spec-card .spec-value{
  font-weight:600;
  font-size:0.95rem;
  text-align:center;
}

/* Valoracion (robusta) */
.val-card{
  display:flex;
  flex-direction:column;
  gap:10px;
}
.val-row{
  display:flex;
  flex-direction:row;   
  align-items:center;   /* alinea verticalmente */
  justify-content:space-between; /* separa nombre y estrellas */
  gap:12px;
  padding:12px 14px;
  background:var(--color-surface-soft);
  border-radius:12px;
}
.val-label{
  font-weight:500;
  opacity:0.8;
  overflow-wrap:anywhere;
}
.val-stars{
  font-size:0.95rem;
  letter-spacing:1px;
  overflow-wrap:anywhere;
  color:var(--color-stars);
  text-shadow:0 0 2px var(--color-stars-shadow);
}

/* Medidas: 6 columnas + scroll horizontal si no cabe */
.measures-grid,
.measures-grid.small{
  display:grid;
  grid-template-columns:repeat(6, minmax(120px, 1fr));
  gap:12px;
  overflow-x:auto;
  overflow-y:hidden;
  max-width:100%;
  -webkit-overflow-scrolling:touch;
  scroll-snap-type:x mandatory;
}

.measures-grid > *,
.measures-grid.small > *{
  scroll-snap-align:start;
}

/* Medidas: icono arriba, texto debajo, centrado */
.measure-col{
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap:6px;
  text-align:center;
}

.measure-col img{
  width:22px;
  height:22px;
  object-fit:contain;
  opacity:0.7;
}


/* ===============================
   Carroceria (mejor estetica)
   =============================== */

.carro-section{
  display:grid;
  gap:10px;
  margin-top:12px;
}

.carro-label{
  font-size:0.75rem;
  text-transform:uppercase;
  letter-spacing:0.6px;
  opacity:0.65;
}

/* Chips de colores */
.carro-chips{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
}

.carro-chip{
  display:inline-flex;
  align-items:center;
  padding:6px 10px;
  border-radius:999px;
  background:var(--color-surface-soft);
  box-shadow:var(--shadow-chip);
}

/* Lista key/value */
.carro-kv-list{
  display:grid;
  gap:0;
}

.carro-kv{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap:12px;
  padding:10px 0;
  border-bottom:1px solid var(--color-border);
}

.carro-kv:last-child{
  border-bottom:0;
}

.carro-k{
  opacity:0.75;
  overflow-wrap:anywhere;
}

.carro-v{
  font-weight:600;
  text-align:right;
  overflow-wrap:anywhere;
}

@media (max-width:600px){
  .carro-kv{
    grid-template-columns:1fr;
    gap:4px;
  }
  .carro-v{
    text-align:left;
  }
}

/* Chip con punto de color */
.carro-chip{
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding:6px 10px;
  border-radius:999px;
  background:var(--color-surface-soft);
  box-shadow:var(--shadow-chip);
}

.carro-dot{
  width:12px;
  height:12px;
  border-radius:50%;
  border:1px solid var(--color-border-strong);
  flex-shrink:0;
}

/* Patrocinadores en línea con scroll */
.carro-sponsors{
  display:flex;
  gap:8px;
  overflow-x:auto;
  overflow-y:hidden;
  padding-bottom:6px;

  -webkit-overflow-scrolling:touch;
  scroll-snap-type:x mandatory;
}

.carro-sponsors .carro-chip{
  flex:0 0 auto;
  scroll-snap-align:start;
}


/* ===============================
   Notas
   =============================== */

.notas-content{
  line-height:1.6;
  opacity:0.9;
  white-space:pre-line;   /* respeta saltos de línea si los hay */
}

.notas-empty{
  font-style:italic;
  opacity:0.6;
}


/* ===============================
   Componentes (3 botones + panel)
   =============================== */

.componentes-tabs{
  display:grid;
  grid-template-columns:repeat(3, 1fr);
  gap:12px;
  margin-top:10px;
}

.componentes-btn{
  border:0;
  border-radius:12px;
  padding:12px 10px;
  font:inherit;
  font-weight:600;
  cursor:pointer;
  background:var(--color-surface-soft);
  transition:transform .15s ease, box-shadow .15s ease, opacity .15s ease;
}

.componentes-btn:hover{
  transform:translateY(-1px);
  box-shadow:var(--shadow-soft-hover);
}

.componentes-btn.is-active{
  background:var(--color-button-bg);
  color:var(--color-button-text);
}

.componentes-panel{
  margin-top:14px;
  padding:14px;
  border-radius:12px;
  background:var(--color-surface-soft);
  min-width:0;
}

.componentes-empty{
  opacity:.65;
  font-style:italic;
}

/* Imágenes dentro del panel (scroll horizontal) */
.comp-imgs{
  display:flex;
  gap:10px;
  overflow-x:auto;
  overflow-y:hidden;
  padding-bottom:6px;
  -webkit-overflow-scrolling:touch;
  scroll-snap-type:x mandatory;
  margin-bottom:10px;
  justify-content:center;
}
.comp-imgs img{
  height:120px;
  width:auto;
  border-radius:10px;
  display:block;
  scroll-snap-align:start;
  background:var(--color-surface);
}

/* Lista de datos (secciones + pares) */
.comp-list{ display:grid; gap:0; }

.comp-section{
  margin-top:10px;
  font-size:.75rem;
  text-transform:uppercase;
  letter-spacing:.6px;
  opacity:.7;
}

.comp-kv{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:12px;
  padding:10px 0;
  border-bottom:1px solid var(--color-border);
}

.comp-k{ opacity:.75; overflow-wrap:anywhere; }
.comp-v{ font-weight:600; text-align:right; overflow-wrap:anywhere; }

.componentes-grid{
  display:grid;
  grid-template-columns:repeat(3, 1fr);
  gap:20px;
}

.componentes-col{
  display:flex;
  flex-direction:column;
  gap:10px;
}

.componentes-btn{
  width:100%;
  padding:10px;
  border:0;
  border-radius:10px;
  background:var(--color-button-bg);
  color:var(--color-button-text);
  cursor:pointer;
}

.componentes-panel{
  display:none;
}

/* mostrar cuando esté activo */
.componentes-col.active .componentes-panel{
  display:block;
}


.detalle-hero-img {
  position: relative;
}

.fav-overlay-btn {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 5;
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  font-size: 24px;
  line-height: 1;
  background: var(--color-icon-button-bg);
  box-shadow: var(--shadow-control);
}

.fav-overlay-btn.is-favorite {
  color: var(--color-favorite);
}

.user-actions-card {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.user-actions-row + .user-actions-row {
  margin-top: 12px;
}

.user-actions-row select {
  min-width: 90px;
  padding: 8px 10px;
  border: 1px solid var(--color-border-strong);
  border-radius: 10px;
  background: var(--color-surface);
}

.user-actions-row button {
  padding: 9px 14px;
  border: 0;
  border-radius: 10px;
  cursor: pointer;
  background: var(--color-button-bg);
  color: var(--color-button-text);
}

.user-actions-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

select.status-select {

  padding-left: 34px;

  background-repeat: no-repeat;
  background-position: 8px center;
  background-size: 18px;
}

.user-collection-total {
  margin-top: 14px;
  margin-bottom: 8px;
}

.user-badge-list {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
}

.user-badge-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  background: var(--color-surface-soft);
}

.user-badge-item img {
  width: 24px;
  height: 24px;
  object-fit: contain;
}

.user-badge-count {
  font-weight: 700;
}

.user-collection-empty {
  margin-top: 10px;
  color: var(--color-text-muted);
}

.hero-badges-right {
  position: absolute;
  top: 10px;
  right: 10px;

  display: flex;
  flex-direction: column;
  gap: 10px;

  z-index: 6;
}

.hero-badge-item {
  position: relative;
  display: inline-block;
}

.hero-badge-item img {
  width: 40px;
  height: 40px;
  filter: var(--drop-shadow-badge-strong);
}

.hero-badge-count {
  position: absolute;
  top: -6px;
  right: -6px;

  min-width: 20px;
  height: 20px;

  padding: 0 4px;

  background: var(--color-danger);
  color: var(--color-danger-text);

  font-size: 12px;
  font-weight: 700;

  border-radius: 999px;

  display: flex;
  align-items: center;
  justify-content: center;

  box-shadow: var(--shadow-avatar);
}


.user-actions-card {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.user-action-group {
  display: flex;
  align-items: center;
  gap: 10px;
}



.status-picker {
  position: relative;
}

.status-picker-trigger {
  height: 48px;
  min-width: 90px;

  padding: 0 28px 0 12px;

  border: 1px solid var(--color-border-strong);
  border-radius: 10px;

  background: var(--color-surface);

  display: inline-flex;
  align-items: center;
  gap: 8px;

  cursor: pointer;

  position: relative;
}

.status-picker-trigger::after {

  content: "";

  position: absolute;
  right: 10px;
  top: 50%;

  width: 0;
  height: 0;

  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 6px solid var(--color-text-muted);

  transform: translateY(-50%);
}


.status-picker-trigger img {
  width: 25px;
  height: 25px;
  object-fit: contain;
}

.status-picker.open .status-picker-trigger::after {
  transform: translateY(-50%) rotate(180deg);
}

.status-picker-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  min-width: 120px;
  padding: 6px;
  border-radius: 12px;
  background: var(--color-surface);
  box-shadow: var(--shadow-panel-strong);
  display: none;
  z-index: 20;
}

.status-picker.open .status-picker-menu {
  display: block;
}

.status-option {
  width: 100%;
  border: 0;
  background: transparent;
  padding: 8px 10px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  text-align: left;
}

.status-option:hover {
  background: var(--color-surface-soft);
}

.status-option img {
  width: 25px;
  height: 25px;
  object-fit: contain;
}


/* móvil */
@media (max-width:900px){
  .componentes-grid{
    grid-template-columns:1fr;
  }
}

@media (max-width:600px){
  .comp-kv{ grid-template-columns:1fr; gap:4px; }
  .comp-v{ text-align:left; }
}


/* Corrigiendo las specCards en móvil */
@media (max-width: 600px) {
  .spec-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
  }

  .spec-card {
    min-width: 0;
    min-height: 110px;
    padding: 10px 6px;
    box-sizing: border-box;
    align-items: center;
    justify-content: center;
    text-align: center;
  }

  .spec-card img {
    width: 20px;
    height: auto;
  }

  .spec-card .spec-title {
    width: 100%;
    max-width: 100%;
    font-size: 0.68rem;
    line-height: 1.15;
    letter-spacing: 0.05em;
    text-align: center;

    overflow: hidden;
    text-overflow: ellipsis;
    overflow-wrap: normal;
    word-break: normal;
    hyphens: none;
  }

  .spec-card .spec-value {
    width: 100%;
    max-width: 100%;
    font-size: 0.86rem;
    line-height: 1.18;
    text-align: center;

    overflow: hidden;
    text-overflow: ellipsis;
    overflow-wrap: normal;
    word-break: normal;
    hyphens: none;

    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
  }
}

/* ===== Ajustes tema oscuro: detalle ===== */

html[data-theme="dark"] .status-picker-menu {
  background: var(--color-surface-soft);
  border: 1px solid var(--color-border-strong);
  color: var(--color-text);
}

html[data-theme="dark"] .status-picker-trigger,
html[data-theme="dark"] .status-option {
  color: var(--color-text);
}

html[data-theme="dark"] .status-option:hover {
  background: var(--color-surface);
}

html[data-theme="dark"] .spec-card img,
html[data-theme="dark"] .measure-col img {
  filter: invert(1) brightness(2) contrast(1.15);
  opacity: 0.95;
}

