/* ============================================
   ESQUINITA DEL MOJITO — CHATBOT WIDGET
   ============================================ */

/* ---------- Trigger Button ---------- */
#esquinitaChatTrigger {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 99999992;
    width: 62px;
    height: 62px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    background: linear-gradient(135deg, #f19822 0%, #d4800e 100%);
    box-shadow: 0 6px 24px rgba(241,152,34,0.45), 0 2px 8px rgba(0,0,0,0.18);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s cubic-bezier(.34,1.56,.64,1), box-shadow 0.3s ease;
    -webkit-tap-highlight-color: transparent;
}

#esquinitaChatTrigger:hover {
    transform: scale(1.08);
    box-shadow: 0 8px 30px rgba(241,152,34,0.55), 0 3px 12px rgba(0,0,0,0.22);
}

#esquinitaChatTrigger:active {
    transform: scale(0.95);
}

#esquinitaChatTrigger svg {
    width: 30px;
    height: 30px;
    fill: #fff;
    transition: opacity 0.25s ease, transform 0.3s ease;
}

#esquinitaChatTrigger .chat-icon-close {
    position: absolute;
    opacity: 0;
    transform: rotate(-90deg) scale(0.6);
}

#esquinitaChatTrigger.active .chat-icon-open {
    opacity: 0;
    transform: rotate(90deg) scale(0.6);
}

#esquinitaChatTrigger.active .chat-icon-close {
    opacity: 1;
    transform: rotate(0) scale(1);
}

#esquinitaChatTrigger.active .chat-icon-open {
    opacity: 0;
    transform: rotate(90deg) scale(0.6);
}

#esquinitaChatTrigger.active .chat-icon-close {
    opacity: 1;
    transform: rotate(0) scale(1);
}

/* Pulse ring */
#esquinitaChatTrigger::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 2px solid rgba(241,152,34,0.5);
    animation: chatPulse 2.5s ease-out infinite;
    pointer-events: none;
}

#esquinitaChatTrigger.active::after {
    animation: none;
    opacity: 0;
}

@keyframes chatPulse {
    0% { transform: scale(1); opacity: 0.7; }
    70% { transform: scale(1.45); opacity: 0; }
    100% { transform: scale(1.45); opacity: 0; }
}

/* ---------- Chat Window ---------- */
#esquinitaChatWindow {
    position: fixed;
    bottom: 100px;
    right: 24px;
    z-index: 99999993;
    width: 380px;
    max-width: calc(100vw - 32px);
    height: 540px;
    max-height: calc(100vh - 140px);
    background: #1a1410;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.5), 0 0 0 1px rgba(241,152,34,0.15);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    opacity: 0;
    transform: translateY(20px) scale(0.95);
    pointer-events: none;
    transition: opacity 0.35s cubic-bezier(.16,1,.3,1),
                transform 0.35s cubic-bezier(.16,1,.3,1);
}

#esquinitaChatWindow.open {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: all;
}

/* ---------- Header ---------- */
.esquinita-chat-header {
    background: linear-gradient(135deg, #2a1e14 0%, #1a1410 100%);
    padding: 18px 20px;
    display: flex;
    align-items: center;
    gap: 14px;
    border-bottom: 1px solid rgba(241,152,34,0.18);
    flex-shrink: 0;
}

.esquinita-chat-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(135deg, #f19822 0%, #d4800e 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 2px 10px rgba(241,152,34,0.3);
}

.esquinita-chat-avatar svg {
    width: 24px;
    height: 24px;
    fill: #fff;
}

.esquinita-chat-header-info {
    flex: 1;
    min-width: 0;
}

.esquinita-chat-header-name {
    font-family: Cera-Pro-Bold, 'Inter', sans-serif;
    font-size: 15px;
    color: #fff;
    letter-spacing: 0.5px;
    line-height: 1.2;
}

/* ---------- Messages Area ---------- */
.esquinita-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    scroll-behavior: smooth;
    background: #1a1410;
}

