/**
 * EU Legal Guarantee Notice & GARAN Label
 *
 * NOTICE OF LICENSE
 *
 * This source file is subject to the Commercial License
 * you can't distribute, modify or sell this code
 *
 * DISCLAIMER
 *
 * Do not edit or add to this file
 * If you need help please contact leo@prestachamps.com
 *
 * @author    PrestaChamps
 * @copyright PrestaChamps
 * @license   commercial
 */

/* ==========================================================================
   eugl-assign: what the "Guarantee sources" and "Assign guarantees" sections
   add to the UI kit (eugl-ui.css, loaded before this file): the precedence
   steps, the mapping table inputs, the category tree details, the product
   table cells, the pager, the mass-action bar and its result box.
   Scoped like the kit: every rule sits under .eugl-ui and the section root
   (.eugl-sources / .eugl-assign); rules that override a kit rule use the
   kit's :is(.eugl-ui, #eugl-ui) prefix plus one class more. The colours are
   the kit's custom properties (EU blue), with the same values as fallbacks.
   ========================================================================== */

/* ---- Guarantee sources: the precedence steps ------------------------------ */

:is(.eugl-ui, #eugl-ui) .eugl-sources .eugl-steps {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 10px;
    margin: 0;
    padding: 0;
    list-style: none;
    counter-reset: none;
}

