/* ── Chatbot widget — García Smester ── */
#gs-chat-widget {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    z-index: 9999;
    font-family: -apple-system, BlinkMacSystemFont, 'Inter', sans-serif;
}

/* ── Botón flotante ── */
.gs-chat-btn {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: #26e089;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 20px rgba(38,224,137,.4);
    transition: transform .2s, box-shadow .2s;
    position: relative;
    color: #0a0a0a;
}

.gs-chat-btn:hover {
    transform: scale(1.08);
    box-shadow: 0 6px 28px rgba(38,224,137,.5);
}

.gs-chat-btn__icon {
    width: 24px;
    height: 24px;
    position: absolute;
    transition: opacity .2s, transform .2s;
}

.gs-chat-btn__icon--close {
    opacity: 0;
    transform: rotate(-90deg) scale(.7);
}

/* Cuando el panel está abierto (aria-expanded=true) */
.gs-chat-btn[aria-expanded="true"] .gs-chat-btn__icon--open {
    opacity: 0;
    transform: rotate(90deg) scale(.7);
}

.gs-chat-btn[aria-expanded="true"] .gs-chat-btn__icon--close {
    opacity: 1;
    transform: rotate(0) scale(1);
}

/* Badge de notificación */
.gs-chat-badge {
    position: absolute;
    top: -3px;
    right: -3px;
    width: 18px;
    height: 18px;
    background: #ed1c24;
    color: #fff;
    font-size: .65rem;
    font-weight: 700;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #fff;
}

/* ── Panel ── */
.gs-chat-panel {
    position: absolute;
    bottom: 70px;
    right: 0;
    width: 340px;
    max-height: 520px;
    background: #1c1c1e;
    border: 1px solid rgba(255,255,255,.12);
    border-radius: 20px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 16px 48px rgba(0,0,0,.5);
    animation: gs-chat-in .2s ease;
}

@keyframes gs-chat-in {
    from { opacity: 0; transform: translateY(12px) scale(.97); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* ── Header ── */
.gs-chat-header {
    background: linear-gradient(135deg, #26e089 0%, #1ab870 100%);
    padding: 1rem 1.25rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

.gs-chat-header__info {
    display: flex;
    align-items: center;
    gap: .75rem;
    color: #0a0a0a;
}

.gs-chat-header__dot {
    width: 10px;
    height: 10px;
    background: #0a0a0a;
    border-radius: 50%;
    opacity: .7;
    box-shadow: 0 0 0 3px rgba(0,0,0,.15);
    animation: gs-pulse 2s infinite;
}

@keyframes gs-pulse {
    0%, 100% { box-shadow: 0 0 0 3px rgba(0,0,0,.15); }
    50%       { box-shadow: 0 0 0 5px rgba(0,0,0,.05); }
}

.gs-chat-header__info strong {
    display: block;
    font-size: .9rem;
    font-weight: 700;
    color: #0a0a0a;
}

.gs-chat-header__info small {
    font-size: .72rem;
    color: rgba(0,0,0,.6);
}

.gs-chat-header__close {
    background: rgba(0,0,0,.15);
    border: none;
    color: #0a0a0a;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    cursor: pointer;
    font-size: .85rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .15s;
}

.gs-chat-header__close:hover { background: rgba(0,0,0,.25); }

/* ── Mensajes ── */
.gs-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: .75rem;
    scroll-behavior: smooth;
}

.gs-chat-messages::-webkit-scrollbar { width: 4px; }
.gs-chat-messages::-webkit-scrollbar-track { background: transparent; }
.gs-chat-messages::-webkit-scrollbar-thumb { background: rgba(255,255,255,.15); border-radius: 2px; }

.gs-msg {
    display: flex;
    flex-direction: column;
    max-width: 85%;
    animation: gs-msg-in .18s ease;
}

@keyframes gs-msg-in {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
}

.gs-msg--usuario {
    align-self: flex-end;
    align-items: flex-end;
}

.gs-msg--bot {
    align-self: flex-start;
    align-items: flex-start;
}

.gs-msg__bubble {
    padding: .65rem .9rem;
    border-radius: 16px;
    font-size: .875rem;
    line-height: 1.5;
    word-break: break-word;
}

.gs-msg--usuario .gs-msg__bubble {
    background: #26e089;
    color: #0a0a0a;
    border-bottom-right-radius: 4px;
}

.gs-msg--bot .gs-msg__bubble {
    background: rgba(255,255,255,.07);
    color: #f5f5f7;
    border: 1px solid rgba(255,255,255,.1);
    border-bottom-left-radius: 4px;
}

/* Typing indicator */
.gs-msg--typing .gs-msg__bubble {
    display: flex;
    gap: 4px;
    align-items: center;
    padding: .75rem 1rem;
}

.gs-msg--typing .gs-msg__bubble span {
    width: 7px;
    height: 7px;
    background: rgba(255,255,255,.4);
    border-radius: 50%;
    animation: gs-bounce .9s ease-in-out infinite;
}

.gs-msg--typing .gs-msg__bubble span:nth-child(2) { animation-delay: .15s; }
.gs-msg--typing .gs-msg__bubble span:nth-child(3) { animation-delay: .3s; }

@keyframes gs-bounce {
    0%, 80%, 100% { transform: scale(.7); opacity: .5; }
    40%            { transform: scale(1);  opacity: 1; }
}

/* Botones de acción */
.gs-msg__buttons {
    display: flex;
    flex-wrap: wrap;
    gap: .4rem;
    margin-top: .4rem;
}

.gs-msg__btn {
    display: inline-block;
    padding: .35rem .8rem;
    background: rgba(38,224,137,.12);
    border: 1px solid rgba(38,224,137,.3);
    border-radius: 100px;
    color: #26e089;
    font-size: .78rem;
    font-weight: 600;
    text-decoration: none;
    transition: background .15s;
}

.gs-msg__btn:hover {
    background: rgba(38,224,137,.22);
}

/* ── Input form ── */
.gs-chat-form {
    display: flex;
    gap: .5rem;
    padding: .75rem 1rem;
    border-top: 1px solid rgba(255,255,255,.08);
    flex-shrink: 0;
    background: #1c1c1e;
}

.gs-chat-input {
    flex: 1;
    background: rgba(255,255,255,.06);
    border: 1px solid rgba(255,255,255,.1);
    border-radius: 100px;
    padding: .55rem 1rem;
    color: #f5f5f7;
    font-size: .875rem;
    font-family: inherit;
    outline: none;
    transition: border-color .15s;
}

.gs-chat-input:focus { border-color: #26e089; }
.gs-chat-input::placeholder { color: rgba(255,255,255,.3); }

.gs-chat-send {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: #26e089;
    border: none;
    color: #0a0a0a;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: opacity .15s, transform .1s;
}

.gs-chat-send:hover   { opacity: .85; transform: scale(1.05); }
.gs-chat-send:active  { transform: scale(.95); }

/* ── Responsive ── */
@media (max-width: 420px) {
    #gs-chat-widget { bottom: 1rem; right: 1rem; }
    .gs-chat-panel  { width: calc(100vw - 2rem); right: 0; }
}
