/**
 * Max Chat Test - Floating Widget Styles
 * Exact colors and PP Fraktion Sans font
 */



/* Widget Container */
.max-chat-widget {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999;
    font-family: "PP Franktion Sans", Sans-serif;
    background-color: transparent !important;
}

.max-chat-widget code {
    background-color: transparent !important;
    height: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
}

/* Floating Bubble Trigger (Collapsed State) */
.max-chat-bubble-trigger {
    position: relative;
    cursor: pointer;
    animation: slideInBubble 0.5s ease-out;
    transition: transform 0.3s ease;
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
}

.max-chat-bubble-trigger:hover {
    transform: translateY(-3px);
}

@keyframes slideInBubble {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Bubble Icon - Character Image */
.max-bubble-icon {
    display: block;
    width: auto;
    height: auto !important;
    max-width: 150px;
    cursor: pointer;
    filter: drop-shadow(0 4px 12px rgba(169, 18, 246, 0.3));
    position: relative;
    z-index: 2;
}

/* Hide bubble message text (using image only) */
.max-bubble-message {
    display: none;
}

/* Bubble Text - Purple bubble below character */
.max-bubble-text {
    background: #A912F6;
    color: #ffffff;
    padding: 8.69px;
    border-radius: 24px;
    font-size: 14px;
    line-height: 1.4;
    text-align: center;
    position: relative;
    z-index: 1;
    min-width: 194px;
    font-family: "Ramboia Bold", Sans-serif;
}


/* Chat Modal (Expanded State) */
.max-chat-modal {
    position: fixed;
    bottom: 26px;
    right: 26px;
    width: 450px;
    max-width: calc(100vw - 40px);
    height: 817px;
    max-height: calc(100vh - 40px);
    background: #ffffff;
    border-radius: 24px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: slideInModal 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideInModal {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.95);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Header */
.max-chat-header {
    background: #ffffff;
    padding: 6px 24px;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}

.max-chat-header-content {
    display: flex;
    align-items: center;
    gap: 20px;
}

.max-avatar-header {
    width: 50px;
    height: 50px !important;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.max-avatar-img {
    width: 100%;
    height: 100% !important;
    object-fit: contain !important;
}

.max-chat-title {
    font-family: "FraktionSans Black", Sans-serif;
    font-size: 20px !important;
    font-weight: 900;
    color: #000000;
    letter-spacing: 0.5px;
    margin: 0;
}

/* Close Button */
.max-chat-close-btn {
    border: none;
    background: transparent;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.2s ease;
}


.max-chat-close-btn:focus {
    outline: 2px solid #A912F6;
    outline-offset: 2px;
}

/* Messages Container */
.max-chat-messages {
    flex: 1;
    padding: 24px;
    overflow-y: auto;
    background-image: url('../images/fondodechat.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    position: relative;
}

/* Scrollbar styling */
.max-chat-messages::-webkit-scrollbar {
    width: 6px;
}

.max-chat-messages::-webkit-scrollbar-track {
    background: rgba(169, 18, 246, 0.05);
}

.max-chat-messages::-webkit-scrollbar-thumb {
    background: rgba(169, 18, 246, 0.2);
    border-radius: 10px;
}

.max-chat-messages::-webkit-scrollbar-thumb:hover {
    background: rgba(169, 18, 246, 0.35);
}

/* Message Base */
.max-chat-message {
    margin-bottom: 16px;
    display: flex;
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Bot Messages (Left) */
.max-chat-bot-message {
    justify-content: flex-start;
}

.max-chat-bot-message .max-chat-bubble-msg {
    background: #ffffff;
    color: #000000;
    border-radius: 10px;
    max-width: 340px;
    padding: 10px;
    line-height: 1.6;
    font-weight: 900;
    font-size: 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    font-family: "PP Franktion Sans", Sans-serif;
}

/* User Messages (Right) - Color #C700CC */
.max-chat-user-message {
    justify-content: flex-end;
}

.max-chat-user-message .max-chat-bubble-msg {
    background: #C700CC;
    color: #ffffff;
    font-weight: 900;
    border-radius: 10px;
    max-width: 100%;
    padding: 10px;
    line-height: 1.6;
    font-size: 16px;
    box-shadow: 0 2px 8px rgba(199, 0, 204, 0.3);
    font-family: "PP Franktion Sans", Sans-serif;
}

/* Typing Indicator */
.max-chat-typing {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 14px 18px;
    background: #ffffff;
    border-radius: 18px 18px 18px 4px;
    width: fit-content;
    animation: slideIn 0.3s ease-out;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.max-chat-typing-dot {
    width: 8px;
    height: 8px;
    background: #A912F6;
    border-radius: 50%;
    animation: typingDot 1.4s infinite;
}

.max-chat-typing-dot:nth-child(2) {
    animation-delay: 0.2s;
}

.max-chat-typing-dot:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typingDot {

    0%,
    60%,
    100% {
        transform: translateY(0);
        opacity: 0.5;
    }

    30% {
        transform: translateY(-6px);
        opacity: 1;
    }
}

/* Options Container */
.max-chat-options {
    margin: 16px 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
    animation: slideIn 0.3s ease-out;
}

/* Option Buttons - White background, black text */
.max-chat-option-btn {
    background: #FAA8F1;
    color: #333;
    min-width: 164px;
    max-width: 100%;
    width: auto;
    border: none;
    border-radius: 10px;
    padding: 10px 14px;
    font-size: 16px;
    font-family: "PP Franktion Sans", sans-serif;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: start;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    margin-left: auto;
    line-height: 1.5;
    white-space: normal;
    word-wrap: break-word;
    overflow-wrap: break-word;
    display: block;
}

.max-chat-option-btn:hover {
    background: #C700CC;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.max-chat-option-btn:focus {
    outline: 3px solid #C700CC;
    outline-offset: 2px;
}

.max-chat-option-btn:active {
    transform: translateY(0);
}

/* Start Button - Purple background */
.max-chat-start-btn {
    background: #C700CC !important;
    color: #ffffff !important;
    box-shadow: 0 2px 8px rgba(199, 0, 204, 0.3) !important;
    text-align: center;
}

.max-chat-start-btn:hover {
    background: #A912F6 !important;
    box-shadow: 0 4px 12px rgba(169, 18, 246, 0.4) !important;
}


/* Result Container */
.max-chat-result {
    margin-top: 24px;
    padding: 20px;
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    animation: slideIn 0.3s ease-out;
}

.max-chat-result h3 {
    margin: 0 0 16px 0;
    font-size: 18px;
    font-weight: 700;
    color: #1a1a1a;
}

.max-chat-result h4 {
    margin: 0 0 12px 0;
    font-size: 16px;
    font-weight: 700;
    color: #000000;
    font-family: "PP Franktion Sans", Sans-serif;
}

.max-chat-result p {
    margin: 0 0 12px 0;
    line-height: 1.6;
    color: #000000;
    font-family: "PP Franktion Sans", Sans-serif;
    font-size: 14px;
}

/* Disclaimer - Appears first for scored results */
.max-chat-disclaimer {
    margin: 0 0 20px 0;
    padding: 14px 16px;
    background: rgba(251, 191, 36, 0.1);
    border-left: 4px solid #fbbf24;
    border-radius: 8px;
    font-size: 13px;
    line-height: 1.5;
    color: #92400e;
    font-family: "PP Franktion Sans", Sans-serif;
}

.max-chat-disclaimer strong {
    font-weight: 700;
}

/* Neutral Result */
.max-chat-result-neutral {
    padding: 16px;
    background: rgba(169, 18, 246, 0.05);
    border-radius: 12px;
    border: 2px solid #A912F6;
}

.max-chat-result-neutral p {
    margin: 0;
    font-size: 15px;
    line-height: 1.6;
    color: #000000;
    font-family: "PP Franktion Sans", Sans-serif;
}

/* Recommendations Container */
.max-chat-recommendations {
    margin-top: 16px;
}

.max-chat-recommendation-section {
    margin-bottom: 20px;
}

.max-chat-recommendation-section p {
    margin-bottom: 10px;
}

/* Emotion Links List - Purple links */
.max-chat-emotion-links {
    list-style: none;
    padding: 0;
    margin: 8px 0 0 20px;
}

.max-chat-emotion-links li {
    margin: 6px 0;
    line-height: 1.6;
}

.max-chat-emotion-link {
    color: #A912F6;
    text-decoration: none;
    font-weight: 600;
    font-family: "PP Franktion Sans", Sans-serif;
    font-size: 14px;
    transition: all 0.2s ease;
    border-bottom: 1px solid transparent;
}

.max-chat-emotion-link:hover {
    color: #C700CC;
    border-bottom-color: #C700CC;
}

.max-chat-emotion-text {
    color: #A912F6;
    font-weight: 600;
    font-family: "PP Franktion Sans", Sans-serif;
    font-size: 14px;
}

/* Product Recommendations List */
.max-chat-product-recommendations {
    list-style: none;
    padding: 0;
    margin: 8px 0 0 20px;
}

.max-chat-product-recommendations li {
    margin: 8px 0;
    line-height: 1.6;
    font-size: 14px;
    color: #000000;
    font-family: "PP Franktion Sans", Sans-serif;
}

/* Product Links - Purple links */
.max-chat-product-link {
    color: #A912F6;
    text-decoration: none;
    font-weight: 700;
    font-family: "PP Franktion Sans", Sans-serif;
    transition: all 0.2s ease;
    border-bottom: 1px solid transparent;
}

.max-chat-product-link:hover {
    color: #C700CC;
    border-bottom-color: #C700CC;
}

/* Legacy styles - keeping for backwards compatibility */
.max-chat-result-categories {
    margin: 20px 0;
}

.max-chat-result-category {
    display: inline-block;
    margin: 6px 8px 6px 0;
    padding: 8px 16px;
    background: #C700CC;
    color: #ffffff;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s ease;
    box-shadow: 0 2px 6px rgba(199, 0, 204, 0.3);
}

.max-chat-result-category:hover {
    background: #A912F6;
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(169, 18, 246, 0.4);
}

.max-chat-result-product {
    margin: 20px 0;
    padding: 16px;
    background: linear-gradient(135deg, #C700CC 0%, #A912F6 100%);
    border-radius: 12px;
    text-align: center;
}

.max-chat-result-product h4 {
    margin: 0 0 8px 0;
    font-size: 16px;
    font-weight: 700;
    color: #ffffff;
}

.max-chat-result-product p {
    color: #ffffff;
    margin: 0 0 12px 0;
}

.max-chat-result-product-link {
    display: inline-block;
    margin-top: 8px;
    padding: 10px 24px;
    background: #ffffff;
    color: #C700CC;
    border-radius: 24px;
    text-decoration: none;
    font-weight: 700;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.max-chat-result-product-link:hover {
    background: #faf5ff;
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}


/* Footer */
.max-chat-footer {
    padding: 16px 20px;
    background: #ffffff;
    border-top: 1px solid #f0f0f0;
    text-align: center;
    flex-shrink: 0;
}

/* Restart Button */
.max-chat-restart-btn {
    background: #C700CC;
    color: #ffffff;
    border: none;
    border-radius: 24px;
    padding: 12px 24px;
    font-size: 15px;
	margin-top:10px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(199, 0, 204, 0.3);
}

.max-chat-restart-btn:hover {
    background: #A912F6;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(169, 18, 246, 0.4);
}

.max-chat-restart-btn:focus {
    outline: 3px solid #C700CC;
    outline-offset: 2px;
}

.max-chat-restart-btn:active {
    transform: translateY(0);
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .max-chat-widget {
        bottom: 21px;
        right: 17px;
    }

    .max-chat-modal {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        width: 100%;
        height: 100%;
        height: 100dvh;
        max-width: 100%;
        max-height: none;
        border-radius: 0;
        margin: 0;
    }

    .max-chat-header {
        height: 87px;
        padding: 0 20px;
    }

    .max-chat-close-btn {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 44px;
        height: 44px;
        opacity: 1;
        visibility: visible;
    }

    .max-bubble-icon {
        max-width: 200px;
        max-height: 120px;
    }
}

@media (max-width: 480px) {

    /* Hide the default bubble icon and text on mobile */
    .max-bubble-icon {
        display: none;
    }

    /* Use background image for mobile bubble */
    .max-chat-bubble-trigger {
        background-image: url(../images/movilburbuja.svg);
        background-size: contain;
        background-position: center;
        background-repeat: no-repeat;
        width: 76px;
        height: 83px;
        justify-content: center;
        padding-top: 20px;
    }

    .max-bubble-text {
        background: transparent;
        color: #ffffff;
        font-family: "Ramboia Bold", Sans-serif;
        font-size: 11px !important;
        line-height: 1.2;
        text-align: center;
        padding: 0;
        min-width: 57px;
        max-width: 57px;
        position: relative;
        z-index: 10;
        box-shadow: none;
        margin-left: -10px;
    }

    /* Hide greeting, show only question on mobile */
    .max-bubble-greeting {
        display: none;
    }

    .max-chat-messages {
        padding: 16px;
    }
}

/* Accessibility */
.max-chat-option-btn:focus-visible,
.max-chat-restart-btn:focus-visible,
.max-chat-close-btn:focus-visible,
.max-chat-result-category:focus-visible,
.max-chat-result-product-link:focus-visible {
    outline: 3px solid #C700CC;
    outline-offset: 2px;
}

/* Screen reader only */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* Hide bubble when modal is open */
.max-chat-widget.modal-open .max-chat-bubble-trigger {
    display: none;
}