/* InfoPanel and its two lookup dialogs. Keep these overrides in the native
   theme layer so a dark cell and its foreground always change together. */
@layer eureka-theme-controls {
    html:root :is(.eureka-pattern.eureka-info-view, .eureka-pattern.eureka-product-attributes, .eureka-pattern.eureka-price-history) {
        color: var(--ep-text);
    }

    html:root :is(.eureka-pattern.eureka-info-view, .eureka-pattern.eureka-product-attributes, .eureka-pattern.eureka-price-history) > .z-window-header {
        background: var(--ep-heading) !important;
        color: var(--ep-heading-text) !important;
        font-size: 19px;
        font-weight: 700;
    }

    html:root :is(.eureka-pattern.eureka-info-view, .eureka-pattern.eureka-product-attributes, .eureka-pattern.eureka-price-history) > .z-window-header .z-window-icon {
        color: var(--ep-heading-text) !important;
    }

    html:root :is(.eureka-pattern.eureka-info-view, .eureka-pattern.eureka-product-attributes, .eureka-pattern.eureka-price-history) > .z-window-content,
    html:root .eureka-pattern.eureka-info-view :is(.product-search-filters, .partner-search-filters) {
        background: var(--ep-surface) !important;
        color: var(--ep-text) !important;
    }

    html:root :is(.eureka-pattern.eureka-info-view, .eureka-pattern.eureka-product-attributes, .eureka-pattern.eureka-price-history) .z-listbox-header {
        background: var(--ep-heading) !important;
    }

    html:root :is(.eureka-pattern.eureka-info-view, .eureka-pattern.eureka-product-attributes, .eureka-pattern.eureka-price-history) .z-listbox-header :is(.z-listhead, .z-listheader, .z-listheader-content, .z-listhead-bar) {
        background: transparent !important;
        color: var(--ep-heading-text) !important;
        font-size: 14px;
        font-weight: 700;
    }

    .eureka-pattern .z-listitem:where(:nth-child(even of .z-listitem)) { --info-row: var(--ep-alt); }
    .eureka-pattern .z-listitem:hover { --info-row: var(--ep-hover); }
    .eureka-pattern .z-listitem.z-listitem-selected { --info-row: var(--ep-selected); }

    html:root :is(.eureka-pattern.eureka-info-view, .eureka-pattern.eureka-product-attributes, .eureka-pattern.eureka-price-history) .z-listbox-body .z-listitem,
    html:root :is(.eureka-pattern.eureka-info-view, .eureka-pattern.eureka-product-attributes, .eureka-pattern.eureka-price-history) .z-listbox-body .z-listitem :is(.z-listcell, .z-listcell-content) {
        background: var(--info-row, var(--ep-surface)) !important;
        color: var(--info-ink-cell, var(--ep-text)) !important;
        border-color: var(--ep-border) !important;
        font-variant-numeric: tabular-nums;
    }

    /* Native row warnings retain a marker without coloring unrelated values. */
    .eureka-info-view:not(.eureka-bpartner-info) .eureka-info-flagged > .z-listcell:first-child {
        outline: 1px dashed var(--ep-negative);
        outline-offset: -2px;
    }
    .eureka-info-view .z-listcell.eureka-info-negative { --info-ink-cell: var(--ep-negative); }
    .eureka-info-view .eureka-info-date { --info-ink-cell: var(--ep-date); }

    html:root .eureka-pattern.eureka-info-view .z-listitem-selected > .z-listcell:first-child {
        box-shadow: inset 3px 0 var(--ep-accent);
    }

    html:root .eureka-pattern.eureka-info-view .product-warehouse-table .z-listcell:nth-last-child(-n+4 of .z-listcell) .z-listcell-content,
    html:root .eureka-pattern.eureka-info-view .product-locator-table .z-listcell:last-of-type .z-listcell-content {
        text-align: right !important;
    }

    html:root .eureka-pattern.eureka-info-view .eureka-info-footer,
    html:root .eureka-pattern.eureka-price-history .price-history-footer-content {
        background: var(--ep-footer) !important;
        color: var(--ep-muted) !important;
        border-top: 1px solid var(--ep-border);
        overflow-x: auto;
    }

    .eureka-pattern .eureka-info-primary {
        --info-button: var(--ep-primary-bg);
        --info-ink: var(--ep-primary-text);
    }
    .eureka-pattern .eureka-info-secondary {
        --info-button: var(--ep-secondary-bg);
        --info-ink: var(--ep-secondary-text);
    }
    .eureka-pattern .eureka-info-close { --info-button: var(--ep-close-bg); }

    html:root :is(.eureka-pattern.eureka-info-view, .eureka-pattern.eureka-product-attributes, .eureka-pattern.eureka-price-history) :is(.confirm-panel-button, .product-search-action, .partner-search-action, .price-history-accept).z-button {
        background: var(--info-button, var(--ep-utility-bg)) !important;
        color: var(--info-ink, var(--ep-text)) !important;
        border: 1px solid var(--ep-border) !important;
        border-radius: 4px !important;
        font-weight: 650;
        white-space: nowrap;
    }

    html:root :is(.eureka-pattern.eureka-info-view, .eureka-pattern.eureka-product-attributes, .eureka-pattern.eureka-price-history) .z-button:focus-visible {
        outline: 2px solid var(--ep-focus) !important;
        outline-offset: -2px;
    }

    html:root .eureka-pattern.eureka-info-view .eureka-info-footer .z-button > i,
    html:root .eureka-pattern.eureka-info-view .eureka-info-footer .z-button > i::before {
        color: inherit !important;
    }

    html:root .eureka-pattern.eureka-info-view .eureka-info-footer .confirm-panel-button.z-button {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 5px;
        width: auto !important;
        min-width: max-content !important;
        padding-inline: 8px !important;
    }

    html:root .eureka-pattern.eureka-info-view .eureka-info-footer .z-paging {
        flex: 0 0 auto;
        display: inline-flex;
        align-items: center;
        gap: 6px;
        height: auto;
        background: transparent !important;
        color: var(--ep-text) !important;
    }
    html:root .eureka-pattern.eureka-info-view .eureka-info-footer .z-paging :is(span, .z-paging-info, .z-paging-text, .z-paging-input, .z-paging-button, .z-paging-icon) {
        color: var(--ep-text) !important;
    }
    html:root .eureka-pattern.eureka-info-view .eureka-info-footer .z-paging-info {
        position: static !important;
        line-height: normal;
    }

    /* The resource form groups labels on one row and editors on the next. */
    html:root .eureka-pattern.eureka-info-view .eureka-resource-criteria .z-row-content > div {
        text-align: start !important;
    }
    html:root .eureka-pattern.eureka-info-view .partner-search-context {
        flex: 0 0 auto;
        max-width: min(42vw, 32rem);
        min-width: 0;
        overflow: hidden;
    }
    html:root .eureka-pattern.eureka-info-view .partner-search-context > .z-label {
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    html:root .eureka-pattern.eureka-info-view .partner-search-customer .z-checkbox-mold {
        background-color: #985044 !important;
    }
    html:root .eureka-pattern.eureka-info-view .partner-search-customer.z-checkbox-switch-on > .z-checkbox-mold {
        background-color: #257247 !important;
    }
}
