/* ================================================================
   kubota_finder/css/finder.css
   KI-Teilefinder Widget fuer kubota-teile.de
   Kompatibel mit Bootstrap 3 (je_pronautics Template)
   Kubota Corporate Farben: Rot #C8102E, Schwarz #1a1a1a
   ================================================================ */

/* ----------------------------------------------------------------
   Floating Trigger Button
   ---------------------------------------------------------------- */
#kubota-finder-trigger {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 8000;
}

#kubota-finder-btn {
    display: -webkit-inline-flex;
    display: inline-flex;
    -webkit-align-items: center;
    align-items: center;
    gap: 8px;
    background-color: #C8102E;
    color: #fff;
    border: none;
    border-radius: 40px;
    padding: 12px 18px 12px 14px;
    font-size: 14px;
    font-weight: 600;
    line-height: 1;
    cursor: pointer;
    box-shadow: 0 4px 18px rgba(200, 16, 46, 0.45);
    -webkit-transition: background-color 0.2s ease, -webkit-transform 0.2s ease, box-shadow 0.2s ease;
    transition: background-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
    font-family: inherit;
    text-decoration: none;
}

#kubota-finder-btn:hover,
#kubota-finder-btn:focus {
    background-color: #a50d24;
    -webkit-transform: translateY(-2px);
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(200, 16, 46, 0.55);
    color: #fff;
    outline: none;
}

#kubota-finder-btn svg {
    width: 18px;
    height: 18px;
    -webkit-flex-shrink: 0;
    flex-shrink: 0;
}

/* ----------------------------------------------------------------
   Overlay (Hintergrund)
   ---------------------------------------------------------------- */
#kubota-finder-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.65);
    z-index: 9000;
    display: -webkit-flex;
    display: flex;
    -webkit-align-items: center;
    align-items: center;
    -webkit-justify-content: center;
    justify-content: center;
    padding: 16px;
    -webkit-box-sizing: border-box;
    box-sizing: border-box;
}

/* ----------------------------------------------------------------
   Modal
   ---------------------------------------------------------------- */
#kubota-finder-modal {
    background: #fff;
    border-radius: 8px;
    width: 100%;
    max-width: 660px;
    max-height: 90vh;
    overflow-y: auto;
    overflow-x: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35), 0 4px 16px rgba(0, 0, 0, 0.2);
    font-family: inherit;
    -webkit-box-sizing: border-box;
    box-sizing: border-box;
    scrollbar-width: thin;
}

/* ----------------------------------------------------------------
   Header
   ---------------------------------------------------------------- */
.kf-header {
    display: -webkit-flex;
    display: flex;
    -webkit-align-items: center;
    align-items: center;
    -webkit-justify-content: space-between;
    justify-content: space-between;
    padding: 14px 18px;
    background: #1a1a1a;
    border-radius: 8px 8px 0 0;
    border-bottom: 3px solid #C8102E;
}

.kf-logo {
    display: -webkit-flex;
    display: flex;
    -webkit-align-items: center;
    align-items: center;
    gap: 12px;
}

.kf-logo svg {
    width: 34px;
    height: 34px;
    -webkit-flex-shrink: 0;
    flex-shrink: 0;
}

.kf-logo h2 {
    margin: 0;
    font-size: 17px;
    font-weight: 700;
    color: #fff;
    line-height: 1.2;
}

.kf-logo p {
    margin: 3px 0 0;
    font-size: 11px;
    color: rgba(255, 255, 255, 0.55);
    line-height: 1.3;
}

#kubota-finder-close {
    background: rgba(255, 255, 255, 0.12);
    border: none;
    color: #fff;
    width: 30px;
    height: 30px;
    border-radius: 5px;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    display: -webkit-flex;
    display: flex;
    -webkit-align-items: center;
    align-items: center;
    -webkit-justify-content: center;
    justify-content: center;
    -webkit-flex-shrink: 0;
    flex-shrink: 0;
    -webkit-transition: background-color 0.15s;
    transition: background-color 0.15s;
    padding: 0;
}

#kubota-finder-close:hover {
    background: rgba(255, 255, 255, 0.22);
}

/* ----------------------------------------------------------------
   Suchbereich
   ---------------------------------------------------------------- */
.kf-search-area {
    padding: 16px 18px;
    background: #f7f7f7;
    border-bottom: 1px solid #e5e5e5;
}

.kf-examples-label {
    margin: 0 0 8px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: #888;
}

.kf-examples {
    display: -webkit-flex;
    display: flex;
    -webkit-flex-wrap: wrap;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 12px;
}

