@import url('https://webfonts.ge/fonts/bpg-extrasquare-mtavruli/css/bpg-extrasquare-mtavruli.min.css');
@import url('https://webfonts.ge/fonts/dejavu-sans/css/dejavu-sans.min.css');

#imeri-chatbot-widget {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 999999;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    font-family: var(--font-family);
}

#imeri-chatbot-widget #chat-toggle-btn {
    width: 55px;
    height: 55px;
    background: var(--primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 8px 24px rgba(140, 188, 103, 0.3);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1000000;
    overflow: hidden;
}

#imeri-chatbot-widget #chat-toggle-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 12px 30px rgba(140, 188, 103, 0.4);
}

#imeri-chatbot-widget #chat-toggle-btn.btn-hidden {
    opacity: 0 !important;
    pointer-events: none !important;
    transform: scale(0.5);
}

#imeri-chatbot-widget #chat-toggle-btn img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

:root {
    --primary: #8cbc67;
    --primary-dark: #4c5a3c;
    --accent: #8cbc67;
    --bg-light: #f4f4f4;
    --card-bg: #ffffff;
    --text-main: #333333;
    --text-grey: #777777;
    --glass: rgba(255, 255, 255, 0.95);
    --glass-border: rgba(140, 188, 103, 0.2);
    --font-family: "DejaVu Sans", "Inter", Arial, sans-serif;
    --font-title: "BPG ExtraSquare Mtavruli", "DejaVu Sans", sans-serif;
    --shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
}





#imeri-chatbot-widget #chat-container {
    width: min(400px, 90vw);
    height: min(650px, 80vh);
    max-height: 800px;
    background: var(--card-bg);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.12);
    display: flex;
    flex-direction: column;
    backdrop-filter: blur(10px);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    transform-origin: bottom right;
    position: relative;
}

@media (max-width: 480px) {
    #imeri-chatbot-widget {
        right: 15px;
        bottom: 15px;
    }

    #imeri-chatbot-widget #chat-container {
        width: calc(100vw - 30px);
        height: min(600px, 85vh);
        border-radius: 20px;
    }

    #imeri-chatbot-widget #chat-close-btn {
        width: 36px;
        height: 36px;
        font-size: 22px;
        top: -10px;
    }
}

#imeri-chatbot-widget #chat-container.chat-hidden {
    opacity: 0 !important;
    transform: scale(0.6) translateY(40px) !important;
    pointer-events: none !important;
    visibility: hidden !important;
    height: 0 !important;
    margin: 0 !important;
    border: none !important;
}

#imeri-chatbot-widget #chat-container:not(.chat-hidden) {
    opacity: 1 !important;
    transform: scale(1) translateY(0) !important;
    pointer-events: auto !important;
    visibility: visible !important;
}

#imeri-chatbot-widget header {
    border-radius: 24px 24px 0 0;
    padding: 20px;
    background: white;
    border-bottom: 2px solid #f0f0f0;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    position: relative;
    z-index: 10;
}

#imeri-chatbot-widget .header-top {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
}

#imeri-chatbot-widget #chat-close-btn {
    position: absolute;
    right: 0px;
    top: -15px;
    transform: translateY(-100%);
    width: 40px;
    height: 40px;
    background: white;
    border: 2px solid white;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    border-radius: 50%;
    font-size: 26px;
    color: var(--text-grey);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    line-height: 1;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1000;
}

#imeri-chatbot-widget #chat-close-btn:hover {
    color: white;
    background: #ff4757;
    border-color: #ff4757;
    transform: translateY(-100%) scale(1.1) rotate(90deg);
}

#imeri-chatbot-widget #chat-info-btn {
    position: absolute;
    right: 48px;
    top: -15px;
    transform: translateY(-100%);
    width: 40px;
    height: 40px;
    background: white;
    border: 2px solid white;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    border-radius: 50%;
    color: var(--primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1000;
}

#imeri-chatbot-widget #chat-info-btn:hover {
    color: white;
    background: var(--primary);
    border-color: var(--primary);
    transform: translateY(-100%) scale(1.1);
}

#imeri-chatbot-widget .lang-selector {
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
}

#imeri-chatbot-widget .custom-lang-select {
    position: relative;
    width: auto;
    user-select: none;
}

#imeri-chatbot-widget .lang-selected {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: 2px solid rgba(140, 188, 103, 0.35);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    overflow: hidden;
    padding: 0;
}

#imeri-chatbot-widget .lang-selected:hover {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(140, 188, 103, 0.15), 0 4px 12px rgba(140, 188, 103, 0.2);
    transform: scale(1.08);
}