/* Scrollbar */
.esquinita-chat-messages::-webkit-scrollbar {
    width: 5px;
}
.esquinita-chat-messages::-webkit-scrollbar-track {
    background: transparent;
}
.esquinita-chat-messages::-webkit-scrollbar-thumb {
    background: rgba(241,152,34,0.25);
    border-radius: 10px;
}

/* ---------- Message Bubbles ---------- */
.chat-msg {
    display: flex;
    gap: 10px;
    animation: chatMsgIn 0.4s cubic-bezier(.16,1,.3,1) both;
}

@keyframes chatMsgIn {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.chat-msg-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, #f19822, #d4800e);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-top: 2px;
}

.chat-msg-avatar svg {
    width: 16px;
    height: 16px;
    fill: #fff;
}

.chat-msg-bubble {
    background: #2a2018;
    border: 1px solid rgba(241,152,34,0.12);
    border-radius: 4px 16px 16px 16px;
    padding: 12px 16px;
    max-width: 85%;
    color: #f0e6d8;
    font-family: Cera-Pro-Regular, 'Inter', sans-serif;
    font-size: 14px;
    line-height: 1.55;
}

.chat-msg-bubble strong {
    color: #f19822;
    font-family: Cera-Pro-Bold, 'Inter', sans-serif;
}

.chat-msg-bubble a {
    color: #f19822;
    text-decoration: underline;
    text-underline-offset: 3px;
    transition: color 0.2s;
}

.chat-msg-bubble a:hover {
    color: #ffc266;
}

/* Info card inside bubble */
.chat-info-card {
    background: rgba(241,152,34,0.08);
    border: 1px solid rgba(241,152,34,0.15);
    border-radius: 12px;
    padding: 14px;
    margin-top: 10px;
}

.chat-info-row {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 6px 0;
}

.chat-info-row + .chat-info-row {
    border-top: 1px solid rgba(241,152,34,0.1);
}

.chat-info-row svg {
    width: 18px;
    height: 18px;
    fill: #f19822;
    flex-shrink: 0;
    margin-top: 2px;
}

.chat-info-row span {
    font-size: 13px;
    line-height: 1.5;
    color: #e0d5c5;
}

.chat-info-row span strong {
    display: block;
    color: #f19822;
    font-family: Cera-Pro-Bold, 'Inter', sans-serif;
    font-size: 12px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    margin-bottom: 2px;
}

/* ---------- Carta Links Grid ---------- */
.chat-cartas-grid {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 10px;
}

.chat-carta-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    background: rgba(241,152,34,0.06);
    border: 1px solid rgba(241,152,34,0.12);
    border-radius: 10px;
    color: #f0e6d8 !important;
    text-decoration: none !important;
    font-family: Cera-Pro-Regular, 'Inter', sans-serif;
    font-size: 13px;
    transition: all 0.25s ease;
    cursor: pointer;
}

.chat-carta-link:hover {
    background: rgba(241,152,34,0.14);
    border-color: rgba(241,152,34,0.3);
    color: #fff !important;
    transform: translateX(4px);
}

.chat-carta-link svg {
    width: 18px;
    height: 18px;
    fill: #f19822;
    flex-shrink: 0;
}

/* ---------- Quick Reply Buttons ---------- */
.chat-quick-replies {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 14px 16px 16px;
    border-top: 1px solid rgba(241,152,34,0.1);
    background: #1a1410;
    flex-shrink: 0;
}

.chat-quick-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    border-radius: 24px;
    border: 1px solid rgba(241,152,34,0.3);
    background: rgba(241,152,34,0.06);
    color: #f19822;
    font-family: Cera-Pro-Regular, 'Inter', sans-serif;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(.16,1,.3,1);
    -webkit-tap-highlight-color: transparent;
    white-space: nowrap;
}

