/*
 * Design-Einstellungen: Hardware-Dialog der Projektansicht (docs/project-shell.md).
 *   Markup  src/Shortcodes/ProjectShortcode.php (#mapHardwarePopup .ees-hw-backdrop)
 *   Inhalt  assets/js/modules/project/project-init.js (openHardwareView, createContentHTML)
 * Glas wie Konfig-Panel und Inspektor (ee-config-panel.css), Farben/Radien NUR ueber
 * --ees-* (ee-shell-tokens.css), hell/dunkel nach Systemeinstellung wie die Shell.
 * Ersetzt das alte dunkle .mapHardware*-CSS (entfernt aus ee-project-styles.css und ee-responsive.css).
 */
.ees-hw-backdrop {
    position: fixed; inset: 0; z-index: 100200; display: grid; place-items: center; padding: 16px;
    background: color-mix(in srgb, var(--ees-bg) 55%, transparent); color-scheme: dark;
}
.ees-hw-backdrop[hidden] { display: none; }
@media (prefers-color-scheme: light) {
    .ees-hw-backdrop { color-scheme: light; }
}

.ees-hw {
    width: min(760px, 100%); max-height: min(640px, calc(100vh - 32px)); display: flex; flex-direction: column; overflow: hidden;
    box-sizing: border-box; font-family: var(--ees-font); color: var(--ees-text); -webkit-font-smoothing: antialiased;
    background: var(--ees-glass-bg); border: 1px solid var(--ees-glass-border); border-radius: var(--ees-radius-panel);
    box-shadow: var(--ees-glass-shadow), var(--ees-float-shadow);
    backdrop-filter: var(--ees-backdrop); -webkit-backdrop-filter: var(--ees-backdrop);
    animation: ees-hw-in .16s ease-out;
}
.ees-hw *, .ees-hw *::before, .ees-hw *::after { box-sizing: border-box; }
.ees-hw svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.ees-hw button:focus-visible, .ees-hw a:focus-visible, .ees-hw select:focus-visible { outline: 2px solid var(--ees-accent); outline-offset: 2px; }

/* Kopf: Titel, Hinweis, Schliessen */
.ees-hw-head {
    display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
    padding: 16px 16px 12px 20px; border-bottom: 1px solid var(--ees-border);
}
.ees-hw-head h2 { margin: 0; padding: 0; font-size: 17px; font-weight: 700; letter-spacing: -.2px; line-height: 1.3; color: var(--ees-text); }
.ees-hw-head p { margin: 3px 0 0; font-size: 12.5px; line-height: 1.4; color: var(--ees-text-dim); }
.ees-hw-close {
    width: 32px; height: 32px; display: grid; place-items: center; flex: none; padding: 0; border: 0; border-radius: 99px;
    background: var(--ees-surface-2); color: var(--ees-text-2); cursor: pointer;
}
.ees-hw-close:hover { background: var(--ees-surface-3); color: var(--ees-text); }

/* Reiter links, Inhalt rechts */
.ees-hw-body { flex: 1; min-height: 0; display: grid; grid-template-columns: 190px 1fr; }
.ees-hw-tabs { display: flex; flex-direction: column; gap: 2px; padding: 12px 10px; border-right: 1px solid var(--ees-border); overflow-y: auto; }
.ees-hw-tab {
    text-align: left; padding: 9px 12px; border: 0; border-radius: 10px; background: transparent;
    font: inherit; font-size: 13.5px; font-weight: 500; color: var(--ees-text-2); cursor: pointer;
}
.ees-hw-tab:hover { background: var(--ees-surface-2); color: var(--ees-text); }
.ees-hw-tab[aria-selected="true"] { background: var(--ees-accent-soft); color: var(--ees-text); font-weight: 650; box-shadow: inset 2px 0 0 var(--ees-accent); }
.ees-hw-tab[hidden] { display: none; }
.ees-hw-pane { overflow-y: auto; padding: 16px 20px 20px; outline: none; }
.ees-hw-content { animation: ees-hw-fade .18s ease-out; }

