/**
 * Estilos para el Widget de Doctoralia
 * Posicionamiento y comportamiento visual del widget flotante
 */

/* ========================================
   CONTENEDOR FLOTANTE - DESKTOP
   ======================================== */
#doctoralia-float.doctoralia-float {
    position: fixed;
    left: 16px;
    bottom: 16px;
    width: min(420px, 92vw);
    max-height: 78vh;
    overflow: auto;
    padding: 0;
    background: transparent;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    z-index: 9999;
}

/* Enlace que Doctoralia transforma en widget */
#doctoralia-float .zl-url { 
    display: block; 
    width: 100%; 
}

/* ========================================
   BOTÓN DE CERRAR (X)
   ======================================== */
#doctoralia-float .doctoralia-min-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 28px;
    height: 28px;
    line-height: 26px;
    text-align: center;
    font-weight: 700;
    font-size: 18px;
    border: 0;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
    cursor: pointer;
    z-index: 1;
    transition: background 0.3s ease;
}

#doctoralia-float .doctoralia-min-btn:hover {
    background: rgba(0, 0, 0, 0.8);
}

/* ========================================
   ESTADO MINIMIZADO
   ======================================== */
#doctoralia-float.is-hidden { 
    display: none !important; 
}

/* ========================================
   BOTÓN PARA REABRIR
   ======================================== */
#doctoralia-open-btn.doctoralia-open-btn {
    position: fixed;
    left: 16px;
    bottom: 16px;
    z-index: 9999;
    border: 0;
    border-radius: 999px;
    padding: 10px 14px;
    background: #00C3A5;
    color: #fff;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
    transition: all 0.3s ease;
}

#doctoralia-open-btn.doctoralia-open-btn:hover {
    background: #00a88c;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
    transform: translateY(-2px);
}

/* ========================================
   RESPONSIVE - TABLETS Y MÓVILES
   ======================================== */
@media (max-width: 768px) {
    /* Contenedor del widget centrado en la parte inferior */
    #doctoralia-float {
        position: fixed;
        left: 0 !important;
        right: 0 !important;
        bottom: calc(12px + env(safe-area-inset-bottom));
        transform: none !important;
        width: calc(100vw - 32px) !important;
        max-width: 420px !important;
        margin: 0 auto !important;
        max-height: 60vh;
        z-index: 9999;
    }

    /* Forzar que el contenido interno no se salga */
    #doctoralia-float * {
        max-width: 100% !important;
        box-sizing: border-box !important;
    }

    /* Botón para reabrir centrado */
    #doctoralia-open-btn.doctoralia-open-btn {
        left: 50%;
        right: auto;
        bottom: calc(12px + env(safe-area-inset-bottom));
        transform: translateX(-50%);
        z-index: 10001;
    }
    
    #doctoralia-open-btn.doctoralia-open-btn:hover {
        transform: translateX(-50%) translateY(-2px);
    }
}

/* ========================================
   RESPONSIVE - MÓVILES PEQUEÑOS
   ======================================== */
@media (max-width: 480px) {
    #doctoralia-float {
        width: calc(100vw - 24px) !important;
        left: 12px !important;
        right: 12px !important;
    }
}

/* ========================================
   ANIMACIONES OPCIONALES
   ======================================== */
#doctoralia-float {
    animation: fadeInUp 0.3s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}