.chat-quick-btn svg {
    width: 16px;
    height: 16px;
    fill: currentColor;
    flex-shrink: 0;
}

.chat-quick-btn:hover {
    background: #f19822;
    color: #1a1410;
    border-color: #f19822;
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(241,152,34,0.3);
}

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

/* Back button */
.chat-quick-btn.back-btn {
    border-color: rgba(255,255,255,0.15);
    color: rgba(240,230,216,0.7);
    background: rgba(255,255,255,0.04);
}

.chat-quick-btn.back-btn:hover {
    background: rgba(255,255,255,0.1);
    color: #fff;
    border-color: rgba(255,255,255,0.3);
    box-shadow: none;
}

/* ---------- Typing Indicator ---------- */
.chat-typing {
    display: flex;
    gap: 10px;
    animation: chatMsgIn 0.3s ease both;
}

.chat-typing-dots {
    background: #2a2018;
    border: 1px solid rgba(241,152,34,0.12);
    border-radius: 4px 16px 16px 16px;
    padding: 14px 20px;
    display: flex;
    gap: 5px;
    align-items: center;
}

.chat-typing-dots span {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: rgba(241,152,34,0.5);
    animation: chatTypingBounce 1.4s ease-in-out infinite;
}

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

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

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

/* ---------- Paladar highlight ---------- */
.chat-paladar-highlight {
    background: linear-gradient(135deg, rgba(241,152,34,0.12) 0%, rgba(241,152,34,0.04) 100%);
    border: 1px solid rgba(241,152,34,0.2);
    border-radius: 14px;
    padding: 16px;
    margin-top: 10px;
}

.chat-paladar-highlight h4 {
    color: #f19822;
    font-family: Cera-Pro-Bold, 'Inter', sans-serif;
    font-size: 14px;
    letter-spacing: 1px;
    text-transform: uppercase;
    margin: 0 0 8px 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.chat-paladar-highlight h4 svg {
    width: 18px;
    height: 18px;
    fill: #f19822;
}

.chat-paladar-highlight p {
    font-size: 13px;
    line-height: 1.55;
    color: #e0d5c5;
    margin: 0;
}

.chat-paladar-highlight .paladar-cta {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 10px;
    padding: 8px 14px;
    background: #f19822;
    color: #1a1410;
    border-radius: 20px;
    font-family: Cera-Pro-Bold, 'Inter', sans-serif;
    font-size: 12px;
    letter-spacing: 0.5px;
    text-decoration: none;
    transition: all 0.25s ease;
}

.chat-paladar-highlight .paladar-cta:hover {
    background: #ffc266;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(241,152,34,0.3);
}

.chat-paladar-highlight .paladar-cta svg {
    width: 14px;
    height: 14px;
    fill: #1a1410;
}

/* ---------- Reservation CTA in chat ---------- */
.chat-reserve-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 10px;
    padding: 10px 18px;
    background: linear-gradient(135deg, #f19822, #d4800e);
    color: #fff !important;
    border-radius: 24px;
    font-family: Cera-Pro-Bold, 'Inter', sans-serif;
    font-size: 13px;
    letter-spacing: 0.5px;
    text-decoration: none !important;
    cursor: pointer;
    border: none;
    transition: all 0.25s ease;
}

.chat-reserve-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(241,152,34,0.4);
}

.chat-reserve-btn svg {
    width: 16px;
    height: 16px;
    fill: #fff;
}

/* ---------- Responsive ---------- */
@media (max-width: 480px) {
    #esquinitaChatWindow {
        bottom: 85px;
        right: 15px;
        width: calc(100% - 30px);
        max-width: 100%;
        height: calc(100% - 110px);
        height: calc(100dvh - 110px);
        max-height: 650px;
        border-radius: 20px;
    }

    #esquinitaChatTrigger {
        bottom: 15px;
        right: 15px;
        width: 55px;
        height: 55px;
    }
}