.ees-hw-titlerow { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.ees-hw-title { margin: 0; padding: 0; font-size: 15px; font-weight: 700; color: var(--ees-text); }
/* Hersteller: Name als Text; Logo nur mit Freigabe (logo_freigegeben), dann auf Weiss */
.ees-hw-maker {
    font-size: 12.5px; font-weight: 600; color: var(--ees-text-2); padding: 4px 10px; border-radius: 99px;
    background: var(--ees-surface-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 50%;
}
.ees-hw-maker[hidden] { display: none; }
.ees-hw-maker:has(img) { background: #fff; padding: 4px 8px; border-radius: 8px; }
.ees-hw-maker img { display: block; height: 22px; max-width: 120px; object-fit: contain; }

/* Produktbild (Datenblatt-Renderings sind weiss hinterlegt) */
.ees-hw-media { margin-bottom: 14px; border-radius: var(--ees-radius-md); overflow: hidden; }
.ees-hw-img { display: block; width: 100%; height: 180px; object-fit: contain; background: #fff; }
.ees-hw-img[hidden] { display: none; }

/* Auswahl Hersteller / Produkt */
.ees-hw-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 14px; }
.ees-hw .f label { display: block; margin: 0 0 6px; font-size: 12px; font-weight: 600; color: var(--ees-text-dim); }
.ees-hw .sel { position: relative; }
.ees-hw .sel select {
    width: 100%; height: 38px; margin: 0; padding: 0 34px 0 12px; appearance: none; -webkit-appearance: none;
    border: 1px solid var(--ees-border); border-radius: var(--ees-radius-sm); background: var(--ees-field);
    font: inherit; font-size: 13.5px; color: var(--ees-text); cursor: pointer;
}
.ees-hw .sel select:hover { border-color: var(--ees-border-strong); }
.ees-hw .sel svg { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); pointer-events: none; color: var(--ees-text-dim); }

/* Kennwerte */
.ees-hw-specs { margin: 0 0 14px; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.ees-hw-specs div { padding: 9px 12px; border-radius: 10px; background: var(--ees-surface-2); }
.ees-hw-specs dt { margin: 0; font-size: 11.5px; color: var(--ees-text-dim); }
.ees-hw-specs dd { margin: 2px 0 0; font-size: 14px; font-weight: 650; color: var(--ees-text); font-variant-numeric: tabular-nums; }

/* Datenblatt (nur mit Link) */
.ees-hw-pdf {
    display: inline-flex; align-items: center; gap: 7px; height: 36px; padding: 0 13px; border-radius: 10px;
    border: 1px solid var(--ees-border); background: var(--ees-surface-2); color: var(--ees-text);
    font-size: 12.5px; font-weight: 600; text-decoration: none;
}
.ees-hw-pdf:hover { border-color: var(--ees-accent); color: var(--ees-text); }
.ees-hw-pdf[hidden] { display: none; }

@keyframes ees-hw-in { from { opacity: 0; transform: translateY(6px) scale(.99); } to { opacity: 1; transform: none; } }
@keyframes ees-hw-fade { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
    .ees-hw, .ees-hw-content { animation: none; }
}

/* Handy: Bottom-Sheet, Reiter waagerecht */
@media (max-width: 640px) {
    .ees-hw-backdrop { place-items: end stretch; padding: 0; }
    .ees-hw { width: 100%; max-height: 85vh; border-radius: var(--ees-radius-panel) var(--ees-radius-panel) 0 0; }
    .ees-hw-body { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
    .ees-hw-tabs { flex-direction: row; overflow-x: auto; border-right: 0; border-bottom: 1px solid var(--ees-border); padding: 8px 10px; }
    .ees-hw-tab { flex: none; white-space: nowrap; }
    .ees-hw-tab[aria-selected="true"] { box-shadow: inset 0 -2px 0 var(--ees-accent); }
    .ees-hw-fields { grid-template-columns: 1fr; }
}
