/* Container Principal del Bot */
#cda-wa-bot-container {
    position: fixed;
    bottom: 25px;
    right: 25px;
    z-index: 999999;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

/* Botón Flotante de WhatsApp */
#cda-wa-btn-flotante {
    background-color: #25D366;
    color: white;
    border: none;
    border-radius: 50%;
    width: 55px;
    height: 55px;
    font-size: 28px;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0,0,0,0.25);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

#cda-wa-btn-flotante:hover {
    transform: scale(1.08);
    background-color: #20ba5a;
}

/* Ventana del Chat - Ampliada a 600px de alto para máxima capacidad */
#cda-wa-chat-window {
    width: 340px;
    max-width: 90vw;
    height: 600px !important;
    max-height: 90vh;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.2);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    position: absolute;
    bottom: 0;
    right: 0;
    transform-origin: bottom right;
}

/* Encabezado estilo WhatsApp Médico */
.cda-wa-header {
    background: #005C4B;
    color: white;
    padding: 14px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.cda-header-info {
    display: flex;
    align-items: center;
    font-weight: 600;
    font-size: 15px;
}

.cda-header-info img {
    width: 28px;
    height: 28px;
    margin-right: 10px;
    border-radius: 50%;
    background: white;
    object-fit: contain;
    padding: 2px;
}

.cda-close-btn {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.8);
    cursor: pointer;
    font-size: 18px;
    transition: color 0.2s;
    padding: 4px;
}

.cda-close-btn:hover {
    color: white;
}

/* Cuerpo del Chat con Fondo Clásico de WhatsApp */
.cda-wa-body {
    flex: 1;
    padding: 16px;
    background-color: #E5DDD5;
    background-image: url('https://user-images.githubusercontent.com/15075759/28719144-86dc0f70-73b1-11e7-911d-60d70fcded21.png');
    background-repeat: repeat;
    overflow-y: auto !important; /* Si la pantalla del celular es muy pequeña, permitirá scroll de seguridad */
    display: flex;
    flex-direction: column;
}

/* Burbuja de Mensaje del Bot */
.cda-wa-mensaje-bot {
    background: white;
    padding: 12px 14px;
    border-radius: 0px 12px 12px 12px;
    font-size: 14px;
    line-height: 1.4;
    color: #333;
    margin-bottom: 14px;
    box-shadow: 0 1px 1.5px rgba(0,0,0,0.15);
    position: relative;
    max-width: 95%;
    align-self: flex-start;
}

/* Contenedor de Botones de Sucursales - Sin límites de corte */
.cda-sucursales-grid {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 10px;
    max-height: none !important;
    overflow: visible !important;
    padding-right: 2px;
}

/* Botón de cada Sucursal - Ajustado sutilmente el padding para optimizar el espacio */
.cda-btn-sucursal {
    background: white;
    color: #005C4B;
    border: 2px solid #005C4B;
    border-radius: 8px;
    padding: 9px 12px;
    font-size: 13.5px;
    font-weight: 600;
    cursor: pointer;
    text-align: left;
    transition: all 0.2s ease;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.cda-btn-sucursal::after {
    content: '\f105';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    opacity: 0.5;
}

.cda-btn-sucursal:hover {
    background: #005C4B;
    color: white;
}

.cda-btn-sucursal:active {
    transform: scale(0.98);
}

/* Estilos de Campos de Entrada */
.cda-wa-body input[type="text"],
.cda-wa-body input[type="tel"],
.cda-wa-body textarea {
    width: 100%;
    box-sizing: border-box;
    padding: 12px;
    border: 1px solid #ccc;
    border-radius: 8px;
    margin-bottom: 12px;
    font-family: inherit;
    font-size: 14px;
    box-shadow: inset 0 1px 2px rgba(0,0,0,0.05);
    transition: border-color 0.2s;
}

.cda-wa-body input:focus,
.cda-wa-body textarea:focus {
    border-color: #005C4B;
    outline: none;
}

/* Mensajes de Error Amables */
.cda-error-msg {
    color: #d32f2f;
    font-size: 12px;
    margin-top: -6px;
    margin-bottom: 12px;
    padding-left: 4px;
    font-weight: 500;
}

/* Botones de Acción (Siguiente y Enviar) */
.cda-wa-btn-siguiente, 
.cda-wa-btn-enviar {
    width: 100%;
    padding: 12px;
    border: none;
    border-radius: 8px;
    background: #25D366;
    color: white;
    font-weight: bold;
    font-size: 14px;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0,0,0,0.15);
    transition: background 0.2s;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
}

.cda-wa-btn-siguiente:hover {
    background: #128C7E;
}

.cda-wa-btn-enviar {
    background: #005C4B;
}

.cda-wa-btn-enviar:hover {
    background: #07473a;
}

/* Clases de Utilidad y Animaciones */
.oculto {
    display: none !important;
}

.activo {
    display: block !important;
}

.fade-in {
    animation: cdaFadeIn 0.4s ease-out forwards;
}

.slide-up {
    animation: cdaSlideUp 0.3s cubic-bezier(0.25, 0.8, 0.25, 1) forwards;
}

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

@keyframes cdaSlideUp {
    from { opacity: 0; transform: translateY(40px) scale(0.95); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}