/**
 * Enhanced Frontend Styles for ConvertyBot Chatbot
 * Features: Modern design system, Mobile-first responsive layout,
 * Advanced animations, Dark/Light themes, Accessibility support
 */

/* ==========================================================================
   CSS Custom Properties (Design System)
   ========================================================================== */

:root {
    /* Color Palette */
    --convertybot-primary: #2563eb;
    --convertybot-primary-hover: #1d4ed8;
    --convertybot-primary-light: #dbeafe;
    --convertybot-secondary: #f97316;
    --convertybot-secondary-hover: #ea580c;
    --convertybot-secondary-light: #fed7aa;
    
    /* Grayscale */
    --convertybot-white: #ffffff;
    --convertybot-gray-50: #f9fafb;
    --convertybot-gray-100: #f3f4f6;
    --convertybot-gray-200: #e5e7eb;
    --convertybot-gray-300: #d1d5db;
    --convertybot-gray-400: #9ca3af;
    --convertybot-gray-500: #6b7280;
    --convertybot-gray-600: #4b5563;
    --convertybot-gray-700: #374151;
    --convertybot-gray-800: #1f2937;
    --convertybot-gray-900: #111827;
    
    /* Status Colors */
    --convertybot-success: #10b981;
    --convertybot-success-light: #d1fae5;
    --convertybot-warning: #f59e0b;
    --convertybot-warning-light: #fef3c7;
    --convertybot-error: #ef4444;
    --convertybot-error-light: #fee2e2;
    --convertybot-info: #3b82f6;
    --convertybot-info-light: #dbeafe;
    
    /* Theme Colors (Light) */
    --convertybot-bg-primary: var(--convertybot-white);
    --convertybot-bg-secondary: var(--convertybot-gray-50);
    --convertybot-bg-tertiary: var(--convertybot-gray-100);
    --convertybot-text-primary: var(--convertybot-gray-900);
    --convertybot-text-secondary: var(--convertybot-gray-600);
    --convertybot-text-muted: var(--convertybot-gray-500);
    --convertybot-border: var(--convertybot-gray-200);
    --convertybot-border-light: var(--convertybot-gray-100);
    --convertybot-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --convertybot-shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --convertybot-shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    
    /* Typography */
    --convertybot-font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    --convertybot-font-mono: 'SF Mono', 'Monaco', 'Inconsolata', 'Roboto Mono', monospace;
    --convertybot-font-size-xs: 0.75rem;
    --convertybot-font-size-sm: 0.875rem;
    --convertybot-font-size-base: 1rem;
    --convertybot-font-size-lg: 1.125rem;
    --convertybot-font-size-xl: 1.25rem;
    --convertybot-font-size-2xl: 1.5rem;
    --convertybot-font-weight-normal: 400;
    --convertybot-font-weight-medium: 500;
    --convertybot-font-weight-semibold: 600;
    --convertybot-font-weight-bold: 700;
    --convertybot-line-height-tight: 1.25;
    --convertybot-line-height-normal: 1.5;
    --convertybot-line-height-relaxed: 1.625;
    
    /* Spacing */
    --convertybot-space-1: 0.25rem;
    --convertybot-space-2: 0.5rem;
    --convertybot-space-3: 0.75rem;
    --convertybot-space-4: 1rem;
    --convertybot-space-5: 1.25rem;
    --convertybot-space-6: 1.5rem;
    --convertybot-space-8: 2rem;
    --convertybot-space-10: 2.5rem;
    --convertybot-space-12: 3rem;
    --convertybot-space-16: 4rem;
    --convertybot-space-20: 5rem;
    
    /* Border Radius */
    --convertybot-radius-sm: 0.25rem;
    --convertybot-radius: 0.375rem;
    --convertybot-radius-md: 0.5rem;
    --convertybot-radius-lg: 0.75rem;
    --convertybot-radius-xl: 1rem;
    --convertybot-radius-2xl: 1.5rem;
    --convertybot-radius-full: 9999px;
    
    /* Transitions */
    --convertybot-transition-fast: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    --convertybot-transition-base: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --convertybot-transition-slow: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    --convertybot-ease-in-out: cubic-bezier(0.4, 0, 0.2, 1);
    --convertybot-ease-out: cubic-bezier(0, 0, 0.2, 1);
    --convertybot-ease-in: cubic-bezier(0.4, 0, 1, 1);
    
    /* Z-Index Scale */
    --convertybot-z-dropdown: 1000;
    --convertybot-z-sticky: 1020;
    --convertybot-z-fixed: 1030;
    --convertybot-z-modal-backdrop: 1040;
    --convertybot-z-modal: 1050;
    --convertybot-z-popover: 1060;
    --convertybot-z-tooltip: 1070;
    --convertybot-z-toast: 1080;
    --convertybot-z-chatbot: 999999;
}

/* Dark Theme */
[data-theme="dark"] {
    --convertybot-bg-primary: var(--convertybot-gray-900);
    --convertybot-bg-secondary: var(--convertybot-gray-800);
    --convertybot-bg-tertiary: var(--convertybot-gray-700);
    --convertybot-text-primary: var(--convertybot-white);
    --convertybot-text-secondary: var(--convertybot-gray-300);
    --convertybot-text-muted: var(--convertybot-gray-400);
    --convertybot-border: var(--convertybot-gray-700);
    --convertybot-border-light: var(--convertybot-gray-600);
    --convertybot-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.3), 0 1px 2px 0 rgba(0, 0, 0, 0.2);
    --convertybot-shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.3), 0 4px 6px -2px rgba(0, 0, 0, 0.2);
    --convertybot-shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.4), 0 10px 10px -5px rgba(0, 0, 0, 0.2);
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    :root {
        --convertybot-border: #000000;
        --convertybot-text-primary: #000000;
        --convertybot-shadow: 0 0 0 2px #000000;
    }
    
    [data-theme="dark"] {
        --convertybot-border: #ffffff;
        --convertybot-text-primary: #ffffff;
        --convertybot-shadow: 0 0 0 2px #ffffff;
    }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* ==========================================================================
   Base Styles & Reset
   ========================================================================== */

.ai-chatbot-widget * {
    box-sizing: border-box;
}

.ai-chatbot-widget {
    position: fixed;
    bottom: var(--convertybot-space-5);
    right: var(--convertybot-space-5);
    z-index: var(--convertybot-z-chatbot);
    font-family: var(--convertybot-font-family);
    font-size: var(--convertybot-font-size-base);
    line-height: var(--convertybot-line-height-normal);
    color: var(--convertybot-text-primary);
    direction: ltr;
    text-align: left;
    contain: layout style;
}

.ai-chatbot-widget button {
    cursor: pointer;
    border: none;
    background: transparent;
    padding: 0;
    font: inherit;
    color: inherit;
}

.ai-chatbot-widget input,
.ai-chatbot-widget textarea,
.ai-chatbot-widget select {
    font: inherit;
    color: inherit;
}

.ai-chatbot-widget a {
    color: var(--convertybot-primary);
    text-decoration: none;
}

