/* Santy — bot del botón "Mi Club" (adaptado del chat de lla-santacruz con los colores del Club) */
:root {
    --santy-a: #ff6a00;
    --santy-b: #ee0979;
    --santy-oscuro: #1a3a5c;
}

/* El botón Mi Club es un <button> cuando abre a Santy */
.santy-fab { border: 0; cursor: pointer; font: inherit; padding: 0; }
.santy-fab::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 50%;
    animation: santyPulse 2.4s ease-out infinite;
    z-index: -1;
}
.santy-fab.is-active::before { animation: none; }
.santy-fab-tip {
    position: absolute;
    right: 72px;
    background: var(--santy-oscuro);
    color: #fff;
    padding: .45rem .8rem;
    border-radius: 8px;
    font-size: .82rem;
    font-style: normal;
    font-weight: 700;
    white-space: nowrap;
    opacity: 0;
    transform: translateX(8px);
    pointer-events: none;
    transition: opacity .25s ease, transform .25s ease;
}
.santy-fab:hover .santy-fab-tip { opacity: 1; transform: none; }
.santy-fab.is-active .santy-fab-tip { display: none; }

@keyframes santyPulse {
    0%   { box-shadow: 0 0 0 0 rgba(238, 9, 121, .55); }
    70%  { box-shadow: 0 0 0 16px rgba(238, 9, 121, 0); }
    100% { box-shadow: 0 0 0 0 rgba(238, 9, 121, 0); }
}

/* Ventana del chat */
.santy-chat {
    position: fixed;
    right: 40px;
    bottom: 272px;
    z-index: 1600;
    width: 360px;
    height: min(540px, calc(100vh - 300px));
    min-height: 380px;
    display: flex;
    flex-direction: column;
    border-radius: 16px;
    overflow: hidden;
    background: #f6f1ee;
    box-shadow: 0 18px 48px rgba(0,0,0,.28);
    opacity: 0;
    transform: translateY(16px) scale(.96);
    transform-origin: bottom right;
    transition: opacity .22s ease, transform .22s ease;
    font-family: inherit;
}
.santy-chat.is-open { opacity: 1; transform: none; }
.santy-chat[hidden] { display: none; }

.santy-header {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .75rem .9rem;
    background: linear-gradient(135deg, var(--santy-a), var(--santy-b));
    color: #fff;
}
.santy-avatar {
    width: 40px; height: 40px; flex-shrink: 0;
    border-radius: 50%;
    background: #fff;
    color: var(--santy-b);
    font-weight: 900;
    font-size: 1.2rem;
    display: flex; align-items: center; justify-content: center;
}
.santy-info { display: flex; flex-direction: column; line-height: 1.25; flex: 1; min-width: 0; }
.santy-info strong { font-size: .98rem; }
.santy-status { font-size: .75rem; opacity: .9; }
.santy-close {
    display: flex; background: none; border: 0; color: inherit;
    padding: .35rem; border-radius: 50%; cursor: pointer;
}
.santy-close svg { width: 20px; height: 20px; }
.santy-close:hover { background: rgba(255,255,255,.18); }
.santy-close:focus-visible, .santy-chip:focus-visible, .santy-send:focus-visible {
    outline: 2px solid var(--santy-oscuro); outline-offset: 2px;
}

.santy-body {
    flex: 1;
    overflow-y: auto;
    padding: 1rem .8rem;
    display: flex;
    flex-direction: column;
    gap: .45rem;
    background-image: radial-gradient(rgba(0,0,0,.035) 1px, transparent 1px);
    background-size: 14px 14px;
}

.santy-msg {
    position: relative;
    max-width: 85%;
    padding: .45rem .65rem 1.1rem;
    border-radius: 10px;
    font-size: .9rem;
    line-height: 1.4;
    color: #111b21;
    box-shadow: 0 1px .5px rgba(0,0,0,.13);
    animation: santyMsgIn .2s ease-out;
}
.santy-msg p { margin: 0; white-space: pre-line; overflow-wrap: anywhere; }
.santy-msg--bot  { align-self: flex-start; background: #fff; border-top-left-radius: 2px; }
.santy-msg--user { align-self: flex-end; background: #ffe3ef; border-top-right-radius: 2px; }
.santy-msg-time {
    position: absolute; right: .55rem; bottom: .2rem;
    font-size: .68rem; color: #667781;
}

.santy-typing { display: flex; gap: 4px; padding: .7rem .8rem; }
.santy-typing span {
    width: 7px; height: 7px; border-radius: 50%;
    background: #8696a0;
    animation: santyTyping 1.2s infinite ease-in-out;
}
.santy-typing span:nth-child(2) { animation-delay: .15s; }
.santy-typing span:nth-child(3) { animation-delay: .3s; }

.santy-options { display: flex; flex-wrap: wrap; gap: .4rem; padding: 0 .8rem; }
.santy-options:not(:empty) { padding-bottom: .6rem; }
.santy-chip {
    border: 1px solid var(--santy-b);
    background: #fff;
    color: var(--santy-b);
    border-radius: 999px;
    padding: .35rem .8rem;
    font: inherit;
    font-size: .82rem;
    font-weight: 700;
    cursor: pointer;
    transition: background .15s ease, color .15s ease;
}
.santy-chip:hover { background: var(--santy-b); color: #fff; }

.santy-form {
    display: flex; align-items: center; gap: .5rem;
    padding: .55rem .6rem;
    background: #efe9e6;
    margin: 0;
}
.santy-input {
    flex: 1; min-width: 0;
    border: 0; border-radius: 999px;
    padding: .65rem 1rem;
    font: inherit; font-size: .9rem;
    background: #fff; outline: none;
}
.santy-prefijo {
    flex-shrink: 0;
    padding: .65rem .7rem;
    border-radius: 999px;
    background: #fff;
    font-size: .9rem; font-weight: 600;
    color: var(--santy-oscuro);
}
.santy-prefijo[hidden] { display: none; }
.santy-input:focus { box-shadow: 0 0 0 2px var(--santy-b); }
.santy-input:disabled { background: #f3f3f3; }
.santy-send {
    display: flex; align-items: center; justify-content: center;
    width: 42px; height: 42px; flex-shrink: 0;
    border: 0; border-radius: 50%;
    background: linear-gradient(135deg, var(--santy-a), var(--santy-b));
    color: #fff; cursor: pointer;
}
.santy-send svg { width: 20px; height: 20px; }
.santy-send:disabled { opacity: .5; cursor: default; }

@keyframes santyMsgIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes santyTyping {
    0%, 60%, 100% { transform: translateY(0); opacity: .5; }
    30% { transform: translateY(-4px); opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
    .santy-chat, .santy-msg, .santy-typing span, .santy-fab::before { transition: none; animation: none; }
}

@media (max-width: 768px) {
    .santy-chat {
        right: 1rem;
        left: 1rem;
        width: auto;
        bottom: 1rem;
        height: min(560px, calc(100dvh - 2rem));
        min-height: 0;
    }
    .santy-fab-tip { display: none; }
    /* 16px evita que iOS haga zoom al tocar el input */
    .santy-input { font-size: 16px; }
}
