#af-chat-widget {
    position: fixed;
    bottom: 25px;
    right: 25px;
    z-index: 99999;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

#af-chat-toggle {
    background-color: #25D366;
    border: none;
    border-radius: 50%;
    width: 65px;
    height: 65px;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s;
}

#af-chat-toggle:hover { transform: scale(1.08); }

#af-chat-box {
    position: absolute;
    bottom: 85px;
    right: 0;
    width: 340px;
    background: #f4f5f7;
    border-radius: 15px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.2);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.af-hidden { display: none !important; }

/* Header */
.af-chat-header {
    background: #0b5c46;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: white;
}

.af-header-info {
    flex-grow: 1;
    margin-left: 10px;
}

.af-header-info strong {
    display: block;
    font-size: 16px;
    font-weight: 600;
}

.af-header-info span {
    font-size: 12px;
    color: #e0e0e0;
}

#af-chat-close, #af-back-btn {
    background: none;
    border: none;
    font-size: 24px;
    color: white;
    cursor: pointer;
    padding: 0 5px;
}

#af-back-btn { font-size: 20px; }

/* Wrapper y Pantallas */
#af-screens-wrapper {
    position: relative;
    height: 450px;
    overflow: hidden;
    background: #f4f5f7;
}

.af-screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    transition: transform 0.35s ease-in-out;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    overflow-x: hidden; /* Evita scroll horizontal en las pantallas */
}

.af-chat-body { padding: 20px; flex-grow: 1; overflow-x: hidden; }

.af-bubble {
    background: white;
    color: #333;
    padding: 15px;
    border-radius: 0 15px 15px 15px;
    font-size: 14px;
    margin-bottom: 20px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
    line-height: 1.5;
}

/* Área de Ciudades (Scrollable Vertical) */
.af-city-list-container {
    position: relative;
    height: 290px;
}

.af-city-list {
    height: 100%;
    overflow-y: auto;
    overflow-x: hidden; /* Bloquea completamente el scroll horizontal */
    padding-right: 5px;
    /* Esto le dice a los navegadores móviles que este contenedor SOLO soporta gestos verticales (scroll arriba/abajo) */
    touch-action: pan-y; 
}

.af-city-list::-webkit-scrollbar { width: 6px; }
.af-city-list::-webkit-scrollbar-track { background: #e0e0e0; border-radius: 10px; }
.af-city-list::-webkit-scrollbar-thumb { background: #25D366; border-radius: 10px; }

/* Indicador de Scroll Animado */
.af-scroll-hint {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    text-align: center;
    background: linear-gradient(transparent, #f4f5f7 60%);
    padding: 25px 0 5px;
    color: #0b5c46;
    font-size: 12px;
    font-weight: bold;
    pointer-events: none;
    transition: opacity 0.3s;
    animation: af-bounce 1.5s infinite;
}

@keyframes af-bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(5px); }
}

/* Botones de ciudades */
.af-city-btn {
    width: 100%;
    background: white;
    border: 1.5px solid #25D366;
    border-radius: 25px;
    padding: 12px 15px;
    margin-bottom: 10px;
    font-size: 13px;
    font-weight: bold;
    color: #333;
    text-align: left;
    cursor: pointer;
    display: flex;
    align-items: center;
    transition: background 0.2s;
    user-select: none; /* Evita que el usuario seleccione texto al hacer scroll */
    -webkit-user-select: none;
}

.af-city-btn:hover { background: #e8fbed; }

/* Formularios y Botones Generales */
#af-chat-form textarea, #af-chat-form input[type="email"] {
    width: 100%;
    padding: 12px;
    margin-bottom: 12px;
    border: 1px solid #ddd;
    border-radius: 10px;
    box-sizing: border-box;
    font-size: 14px;
}

#af-chat-form textarea {
    height: 100px;
    resize: none;
    font-family: inherit;
}

.af-action-btn {
    width: 100%;
    padding: 14px;
    background: #25D366;
    color: white;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    font-weight: bold;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 10px;
    transition: background 0.3s;
}

.af-action-btn:hover { background: #1da851; }

.af-error-msg {
    color: red;
    font-size: 12px;
    margin-top: -8px;
    margin-bottom: 10px;
}

@media (max-width: 400px) {
    #af-chat-box { width: 92vw; right: -15px; height: 80vh; }
    #af-screens-wrapper { height: calc(100% - 60px); }
    .af-city-list-container { height: calc(100vh - 250px); }
}