/*
 * Ajustes del Comparador de Racks cuando se muestra dentro del sitio (iframe).
 * Solo aplica con html.embed, que agrega public/herramientas/comparador-racks.html
 * al detectar que está dentro de un iframe. El archivo original no cambia su lógica.
 */

/* --- Sin encabezado propio: el sitio ya muestra logo y menú --- */
html.embed body > header { display: none; }

/* --- Scrollbars discretas --- */
html.embed aside { scrollbar-width: thin; scrollbar-color: #d4cfdc transparent; }
html.embed aside::-webkit-scrollbar { width: 6px; }
html.embed aside::-webkit-scrollbar-thumb { background: #d4cfdc; border-radius: 3px; }

/* --- Columnas: más espacio al visor 3D --- */
html.embed main { grid-template-columns: 268px minmax(0, 1fr) 272px; }
html.embed aside { padding: 10px; }
html.embed h2 { font-size: 13px; margin-bottom: 6px; }

/* --- Catálogo: tarjetas compactas en una fila --- */
html.embed .filters { gap: 4px; margin-bottom: 8px; }
html.embed .filters input,
html.embed .filters select { padding: 3px 6px; font-size: 12px; }

html.embed .card {
    grid-template-columns: 40px minmax(0, 1fr) 26px;
    gap: 0 6px;
    padding: 5px 6px;
    margin-bottom: 4px;
    align-items: center;
}
html.embed .card img {
    width: 40px;
    height: 40px;
    grid-row: 1 / span 2;
    grid-column: 1;
}
html.embed .card > div:not(.dims) { grid-column: 2; grid-row: 1; line-height: 1.3; }
html.embed .card > div:not(.dims) br { display: none; }
html.embed .card > div:not(.dims) b { font-size: 12px; margin-right: 4px; }
html.embed .card > div:not(.dims) small { display: none; }
html.embed .card .dims { grid-column: 2; grid-row: 2; font-size: 10.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; letter-spacing: -.01em; }

/* Botón agregar/quitar como icono; el texto sigue en el DOM para lectores de pantalla */
html.embed .card button {
    grid-column: 3;
    grid-row: 1 / span 2;
    width: 26px;
    height: 26px;
    padding: 0;
    font-size: 0;
    border-radius: 50%;
    display: grid;
    place-items: center;
}
html.embed .card button::before { content: "+"; font-size: 16px; line-height: 1; font-weight: 600; }
html.embed .card.on button { background: var(--brand); border-color: var(--brand); color: #fff; }
html.embed .card.on button::before { content: "\2212"; }

/* --- Barras de controles más bajas --- */
html.embed .bar { padding: 5px 8px; gap: 4px 8px; }
html.embed .bar button,
html.embed .bar select,
html.embed .bar input[type=number] { padding: 3px 8px; font-size: 12px; }
html.embed .bar label { font-size: 12px; }
html.embed #roombar input[type=number] { width: 72px; }
html.embed input[type=range] { width: 80px; }

/* --- Panel de dimensiones compacto --- */
html.embed th, html.embed td { padding: 2px 4px; font-size: 12px; }
html.embed #panel > .dims { margin: 4px 0 8px; }
html.embed #panel > label { font-size: 12px; }
html.embed #panel > label select { padding: 3px 6px; font-size: 12px; }
html.embed .metric { margin-top: 8px; }
html.embed .metric h3 { font-size: 11px; }
html.embed .row { margin-top: 3px; font-size: 12px; line-height: 1.35; }
html.embed .track { margin: 1px 0; height: 4px; }
html.embed .delta { font-size: 11px; line-height: 1.2; }
html.embed .fit { margin-bottom: 10px; }
html.embed .fitrow { padding: 5px 0; font-size: 12px; }

/* --- Móvil: todo en una columna, sin scroll interno --- */
@media (max-width: 980px) {
    html.embed main { display: flex; }
    html.embed #cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 5px; }
    html.embed .card { margin-bottom: 0; }
}
