/* Ferwer AI nákupní rádce – widget (beta) */

.fwa-root {
    position: fixed;
    right: 18px;
    bottom: 18px;
    z-index: 99990;
    font-family: inherit;
}

/* Bublina */
.fwa-bubble {
    display: flex;
    align-items: center;
    gap: 8px;
    border: none;
    border-radius: 999px;
    background: #1a1a1a;
    color: #fff;
    padding: 12px 18px;
    font-size: 14px;
    cursor: pointer;
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.25);
    transition: transform 0.15s ease;
}

.fwa-bubble:hover { transform: translateY(-2px); }
.fwa-bubble-icon { font-size: 16px; }
.fwa-bubble-open .fwa-bubble-text { display: none; }

/* Panel */
.fwa-panel {
    display: flex;
    flex-direction: column;
    width: 380px;
    max-width: calc(100vw - 24px);
    height: 560px;
    max-height: calc(100vh - 110px);
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.28);
    overflow: hidden;
    margin-bottom: 12px;
}

.fwa-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
    padding: 14px 16px;
    background: #1a1a1a;
    color: #fff;
}

.fwa-title { font-size: 15px; font-weight: 600; }
.fwa-disclosure { font-size: 11px; opacity: 0.75; margin-top: 2px; line-height: 1.35; }

.fwa-head-btns {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.fwa-close,
.fwa-new {
    border: none;
    background: transparent;
    color: #fff;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    padding: 0 2px;
}

.fwa-new { font-size: 17px; opacity: 0.85; }
.fwa-new:hover { opacity: 1; }

.fwa-body {
    flex: 1;
    overflow-y: auto;
    padding: 14px;
    background: #f7f7f7;
}

/* Zprávy */
.fwa-msg {
    max-width: 85%;
    padding: 9px 12px;
    border-radius: 12px;
    margin-bottom: 8px;
    font-size: 13.5px;
    line-height: 1.45;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.fwa-msg-user {
    margin-left: auto;
    background: #1a1a1a;
    color: #fff;
    border-bottom-right-radius: 4px;
}

.fwa-msg-ai {
    margin-right: auto;
    background: #fff;
    color: #222;
    border: 1px solid #e6e6e6;
    border-bottom-left-radius: 4px;
}

.fwa-thinking { color: #888; font-style: italic; }

/* Historie – časový oddělovač konverzací */
.fwa-sep {
    text-align: center;
    font-size: 11px;
    color: #9a9a9a;
    margin: 12px 0 8px;
}

/* Starter */
.fwa-starter { margin: 4px 0 10px; }
.fwa-starter-btn {
    border: 1px solid #1a1a1a;
    background: #fff;
    color: #1a1a1a;
    border-radius: 999px;
    padding: 8px 14px;
    font-size: 13px;
    cursor: pointer;
}
.fwa-starter-btn:hover { background: #1a1a1a; color: #fff; }

/* Produktové karty */
.fwa-cards {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 4px 0 10px;
}

.fwa-card {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #fff;
    border: 1px solid #e2e2e2;
    border-radius: 10px;
    padding: 8px;
}

.fwa-card-link {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    min-width: 0;
    text-decoration: none;
    color: inherit;
}

.fwa-card-img {
    width: 52px;
    height: 52px;
    object-fit: contain;
    flex-shrink: 0;
    border-radius: 6px;
    background: #fafafa;
}

.fwa-card-info { min-width: 0; }
.fwa-card-brand { font-size: 11px; color: #888; text-transform: uppercase; letter-spacing: 0.03em; }
.fwa-card-name {
    font-size: 13px;
    font-weight: 500;
    color: #222;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}
.fwa-card-price-row { display: flex; gap: 6px; align-items: baseline; margin-top: 2px; }
.fwa-card-price { font-size: 13.5px; font-weight: 700; color: #1a1a1a; }
.fwa-card-price-old { font-size: 11.5px; color: #999; text-decoration: line-through; }

.fwa-card-add {
    flex-shrink: 0;
    border: none;
    background: #1a1a1a;
    color: #fff;
    border-radius: 8px;
    padding: 9px 12px;
    font-size: 12.5px;
    cursor: pointer;
    max-width: 110px;
}
.fwa-card-add:disabled { background: #bbb; cursor: default; }
.fwa-card-add.fwa-card-added { background: #2e7d32; }

/* Vstup */
.fwa-form {
    display: flex;
    gap: 8px;
    padding: 10px;
    background: #fff;
    border-top: 1px solid #e6e6e6;
}

.fwa-input {
    flex: 1;
    border: 1px solid #ddd;
    border-radius: 10px;
    padding: 9px 12px;
    font-size: 13.5px;
    resize: none;
    font-family: inherit;
    max-height: 90px;
}
.fwa-input:focus { outline: none; border-color: #1a1a1a; }

.fwa-send {
    border: none;
    background: #1a1a1a;
    color: #fff;
    border-radius: 10px;
    padding: 0 16px;
    font-size: 13.5px;
    cursor: pointer;
}
.fwa-send:disabled { background: #bbb; cursor: default; }

/* Diktování */
.fwa-mic {
    border: 1px solid #ddd;
    background: #fff;
    border-radius: 10px;
    min-width: 44px;
    font-size: 16px;
    cursor: pointer;
    flex-shrink: 0;
}
.fwa-mic:disabled { opacity: 0.6; cursor: default; }
.fwa-mic-rec {
    background: #c62828;
    border-color: #c62828;
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    animation: fwa-pulse 1.2s ease-in-out infinite;
}
.fwa-mic-count { background: #e65100; border-color: #e65100; }
@keyframes fwa-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(198, 40, 40, 0.45); }
    50% { box-shadow: 0 0 0 6px rgba(198, 40, 40, 0); }
}

/* CTA v prázdném vyhledávání (autocomplete dropdown) */
.fwa-search-empty-cta {
    display: block;
    margin: 10px auto 14px;
    border: 1px solid #1a1a1a;
    background: #fff;
    color: #1a1a1a;
    border-radius: 999px;
    padding: 8px 16px;
    font-size: 13px;
    cursor: pointer;
}
.fwa-search-empty-cta:hover { background: #1a1a1a; color: #fff; }

/* Mobil – jen malá kulatá ikonka nad spodní lištou */
@media (max-width: 480px) {
    .fwa-root { right: 12px; bottom: 86px; }
    .fwa-bubble {
        width: 46px;
        height: 46px;
        padding: 0;
        justify-content: center;
        gap: 0;
    }
    .fwa-bubble-text { display: none; }
    .fwa-bubble-icon { font-size: 20px; }

    /* Otevřený chat: bublinu schovat (zavírá se křížkem v hlavičce) */
    .fwa-bubble.fwa-bubble-open { display: none; }

    /* iOS Safari zoomuje na fokus pole s font-size < 16px – držet 16px */
    .fwa-input { font-size: 16px; }

    /* Panel přes celou šířku, dole u okraje, nahoře odstup */
    .fwa-panel {
        position: fixed;
        left: 10px;
        right: 10px;
        bottom: 10px;
        width: auto;
        margin-bottom: 0;
        height: calc(100vh - 80px);
        height: calc(100dvh - 80px);
        max-height: none;
    }
}