.ai-chatbot-widget a:hover {
    color: var(--convertybot-primary-hover);
    text-decoration: underline;
}

/* ==========================================================================
   Chat Toggle Button
   ========================================================================== */

.chatbot-toggle {
    position: relative;
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, var(--convertybot-primary) 0%, var(--convertybot-primary-hover) 100%);
    border-radius: var(--convertybot-radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: var(--convertybot-shadow-xl);
    transition: var(--convertybot-transition-base);
    color: var(--convertybot-white);
    overflow: hidden;
    user-select: none;
}

.chatbot-toggle::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at 50% 50%, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
    opacity: 0;
    transition: var(--convertybot-transition-fast);
}

.chatbot-toggle:hover {
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 25px 50px -12px rgba(37, 99, 235, 0.25), var(--convertybot-shadow-xl);
}

.chatbot-toggle:hover::before {
    opacity: 1;
}

.chatbot-toggle:active {
    transform: translateY(-1px) scale(1.02);
}

.chatbot-toggle.has-unread {
    animation: pulseNotification 2s ease-in-out infinite;
}

@keyframes pulseNotification {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

/* Toggle Icon Animation */
.toggle-icon {
    position: relative;
    width: 24px;
    height: 24px;
}

.toggle-icon svg {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    transition: var(--convertybot-transition-base);
}

.chat-icon {
    opacity: 1;
    transform: translate(-50%, -50%) rotate(0deg) scale(1);
}

.close-icon {
    opacity: 0;
    transform: translate(-50%, -50%) rotate(-180deg) scale(0.8);
}

.chatbot-toggle.active .chat-icon {
    opacity: 0;
    transform: translate(-50%, -50%) rotate(180deg) scale(0.8);
}

.chatbot-toggle.active .close-icon {
    opacity: 1;
    transform: translate(-50%, -50%) rotate(0deg) scale(1);
}

/* Notification Badge */
.notification-badge {
    position: absolute;
    top: -6px;
    right: -6px;
    min-width: 22px;
    height: 22px;
    background: var(--convertybot-error);
    color: var(--convertybot-white);
    border-radius: var(--convertybot-radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--convertybot-font-size-xs);
    font-weight: var(--convertybot-font-weight-bold);
    border: 2px solid var(--convertybot-white);
    box-shadow: var(--convertybot-shadow);
    animation: bounceIn 0.5s var(--convertybot-ease-out);
}

@keyframes bounceIn {
    0% {
        opacity: 0;
        transform: scale(0.3);
    }
    50% {
        opacity: 1;
        transform: scale(1.1);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

/* ==========================================================================
   Chat Window
   ========================================================================== */

.chatbot-window {
    position: absolute;
    bottom: 80px;
    right: 0;
    width: 380px;
    height: 500px;
    max-width: calc(100vw - var(--convertybot-space-10));
    max-height: calc(100vh - 140px);
    background: var(--convertybot-bg-primary);
    border-radius: var(--convertybot-radius-2xl);
    box-shadow: var(--convertybot-shadow-xl);
    display: flex;
    flex-direction: column;
    opacity: 0;
    transform: translateY(var(--convertybot-space-5)) scale(0.95);
    transition: var(--convertybot-transition-base);
    pointer-events: none;
    border: 1px solid var(--convertybot-border);
    overflow: hidden;
    backdrop-filter: blur(10px);
}

.chatbot-window.active {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: all;
}

/* Chat Header */
.chatbot-header {
    padding: var(--convertybot-space-4) var(--convertybot-space-5);
    background: linear-gradient(135deg, var(--convertybot-primary) 0%, var(--convertybot-primary-hover) 100%);
    color: var(--convertybot-white);
    border-radius: var(--convertybot-radius-2xl) var(--convertybot-radius-2xl) 0 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
    position: relative;
    overflow: hidden;
}

.chatbot-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg width="60" height="60" viewBox="0 0 60 60" xmlns="http://www.w3.org/2000/svg"><g fill="none" fill-rule="evenodd"><g fill="%23ffffff" fill-opacity="0.05"><circle cx="30" cy="30" r="4"/></g></svg>') repeat;
    opacity: 0.5;
    animation: subtleFloat 20s ease-in-out infinite;
}

@keyframes subtleFloat {
    0%, 100% { transform: translate(0, 0); }
    25% { transform: translate(-5px, -5px); }
    50% { transform: translate(5px, -10px); }
    75% { transform: translate(-5px, -5px); }
}

.header-content {
    display: flex;
    align-items: center;
    gap: var(--convertybot-space-3);
    position: relative;
    z-index: 1;
}

.bot-avatar {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: var(--convertybot-radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.1);
}

.bot-avatar svg {
    opacity: 0.9;
}

.header-info {
    display: flex;
    flex-direction: column;
    gap: var(--convertybot-space-1);
    min-width: 0;
}

.bot-name {
    font-weight: var(--convertybot-font-weight-semibold);
    font-size: var(--convertybot-font-size-lg);
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.bot-status {
    display: flex;
    align-items: center;
    gap: var(--convertybot-space-2);
    font-size: var(--convertybot-font-size-sm);
    opacity: 0.9;
}

.status-indicator {
    width: 8px;
    height: 8px;
    background: var(--convertybot-success);
    border-radius: var(--convertybot-radius-full);
    flex-shrink: 0;
    position: relative;
}

.status-indicator.pulse::before {
    content: '';
    position: absolute;
    top: -4px;
    left: -4px;
    right: -4px;
    bottom: -4px;
    background: inherit;
    border-radius: inherit;
    animation: ping 2s ease-in-out infinite;
}

@keyframes ping {
    75%, 100% {
        transform: scale(2);
        opacity: 0;
    }
}

.header-actions {
    display: flex;
    align-items: center;
    gap: var(--convertybot-space-2);
    position: relative;
    z-index: 1;
}

.header-actions button {
    width: 32px;
    height: 32px;
    border-radius: var(--convertybot-radius-lg);
    background: rgba(255, 255, 255, 0.1);
    color: inherit;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--convertybot-transition-fast);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.header-actions button:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.05);
}

.header-actions button:active {
    transform: scale(0.95);
}

/* ==========================================================================
   Messages Area
   ========================================================================== */

.chatbot-messages {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: var(--convertybot-space-1) 0;
    display: flex;
    flex-direction: column;
    gap: var(--convertybot-space-3);
    scrollbar-width: thin;
    scrollbar-color: var(--convertybot-border) transparent;
    scroll-behavior: smooth;
}

.chatbot-messages::-webkit-scrollbar {
    width: 6px;
}

.chatbot-messages::-webkit-scrollbar-track {
    background: transparent;
}

.chatbot-messages::-webkit-scrollbar-thumb {
    background: var(--convertybot-border);
    border-radius: var(--convertybot-radius-full);
}

.chatbot-messages::-webkit-scrollbar-thumb:hover {
    background: var(--convertybot-text-muted);
}

/* Welcome Message */
.welcome-message {
    padding: var(--convertybot-space-4) var(--convertybot-space-5) 0;
}

/* Individual Messages */
.message {
    display: flex;
    align-items: flex-start;
    gap: var(--convertybot-space-2);
    padding: 0 var(--convertybot-space-5);
    animation: messageSlideIn 0.4s var(--convertybot-ease-out);
    position: relative;
}

@keyframes messageSlideIn {
    from {
        opacity: 0;
        transform: translateY(var(--convertybot-space-3));
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.message.user-message {
    flex-direction: row-reverse;
    padding-left: var(--convertybot-space-16);
}

.message.bot-message {
    padding-right: var(--convertybot-space-12);
}

/* Message Avatars */
.message-avatar {
    width: 32px;
    height: 32px;
    border-radius: var(--convertybot-radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    position: relative;
    margin-top: var(--convertybot-space-1);
}

.bot-message .message-avatar {
    background: var(--convertybot-primary);
    color: var(--convertybot-white);
}

.user-message .message-avatar {
    background: var(--convertybot-gray-200);
    color: var(--convertybot-text-secondary);
}

.message-avatar svg {
    width: 18px;
    height: 18px;
}

/* Message Content */
.message-content {
    display: flex;
    flex-direction: column;
    gap: var(--convertybot-space-1);
    flex: 1;
    min-width: 0;
}

.message-text {
    background: var(--convertybot-bg-secondary);
    padding: var(--convertybot-space-3) var(--convertybot-space-4);
    border-radius: var(--convertybot-radius-2xl);
    font-size: var(--convertybot-font-size-sm);
    line-height: var(--convertybot-line-height-relaxed);
    color: var(--convertybot-text-primary);
    word-wrap: break-word;
    position: relative;
    max-width: 100%;
    box-shadow: var(--convertybot-shadow);
    border: 1px solid var(--convertybot-border-light);
}

.user-message .message-text {
    background: linear-gradient(135deg, var(--convertybot-primary) 0%, var(--convertybot-primary-hover) 100%);
    color: var(--convertybot-white);
    margin-left: auto;
    border-color: transparent;
    box-shadow: 0 4px 6px -1px rgba(37, 99, 235, 0.1), var(--convertybot-shadow);
}

/* Message Metadata */
.message-time {
    font-size: var(--convertybot-font-size-xs);
    color: var(--convertybot-text-muted);
    margin-top: var(--convertybot-space-1);
    display: flex;
    align-items: center;
    gap: var(--convertybot-space-2);
}

.user-message .message-time {
    justify-content: flex-end;
}

.message-status {
    display: inline-flex;
    align-items: center;
    font-size: var(--convertybot-font-size-xs);
}

/* Typing Indicator */
.typing-indicator {
    padding: 0 var(--convertybot-space-5);
    animation: fadeIn 0.3s var(--convertybot-ease-out);
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.typing-dots {
    display: flex;
    align-items: center;
    gap: var(--convertybot-space-1);
    padding: var(--convertybot-space-3) var(--convertybot-space-4);
    background: var(--convertybot-bg-secondary);
    border-radius: var(--convertybot-radius-2xl);
    width: fit-content;
    border: 1px solid var(--convertybot-border-light);
    box-shadow: var(--convertybot-shadow);
}

.typing-dots span {
    width: 6px;
    height: 6px;
    background: var(--convertybot-text-muted);
    border-radius: var(--convertybot-radius-full);
    animation: typingDots 1.4s ease-in-out infinite;
}

.typing-dots span:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-dots span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typingDots {
    0%, 60%, 100% {
        transform: translateY(0);
        opacity: 0.4;
    }
    30% {
        transform: translateY(-8px);
        opacity: 1;
    }
}

/* ==========================================================================
   Product Components
   ========================================================================== */

/* Enhanced Product Card Inline */
.product-card-enhanced-inline {
    display: flex;
    align-items: center;
    gap: var(--convertybot-space-3);
    background: var(--convertybot-bg-primary);
    border: 1px solid var(--convertybot-border);
    border-radius: var(--convertybot-radius-lg);
    padding: var(--convertybot-space-3);
    margin: var(--convertybot-space-2) 0;
    cursor: pointer;
    transition: var(--convertybot-transition-base);
    box-shadow: var(--convertybot-shadow);
}

.product-card-enhanced-inline:hover {
    border-color: var(--convertybot-primary);
    transform: translateY(-1px);
    box-shadow: var(--convertybot-shadow-lg);
}

.product-image-inline {
    flex-shrink: 0;
    position: relative;
}

.product-image-inline img {
    width: 70px;
    height: 70px;
    object-fit: contain;
    object-position: center;
    background: var(--convertybot-bg-secondary);
    border-radius: var(--convertybot-radius-md);
    border: 1px solid var(--convertybot-border-light);
    padding: 2px;
}

.product-info-inline {
    flex: 1;
    min-width: 0;
}

.product-info-inline .product-name {
    font-weight: var(--convertybot-font-weight-semibold);
    font-size: var(--convertybot-font-size-sm);
    color: var(--convertybot-text-primary);
    margin: 0 0 var(--convertybot-space-1) 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: var(--convertybot-line-height-tight);
}

.product-info-inline .product-price {
    color: var(--convertybot-primary);
    font-weight: var(--convertybot-font-weight-semibold);
    font-size: var(--convertybot-font-size-sm);
    margin-bottom: var(--convertybot-space-1);
}

.price-sale {
    color: var(--convertybot-error);
    font-weight: var(--convertybot-font-weight-bold);
}

.price-regular {
    color: var(--convertybot-text-muted);
    text-decoration: line-through;
    font-size: var(--convertybot-font-size-xs);
    margin-left: var(--convertybot-space-1);
}

.stars {
    color: #fbbf24;
    font-size: var(--convertybot-font-size-xs);
}

.product-rating {
    display: flex;
    align-items: center;
    gap: var(--convertybot-space-1);
    margin-bottom: var(--convertybot-space-1);
    font-size: var(--convertybot-font-size-xs);
}

.product-availability {
    font-size: var(--convertybot-font-size-xs);
    color: var(--convertybot-text-muted);
    margin-bottom: var(--convertybot-space-2);
}

.product-availability.in-stock {
    color: var(--convertybot-success);
}

.product-availability.out-stock {
    color: var(--convertybot-error);
}

.product-actions-inline {
    display: flex;
    align-items: center;
    gap: var(--convertybot-space-2);
}

.btn-view, .btn-cart {
    padding: 6px 10px;
    border-radius: var(--convertybot-radius);
    font-size: 11px;
    font-weight: var(--convertybot-font-weight-medium);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: var(--convertybot-transition-fast);
    border: 1px solid;
    cursor: pointer;
    line-height: 1.2;
    white-space: nowrap;
    min-height: 28px;
    position: relative;
}

.btn-view {
    color: var(--convertybot-primary);
    border-color: var(--convertybot-primary);
    background: var(--convertybot-white);
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

.btn-view:hover {
    background: var(--convertybot-primary);
    color: var(--convertybot-white);
    text-decoration: none;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.btn-cart {
    background: var(--convertybot-primary);
    color: var(--convertybot-white) !important;
    border-color: var(--convertybot-primary);
    box-shadow: 0 1px 2px rgba(37, 99, 235, 0.2);
}

.btn-cart:hover {
    background: var(--convertybot-primary-hover);
    border-color: var(--convertybot-primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(37, 99, 235, 0.3);
}

/* Ensure button text is always visible */
.btn-cart svg {
    fill: currentColor;
    stroke: currentColor;
}

.btn-view svg {
    fill: currentColor;
    stroke: currentColor;
}

/* See More Products Button - Minimized and Compact */
.see-more-products {
    margin-top: var(--convertybot-space-2);
    text-align: center;
}

.see-more-btn {
    padding: var(--convertybot-space-1) var(--convertybot-space-2);
    background: var(--convertybot-bg-secondary);
    border: 1px solid var(--convertybot-border);
    border-radius: var(--convertybot-radius);
    font-size: 11px;
    font-weight: var(--convertybot-font-weight-medium);
    color: var(--convertybot-text-secondary);
    cursor: pointer;
    transition: var(--convertybot-transition-fast);
    display: inline-flex;
    align-items: center;
    gap: var(--convertybot-space-1);
    line-height: 1.2;
    min-height: auto;
    white-space: nowrap;
}

.see-more-btn:hover {
    background: var(--convertybot-primary-light);
    border-color: var(--convertybot-primary);
    color: var(--convertybot-primary);
    transform: translateY(-1px);
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.see-more-btn .emoji {
    width: 10px;
    height: 10px;
    font-size: 10px;
}

/* Enhanced Product Card for Modal */
.product-card-enhanced {
    background: var(--convertybot-bg-primary);
    border: 1px solid var(--convertybot-border);
    border-radius: var(--convertybot-radius-xl);
    padding: var(--convertybot-space-4);
    transition: var(--convertybot-transition-base);
    cursor: pointer;
    box-shadow: var(--convertybot-shadow);
    height: 100%;
    display: flex;
    flex-direction: column;
}

.product-card-enhanced:hover {
    border-color: var(--convertybot-primary);
    transform: translateY(-2px);
    box-shadow: var(--convertybot-shadow-xl);
}

.product-card-enhanced .product-image {
    margin-bottom: var(--convertybot-space-3);
    overflow: hidden;
    border-radius: var(--convertybot-radius-lg);
    position: relative;
    aspect-ratio: 4/3;
}

.product-card-enhanced .product-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
    transition: var(--convertybot-transition-base);
    background: var(--convertybot-bg-secondary);
    border-radius: var(--convertybot-radius);
    padding: var(--convertybot-space-1);
}

.product-card-enhanced:hover .product-image img {
    transform: scale(1.02);
}

/* Inline Products */
.product-inline {
    display: flex;
    align-items: center;
    gap: var(--convertybot-space-3);
    background: var(--convertybot-bg-primary);
    border: 1px solid var(--convertybot-border);
    border-radius: var(--convertybot-radius-xl);
    padding: var(--convertybot-space-3);
    margin-top: var(--convertybot-space-2);
    cursor: pointer;
    transition: var(--convertybot-transition-base);
    box-shadow: var(--convertybot-shadow);
}

.product-inline:hover {
    border-color: var(--convertybot-primary);
    transform: translateY(-1px);
    box-shadow: var(--convertybot-shadow-lg);
}

.product-thumbnail {
    flex-shrink: 0;
}

.product-thumbnail img {
    width: 56px;
    height: 56px;
    object-fit: contain;
    object-position: center;
    background: var(--convertybot-bg-secondary);
    border-radius: var(--convertybot-radius-lg);
    border: 2px solid var(--convertybot-border-light);
    padding: 2px;
}

.product-details {
    flex: 1;
    min-width: 0;
}

.product-name {
    font-weight: var(--convertybot-font-weight-semibold);
    font-size: var(--convertybot-font-size-sm);
    color: var(--convertybot-text-primary);
    margin: 0 0 var(--convertybot-space-1) 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: var(--convertybot-line-height-tight);
}

.product-price {
    color: var(--convertybot-primary);
    font-weight: var(--convertybot-font-weight-semibold);
    font-size: var(--convertybot-font-size-sm);
    margin-bottom: var(--convertybot-space-2);
}

.product-actions {
    display: flex;
    align-items: center;
    gap: var(--convertybot-space-2);
}

.product-link {
    color: var(--convertybot-primary);
    font-size: var(--convertybot-font-size-xs);
    font-weight: var(--convertybot-font-weight-medium);
    padding: var(--convertybot-space-1) var(--convertybot-space-2);
    border-radius: var(--convertybot-radius);
    border: 1px solid var(--convertybot-primary);
    transition: var(--convertybot-transition-fast);
    text-decoration: none;
}

.product-link:hover {
    background: var(--convertybot-primary);
    color: var(--convertybot-white);
    text-decoration: none;
}

/* Product Cards (Showcase) */
.product-card {
    background: var(--convertybot-bg-primary);
    border: 1px solid var(--convertybot-border);
    border-radius: var(--convertybot-radius-xl);
    padding: var(--convertybot-space-4);
    transition: var(--convertybot-transition-base);
    cursor: pointer;
    box-shadow: var(--convertybot-shadow);
    height: 100%;
    display: flex;
    flex-direction: column;
}

.product-card:hover {
    border-color: var(--convertybot-primary);
    transform: translateY(-2px);
    box-shadow: var(--convertybot-shadow-xl);
}

.product-image {
    margin-bottom: var(--convertybot-space-3);
    overflow: hidden;
    border-radius: var(--convertybot-radius-lg);
    position: relative;
}

.product-image img {
    width: 100%;
    height: 180px;
    object-fit: cover;
    transition: var(--convertybot-transition-base);
}

.product-card:hover .product-image img {
    transform: scale(1.05);
}

.product-info {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.product-info h4 {
    font-size: var(--convertybot-font-size-lg);
    font-weight: var(--convertybot-font-weight-semibold);
    margin: 0 0 var(--convertybot-space-2) 0;
    color: var(--convertybot-text-primary);
    line-height: var(--convertybot-line-height-tight);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-card .product-price {
    font-size: var(--convertybot-font-size-xl);
    font-weight: var(--convertybot-font-weight-bold);
    color: var(--convertybot-primary);
    margin-bottom: var(--convertybot-space-2);
}

.product-description {
    font-size: var(--convertybot-font-size-sm);
    color: var(--convertybot-text-secondary);
    line-height: var(--convertybot-line-height-relaxed);
    margin-bottom: var(--convertybot-space-4);
    flex: 1;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Action Buttons */
.button {
    padding: var(--convertybot-space-2) var(--convertybot-space-4);
    border-radius: var(--convertybot-radius-lg);
    font-size: var(--convertybot-font-size-sm);
    font-weight: var(--convertybot-font-weight-medium);
    text-decoration: none;
    text-align: center;
    cursor: pointer;
    transition: var(--convertybot-transition-base);
    border: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--convertybot-space-2);
    position: relative;
    overflow: hidden;
}

.button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.button:hover::before {
    left: 100%;
}

.button.primary {
    background: linear-gradient(135deg, var(--convertybot-primary) 0%, var(--convertybot-primary-hover) 100%);
    color: var(--convertybot-white);
    box-shadow: var(--convertybot-shadow);
}

.button.primary:hover {
    transform: translateY(-1px);
    box-shadow: var(--convertybot-shadow-lg);
}

.button.secondary {
    background: var(--convertybot-bg-primary);
    color: var(--convertybot-primary);
    border: 1px solid var(--convertybot-primary);
    box-shadow: var(--convertybot-shadow);
}

.button.secondary:hover {
    background: var(--convertybot-primary);
    color: var(--convertybot-white);
    transform: translateY(-1px);
}

/* ==========================================================================
   Coupon Components
   ========================================================================== */

.coupon-card {
    background: linear-gradient(135deg, var(--convertybot-secondary) 0%, var(--convertybot-secondary-hover) 100%);
    color: var(--convertybot-white);
    border-radius: var(--convertybot-radius-xl);
    padding: var(--convertybot-space-4);
    margin-top: var(--convertybot-space-2);
    position: relative;
    overflow: hidden;
    box-shadow: var(--convertybot-shadow-lg);
    animation: slideInLeft 0.5s var(--convertybot-ease-out);
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.coupon-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg width="40" height="40" viewBox="0 0 40 40" xmlns="http://www.w3.org/2000/svg"><g fill="none" fill-rule="evenodd"><g fill="%23ffffff" fill-opacity="0.1"><path d="M20 20c0-5.5-4.5-10-10-10s-10 4.5-10 10 4.5 10 10 10 10-4.5 10-10zm10 0c0-5.5-4.5-10-10-10s-10 4.5-10 10 4.5 10 10 10 10-4.5 10-10z"/></g></svg>') repeat;
    opacity: 0.3;
}

.coupon-header {
    display: flex;
    align-items: center;
    gap: var(--convertybot-space-3);
    margin-bottom: var(--convertybot-space-3);
    position: relative;
    z-index: 1;
}

.coupon-icon {
    font-size: 32px;
    flex-shrink: 0;
}

.coupon-info {
    flex: 1;
}

.coupon-title {
    font-weight: var(--convertybot-font-weight-bold);
    font-size: var(--convertybot-font-size-lg);
    margin-bottom: var(--convertybot-space-1);
}

.coupon-description {
    font-size: var(--convertybot-font-size-sm);
    opacity: 0.9;
    line-height: var(--convertybot-line-height-normal);
}

.coupon-body {
    position: relative;
    z-index: 1;
    margin-bottom: var(--convertybot-space-3);
}

.coupon-code-container {
    /* display: flex; */
    align-items: center;
    gap: var(--convertybot-space-2);
    margin-bottom: var(--convertybot-space-2);
}

.coupon-code {
    background: rgba(255, 255, 255, 0.2);
    padding: var(--convertybot-space-2) var(--convertybot-space-3);
    border-radius: var(--convertybot-radius);
    font-family: var(--convertybot-font-mono);
    font-weight: var(--convertybot-font-weight-bold);
    font-size: var(--convertybot-font-size-lg);
    letter-spacing: 1px;
    border: 2px dashed rgba(255, 255, 255, 0.3);
}

.copy-code-btn {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: inherit;
    padding: var(--convertybot-space-2);
    border-radius: var(--convertybot-radius);
    font-size: var(--convertybot-font-size-xs);
    cursor: pointer;
    transition: var(--convertybot-transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
}

.copy-code-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.05);
}

.coupon-discount {
    font-weight: var(--convertybot-font-weight-bold);
    font-size: var(--convertybot-font-size-xl);
    margin-bottom: var(--convertybot-space-2);
}

.coupon-expiry {
    display: flex;
    align-items: center;
    gap: var(--convertybot-space-2);
    font-size: var(--convertybot-font-size-sm);
    opacity: 0.9;
}

.countdown-timer {
    font-weight: var(--convertybot-font-weight-semibold);
    background: rgba(255, 255, 255, 0.2);
    padding: var(--convertybot-space-1) var(--convertybot-space-2);
    border-radius: var(--convertybot-radius);
}

.coupon-actions {
    position: relative;
    z-index: 1;
}

.apply-coupon-btn {
    background: rgba(255, 255, 255, 0.2);
    color: inherit;
    border: 2px solid rgba(255, 255, 255, 0.3);
    padding: var(--convertybot-space-2) var(--convertybot-space-4);
    border-radius: var(--convertybot-radius-lg);
    font-weight: var(--convertybot-font-weight-semibold);
    cursor: pointer;
    transition: var(--convertybot-transition-base);
    width: 100%;
}

.apply-coupon-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-1px);
}

.coupon-card.expired {
    opacity: 0.6;
    filter: grayscale(50%);
}

.coupon-card.expired .apply-coupon-btn {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ==========================================================================
   Chat Input
   ========================================================================== */

.chatbot-input {
    padding: var(--convertybot-space-4) var(--convertybot-space-5);
    background: var(--convertybot-bg-primary);
    border-top: 1px solid var(--convertybot-border);
    border-radius: 0 0 var(--convertybot-radius-2xl) var(--convertybot-radius-2xl);
    flex-shrink: 0;
}

.input-container {
    display: flex;
    align-items: flex-end;
    gap: var(--convertybot-space-3);
    background: var(--convertybot-bg-secondary);
    border: 2px solid var(--convertybot-border);
    border-radius: var(--convertybot-radius-2xl);
    padding: var(--convertybot-space-2) var(--convertybot-space-4);
    transition: var(--convertybot-transition-base);
    position: relative;
}

.input-container:focus-within {
    border-color: var(--convertybot-primary);
    background: var(--convertybot-bg-primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.message-input {
    flex: 1;
    border: none;
    outline: none;
    background: transparent;
    font-size: var(--convertybot-font-size-sm);
    color: var(--convertybot-text-primary);
    resize: none;
    min-height: 20px;
    max-height: 80px;
    font-family: inherit;
    line-height: var(--convertybot-line-height-normal);
    padding: var(--convertybot-space-1) 0;
}

.message-input::placeholder {
    color: var(--convertybot-text-muted);
}

.send-button {
    width: 36px;
    height: 36px;
    border-radius: var(--convertybot-radius-full);
    background: var(--convertybot-primary);
    color: var(--convertybot-white);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--convertybot-transition-base);
    flex-shrink: 0;
    position: relative;
    overflow: hidden;
}

.send-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.3) 0%, transparent 70%);
    opacity: 0;
    transition: var(--convertybot-transition-fast);
}

.send-button:hover:not(:disabled) {
    background: var(--convertybot-primary-hover);
    transform: scale(1.05);
}

.send-button:hover:not(:disabled)::before {
    opacity: 1;
}

.send-button:active:not(:disabled) {
    transform: scale(0.95);
}

.send-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Quick Actions */
.quick-actions {
    margin-top: var(--convertybot-space-3);
    display: flex;
    flex-wrap: wrap;
    gap: var(--convertybot-space-2);
    animation: fadeIn 0.3s var(--convertybot-ease-out);
}

.quick-action-btn {
    padding: var(--convertybot-space-2) var(--convertybot-space-3);
    background: var(--convertybot-bg-primary);
    border: 1px solid var(--convertybot-border);
    border-radius: var(--convertybot-radius-2xl);
    font-size: var(--convertybot-font-size-xs);
    color: var(--convertybot-text-primary);
    cursor: pointer;
    transition: var(--convertybot-transition-fast);
    display: flex;
    align-items: center;
    gap: var(--convertybot-space-1);
}

.quick-action-btn:hover {
    border-color: var(--convertybot-primary);
    color: var(--convertybot-primary);
    background: var(--convertybot-primary-light);
    transform: translateY(-1px);
}

.action-icon {
    font-size: var(--convertybot-font-size-sm);
}

/* ==========================================================================
   Product Showcase
   ========================================================================== */

.product-showcase {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(12px);
    z-index: var(--convertybot-z-modal);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--convertybot-space-6);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s var(--convertybot-ease-out);
}

.product-showcase.active {
    opacity: 1;
    visibility: visible;
}

.product-showcase-content {
    background: var(--convertybot-bg-primary);
    border-radius: var(--convertybot-radius-2xl);
    max-width: 1200px;
    max-height: 90vh;
    width: 100%;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    border: 1px solid var(--convertybot-border);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: scale(0.95);
    transition: transform 0.3s var(--convertybot-ease-out);
}

.product-showcase.active .product-showcase-content {
    transform: scale(1);
}

.showcase-header {
    padding: var(--convertybot-space-6) var(--convertybot-space-8);
    border-bottom: 1px solid var(--convertybot-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
    background: linear-gradient(135deg, var(--convertybot-bg-primary) 0%, var(--convertybot-bg-secondary) 100%);
}

.showcase-header h3 {
    font-size: var(--convertybot-font-size-2xl);
    font-weight: var(--convertybot-font-weight-bold);
    margin: 0;
    color: var(--convertybot-text-primary);
    display: flex;
    align-items: center;
    gap: var(--convertybot-space-3);
}

.showcase-header h3::before {
    content: "✨";
    font-size: 1.2em;
}

.close-showcase {
    width: 44px;
    height: 44px;
    border-radius: var(--convertybot-radius-full);
    background: rgba(255, 255, 255, 0.1);
    color: var(--convertybot-text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--convertybot-transition-fast);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.close-showcase:hover {
    background: rgba(239, 68, 68, 0.15);
    color: var(--convertybot-error);
    transform: scale(1.05);
    border-color: rgba(239, 68, 68, 0.3);
}

.showcase-content {
    flex: 1;
    overflow-y: auto;
    padding: var(--convertybot-space-8);
    background: var(--convertybot-bg-primary);
    scrollbar-width: thin;
    scrollbar-color: var(--convertybot-border) transparent;
}

.showcase-content::-webkit-scrollbar {
    width: 8px;
}

.showcase-content::-webkit-scrollbar-track {
    background: transparent;
}

.showcase-content::-webkit-scrollbar-thumb {
    background: var(--convertybot-border);
    border-radius: var(--convertybot-radius-full);
}

.showcase-content::-webkit-scrollbar-thumb:hover {
    background: var(--convertybot-text-muted);
}

.showcase-controls {
    display: flex;
    gap: var(--convertybot-space-2);
    margin-bottom: var(--convertybot-space-4);
}

.showcase-filter,
.showcase-sort {
    flex: 1;
    padding: var(--convertybot-space-2) var(--convertybot-space-3);
    border: 1px solid var(--convertybot-border);
    border-radius: var(--convertybot-radius-lg);
    background: var(--convertybot-bg-secondary);
    color: var(--convertybot-text-primary);
    font-size: var(--convertybot-font-size-sm);
    transition: var(--convertybot-transition-fast);
}

.showcase-filter:focus,
.showcase-sort:focus {
    outline: none;
    border-color: var(--convertybot-primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: var(--convertybot-space-4);
}

/* ==========================================================================
   Rating Modal
   ========================================================================== */

.rating-modal {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--convertybot-radius-2xl);
    z-index: var(--convertybot-z-modal);
    backdrop-filter: blur(4px);
}

.modal-content {
    background: var(--convertybot-bg-primary);
    border-radius: var(--convertybot-radius-xl);
    padding: var(--convertybot-space-6);
    width: 90%;
    max-width: 320px;
    text-align: center;
    box-shadow: var(--convertybot-shadow-xl);
    border: 1px solid var(--convertybot-border);
    animation: modalSlideIn 0.3s var(--convertybot-ease-out);
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(var(--convertybot-space-4)) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal-header h3 {
    margin: 0 0 var(--convertybot-space-5) 0;
    font-size: var(--convertybot-font-size-xl);
    font-weight: var(--convertybot-font-weight-semibold);
    color: var(--convertybot-text-primary);
}

.rating-stars {
    display: flex;
    justify-content: center;
    gap: var(--convertybot-space-2);
    margin-bottom: var(--convertybot-space-4);
}

.star {
    font-size: 36px;
    color: var(--convertybot-gray-300);
    cursor: pointer;
    transition: var(--convertybot-transition-fast);
    user-select: none;
    position: relative;
}

.star:hover,
.star.active {
    color: #fbbf24;
    transform: scale(1.1);
}

.star:hover::before,
.star.active::before {
    content: '';
    position: absolute;
    top: -4px;
    left: -4px;
    right: -4px;
    bottom: -4px;
    background: radial-gradient(circle, rgba(251, 191, 36, 0.2) 0%, transparent 70%);
    border-radius: var(--convertybot-radius-full);
    z-index: -1;
}

#rating-feedback {
    width: 100%;
    min-height: 80px;
    border: 1px solid var(--convertybot-border);
    border-radius: var(--convertybot-radius-lg);
    padding: var(--convertybot-space-3);
    font-size: var(--convertybot-font-size-sm);
    margin-bottom: var(--convertybot-space-4);
    resize: vertical;
    font-family: inherit;
    background: var(--convertybot-bg-secondary);
    color: var(--convertybot-text-primary);
    transition: var(--convertybot-transition-fast);
}

#rating-feedback:focus {
    outline: none;
    border-color: var(--convertybot-primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

#rating-feedback::placeholder {
    color: var(--convertybot-text-muted);
}

.modal-actions {
    display: flex;
    gap: var(--convertybot-space-3);
    justify-content: center;
}

/* ==========================================================================
   Products Showcase Modal
   ========================================================================== */

.products-showcase-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: var(--convertybot-z-modal);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: var(--convertybot-transition-base);
}

.products-showcase-modal.active {
    opacity: 1;
    visibility: visible;
}

.showcase-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

.showcase-modal-container {
    position: relative;
    width: 90vw;
    max-width: 900px;
    max-height: 80vh;
    background: var(--convertybot-bg-primary);
    border-radius: var(--convertybot-radius-2xl);
    box-shadow: var(--convertybot-shadow-xl);
    border: 1px solid var(--convertybot-border);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: modalSlideIn 0.3s var(--convertybot-ease-out);
}

.showcase-modal-header {
    padding: var(--convertybot-space-4) var(--convertybot-space-5);
    border-bottom: 1px solid var(--convertybot-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--convertybot-bg-secondary);
    flex-shrink: 0;
}

.showcase-title {
    font-size: var(--convertybot-font-size-xl);
    font-weight: var(--convertybot-font-weight-semibold);
    color: var(--convertybot-text-primary);
    margin: 0;
    display: flex;
    align-items: center;
    gap: var(--convertybot-space-2);
}

.title-icon {
    font-size: var(--convertybot-font-size-2xl);
}

.product-count {
    font-size: var(--convertybot-font-size-sm);
    color: var(--convertybot-text-muted);
    font-weight: var(--convertybot-font-weight-normal);
    margin-left: var(--convertybot-space-2);
}

.showcase-close-btn {
    width: 40px;
    height: 40px;
    border-radius: var(--convertybot-radius-full);
    background: var(--convertybot-bg-primary);
    border: 1px solid var(--convertybot-border);
    color: var(--convertybot-text-secondary);
    cursor: pointer;
    transition: var(--convertybot-transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
}

.showcase-close-btn:hover {
    background: var(--convertybot-error-light);
    color: var(--convertybot-error);
    border-color: var(--convertybot-error);
    transform: scale(1.05);
}

.showcase-modal-content {
    flex: 1;
    overflow-y: auto;
    padding: var(--convertybot-space-5);
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: var(--convertybot-space-6);
    margin-top: var(--convertybot-space-6);
    padding: var(--convertybot-space-2);
}

/* Enhanced Product Cards in Modal */
.products-grid .product-card-enhanced {
    background: var(--convertybot-bg-primary);
    border: 1px solid var(--convertybot-border);
    border-radius: var(--convertybot-radius-2xl);
    padding: var(--convertybot-space-6);
    transition: all 0.3s var(--convertybot-ease-out);
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    height: 100%;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
}

.products-grid .product-card-enhanced::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, var(--convertybot-primary) 0%, transparent 100%);
    opacity: 0;
    transition: opacity 0.3s var(--convertybot-ease-out);
    pointer-events: none;
}

.products-grid .product-card-enhanced:hover {
    border-color: var(--convertybot-primary);
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

.products-grid .product-card-enhanced:hover::before {
    opacity: 0.05;
}

.products-grid .product-card-enhanced .product-image {
    margin-bottom: var(--convertybot-space-4);
    overflow: hidden;
    border-radius: var(--convertybot-radius-xl);
    position: relative;
    aspect-ratio: 4/3;
    background: linear-gradient(135deg, var(--convertybot-bg-secondary) 0%, rgba(255, 255, 255, 0.05) 100%);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.products-grid .product-card-enhanced .product-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
    transition: var(--convertybot-transition-base);
    padding: var(--convertybot-space-3);
    mix-blend-mode: multiply;
}

.products-grid .product-card-enhanced:hover .product-image img {
    transform: scale(1.05);
}

.products-grid .product-card-enhanced .product-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    position: relative;
    z-index: 1;
}

.products-grid .product-card-enhanced .product-name {
    font-size: var(--convertybot-font-size-xl);
    font-weight: var(--convertybot-font-weight-bold);
    margin: 0 0 var(--convertybot-space-3) 0;
    color: var(--convertybot-text-primary);
    line-height: var(--convertybot-line-height-tight);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.products-grid .product-card-enhanced .product-price {
    font-size: var(--convertybot-font-size-2xl);
    font-weight: var(--convertybot-font-weight-bold);
    color: var(--convertybot-primary);
    margin-bottom: var(--convertybot-space-3);
    background: linear-gradient(135deg, var(--convertybot-primary) 0%, #3b82f6 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.products-grid .product-card-enhanced .product-description {
    font-size: var(--convertybot-font-size-sm);
    color: var(--convertybot-text-secondary);
    line-height: var(--convertybot-line-height-relaxed);
    margin-bottom: var(--convertybot-space-4);
    flex: 1;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.products-grid .product-card-enhanced .product-actions {
    display: flex;
    gap: var(--convertybot-space-3);
    margin-top: auto;
    padding-top: var(--convertybot-space-4);
}

.products-grid .product-card-enhanced .product-actions .button {
    flex: 1;
    padding: var(--convertybot-space-3) var(--convertybot-space-4);
    border-radius: var(--convertybot-radius-xl);
    font-weight: var(--convertybot-font-weight-semibold);
    font-size: var(--convertybot-font-size-sm);
    transition: all 0.2s var(--convertybot-ease-out);
    text-decoration: none;
    text-align: center;
    border: none;
    cursor: pointer;
}

.products-grid .product-card-enhanced .product-actions .button.secondary {
    background: var(--convertybot-bg-secondary);
    color: var(--convertybot-text-primary);
    border: 1px solid var(--convertybot-border);
}

.products-grid .product-card-enhanced .product-actions .button.secondary:hover {
    background: var(--convertybot-bg-tertiary);
    transform: translateY(-1px);
}

.products-grid .product-card-enhanced .product-actions .button.primary {
    background: linear-gradient(135deg, var(--convertybot-primary) 0%, #3b82f6 100%);
    color: white;
    border: none;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.products-grid .product-card-enhanced .product-actions .button.primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(37, 99, 235, 0.4);
}

/* ==========================================================================
   Responsive Design
   ========================================================================== */

/* Tablet */
@media (max-width: 1024px) {
    .product-showcase-content {
        max-width: 900px;
        margin: var(--convertybot-space-4);
    }
    
    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
        gap: var(--convertybot-space-4);
    }
    
    .showcase-header {
        padding: var(--convertybot-space-5) var(--convertybot-space-6);
    }
    
    .showcase-content {
        padding: var(--convertybot-space-6);
    }
}

/* Mobile */
@media (max-width: 768px) {
    .ai-chatbot-widget {
        bottom: var(--convertybot-space-3);
        right: var(--convertybot-space-3);
        left: var(--convertybot-space-3);
    }
    
    .chatbot-window {
        width: 100%;
        height: 70vh;
        max-height: none;
        bottom: 70px;
        right: 0;
        left: 0;
        border-radius: var(--convertybot-radius-2xl) var(--convertybot-radius-2xl) 0 0;
        max-width: none;
    }
    
    .product-showcase-content {
        margin: var(--convertybot-space-2);
        max-height: 95vh;
        border-radius: var(--convertybot-radius-xl);
    }
    
    .showcase-header {
        padding: var(--convertybot-space-4) var(--convertybot-space-5);
    }
    
    .showcase-header h3 {
        font-size: var(--convertybot-font-size-lg);
    }
    
    .showcase-content {
        padding: var(--convertybot-space-4);
    }
    
    .products-grid {
        grid-template-columns: 1fr;
        gap: var(--convertybot-space-4);
    }
    
    .product-card-enhanced .product-image {
        aspect-ratio: 16/9;
    }
    
    .see-more-btn {
        font-size: var(--convertybot-font-size-xs);
        padding: var(--convertybot-space-1) var(--convertybot-space-2);
    }
    
    /* Mobile Modal Adjustments */
    .showcase-modal-container {
        width: 95vw;
        max-height: 90vh;
        margin: var(--convertybot-space-2);
    }
    
    .products-grid {
        grid-template-columns: 1fr;
        gap: var(--convertybot-space-3);
    }
    
    .showcase-modal-content {
        padding: var(--convertybot-space-3);
    }
    
    .showcase-modal-header {
        padding: var(--convertybot-space-3) var(--convertybot-space-4);
    }
    
    .message.user-message {
        padding-left: var(--convertybot-space-10);
    }
    
    .message.bot-message {
        padding-right: var(--convertybot-space-8);
    }
    
    .chatbot-header {
        padding: var(--convertybot-space-3) var(--convertybot-space-4);
    }
    
    .bot-name {
        font-size: var(--convertybot-font-size-base);
    }
    
    .message {
        padding-left: var(--convertybot-space-4);
        padding-right: var(--convertybot-space-4);
    }
    
    .chatbot-input {
        padding: var(--convertybot-space-3) var(--convertybot-space-4);
    }
    
    .input-container {
        padding: var(--convertybot-space-2) var(--convertybot-space-3);
    }
    
    .modal-content {
        padding: var(--convertybot-space-5);
        margin: var(--convertybot-space-4);
    }
}

/* Small Mobile */
@media (max-width: 480px) {
    .chatbot-window {
        height: 80vh;
        bottom: 60px;
    }
    
    .bot-avatar {
        width: 32px;
        height: 32px;
    }
    
    .message-avatar {
        width: 28px;
        height: 28px;
    }
    
    .product-inline {
        flex-direction: column;
        text-align: center;
    }
    
    .product-thumbnail img {
        width: 80px;
        height: 80px;
    }
    
    .star {
        font-size: 32px;
    }
}

/* ==========================================================================
   Accessibility & Focus States
   ========================================================================== */

/* Focus indicators */
*:focus {
    outline: none;
}

button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
[tabindex]:focus-visible {
    outline: 2px solid var(--convertybot-primary);
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .message-text,
    .product-inline,
    .product-card,
    .coupon-card {
        border-width: 2px;
    }
    
    .button {
        border-width: 2px;
    }
}

/* Print styles */
@media print {
    .ai-chatbot-widget {
        display: none !important;
    }
}

/* ==========================================================================
   Additional Animations & Effects
   ========================================================================== */

/* Shimmer loading effect */
@keyframes shimmer {
    0% {
        background-position: -200px 0;
    }
    100% {
        background-position: calc(200px + 100%) 0;
    }
}

.loading-shimmer {
    background: linear-gradient(90deg, var(--convertybot-bg-secondary) 0%, var(--convertybot-bg-tertiary) 50%, var(--convertybot-bg-secondary) 100%);
    background-size: 200px 100%;
    animation: shimmer 1.5s ease-in-out infinite;
}

/* Notification pulse */
@keyframes notificationPulse {
    0% {
        box-shadow: 0 0 0 0 rgba(37, 99, 235, 0.7);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(37, 99, 235, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(37, 99, 235, 0);
    }
}

.has-notification {
    animation: notificationPulse 2s infinite;
}

/* Floating animation for decorative elements */
@keyframes float {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-6px);
    }
}

.floating {
    animation: float 3s ease-in-out infinite;
}

/* Success checkmark animation */
@keyframes checkmark {
    0% {
        stroke-dasharray: 0 50;
        stroke-dashoffset: 0;
    }
    100% {
        stroke-dasharray: 50 0;
        stroke-dashoffset: -50;
    }
}

.success-checkmark {
    animation: checkmark 0.5s ease-in-out;
}

/* ==========================================================================
   Products Showcase Modal
   ========================================================================== */

.products-showcase-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.75);
    z-index: var(--convertybot-z-modal);
    opacity: 0;
    visibility: hidden;
    transition: var(--convertybot-transition-base);
    backdrop-filter: blur(4px);
}

.products-showcase-modal.active {
    opacity: 1;
    visibility: visible;
}

.showcase-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--convertybot-space-4);
}

.showcase-modal-container {
    background: var(--convertybot-bg-primary);
    border-radius: var(--convertybot-radius-2xl);
    width: 100%;
    max-width: 900px;
    max-height: 90vh;
    box-shadow: var(--convertybot-shadow-xl);
    border: 1px solid var(--convertybot-border);
    display: flex;
    flex-direction: column;
    transform: scale(0.9) translateY(30px);
    transition: var(--convertybot-transition-base);
    overflow: hidden;
}

.products-showcase-modal.active .showcase-modal-container {
    transform: scale(1) translateY(0);
}

.showcase-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--convertybot-space-5);
    border-bottom: 1px solid var(--convertybot-border);
    background: linear-gradient(135deg, var(--convertybot-primary) 0%, var(--convertybot-primary-hover) 100%);
    color: var(--convertybot-white);
}

.showcase-title {
    font-size: var(--convertybot-font-size-xl);
    font-weight: var(--convertybot-font-weight-bold);
    margin: 0;
    display: flex;
    align-items: center;
    gap: var(--convertybot-space-2);
}

.title-icon {
    font-size: var(--convertybot-font-size-2xl);
}

.product-count {
    font-size: var(--convertybot-font-size-sm);
    opacity: 0.8;
    font-weight: var(--convertybot-font-weight-normal);
    margin-left: var(--convertybot-space-2);
}

.showcase-close-btn {
    width: 40px;
    height: 40px;
    border-radius: var(--convertybot-radius-lg);
    background: rgba(255, 255, 255, 0.1);
    color: inherit;
    border: 1px solid rgba(255, 255, 255, 0.2);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--convertybot-transition-fast);
    backdrop-filter: blur(10px);
}

.showcase-close-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.05);
}

.showcase-modal-body {
    flex: 1;
    overflow-y: auto;
    padding: var(--convertybot-space-5);
}

.products-grid-showcase {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: var(--convertybot-space-4);
}

@media (max-width: 768px) {
    .products-grid-showcase {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: var(--convertybot-space-3);
    }
    
    .showcase-modal-container {
        max-height: 95vh;
        margin: var(--convertybot-space-2);
    }
    
    .showcase-modal-header {
        padding: var(--convertybot-space-4);
    }
    
    .showcase-modal-body {
        padding: var(--convertybot-space-4);
    }
}

@media (max-width: 480px) {
    .products-grid-showcase {
        grid-template-columns: 1fr;
    }
    
    .showcase-title {
        font-size: var(--convertybot-font-size-lg);
        flex-direction: column;
        gap: var(--convertybot-space-1);
        text-align: left;
    }
    
    .product-count {
        margin-left: 0;
    }
}