:is(.eugl-ui, #eugl-ui) .eugl-sources .eugl-steps > .eugl-step {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    margin: 0;
    padding: 12px 14px 12px 46px;
    border: 1px solid var(--eugl-line, #e5e7eb);
    border-radius: 8px;
    background: var(--eugl-foot, #fafbfd);
    font-size: 13px;
    line-height: 1.45;
    color: var(--eugl-ink-2, #374151);
}

:is(.eugl-ui, #eugl-ui) .eugl-sources .eugl-steps > .eugl-step + .eugl-step {
    margin-top: 0;
}

.eugl-ui .eugl-sources .eugl-step-num {
    position: absolute;
    top: 12px;
    left: 12px;
    display: inline-grid;
    place-items: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--eugl-blue, #003399);
    font-size: 12px;
    font-weight: 700;
    color: #fff;
}

.eugl-ui .eugl-sources .eugl-step:last-child .eugl-step-num {
    background: var(--eugl-line-2, #d1d5db);
    color: var(--eugl-ink-2, #374151);
}

.eugl-ui .eugl-sources .eugl-step-text strong {
    display: block;
    color: var(--eugl-ink, #1f2937);
}

/* ---- Guarantee sources: the mapping table -------------------------------- */

.eugl-ui .eugl-sources .eugl-map-input {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

:is(.eugl-ui, #eugl-ui) .eugl-sources .eugl-map-input .eugl-map-value {
    width: 92px;
}

:is(.eugl-ui, #eugl-ui) .eugl-sources .eugl-map-input .eugl-map-unit {
    width: auto;
    min-width: 110px;
}

:is(.eugl-ui, #eugl-ui) .eugl-sources .eugl-map-table > tbody > tr.is-ignored > td {
    background: var(--eugl-soft, #f1f5f9);
}

.eugl-ui .eugl-sources .eugl-map-row.is-ignored .eugl-map-text {
    color: var(--eugl-muted, #6b7280);
    text-decoration: line-through;
}

.eugl-ui .eugl-sources .eugl-map-custom {
    margin-left: 6px;
}

/* ---- Assign guarantees: left pane (tree) --------------------------------- */

.eugl-ui .eugl-assign .eugl-assign-left {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

:is(.eugl-ui, #eugl-ui) .eugl-assign .eugl-assign-label {
    margin: 0;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .05em;
    text-transform: uppercase;
    color: var(--eugl-muted, #6b7280);
}

:is(.eugl-ui, #eugl-ui) .eugl-assign .eugl-assign-tree-search {
    width: 100%;
}

:is(.eugl-ui, #eugl-ui) .eugl-assign .eugl-assign-option {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    font-size: 13px;
    font-weight: 400;
    color: var(--eugl-ink-2, #374151);
    cursor: pointer;
}

:is(.eugl-ui, #eugl-ui) .eugl-assign .eugl-assign-option input {
    margin: 0;
}

.eugl-ui .eugl-assign .eugl-assign-tree-box {
    max-height: 560px;
    padding: 6px;
    overflow: auto;
    border: 1px solid var(--eugl-line, #e5e7eb);
    border-radius: 8px;
    background: #fff;
}

:is(.eugl-ui, #eugl-ui) .eugl-card-body .eugl-assign-tree,
:is(.eugl-ui, #eugl-ui) .eugl-card-body .eugl-assign-tree ul {
    margin: 0;
    padding-left: 0;
    list-style: none;
}

:is(.eugl-ui, #eugl-ui) .eugl-card-body .eugl-assign-tree ul {
    padding-left: 16px;
}

:is(.eugl-ui, #eugl-ui) .eugl-card-body .eugl-assign-tree li + li {
    margin-top: 0;
}

:is(.eugl-ui, #eugl-ui) .eugl-assign .eugl-tree-label {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    margin: 0;
    padding: 3px 4px;
    border: 0;
    background: none;
    font: inherit;
    text-align: left;
    color: inherit;
    cursor: pointer;
}

:is(.eugl-ui, #eugl-ui) .eugl-assign .eugl-tree-label:focus-visible {
    outline: 2px solid var(--eugl-blue, #003399);
    outline-offset: 1px;
    border-radius: 4px;
}

.eugl-ui .eugl-assign .eugl-tree-name {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
}

.eugl-ui .eugl-assign .eugl-tree-path {
    max-width: 100%;
    overflow: hidden;
    font-size: 11px;
    font-weight: 400;
    text-overflow: ellipsis;
    color: var(--eugl-muted, #6b7280);
}

.eugl-ui .eugl-assign .eugl-tree-spacer {
    visibility: hidden;
}

.eugl-ui .eugl-assign .eugl-tree-row.is-selected .eugl-tree-count {
    background: #fff;
    color: var(--eugl-blue, #003399);
}

.eugl-ui .eugl-assign .eugl-assign-tree-msg {
    padding: 6px 8px;
    font-size: 12.5px;
}

.eugl-ui .eugl-assign .eugl-assign-tree-msg.is-error {
    color: var(--eugl-danger, #b91c1c);
}

/* ---- Assign guarantees: right pane (filters, selection, table, pager) ---- */

.eugl-ui .eugl-assign .eugl-assign-right {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

:is(.eugl-ui, #eugl-ui) .eugl-assign .eugl-assign-filters :is(select, input[type="search"]) {
    width: auto;
    max-width: 260px;
}

:is(.eugl-ui, #eugl-ui) .eugl-assign .eugl-assign-filters .eugl-assign-q {
    flex: 1 1 200px;
}

.eugl-ui .eugl-assign .eugl-assign-context {
    min-height: 20px;
    font-size: 13px;
    font-weight: 600;
    color: var(--eugl-ink-2, #374151);
}

.eugl-ui .eugl-assign .eugl-assign-selection {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 10px;
    padding: 8px 12px;
    border: 1px solid var(--eugl-blue-line, #b9c8ef);
    border-radius: 8px;
    background: var(--eugl-blue-tint, #e8eefb);
    font-size: 13px;
    font-weight: 600;
    color: var(--eugl-blue-dark, #00297a);
}

.eugl-ui .eugl-assign.is-loading .eugl-assign-table tbody {
    opacity: .55;
    transition: opacity .15s;
}

:is(.eugl-ui, #eugl-ui) .eugl-assign .eugl-assign-table .eugl-assign-col-check {
    width: 38px;
    text-align: center;
}

:is(.eugl-ui, #eugl-ui) .eugl-assign .eugl-assign-table .eugl-assign-col-image {
    width: 56px;
}

.eugl-ui .eugl-assign .eugl-assign-thumb {
    display: block;
    width: 40px;
    height: 40px;
    border: 1px solid var(--eugl-line, #e5e7eb);
    border-radius: 6px;
    background: var(--eugl-soft, #f1f5f9);
    object-fit: contain;
}

:is(.eugl-ui, #eugl-ui) .eugl-assign .eugl-assign-name {
    display: block;
    font-weight: 600;
    color: var(--eugl-ink, #1f2937);
    text-decoration: none;
}

:is(.eugl-ui, #eugl-ui) .eugl-assign a.eugl-assign-name:hover,
:is(.eugl-ui, #eugl-ui) .eugl-assign a.eugl-assign-name:focus {
    color: var(--eugl-blue, #003399);
    text-decoration: underline;
}

.eugl-ui .eugl-assign .eugl-assign-meta {
    display: block;
    margin-top: 2px;
    font-size: 11.5px;
    color: var(--eugl-muted, #6b7280);
}

:is(.eugl-ui, #eugl-ui) .eugl-assign .eugl-assign-table .eugl-assign-col-guarantee {
    width: 1%;
    min-width: 170px;
}

.eugl-ui .eugl-assign .eugl-assign-guarantee {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px 6px;
}

.eugl-ui .eugl-assign .eugl-assign-guarantee strong {
    font-weight: 700;
    color: var(--eugl-ink, #1f2937);
}

.eugl-ui .eugl-assign .eugl-assign-guarantee strong.is-hidden {
    color: var(--eugl-muted, #6b7280);
    text-decoration: line-through;
}

.eugl-ui .eugl-assign .eugl-assign-guarantee .is-none-text {
    color: var(--eugl-muted, #6b7280);
}

.eugl-ui .eugl-assign .eugl-assign-note {
    margin-top: 3px;
    font-size: 12px;
    color: var(--eugl-warning, #b45309);
}

.eugl-ui .eugl-assign .eugl-assign-pager {
    justify-content: flex-start;
}

:is(.eugl-ui, #eugl-ui) .eugl-assign .eugl-assign-pager .eugl-btn.is-current {
    border-color: var(--eugl-blue, #003399);
    background: var(--eugl-blue, #003399);
    color: #fff;
}

.eugl-ui .eugl-assign .eugl-assign-gap {
    padding: 0 2px;
}

.eugl-ui .eugl-assign .eugl-assign-page {
    margin-left: auto;
}

/* ---- Assign guarantees: mass-action bar and its result ------------------- */

.eugl-ui .eugl-assign .eugl-assign-bar {
    margin: 0 20px 16px;
}

.eugl-ui .eugl-assign .eugl-assign-count {
    min-width: 150px;
    font-weight: 700;
    color: var(--eugl-blue, #003399);
}

.eugl-ui .eugl-assign .eugl-assign-bar-field,
.eugl-ui .eugl-assign .eugl-assign-bar-actions {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 8px;
}

:is(.eugl-ui, #eugl-ui) .eugl-assign .eugl-assign-bar-field label {
    margin: 0;
    font-size: 13px;
    font-weight: 600;
}

:is(.eugl-ui, #eugl-ui) .eugl-assign .eugl-assign-bar-field .eugl-assign-value {
    width: 92px;
}

:is(.eugl-ui, #eugl-ui) .eugl-assign .eugl-assign-bar-field .eugl-assign-unit {
    width: auto;
    min-width: 110px;
}

.eugl-ui .eugl-assign .eugl-assign-shops {
    margin-left: auto;
    font-size: 12px;
}

.eugl-ui .eugl-assign .eugl-assign-result {
    margin: 0 20px 18px;
    padding: 10px 12px;
    border: 1px solid var(--eugl-line, #e5e7eb);
    border-radius: 8px;
    background: var(--eugl-ground, #f6f8fb);
    font-size: 13px;
    color: var(--eugl-ink-2, #374151);
}

.eugl-ui .eugl-assign .eugl-assign-result.is-success {
    border-color: var(--eugl-success-line, #bfe5cc);
    background: var(--eugl-success-tint, #e7f6ec);
    color: var(--eugl-success, #15803d);
}

.eugl-ui .eugl-assign .eugl-assign-result.is-warning {
    border-color: var(--eugl-warning-line, #f5d9a8);
    background: var(--eugl-warning-tint, #fef3e2);
    color: #92400e;
}

.eugl-ui .eugl-assign .eugl-assign-result.is-error {
    border-color: var(--eugl-danger-line, #f4c4c4);
    background: var(--eugl-danger-tint, #fdecec);
    color: var(--eugl-danger, #b91c1c);
}

/* Multistore: another shop of the context has another guarantee for the product. */
.eugl-ui .eugl-assign .eugl-badge.is-differs {
    border: 1px dashed var(--eugl-warning-line, #f5d9a8);
    background: var(--eugl-warning-tint, #fef3e2);
    color: #92400e;
    cursor: help;
}

.eugl-ui .eugl-assign .eugl-assign-shops-notice {
    margin-bottom: 14px;
}

.eugl-ui .eugl-assign .eugl-assign-result-main {
    font-weight: 700;
}

:is(.eugl-ui, #eugl-ui) .eugl-assign .eugl-assign-result-title {
    margin: 8px 0 2px;
    font-weight: 600;
}

:is(.eugl-ui, #eugl-ui) .eugl-assign .eugl-assign-result ul {
    max-height: 220px;
    margin: 0;
    padding-left: 20px;
    overflow: auto;
}

@media (max-width: 767px) {
    .eugl-ui .eugl-assign .eugl-assign-bar,
    .eugl-ui .eugl-assign .eugl-assign-result {
        margin-right: 12px;
        margin-left: 12px;
    }

    :is(.eugl-ui, #eugl-ui) .eugl-assign .eugl-assign-table .eugl-assign-col-image {
        display: none;
    }

    :is(.eugl-ui, #eugl-ui) .eugl-assign .eugl-assign-table .eugl-assign-col-guarantee {
        min-width: 0;
    }

    :is(.eugl-ui, #eugl-ui) .eugl-assign .eugl-assign-table > thead > tr > th,
    :is(.eugl-ui, #eugl-ui) .eugl-assign .eugl-assign-table > tbody > tr > td {
        padding: 8px 6px;
        white-space: normal;
    }

    .eugl-ui .eugl-assign .eugl-assign-tree-box {
        max-height: 320px;
    }

    .eugl-ui .eugl-assign .eugl-assign-shops {
        margin-left: 0;
    }
}