#imeri-chatbot-widget .custom-lang-select.active .lang-selected {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(140, 188, 103, 0.2), 0 4px 12px rgba(140, 188, 103, 0.25);
}

#imeri-chatbot-widget .lang-options {
    position: absolute;
    top: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    background: rgba(255, 255, 255, 0.97);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(140, 188, 103, 0.2);
    border-radius: 16px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.12), 0 4px 8px rgba(0, 0, 0, 0.04);
    overflow: hidden;
    display: none;
    z-index: 100;
    padding: 6px;
    min-width: 48px;
}

#imeri-chatbot-widget .custom-lang-select.active .lang-options {
    display: flex;
    flex-direction: column;
    gap: 4px;
    animation: langDropIn 0.2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes langDropIn {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(-6px) scale(0.95);
    }

    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0) scale(1);
    }
}

#imeri-chatbot-widget .lang-option {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    overflow: hidden;
}

#imeri-chatbot-widget .lang-option.selected {
    display: none;
}

#imeri-chatbot-widget .lang-option:hover {
    background-color: rgba(140, 188, 103, 0.1);
    transform: scale(1.1);
}

#imeri-chatbot-widget .flag-icon {
    display: block;
    width: 26px;
    height: 26px;
    background-size: cover;
    background-position: center;
    border-radius: 50%;
    flex-shrink: 0;
    margin: auto;
}

#imeri-chatbot-widget .ge-flag {
    background-image: url('geflag.png');
    background-size: 120%;
}

#imeri-chatbot-widget .en-flag {
    background-image: url('enflag.png');
}

#imeri-chatbot-widget .ru-flag {
    background-image: url('rusflag.png');
}

#imeri-chatbot-widget .logo-text {
    font-size: 1.4rem;
    color: var(--primary);
    font-weight: 800;
    font-family: var(--font-title);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

#imeri-chatbot-widget #header-subtitle {
    font-size: 0.8rem;
    color: var(--text-grey);
}

#imeri-chatbot-widget #chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    background:
        linear-gradient(rgba(249, 249, 249, 0.9), rgba(249, 249, 249, 0.9)),
        url('imerilogo.webp') center center / 80% auto no-repeat;
    background-color: #f9f9f9;
    position: relative;
}

@keyframes messageSlideIn {
    from {
        opacity: 0;
        transform: translateY(15px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

#imeri-chatbot-widget .message {
    max-width: 80%;
    padding: 12px 16px;
    border-radius: 16px;
    font-size: 0.85rem;
    line-height: 1.4;
    position: relative;
    z-index: 1;
    animation: messageSlideIn 0.3s ease-out forwards;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.user-message {
    align-self: flex-end;
    background: var(--primary);
    color: white;
    border-bottom-right-radius: 2px;
}

.bot-message {
    align-self: flex-start;
    background: white;
    color: var(--text-main);
    border-bottom-left-radius: 2px;
    border: 1px solid #eee;
}

.bot-message-wrapper {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    align-self: flex-start;
    max-width: 90%;
    animation: messageSlideIn 0.3s ease-out forwards;
}

.bot-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    flex-shrink: 0;
    margin-bottom: 2px;
    border: 2px solid white;
    background: var(--card-bg);
}

.bot-message-wrapper .bot-message {
    animation: none;
    max-width: calc(100% - 44px);
}

.typing {
    font-style: italic;
    font-size: 0.85rem;
    color: var(--text-grey);
    margin-bottom: 10px;
    display: none;
    padding: 0 20px;
}

#imeri-chatbot-widget .quick-replies-container {
    padding: 12px 15px;
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
    background: #f9f9f9;
    border-top: 1px solid #f0f0f0;
}

#imeri-chatbot-widget .quick-reply-btn {
    background: white;
    color: #444;
    border: 1px solid rgba(0, 0, 0, 0.03);
    padding: 8px 12px;
    border-radius: 16px;
    font-size: 0.8rem;
    cursor: pointer;
    white-space: normal;
    /* Allow text wrapping if needed */
    text-align: center;
    flex: 1 1 calc(50% - 8px);
    /* Fit two items per line, accounting for the gap */
    max-width: fit-content;
    /* Don't stretch if text is small */
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

#imeri-chatbot-widget .quick-reply-btn:hover {
    background: #f8fcf8;
    color: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(140, 188, 103, 0.15);
    border-color: var(--primary-light);
}

#imeri-chatbot-widget .quick-reply-btn:active {
    transform: translateY(0);
}

