.solar-chat-widget {
    position: fixed;
    bottom: 24px;
    right: 85px; /* Moved left to avoid overlapping with Back to Top button */
    z-index: 10000;
    font-family: 'Inter', sans-serif;
}

@media (max-width: 640px) {
    .solar-chat-widget {
        bottom: 20px;
        right: 80px; /* Ensure enough space from right edge on mobile */
    }
}

.chat-toggle {
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, #059669, #10b981);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(5, 150, 105, 0.4);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.chat-toggle:hover {
    transform: scale(1.05) translateY(-2px);
    box-shadow: 0 6px 20px rgba(5, 150, 105, 0.5);
}

.chat-window {
    position: absolute;
    bottom: 70px;
    right: 0;
    width: 350px;
    height: 500px;
    background: white;
    border-radius: 24px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px) scale(0.95);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid #e2e8f0;
}

.chat-window.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

.chat-header {
    background: linear-gradient(135deg, #059669, #10b981);
    color: white;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.chat-header-info h3 {
    font-size: 15px;
    font-weight: 800;
    margin: 0;
}

.chat-header-info p {
    font-size: 11px;
    opacity: 0.9;
    margin: 2px 0 0 0;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: #f8fafc;
}

.msg {
    max-width: 85%;
    padding: 12px 16px;
    border-radius: 18px;
    font-size: 13px;
    line-height: 1.5;
}

.msg.bot {
    align-self: flex-start;
    background: white;
    color: #1e293b;
    border-bottom-left-radius: 4px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.msg.user {
    align-self: flex-end;
    background: #059669;
    color: white;
    border-bottom-right-radius: 4px;
}

.chat-input-area {
    padding: 15px;
    background: white;
    border-top: 1px solid #e2e8f0;
    display: flex;
    gap: 8px;
}

.chat-input {
    flex: 1;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 10px 15px;
    font-size: 13px;
    outline: none;
    transition: border-color 0.2s;
}

.chat-input:focus {
    border-color: #10b981;
}

.chat-send {
    background: #059669;
    color: white;
    border: none;
    width: 38px;
    height: 38px;
    border-radius: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.chat-send:hover {
    background: #047857;
}

.product-card {
    background: #f0fdf4;
    border: 1px solid #dcfce7;
    border-radius: 12px;
    padding: 10px;
    margin-top: 8px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.product-card img {
    width: 100%;
    height: 100px;
    object-fit: contain;
    border-radius: 8px;
    background: white;
}

.product-card h4 {
    font-size: 12px;
    font-weight: 700;
    margin: 0;
    color: #064e3b;
}

.product-card a {
    background: #059669;
    color: white;
    text-decoration: none;
    font-size: 11px;
    font-weight: 700;
    padding: 6px;
    text-align: center;
    border-radius: 6px;
}

@media (max-width: 640px) {
    .chat-window {
        position: fixed;
        bottom: 85px;
        right: 20px;
        left: 20px;
        width: auto;
        max-width: none;
        height: calc(100% - 120px);
        max-height: 500px;
        border-radius: 20px;
    }
}


/* Catalog card override: the assistant preview rule must not shrink the full catalog images to 100px. */
.product-card .catalog-product-image {
    min-height: 250px !important;
    height: 250px !important;
}
.product-card .catalog-product-image-img {
    width: 100% !important;
    height: 100% !important;
    max-height: none !important;
    object-fit: contain !important;
    padding: 1rem !important;
}
@media (max-width: 639px) {
    .product-card .catalog-product-image {
        min-height: 220px !important;
        height: 220px !important;
    }
}
