/* Reparo Chat Widget — Mobile-First, namespaced .rc- */

/* === Bubble (geschlossen) === */
.rc-bubble {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: #344e41;
    color: #fff;
    border: none;
    cursor: pointer;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.22);
    z-index: 9998;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 180ms ease, background 180ms ease;
    padding: 0;
}
.rc-bubble:hover { background: #3a5a40; transform: scale(1.05); }
.rc-bubble:focus-visible { outline: 3px solid #e9c46a; outline-offset: 3px; }
.rc-bubble svg { width: 28px; height: 28px; fill: #fff; }
.rc-bubble[hidden] { display: none !important; }

/* === Fenster (offen) === */
.rc-window {
    position: fixed;
    inset: 0;
    background: #fff;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color: #2b2b2b;
    animation: rc-slide 220ms ease-out;
}
.rc-window[hidden] { display: none !important; }
@keyframes rc-slide {
    from { transform: translateY(20px); opacity: 0; }
    to   { transform: translateY(0);    opacity: 1; }
}

/* === Header === */
.rc-header {
    background: #344e41;
    color: #fff;
    padding: 14px 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}
.rc-header-title {
    font-size: 1.05rem;
    font-weight: 600;
    flex: 1;
    margin: 0;
}
.rc-back, .rc-close {
    background: transparent;
    border: 0;
    color: #fff;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 150ms ease;
    padding: 0;
    font-size: 1.4rem;
    line-height: 1;
}
.rc-back:hover, .rc-close:hover { background: rgba(255, 255, 255, 0.15); }
.rc-back[hidden] { visibility: hidden; }

/* === Body (Scroll-Bereich) === */
.rc-body {
    flex: 1 1 auto;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 16px;
    background: #f7f9f5;
}
.rc-body::-webkit-scrollbar { width: 8px; }
.rc-body::-webkit-scrollbar-thumb { background: #c9d3c4; border-radius: 4px; }

/* === Bot-Nachricht === */
.rc-message {
    background: #fff;
    border: 1px solid #e3e8df;
    border-radius: 12px;
    padding: 14px 16px;
    margin-bottom: 14px;
    line-height: 1.55;
    font-size: 0.97rem;
    animation: rc-fade 180ms ease-out;
}
.rc-message strong { color: #344e41; }
.rc-message p { margin: 0 0 8px; }
.rc-message p:last-child { margin: 0; }
.rc-message ol, .rc-message ul { margin: 8px 0; padding-left: 22px; }
.rc-message li { margin-bottom: 4px; }
.rc-question {
    color: #344e41;
    font-weight: 600;
    margin: 0 0 10px;
    font-size: 1rem;
}
@keyframes rc-fade {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* === Button-Liste (Kategorien, Marken, Modelle, Reparaturen) === */
.rc-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 12px;
}
.rc-options-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    margin-bottom: 12px;
}
.rc-btn {
    background: #fff;
    border: 1.5px solid #d6dccf;
    color: #344e41;
    padding: 12px 14px;
    border-radius: 10px;
    text-align: left;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 500;
    transition: all 150ms ease;
    line-height: 1.35;
    min-height: 48px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    width: 100%;
    font-family: inherit;
}
.rc-btn:hover, .rc-btn:focus-visible {
    background: #eef2ea;
    border-color: #588157;
    color: #344e41;
    outline: none;
}
.rc-btn::after {
    content: "›";
    color: #588157;
    font-size: 1.3rem;
    flex-shrink: 0;
    line-height: 1;
}
.rc-btn-text {
    flex: 1;
    min-width: 0;
}

/* === Repair-Karte (Preisanzeige) === */
.rc-repair-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 16px;
}
.rc-repair {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #fff;
    border: 1px solid #e3e8df;
    border-radius: 10px;
    padding: 12px 14px;
    text-decoration: none;
    color: #2b2b2b;
    gap: 10px;
    transition: all 150ms ease;
}
.rc-repair:hover {
    border-color: #588157;
    background: #f1efe8;
}
.rc-repair-info {
    flex: 1;
    min-width: 0;
}
.rc-repair-title {
    font-weight: 600;
    color: #344e41;
    font-size: 0.95rem;
    line-height: 1.3;
    margin: 0 0 2px;
}
.rc-repair-meta {
    font-size: 0.8rem;
    color: #6b7765;
    margin: 0;
}
.rc-repair-price {
    color: #344e41;
    font-weight: 700;
    font-size: 1rem;
    flex-shrink: 0;
    white-space: nowrap;
}

/* === CTAs (Anrufen + Termin buchen) === */
.rc-cta {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid #e3e8df;
}
.rc-cta-btn {
    flex: 1;
    padding: 14px 16px;
    border-radius: 10px;
    text-align: center;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.98rem;
    border: 2px solid transparent;
    transition: all 150ms ease;
    cursor: pointer;
    display: inline-block;
    line-height: 1.2;
}
.rc-cta-call {
    background: #fff;
    color: #344e41;
    border-color: #344e41;
}
.rc-cta-call:hover { background: #344e41; color: #fff; }
.rc-cta-book {
    background: #e9c46a;
    color: #fff;
    border-color: #e9c46a;
}
.rc-cta-book:hover { background: #d9b25a; border-color: #d9b25a; color: #fff; }

/* === Footer (Suchfeld) === */
.rc-footer {
    flex-shrink: 0;
    border-top: 1px solid #e3e8df;
    padding: 10px 12px;
    background: #fff;
    display: flex;
    gap: 8px;
}
.rc-search {
    flex: 1;
    padding: 11px 14px;
    border: 1.5px solid #d6dccf;
    border-radius: 10px;
    font-size: 0.95rem;
    font-family: inherit;
    color: #2b2b2b;
    background: #f7f9f5;
    outline: none;
    min-width: 0;
}
.rc-search:focus {
    border-color: #588157;
    background: #fff;
}
.rc-search-btn {
    background: #344e41;
    color: #fff;
    border: 0;
    width: 44px;
    height: 44px;
    border-radius: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-family: inherit;
    transition: background 150ms ease;
}
.rc-search-btn:hover { background: #3a5a40; }
.rc-search-btn svg { width: 20px; height: 20px; fill: #fff; }
.rc-divider {
    text-align: center;
    color: #6b7765;
    font-size: 0.82rem;
    margin: 14px 0 8px;
    position: relative;
}
.rc-divider::before, .rc-divider::after {
    content: "";
    position: absolute;
    top: 50%;
    width: 30%;
    height: 1px;
    background: #d6dccf;
}
.rc-divider::before { left: 0; }
.rc-divider::after  { right: 0; }

/* === Hilfen === */
.rc-info {
    background: #eef2ea;
    border-left: 3px solid #588157;
    padding: 10px 12px;
    border-radius: 6px;
    font-size: 0.9rem;
    margin-bottom: 14px;
    line-height: 1.5;
}
.rc-info strong { color: #344e41; }
.rc-empty {
    text-align: center;
    color: #6b7765;
    padding: 24px 12px;
    font-size: 0.95rem;
}

/* === Tablet / Desktop === */
@media (min-width: 768px) {
    .rc-window {
        inset: auto;
        bottom: 90px;
        right: 16px;
        width: 380px;
        max-width: calc(100vw - 32px);
        height: 560px;
        max-height: calc(100vh - 110px);
        border-radius: 16px;
        box-shadow: 0 12px 40px rgba(0, 0, 0, 0.18);
        overflow: hidden;
    }
    .rc-header { border-radius: 16px 16px 0 0; }
    .rc-cta { flex-direction: row; }
    .rc-bubble { bottom: 20px; right: 20px; }
    .rc-options-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 480px) {
    .rc-options-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (min-width: 768px) {
    .rc-options-grid { grid-template-columns: repeat(2, 1fr); }
}

/* Reset für ältere Browser */
.rc-window *, .rc-bubble {
    box-sizing: border-box;
}

/* Body-Lock wenn Chat offen ist (nur Mobile) */
body.rc-chat-open { overflow: hidden; }
@media (min-width: 768px) {
    body.rc-chat-open { overflow: auto; }
}