#imeri-chatbot-widget #chat-input-area {
    border-radius: 0 0 24px 24px;
    padding: 15px 20px;
    background: white;
    border-top: 1px solid #f0f0f0;
    display: flex;
    gap: 10px;
}

#imeri-chatbot-widget input {
    flex: 1;
    background: #f5f5f5;
    border: 1px solid transparent;
    border-radius: 12px;
    padding: 12px 15px;
    font-size: 0.95rem;
    outline: none;
    transition: all 0.3s ease;
}

#imeri-chatbot-widget input:focus {
    background: white;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(140, 188, 103, 0.15);
}

#imeri-chatbot-widget button {
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 10px;
    padding: 10px 20px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

#imeri-chatbot-widget button:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(140, 188, 103, 0.3);
}

#imeri-chatbot-widget button:active {
    transform: translateY(0);
}

#imeri-chatbot-widget .product-link {
    color: var(--primary);
    text-decoration: underline;
    font-weight: 600;
}

/* Product Card Styling */
#imeri-chatbot-widget .product-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
}

#imeri-chatbot-widget .product-card {
    background: #ffffff;
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    flex-direction: row;
    align-items: center;
    box-shadow: var(--shadow);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

#imeri-chatbot-widget .product-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(100, 140, 70, 0.15);
}

#imeri-chatbot-widget .product-card.status-in-stock {
    box-shadow: 0 0 15px rgba(22, 163, 74, 0.3);
    border-color: rgba(22, 163, 74, 0.5);
}

#imeri-chatbot-widget .product-card.status-in-stock:hover {
    box-shadow: 0 8px 25px rgba(22, 163, 74, 0.4);
}

#imeri-chatbot-widget .product-image {
    width: 120px;
    min-width: 120px;
    height: 100%;
    min-height: 140px;
    background-size: cover;
    background-position: center;
    background-color: #f8fafc;
    border-right: 1px solid var(--glass-border);
    position: relative;
}

#imeri-chatbot-widget .product-card.status-out-stock .product-image::before {
    content: "";
    position: absolute;
    inset: 0;
    background-color: rgba(255, 255, 255, 0.6);
    z-index: 1;
}

#imeri-chatbot-widget .product-card.status-out-stock .product-image::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60px;
    height: 60px;
    background-image: url('data:image/svg+xml;charset=UTF-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="%23dc2626" stroke-width="4" stroke-linecap="round" stroke-linejoin="round"><line x1="18" y1="6" x2="6" y2="18"></line><line x1="6" y1="6" x2="18" y2="18"></line></svg>');
    background-size: cover;
    z-index: 2;
    filter: drop-shadow(0 4px 6px rgba(220, 38, 38, 0.5));
}

#imeri-chatbot-widget .product-details {
    padding: 12px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 8px;
    flex: 1;
}

#imeri-chatbot-widget .product-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-main);
    margin: 0;
    line-height: 1.3;
}

#imeri-chatbot-widget .product-price {
    font-size: 0.9rem;
    color: var(--primary-dark);
    font-weight: 600;
}

#imeri-chatbot-widget .product-status {
    font-size: 0.75rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

#imeri-chatbot-widget .status-in-stock {
    color: #16a34a;
}

#imeri-chatbot-widget .status-out-stock {
    color: #dc2626;
}

#imeri-chatbot-widget .product-btn {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    margin-top: 8px;
    padding: 8px 12px;
    background-color: var(--primary) !important;
    color: white !important;
    text-decoration: none !important;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    transition: background-color 0.2s;
    border: none;
}

#imeri-chatbot-widget .product-btn:hover {
    background-color: var(--primary-dark) !important;
}

/* Recipe Card Styling */
#imeri-chatbot-widget .recipe-card {
    background: white;
    border-radius: 14px;
    overflow: hidden;
    border: 1px solid var(--glass-border);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.06);
    width: 100%;
}

#imeri-chatbot-widget .recipe-header {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    padding: 12px 16px;
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: 0.3px;
}

#imeri-chatbot-widget .recipe-description {
    padding: 12px 16px;
    font-size: 0.8rem;
    line-height: 1.5;
    color: var(--text-grey);
    border-bottom: 1px solid #f0f0f0;
}

#imeri-chatbot-widget .recipe-ingredients {
    padding: 8px 0;
}

#imeri-chatbot-widget .recipe-ingredient-item {
    display: flex;
    align-items: center;
    padding: 8px 16px;
    gap: 8px;
    border-bottom: 1px solid #f8f8f8;
    transition: background 0.15s;
}

