/* ─── KaufHier Shops Plugin ─────────────────────────────────────────────── */

.kh-shops-wrapper {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px 0;
    font-family: inherit;
}

/* ─── Suchleiste ─────────────────────────────────────────────────────────── */
.kh-search-form {
    margin-bottom: 24px;
}

.kh-search-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.kh-search-input {
    flex: 1;
    min-width: 200px;
    padding: 10px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 15px;
    outline: none;
    transition: border-color 0.2s;
}

.kh-search-input:focus {
    border-color: #0073aa;
}

/* Kategorie-Buttons */
.kh-cat-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid #eee;
}

.kh-cat-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    border: 1.5px solid #e2e2e2;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    color: #333;
    background: #fff;
    text-decoration: none;
    transition: all 0.15s;
    cursor: pointer;
    white-space: nowrap;
}

.kh-cat-btn:hover {
    border-color: #6c47ff;
    color: #6c47ff;
    background: #f5f0ff;
    text-decoration: none;
}

.kh-cat-btn.active {
    background: #6c47ff;
    border-color: #6c47ff;
    color: #fff;
}

.kh-cat-btn.active .kh-cat-count {
    background: rgba(255,255,255,0.25);
    color: #fff;
}

.kh-cat-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 20px;
    padding: 0 6px;
    border-radius: 5px;
    background: #eee;
    color: #666;
    font-size: 12px;
    font-weight: 700;
}

.kh-search-btn {
    padding: 10px 24px;
    background: #0073aa;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    cursor: pointer;
    transition: background 0.2s;
}

.kh-search-btn:hover {
    background: #005f8a;
}

.kh-reset-btn {
    padding: 10px 16px;
    color: #666;
    text-decoration: none;
    font-size: 14px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    transition: all 0.2s;
}

.kh-reset-btn:hover {
    border-color: #999;
    color: #333;
}

/* ─── Ergebnis-Info ──────────────────────────────────────────────────────── */
.kh-result-count {
    color: #666;
    font-size: 14px;
    margin-bottom: 20px;
}

/* ─── No Results ─────────────────────────────────────────────────────────── */
.kh-no-results {
    text-align: center;
    padding: 60px 20px;
    color: #999;
    font-size: 16px;
}

/* ─── Grid ───────────────────────────────────────────────────────────────── */
.kh-shops-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
}

/* ─── Shop Card ──────────────────────────────────────────────────────────── */
.kh-shop-card {
    border: 1px solid #e8e8e8;
    border-radius: 12px;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    flex-direction: column;
}

.kh-shop-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
}

/* ─── Banner ─────────────────────────────────────────────────────────────── */
.kh-shop-banner {
    width: 100%;
    background: #f8f8f8;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px;
    box-sizing: border-box;
    border-bottom: 1px solid #f0f0f0;
}

.kh-shop-banner img {
    width: 100%;
    height: auto;          /* Natürliche Proportionen — kein grauer Leerraum */
    max-height: 180px;
    object-fit: contain;
    display: block;
    border-radius: 4px;
}