.kf-example {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 20px;
    padding: 4px 12px;
    font-size: 12px;
    font-family: inherit;
    color: #444;
    cursor: pointer;
    -webkit-transition: border-color 0.15s, color 0.15s;
    transition: border-color 0.15s, color 0.15s;
    line-height: 1.4;
}

.kf-example:hover {
    border-color: #C8102E;
    color: #C8102E;
}

.kf-input-wrap {
    margin-bottom: 10px;
}

#kubota-finder-input {
    width: 100%;
    border: 2px solid #ddd;
    border-radius: 5px;
    padding: 10px 12px;
    font-family: inherit;
    font-size: 13px;
    line-height: 1.5;
    color: #1a1a1a;
    background: #fff;
    resize: none;
    -webkit-box-sizing: border-box;
    box-sizing: border-box;
    -webkit-transition: border-color 0.2s;
    transition: border-color 0.2s;
    /* Bootstrap-Override: kein box-shadow beim Fokus */
    -webkit-box-shadow: none;
    box-shadow: none;
}

#kubota-finder-input:focus {
    outline: none;
    border-color: #C8102E;
    -webkit-box-shadow: none;
    box-shadow: none;
}

.kf-search-btn {
    display: -webkit-flex;
    display: flex;
    -webkit-align-items: center;
    align-items: center;
    -webkit-justify-content: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    background-color: #C8102E;
    color: #fff;
    border: none;
    border-radius: 5px;
    padding: 11px 18px;
    font-family: inherit;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    -webkit-transition: background-color 0.2s;
    transition: background-color 0.2s;
    line-height: 1;
}

.kf-search-btn:hover:not([disabled]) {
    background-color: #a50d24;
}

.kf-search-btn[disabled] {
    opacity: 0.45;
    cursor: not-allowed;
}

.kf-search-btn svg {
    width: 17px;
    height: 17px;
}

/* ----------------------------------------------------------------
   Ladeanimation
   ---------------------------------------------------------------- */
#kubota-finder-loading {
    padding: 36px 18px;
    text-align: center;
}

.kf-spinner {
    width: 38px;
    height: 38px;
    border: 3px solid #eee;
    border-top-color: #C8102E;
    border-radius: 50%;
    margin: 0 auto 14px;
    -webkit-animation: kf-spin 0.75s linear infinite;
    animation: kf-spin 0.75s linear infinite;
}

@-webkit-keyframes kf-spin {
    to { -webkit-transform: rotate(360deg); transform: rotate(360deg); }
}
@keyframes kf-spin {
    to { transform: rotate(360deg); }
}

#kubota-finder-loading p {
    margin: 0 0 5px;
    font-weight: 600;
    font-size: 14px;
    color: #1a1a1a;
}

#kubota-finder-loading small {
    display: block;
    color: #888;
    font-size: 12px;
    min-height: 16px;
}

/* ----------------------------------------------------------------
   Fehlermeldung
   ---------------------------------------------------------------- */
#kubota-finder-error {
    margin: 14px 18px;
    padding: 11px 14px;
    background: #fff5f5;
    border: 1px solid #fca5a5;
    border-radius: 5px;
    color: #b91c1c;
    font-size: 13px;
}

#kubota-finder-error p { margin: 0; }

/* ----------------------------------------------------------------
   Diagnose-Box
   ---------------------------------------------------------------- */
#kf-diagnosis-box {
    margin: 14px 18px 0;
    border-left: 4px solid #C8102E;
    background: #fff8f9;
    border-radius: 0 5px 5px 0;
    overflow: hidden;
}

.kf-diagnosis-grid {
    display: -webkit-flex;
    display: flex;
    -webkit-flex-wrap: wrap;
    flex-wrap: wrap;
}

.kf-diag-item {
    -webkit-flex: 1;
    flex: 1;
    min-width: 100px;
    padding: 8px 12px;
    border-right: 1px solid #fce7ea;
    display: -webkit-flex;
    display: flex;
    -webkit-flex-direction: column;
    flex-direction: column;
    gap: 2px;
}

.kf-diag-item:last-child { border-right: none; }

.kf-diag-label {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: #aaa;
}

.kf-diag-value {
    font-size: 13px;
    font-weight: 600;
    color: #1a1a1a;
}

.kf-tech-hint {
    margin: 0;
    padding: 8px 12px;
    border-top: 1px solid #fce7ea;
    font-size: 12px;
    color: #7c3a44;
    background: #fff0f2;
    line-height: 1.45;
}

/* ----------------------------------------------------------------
   Ergebnis-Header
   ---------------------------------------------------------------- */
