/* ============================================================
   fabrilogy_farbsuche — CSS
   ============================================================ */

#fab-farbsuche-widget {
    margin: 0 0 2rem;
    font-family: inherit;
}

/* ---- Toolbar ---- */
.fab-fs-toolbar {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 1rem;
}

.fab-fs-toolbar input {
    flex: 1;
    max-width: 380px;
    height: 38px;
    padding: 0 14px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 14px;
    color: #333;
    background: #fff;
    outline: none;
    transition: border-color .15s;
}
.fab-fs-toolbar input:focus {
    border-color: #888;
}

.fab-fs-count {
    font-size: 13px;
    color: #888;
}

/* ---- Familien-Filter ---- */
.fab-fs-families {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 1.25rem;
}

.fab-fs-fam {
    height: 28px;
    padding: 0 13px;
    border: 1px solid #ddd;
    border-radius: 999px;
    font-size: 12px;
    cursor: pointer;
    background: #fff;
    color: #555;
    transition: background .12s, border-color .12s;
    line-height: 1;
}
.fab-fs-fam:hover {
    background: #f4f4f4;
    border-color: #bbb;
}
.fab-fs-fam.active {
    background: #222;
    color: #fff;
    border-color: #222;
    font-weight: 500;
}

/* ---- Palette-Grid ---- */
.fab-fs-palette {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(72px, 1fr));
    gap: 10px;
    margin-bottom: 1.5rem;
}

/* ---- Einzelne Farbkachel ---- */
.fab-fs-swatch {
    display: block;
    text-decoration: none;
    border: 1px solid rgba(0,0,0,0.10);
    border-radius: 5px;
    overflow: hidden;
    cursor: pointer;
    transition: transform .12s, box-shadow .12s;
}
.fab-fs-swatch:hover {
    transform: scale(1.07);
    box-shadow: 0 3px 10px rgba(0,0,0,0.15);
    border-color: rgba(0,0,0,0.20);
}

.fab-fs-box {
    height: 58px;
    width: 100%;
    position: relative;
    display: flex;
    align-items: flex-end;
    padding: 0 5px 4px;
}

.fab-fs-code {
    font-size: 10px;
    font-weight: 600;
    letter-spacing: .03em;
    line-height: 1;
}

.fab-fs-badge {
    position: absolute;
    top: 4px;
    right: 4px;
    background: rgba(255,255,255,0.85);
    color: #333;
    font-size: 9px;
    font-weight: 600;
    padding: 1px 4px;
    border-radius: 3px;
    line-height: 1.4;
}
.fab-fs-badge:empty,
.fab-fs-swatch[data-count="0"] .fab-fs-badge {
    display: none;
}

.fab-fs-meta {
    padding: 4px 6px 5px;
    background: #fff;
}

.fab-fs-name {
    display: block;
    font-size: 10px;
    color: #555;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ---- Hinweis ---- */
.fab-fs-hinweis {
    font-size: 12px;
    color: #888;
    border-top: 1px solid #eee;
    padding-top: .85rem;
    line-height: 1.6;
}
.fab-fs-hinweis a {
    color: inherit;
    text-decoration: underline;
}

/* ---- Leer-Zustand ---- */
.fab-fs-empty {
    font-size: 14px;
    color: #aaa;
    padding: 2rem 0;
    text-align: center;
    grid-column: 1 / -1;
}

/* ---- Responsive ---- */
@media (max-width: 480px) {
    .fab-fs-palette {
        grid-template-columns: repeat(auto-fill, minmax(58px, 1fr));
        gap: 7px;
    }
    .fab-fs-box {
        height: 48px;
    }
    .fab-fs-toolbar input {
        max-width: 100%;
    }
}

/* ============================================================
   Farbsuche — Ergebnisseite
   ============================================================ */

#fab-fs-result-widget {
    margin: 0 0 2rem;
    font-family: inherit;
}

.fab-result-header {
    margin-bottom: 1.5rem;
}

.fab-result-back {
    display: inline-block;
    font-size: 13px;
    color: #e07b00;
    text-decoration: none;
    margin-bottom: 12px;
}
.fab-result-back:hover { text-decoration: underline; }

.fab-result-color-info {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.fab-result-dot {
    display: inline-block;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 1px solid rgba(0,0,0,0.12);
    flex-shrink: 0;
}

.fab-result-title {
    font-size: 18px;
    color: #333;
}

.fab-result-count {
    font-size: 13px;
    color: #888;
    background: #f4f4f4;
    padding: 3px 10px;
    border-radius: 20px;
}

/* ---- Grid ---- */
.fab-result-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 14px;
}

/* ---- Karte ---- */
.fab-result-card {
    display: block;
    text-decoration: none;
    border: 1px solid #e0d8d0;
    border-radius: 5px;
    background: #fff;
    overflow: hidden;
    transition: box-shadow .15s, border-color .15s;
}
.fab-result-card:hover {
    box-shadow: 0 3px 12px rgba(0,0,0,.10);
    border-color: #e07b00;
}

.fab-result-img {
    width: 100%;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    background: #f7f4f0;
    display: flex;
    align-items: center;
    justify-content: center;
}
.fab-result-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .25s;
}
.fab-result-card:hover .fab-result-img img { transform: scale(1.05); }

.fab-result-no-img {
    font-size: 2rem;
    color: #ccc;
}

.fab-result-info {
    padding: 8px 10px 10px;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.fab-result-model {
    font-size: 10px;
    color: #aaa;
}

.fab-result-name {
    font-size: 13px;
    color: #333;
    line-height: 1.4;
    font-weight: 500;
}

.fab-result-price {
    font-size: 13px;
    font-weight: 700;
    color: #e07b00;
    margin-top: 2px;
}

.fab-result-empty {
    font-size: 14px;
    color: #aaa;
    padding: 2rem 0;
}

@media (max-width: 480px) {
    .fab-result-grid {
        grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
        gap: 10px;
    }
}

/* Placeholder unsichtbar bis Widget eingesetzt ist */
#fab-fs-placeholder,
#fab-fs-result-placeholder {
    min-height: 0 !important;
    height: 0 !important;
    overflow: hidden;
}

/* Weißer Hintergrund auf der Farbsuche-Ergebnis-Seite */
#fab-fs-result-placeholder,
#fab-fs-placeholder {
    background: #fff;
}