/* Kein Banner → kleiner farbiger Placeholder mit Shop-Initial */
.kh-shop-banner-placeholder {
    width: 100%;
    height: 80px;
    background: linear-gradient(135deg, #0073aa 0%, #005f8a 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    font-weight: 700;
    color: rgba(255,255,255,0.8);
    letter-spacing: 2px;
}

/* ─── Card Body ──────────────────────────────────────────────────────────── */
.kh-shop-body {
    padding: 14px 16px 16px;
    display: flex;
    flex-direction: column;
    flex: 1;
    gap: 6px;
}

/* ─── Shop Logo (klein, neben Titel) ─────────────────────────────────────── */
.kh-shop-header {
    display: flex;
    align-items: center;
    gap: 10px;
}

.kh-shop-logo {
    width: 40px;
    height: 40px;
    object-fit: contain;
    border-radius: 6px;
    border: 1px solid #eee;
    flex-shrink: 0;
}

/* ─── Titel ──────────────────────────────────────────────────────────────── */
.kh-shop-title {
    font-size: 16px;
    font-weight: 600;
    margin: 0;
    color: #1a1a1a;
    line-height: 1.3;
}

/* ─── Kategorie-Badge ────────────────────────────────────────────────────── */
.kh-shop-category {
    display: inline-block;
    font-size: 11px;
    padding: 3px 10px;
    background: #f0f7ff;
    color: #0073aa;
    border-radius: 20px;
    font-weight: 500;
    align-self: flex-start;
}

/* ─── Beschreibung ───────────────────────────────────────────────────────── */
.kh-shop-desc {
    font-size: 13px;
    color: #666;
    line-height: 1.5;
    margin: 0;
    flex: 1;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ─── Button ─────────────────────────────────────────────────────────────── */
.kh-shop-btn {
    display: inline-block;
    padding: 8px 16px;
    background: #0073aa;
    color: #fff !important;
    text-decoration: none;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    text-align: center;
    transition: background 0.2s;
    margin-top: 8px;
    align-self: flex-start;
}

.kh-shop-btn:hover {
    background: #005f8a;
    color: #fff !important;
}

/* ─── Karte klickbar ─────────────────────────────────────────────────────── */
.kh-shop-card {
    cursor: pointer;
}

.kh-shop-more {
    display: inline-block;
    margin-top: 8px;
    font-size: 13px;
    color: #0073aa;
    font-weight: 500;
}

/* ─── Modal Overlay ──────────────────────────────────────────────────────── */
.kh-modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    z-index: 99999;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
}

.kh-modal-overlay.kh-modal-open {
    display: flex;
}

/* ─── Modal Box ──────────────────────────────────────────────────────────── */
.kh-modal {
    background: #fff;
    border-radius: 14px;
    padding: 28px;
    max-width: 500px;
    width: 100%;
    position: relative;
    box-shadow: 0 20px 60px rgba(0,0,0,0.25);
    animation: kh-modal-in 0.2s ease;
}

@keyframes kh-modal-in {
    from { opacity: 0; transform: translateY(20px) scale(0.97); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* ─── Modal Schließen ────────────────────────────────────────────────────── */
.kh-modal-close {
    position: absolute;
    top: 14px;
    right: 16px;
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: #999;
    line-height: 1;
    padding: 4px 8px;
    border-radius: 6px;
    transition: background 0.15s, color 0.15s;
}

.kh-modal-close:hover {
    background: #f0f0f0;
    color: #333;
}

/* ─── Modal Header (Logo + Titel) ────────────────────────────────────────── */
.kh-modal-header {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 14px;
    padding-right: 30px;
}

.kh-modal-logo {
    width: 56px;
    height: 56px;
    object-fit: contain;
    border-radius: 10px;
    border: 1px solid #eee;
    flex-shrink: 0;
}

.kh-modal-title {
    font-size: 20px;
    font-weight: 700;
    margin: 0 0 5px 0;
    color: #1a1a1a;
}

/* ─── Modal Beschreibung ─────────────────────────────────────────────────── */
.kh-modal-desc {
    font-size: 14px;
    color: #555;
    line-height: 1.6;
    margin: 14px 0 24px 0;
    max-height: 160px;
    overflow-y: auto;
}

/* ─── Modal Hinweis ──────────────────────────────────────────────────────── */
.kh-modal-hint {
    background: #fff8e1;
    border: 1px solid #ffe082;
    border-left: 4px solid #ffc107;
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 14px;
    color: #5a4000;
    margin-bottom: 20px;
    line-height: 1.5;
}

/* ─── Modal Buttons ──────────────────────────────────────────────────────── */
.kh-modal-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.kh-btn {
    flex: 1;
    padding: 12px 20px;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
    text-align: center;
    transition: background 0.2s, transform 0.1s;
    min-width: 130px;
}

.kh-btn:active {
    transform: scale(0.97);
}

.kh-btn-secondary {
    background: #f0f0f0;
    color: #333 !important;
    border: 2px solid #e0e0e0;
}

.kh-btn-secondary:hover {
    background: #e4e4e4;
    color: #111 !important;
}

.kh-btn-primary {
    background: #0073aa;
    color: #fff !important;
    border: 2px solid #0073aa;
}

.kh-btn-primary:hover {
    background: #005f8a;
    border-color: #005f8a;
    color: #fff !important;
}

/* ─── Responsive ─────────────────────────────────────────────────────────── */
@media (max-width: 600px) {
    .kh-search-bar {
        flex-direction: column;
    }
    .kh-search-input,
    .kh-search-btn,
    .kh-reset-btn {
        width: 100%;
        box-sizing: border-box;
    }
    .kh-shops-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    .kh-modal {
        padding: 20px;
    }
    .kh-modal-actions {
        flex-direction: column;
    }
    .kh-btn {
        width: 100%;
    }
}