.kf-results-header {
    display: -webkit-flex;
    display: flex;
    -webkit-align-items: center;
    align-items: center;
    -webkit-justify-content: space-between;
    justify-content: space-between;
    padding: 12px 18px 6px;
}

.kf-results-header h3 {
    margin: 0;
    font-size: 14px;
    font-weight: 700;
    color: #1a1a1a;
}

.kf-all-link {
    font-size: 12px;
    color: #C8102E;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
}

.kf-all-link:hover { text-decoration: underline; color: #a50d24; }

/* ----------------------------------------------------------------
   Produkt-Grid
   ---------------------------------------------------------------- */
/* kf-grid: initial display:none, wird per JS auf flex gesetzt */
.kf-grid {
    display: -webkit-flex;
    display: flex;
    -webkit-flex-wrap: wrap;
    flex-wrap: wrap;
    gap: 10px;
    padding: 0 18px 18px;
}

.kf-product-card {
    display: -webkit-flex;
    display: flex;
    -webkit-flex-direction: column;
    flex-direction: column;
    width: calc(33.333% - 7px);
    min-width: 150px;
    background: #fff;
    border: 1px solid #e5e5e5;
    border-radius: 6px;
    text-decoration: none;
    color: inherit;
    overflow: hidden;
    -webkit-transition: border-color 0.18s, -webkit-transform 0.18s, box-shadow 0.18s;
    transition: border-color 0.18s, transform 0.18s, box-shadow 0.18s;
    -webkit-box-sizing: border-box;
    box-sizing: border-box;
}

.kf-product-card:hover {
    border-color: #C8102E;
    -webkit-transform: translateY(-2px);
    transform: translateY(-2px);
    box-shadow: 0 5px 16px rgba(200, 16, 46, 0.12);
    color: inherit;
    text-decoration: none;
}

.kf-card-img {
    height: 100px;
    background: #fafafa;
    display: -webkit-flex;
    display: flex;
    -webkit-align-items: center;
    align-items: center;
    -webkit-justify-content: center;
    justify-content: center;
    border-bottom: 1px solid #eee;
    overflow: hidden;
}

.kf-card-img img {
    max-width: 90%;
    max-height: 88px;
    object-fit: contain;
}

.kf-no-img {
    font-size: 28px;
    opacity: 0.2;
}

.kf-card-body {
    padding: 8px 10px;
    display: -webkit-flex;
    display: flex;
    -webkit-flex-direction: column;
    flex-direction: column;
    gap: 3px;
    -webkit-flex: 1;
    flex: 1;
}

.kf-card-name {
    margin: 0;
    font-size: 12px;
    font-weight: 600;
    color: #1a1a1a;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.kf-card-sku {
    margin: 0;
    font-size: 10px;
    color: #aaa;
}

.kf-card-footer {
    display: -webkit-flex;
    display: flex;
    -webkit-align-items: center;
    align-items: center;
    -webkit-justify-content: space-between;
    justify-content: space-between;
    margin-top: auto;
    padding-top: 5px;
}

.kf-card-price {
    font-size: 13px;
    font-weight: 700;
    color: #C8102E;
}

.kf-stock {
    font-size: 10px;
    font-weight: 600;
    padding: 2px 5px;
    border-radius: 3px;
    white-space: nowrap;
}

.kf-stock-yes { background: #dcfce7; color: #16a34a; }
.kf-stock-no  { background: #fef9c3; color: #b45309; }

/* ----------------------------------------------------------------
   Keine Ergebnisse
   ---------------------------------------------------------------- */
#kf-no-results {
    padding: 24px 18px;
    text-align: center;
    color: #888;
    font-size: 13px;
}

#kf-no-results p { margin: 0 0 10px; }

#kf-no-results a {
    color: #C8102E;
    font-weight: 600;
    text-decoration: none;
}

#kf-no-results a:hover { text-decoration: underline; }

/* ----------------------------------------------------------------
   Responsive (Mobile Bootstrap xs)
   ---------------------------------------------------------------- */
@media (max-width: 480px) {
    #kubota-finder-trigger { bottom: 16px; right: 16px; }

    /* Auf Mobile nur Icon zeigen */
    #kubota-finder-btn > span { display: none; }
    #kubota-finder-btn { padding: 14px; border-radius: 50%; }

    /* 2-spaltig auf Mobile */
    .kf-product-card { width: calc(50% - 5px); }

    .kf-diagnosis-grid { -webkit-flex-direction: column; flex-direction: column; }
    .kf-diag-item { border-right: none; border-bottom: 1px solid #fce7ea; }
    .kf-diag-item:last-child { border-bottom: none; }
}
