/* Štýl pre celý chatbot */
.chatbot-container {
    max-width: 700px;
    min-width: 600px;
    margin: 20px auto;
    border: 1px solid #ddd;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    font-family: Arial, sans-serif;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: calc(65vh - 40px); /* Roztiahnutie na celú výšku okna s paddingom */
    padding: 20px;
}

/* Hlavička chatbota */
.chatbot-header {
    background-color: #0078d4;
    color: white;
    padding: 10px;
    border-radius: 10px 10px 0 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
}

.chatbot-header img {
    width: 30px;
    height: 30px;
    margin-right: 10px;
    border-radius: 50%;
}

/* Chatové správy */
.chatbot-messages {
    padding: 10px;
    overflow-y: auto;
    flex: 1;
    background-color: #fafafa;
}

.user-message,
.bot-message {
    margin: 10px 0;
    padding: 10px;
    border-radius: 5px;
    max-width: 80%;
}

.user-message {
    background-color: #0078d4;
    color: white;
    margin-left: auto;
}

.bot-message {
    background-color: #ececec;
    color: #333;
    margin-right: auto;
}

/* Loader - animácia bodov */
.chatbot-loader {
    text-align: center;
    padding: 10px;
    font-style: italic;
    color: #666;
}

.chatbot-loader .dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    margin: 0 5px;
    background-color: #333;
    border-radius: 50%;
    animation: blink 1.4s infinite ease-in-out both;
}

.chatbot-loader .dot:nth-child(1) { animation-delay: -0.32s; }
.chatbot-loader .dot:nth-child(2) { animation-delay: -0.16s; }

@keyframes blink {
    0%, 80%, 100% { transform: scale(0); }
    40% { transform: scale(1); }
}

/* Textové pole a tlačidlo */
.chatbot-input {
    display: flex;
    border-top: 1px solid #ddd;
    padding: 10px;
    background-color: #fff;
}

.chatbot-input input {
    flex: 1;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
}

.chatbot-send {
    background-color: #0078d4;
    color: white;
    border: none;
    padding: 10px;
    margin-left: 5px;
    border-radius: 5px;
    cursor: pointer;
}

.chatbot-send:hover {
    background-color: #005bb5;
}

/* Klikateľné návrhy */
.suggestions {
    display: flex;
    flex-wrap: wrap;
    margin-top: 10px;
    justify-content: space-between;
}

.suggestions button {
    background-color: #f5f5f5;
    color: #333;
    border: 1px solid #ddd;
    border-radius: 5px;
    margin: 5px;
    padding: 10px;
    cursor: pointer;
    text-align: center;
    flex: 1 1 calc(33% - 10px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

.suggestions button:hover {
    background-color: #0078d4;
    color: white;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
}

/* Sekcia s vygenerovanými produktmi */
.chatbot-products {
    margin: 20px auto;
    width: 95%;
    padding: 10px;
    overflow-y: auto;
    max-height: calc(100vh - 40px); /* Produkty sa scrollujú na výšku okna */
}

/* Produkty podľa kategórie */
.chatbot-products-container {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.category-block {
    border: 1px solid #ddd;
    padding: 1rem;
    border-radius: 8px;
    background-color: #f9f9f9;
}

.category-title {
    font-size: 16px;
    margin-bottom: 1rem;
    color: #333;
    font-weight: bold;
}

.category-products {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.category-products .product {
    flex: 1 1 calc(33.333% - 1rem); /* 3 produkty na riadok */
    box-sizing: border-box;
    border: 1px solid #ddd;
    background-color: #fff;
    padding: 10px;
    border-radius: 5px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.category-products .product:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.category-products .product img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
}

.category-products .product h2 {
    font-size: 1rem;
    margin-top: 0.5rem;
    color: #555;
}

.category-products .product .price {
    color: #e60023;
    font-weight: bold;
    margin-top: 0.25rem;
}

/* Mobilná optimalizácia */
@media (max-width: 768px) {
    .chatbot-container {
        max-width: 95%;
        min-width: unset;
    }

    .chatbot-products {
        width: 100%;
    }

    .suggestions button {
        flex: 1 1 calc(50% - 10px);
    }

    .chatbot-input input {
        font-size: 14px;
    }

    .chatbot-send {
        font-size: 14px;
        padding: 8px;
    }

    .category-products .product {
        flex: 1 1 calc(50% - 1rem); /* 2 produkty na riadok */
    }
}

/* Sekcia s produktmi - štýly pre rôzne rozlíšenia */
.category-products {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.category-products .product {
    flex: 1 1 calc(25% - 1rem); /* 4 produkty na riadok (predvolené pre veľké obrazovky) */
    box-sizing: border-box;
    border: 1px solid #ddd;
    background-color: #fff;
    padding: 10px;
    border-radius: 5px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.category-products .product:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.category-products .product img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
}

.category-products .product h2 {
    font-size: 1rem;
    margin-top: 0.5rem;
    color: #555;
}

.category-products .product .price {
    color: #e60023;
    font-weight: bold;
    margin-top: 0.25rem;
}

/* Pri stredne veľkých obrazovkách (tablet) - 3 produkty na riadok */
@media (max-width: 1024px) {
    .category-products .product {
        flex: 1 1 calc(33.333% - 1rem); /* 3 produkty na riadok */
    }
}

/* Pri menších obrazovkách (menšie tablety a mobily) - 2 produkty na riadok */
@media (max-width: 768px) {
    .category-products .product {
        flex: 1 1 calc(50% - 1rem); /* 2 produkty na riadok */
    }
}

/* Pri mobilných obrazovkách (naozaj malé obrazovky) - 1 produkt na riadok */
@media (max-width: 480px) {
    .category-products .product {
        flex: 1 1 100%; /* 1 produkt na riadok */
    }

    /* Umiestnenie produktov pod chat pri mobiloch */
    .chatbot-container + .chatbot-products {
        margin-top: 20px;
    }
}