#imeri-chatbot-widget .recipe-ingredient-item:last-child {
    border-bottom: none;
}

#imeri-chatbot-widget .recipe-ingredient-item:hover {
    background: #f8fcf8;
}

#imeri-chatbot-widget .recipe-ing-name {
    flex: 1;
    font-size: 0.82rem;
    color: var(--text-main);
    font-weight: 500;
}

#imeri-chatbot-widget .recipe-ing-qty {
    font-size: 0.78rem;
    color: var(--text-grey);
    font-weight: 600;
    min-width: 50px;
    text-align: right;
}

#imeri-chatbot-widget .recipe-add-btn {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: rgba(140, 188, 103, 0.1);
    border: 1px solid rgba(140, 188, 103, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    font-size: 0.85rem;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

#imeri-chatbot-widget .recipe-add-btn:hover {
    background: var(--primary);
    transform: scale(1.1);
    box-shadow: 0 3px 8px rgba(140, 188, 103, 0.3);
}

#imeri-chatbot-widget .recipe-bulk-btn {
    display: block;
    width: calc(100% - 24px);
    margin: 8px 12px 12px;
    padding: 10px 16px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark)) !important;
    color: white !important;
    border: none;
    border-radius: 10px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(140, 188, 103, 0.25);
    text-align: center;
}

#imeri-chatbot-widget .recipe-bulk-btn:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 6px 16px rgba(140, 188, 103, 0.35) !important;
}

#imeri-chatbot-widget .recipe-bulk-btn:active {
    transform: translateY(0) !important;
}

.bot-sender-name {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--primary-dark);
    margin-bottom: 2px;
    margin-left: 2px;
}

#imeri-chatbot-widget #chat-tooltip {
    position: absolute;
    right: 85px;
    bottom: 25px;
    background: white;
    color: var(--text-main);
    padding: 10px 16px;
    border-radius: 12px 12px 0 12px;
    font-size: 0.85rem;
    font-weight: 600;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    opacity: 0;
    visibility: hidden;
    transform: translateX(20px);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    white-space: nowrap;
    pointer-events: none;
    z-index: 100000;
    border: 1px solid var(--glass-border);
}

#imeri-chatbot-widget #chat-tooltip::after {
    content: '';
    position: absolute;
    right: -6px;
    bottom: 0;
    border-width: 6px 0 6px 6px;
    border-style: solid;
    border-color: transparent transparent transparent white;
}

#imeri-chatbot-widget #chat-tooltip.tooltip-visible {
    opacity: 1;
    visibility: visible;
    transform: translateX(0);
}

/* =============================================
   RESPONSIVE MEDIA QUERIES — ALL DEVICES
   ============================================= */

/* Tablets & small laptops */
@media (max-width: 768px) {
    #chat-container {
        width: min(380px, 92vw);
        height: min(620px, 85vh);
    }

    header {
        padding: 16px;
        gap: 6px;
    }

    .logo-text {
        font-size: 1.25rem;
    }

    #header-subtitle {
        font-size: 0.75rem;
    }

    .message {
        font-size: 0.84rem;
    }

    .quick-reply-btn {
        font-size: 0.78rem;
        padding: 7px 10px;
    }
}

/* Large phones (480px and below) */
@media (max-width: 480px) {
    body {
        padding: 0;
        margin: 0;
        align-items: stretch;
    }

    #chat-container {
        width: 100%;
        height: 100vh;
        height: 100dvh;
        max-height: 100vh;
        max-height: 100dvh;
        border-radius: 0;
        border: none;
        box-shadow: none;
    }

    header {
        padding: 14px 16px;
        gap: 5px;
    }

    .logo-text {
        font-size: 1.2rem;
        letter-spacing: 1px;
    }

    #header-subtitle {
        font-size: 0.73rem;
    }

    .lang-selected {
        width: 34px;
        height: 34px;
    }

    .lang-option {
        width: 32px;
        height: 32px;
    }

    .flag-icon {
        width: 20px;
        height: 20px;
    }

    .message {
        max-width: 92%;
        font-size: 0.85rem;
        line-height: 1.45;
        padding: 10px 14px;
    }

    #chat-messages {
        padding: 14px;
        gap: 12px;
    }

    #chat-input-area {
        padding: 12px 14px;
        gap: 8px;
    }

    #chat-container input {
        padding: 12px 16px;
        font-size: 16px;
        /* Prevents auto-zoom on iOS */
        border-radius: 20px;
    }

    #chat-container button {
        padding: 12px 16px;
        font-size: 0.9rem;
        border-radius: 20px;
    }

    .bot-message-wrapper {
        max-width: 96%;
        gap: 6px;
    }

    .bot-avatar {
        width: 30px;
        height: 30px;
    }

    .bot-sender-name {
        font-size: 0.82rem;
    }

    .bot-message-wrapper .bot-message {
        max-width: calc(100% - 38px);
    }

    .quick-replies-container {
        padding: 10px 12px;
        gap: 6px;
    }

    .quick-reply-btn {
        font-size: 0.76rem;
        padding: 7px 10px;
        border-radius: 14px;
        flex: 1 1 calc(50% - 6px);
    }

    .typing {
        font-size: 0.8rem;
        padding: 0 14px;
    }

    /* Product cards responsive */
    .product-image {
        width: 90px;
        min-width: 90px;
        min-height: 110px;
    }

    .product-title {
        font-size: 0.85rem;
    }

    .product-price {
        font-size: 0.82rem;
    }

    .product-btn {
        font-size: 0.8rem;
        padding: 7px 10px;
    }
}

/* Small phones (360px and below) */
@media (max-width: 360px) {
    header {
        padding: 12px 14px;
        gap: 4px;
    }

    .logo-text {
        font-size: 1.1rem;
        letter-spacing: 0.5px;
    }

    #header-subtitle {
        font-size: 0.68rem;
    }

    .lang-selected {
        width: 30px;
        height: 30px;
    }

    .lang-option {
        width: 28px;
        height: 28px;
    }

    .flag-icon {
        width: 18px;
        height: 18px;
    }

    .message {
        max-width: 95%;
        font-size: 0.8rem;
        padding: 9px 12px;
        border-radius: 14px;
    }

    #chat-messages {
        padding: 10px;
        gap: 10px;
    }

    #chat-input-area {
        padding: 10px 12px;
        gap: 6px;
    }

    #chat-container input {
        padding: 10px 14px;
        font-size: 16px;
    }

    #chat-container button {
        padding: 10px 14px;
        font-size: 0.82rem;
    }

    .bot-avatar {
        width: 26px;
        height: 26px;
    }

    .bot-sender-name {
        font-size: 0.76rem;
    }

    .quick-reply-btn {
        font-size: 0.72rem;
        padding: 6px 8px;
        flex: 1 1 calc(50% - 6px);
    }

    .product-image {
        width: 75px;
        min-width: 75px;
        min-height: 95px;
    }

    .product-title {
        font-size: 0.8rem;
    }

    .product-price {
        font-size: 0.78rem;
    }

    .product-details {
        padding: 8px;
        gap: 5px;
    }
}

/* Very small screens (320px and below) */
@media (max-width: 320px) {
    .logo-text {
        font-size: 1rem;
    }

    #header-subtitle {
        font-size: 0.65rem;
    }

    .message {
        font-size: 0.76rem;
        padding: 8px 10px;
    }

    #chat-container input {
        padding: 9px 12px;
    }

    #chat-container button {
        padding: 9px 12px;
        font-size: 0.78rem;
    }

    .quick-reply-btn {
        font-size: 0.68rem;
        padding: 5px 7px;
    }

    .product-image {
        width: 65px;
        min-width: 65px;
        min-height: 80px;
    }
}

/* Landscape on smaller screens */
@media (max-height: 500px) and (orientation: landscape) {
    #chat-container {
        height: 100vh;
        height: 100dvh;
        width: 100vw;
        border-radius: 0;
        border: none;
    }

    header {
        padding: 8px 16px;
        flex-direction: row;
        justify-content: space-between;
        gap: 8px;
    }

    .header-top {
        width: auto;
    }

    #header-subtitle {
        display: none;
    }

    #chat-messages {
        padding: 8px 12px;
        gap: 8px;
    }

    .message {
        padding: 8px 12px;
        font-size: 0.8rem;
    }

    .quick-replies-container {
        padding: 6px 10px;
        gap: 4px;
    }

    .quick-reply-btn {
        padding: 5px 8px;
        font-size: 0.72rem;
    }

    #chat-input-area {
        padding: 8px 12px;
    }
}

/* Tall screens — give more room */
@media (min-height: 800px) and (min-width: 481px) {
    #chat-container {
        height: min(700px, 88vh);
    }
}

/* High-DPI / Retina — sharper text */
@media (-webkit-min-device-pixel-ratio: 2),
(min-resolution: 192dpi) {
    .message {
        -webkit-font-smoothing: antialiased;
        -moz-osx-font-smoothing: grayscale;
    }
}